diff --git a/cashfree_pg/__init__.py b/cashfree_pg/__init__.py index 9cc92e22..8d21738c 100644 --- a/cashfree_pg/__init__.py +++ b/cashfree_pg/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "4.5.1" +__version__ = "5.0.1-beta" # import apis into sdk package # import ApiClient diff --git a/cashfree_pg/api_client.py b/cashfree_pg/api_client.py index 86e501d4..7a3db92c 100644 --- a/cashfree_pg/api_client.py +++ b/cashfree_pg/api_client.py @@ -17,7 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError +from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes from typing_extensions import Annotated from cashfree_pg.configuration import Configuration @@ -41,10 +41,8 @@ import base64 import hashlib import hmac -from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable -from pydantic import Field, StrictStr, StrictBytes from cashfree_pg.configuration import Configuration from cashfree_pg.api_response import ApiResponse @@ -349,10 +347,23 @@ class Cashfree: XApiVersion = "2023-08-01"; + def __init__(self, XEnvironment, XClientId, XClientSecret, XPartnerKey, XPartnerMerchantId, XClientSignature): + if XClientId != None: + self.XClientId = XClientId + if XClientSecret != None: + self.XClientSecret = XClientSecret + if XPartnerKey != None: + self.XPartnerKey = XPartnerKey + if XPartnerMerchantId != None: + self.XPartnerMerchantId = XPartnerMerchantId + if XClientSignature != None: + self.XClientSignature = XClientSignature + self.XEnvironment = XEnvironment; + def PGVerifyWebhookSignature(self, signature, rawBody, timestamp): signatureData = timestamp+rawBody message = bytes(signatureData, 'utf-8') - secretkey=bytes(Cashfree.XClientSecret,'utf-8') + secretkey=bytes(self.XClientSecret,'utf-8') generatedSignature = base64.b64encode(hmac.new(secretkey, message, digestmod=hashlib.sha256).digest()) computed_signature = str(generatedSignature, encoding='utf8') if computed_signature == signature: @@ -404,18 +415,19 @@ def PGCreateCustomer(self, x_api_version : Annotated[StrictStr, Field(..., descr :rtype: tuple(CustomerEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -464,7 +476,7 @@ def PGCreateCustomer(self, x_api_version : Annotated[StrictStr, Field(..., descr if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -560,18 +572,19 @@ def PGAcceptDisputeById(self, x_api_version : Annotated[StrictStr, Field(..., de :rtype: tuple(DisputesEntityMerchantAccepted, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -623,7 +636,7 @@ def PGAcceptDisputeById(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -708,18 +721,19 @@ def PGFetchDisputeById(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(DisputesEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -771,7 +785,7 @@ def PGFetchDisputeById(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -856,18 +870,19 @@ def PGFetchOrderDisputes(self, x_api_version : Annotated[StrictStr, Field(..., d :rtype: tuple(List[DisputesEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -919,7 +934,7 @@ def PGFetchOrderDisputes(self, x_api_version : Annotated[StrictStr, Field(..., d if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1004,18 +1019,19 @@ def PGFetchPaymentDisputes(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(List[DisputesEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1067,7 +1083,7 @@ def PGFetchPaymentDisputes(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1158,18 +1174,19 @@ def PGUploadDisputesDocuments(self, x_api_version : Annotated[StrictStr, Field(. :rtype: tuple(List[DisputesEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1224,7 +1241,7 @@ def PGUploadDisputesDocuments(self, x_api_version : Annotated[StrictStr, Field(. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1328,18 +1345,19 @@ def PGOrderSplitAfterPayment(self, x_api_version : Annotated[StrictStr, Field(.. :rtype: tuple(SplitAfterPaymentResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1392,7 +1410,7 @@ def PGOrderSplitAfterPayment(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1483,18 +1501,19 @@ def PGOrderStaticSplit(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(StaticSplitResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1543,7 +1562,7 @@ def PGOrderStaticSplit(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1632,18 +1651,19 @@ def PGSplitOrderRecon(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(SplitOrderReconSuccessResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1695,7 +1715,7 @@ def PGSplitOrderRecon(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1776,18 +1796,19 @@ def PGesCreateAdjustment(self, x_api_version : Annotated[StrictStr, Field(..., d :rtype: tuple(VendorAdjustmentSuccessResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1840,7 +1861,7 @@ def PGesCreateAdjustment(self, x_api_version : Annotated[StrictStr, Field(..., d if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -1931,18 +1952,19 @@ def PGesCreateOnDemandTransfer(self, x_api_version : Annotated[StrictStr, Field( :rtype: tuple(AdjustVendorBalanceResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -1995,7 +2017,7 @@ def PGesCreateOnDemandTransfer(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2084,18 +2106,19 @@ def PGesCreateVendors(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(CreateVendorResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -2144,7 +2167,7 @@ def PGesCreateVendors(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2235,18 +2258,19 @@ def PGesDownloadVendorsDocs(self, x_api_version : Annotated[StrictStr, Field(... :rtype: tuple(VendorDocumentDownloadResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -2302,7 +2326,7 @@ def PGesDownloadVendorsDocs(self, x_api_version : Annotated[StrictStr, Field(... if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2380,18 +2404,19 @@ def PGesFetchVendors(self, x_api_version : Annotated[StrictStr, Field(..., descr :rtype: tuple(VendorEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -2443,7 +2468,7 @@ def PGesFetchVendors(self, x_api_version : Annotated[StrictStr, Field(..., descr if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2522,18 +2547,19 @@ def PGesGetVendorBalance(self, x_api_version : Annotated[StrictStr, Field(..., d :rtype: tuple(VendorBalance, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -2585,7 +2611,7 @@ def PGesGetVendorBalance(self, x_api_version : Annotated[StrictStr, Field(..., d if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2666,18 +2692,19 @@ def PGesGetVendorBalanceTransferCharges(self, x_api_version : Annotated[StrictSt :rtype: tuple(VendorBalanceTransferCharges, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -2733,7 +2760,7 @@ def PGesGetVendorBalanceTransferCharges(self, x_api_version : Annotated[StrictSt if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2812,18 +2839,19 @@ def PGesGetVendorsDocs(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(VendorDocumentsResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -2875,7 +2903,7 @@ def PGesGetVendorsDocs(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -2954,18 +2982,19 @@ def PGesOrderRecon(self, x_api_version : Annotated[StrictStr, Field(..., descrip :rtype: tuple(ESOrderReconResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3014,7 +3043,7 @@ def PGesOrderRecon(self, x_api_version : Annotated[StrictStr, Field(..., descrip if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -3107,18 +3136,19 @@ def PGesUpdateVendors(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(UpdateVendorResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3171,7 +3201,7 @@ def PGesUpdateVendors(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -3266,18 +3296,19 @@ def PGesUploadVendorsDocs(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(UploadVendorDocumentsResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3332,7 +3363,7 @@ def PGesUploadVendorsDocs(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -3428,18 +3459,19 @@ def PGEligibilityFetchCardlessEmi(self, x_api_version : Annotated[StrictStr, Fie :rtype: tuple(List[EligibilityCardlessEMIEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3488,7 +3520,7 @@ def PGEligibilityFetchCardlessEmi(self, x_api_version : Annotated[StrictStr, Fie if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -3584,18 +3616,19 @@ def PGEligibilityFetchOffers(self, x_api_version : Annotated[StrictStr, Field(.. :rtype: tuple(List[EligibilityOfferEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3644,7 +3677,7 @@ def PGEligibilityFetchOffers(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -3739,18 +3772,19 @@ def PGEligibilityFetchPaylater(self, x_api_version : Annotated[StrictStr, Field( :rtype: tuple(List[EligibilityPaylaterEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3799,7 +3833,7 @@ def PGEligibilityFetchPaylater(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -3895,18 +3929,19 @@ def PGEligibilityFetchPaymentMethods(self, x_api_version : Annotated[StrictStr, :rtype: tuple(List[EligibilityPaymentMethodsEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -3955,7 +3990,7 @@ def PGEligibilityFetchPaymentMethods(self, x_api_version : Annotated[StrictStr, if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4052,18 +4087,19 @@ def PGCreateOffer(self, x_api_version : Annotated[StrictStr, Field(..., descript :rtype: tuple(OfferEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -4112,7 +4148,7 @@ def PGCreateOffer(self, x_api_version : Annotated[StrictStr, Field(..., descript if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4207,18 +4243,19 @@ def PGFetchOffer(self, x_api_version : Annotated[StrictStr, Field(..., descripti :rtype: tuple(OfferEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -4270,7 +4307,7 @@ def PGFetchOffer(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4356,18 +4393,19 @@ def PGCreateOrder(self, x_api_version : Annotated[StrictStr, Field(..., descript :rtype: tuple(OrderEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -4416,7 +4454,7 @@ def PGCreateOrder(self, x_api_version : Annotated[StrictStr, Field(..., descript if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4511,18 +4549,19 @@ def PGFetchOrder(self, x_api_version : Annotated[StrictStr, Field(..., descripti :rtype: tuple(OrderEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -4574,7 +4613,7 @@ def PGFetchOrder(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4659,18 +4698,19 @@ def PGFetchOrderExtendedData(self, x_api_version : Annotated[StrictStr, Field(.. :rtype: tuple(OrderExtendedDataEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -4722,7 +4762,7 @@ def PGFetchOrderExtendedData(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4809,18 +4849,19 @@ def PGTerminateOrder(self, x_api_version : Annotated[StrictStr, Field(..., descr :rtype: tuple(OrderEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -4873,7 +4914,7 @@ def PGTerminateOrder(self, x_api_version : Annotated[StrictStr, Field(..., descr if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -4970,18 +5011,19 @@ def PGUpdateOrderExtendedData(self, x_api_version : Annotated[StrictStr, Field(. :rtype: tuple(UpdateOrderExtendedDataEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5034,7 +5076,7 @@ def PGUpdateOrderExtendedData(self, x_api_version : Annotated[StrictStr, Field(. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -5134,18 +5176,19 @@ def PGFetchRecon(self, x_api_version : Annotated[StrictStr, Field(..., descripti :rtype: tuple(ReconEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5196,7 +5239,7 @@ def PGFetchRecon(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -5292,18 +5335,19 @@ def PGCancelLink(self, x_api_version : Annotated[StrictStr, Field(..., descripti :rtype: tuple(LinkEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5355,7 +5399,7 @@ def PGCancelLink(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -5440,18 +5484,19 @@ def PGCreateLink(self, x_api_version : Annotated[StrictStr, Field(..., descripti :rtype: tuple(LinkEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5500,7 +5545,7 @@ def PGCreateLink(self, x_api_version : Annotated[StrictStr, Field(..., descripti if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -5595,18 +5640,19 @@ def PGFetchLink(self, x_api_version : Annotated[StrictStr, Field(..., descriptio :rtype: tuple(LinkEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5658,7 +5704,7 @@ def PGFetchLink(self, x_api_version : Annotated[StrictStr, Field(..., descriptio if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -5746,18 +5792,19 @@ def PGLinkFetchOrders(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(List[PaymentLinkOrderEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5813,7 +5860,7 @@ def PGLinkFetchOrders(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -5901,18 +5948,19 @@ def PGAuthorizeOrder(self, x_api_version : Annotated[StrictStr, Field(..., descr :rtype: tuple(PaymentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -5965,7 +6013,7 @@ def PGAuthorizeOrder(self, x_api_version : Annotated[StrictStr, Field(..., descr if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -6063,18 +6111,19 @@ def PGOrderAuthenticatePayment(self, x_api_version : Annotated[StrictStr, Field( :rtype: tuple(OrderAuthenticateEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -6127,7 +6176,7 @@ def PGOrderAuthenticatePayment(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -6225,18 +6274,19 @@ def PGOrderFetchPayment(self, x_api_version : Annotated[StrictStr, Field(..., de :rtype: tuple(PaymentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -6292,7 +6342,7 @@ def PGOrderFetchPayment(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -6378,18 +6428,19 @@ def PGOrderFetchPayments(self, x_api_version : Annotated[StrictStr, Field(..., d :rtype: tuple(List[PaymentEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -6441,7 +6492,7 @@ def PGOrderFetchPayments(self, x_api_version : Annotated[StrictStr, Field(..., d if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -6527,18 +6578,19 @@ def PGPayOrder(self, x_api_version : Annotated[StrictStr, Field(..., description :rtype: tuple(PayOrderEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -6587,7 +6639,7 @@ def PGPayOrder(self, x_api_version : Annotated[StrictStr, Field(..., description if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -6686,18 +6738,19 @@ def PGOrderCreateRefund(self, x_api_version : Annotated[StrictStr, Field(..., de :rtype: tuple(RefundEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -6750,7 +6803,7 @@ def PGOrderCreateRefund(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -6848,18 +6901,19 @@ def PGOrderFetchRefund(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(RefundEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -6915,7 +6969,7 @@ def PGOrderFetchRefund(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7001,18 +7055,19 @@ def PGOrderFetchRefunds(self, x_api_version : Annotated[StrictStr, Field(..., de :rtype: tuple(List[RefundEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7064,7 +7119,7 @@ def PGOrderFetchRefunds(self, x_api_version : Annotated[StrictStr, Field(..., de if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7154,18 +7209,19 @@ def PGFetchSettlements(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(SettlementEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7216,7 +7272,7 @@ def PGFetchSettlements(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7315,18 +7371,19 @@ def PGSettlementFetchRecon(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SettlementReconEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7377,7 +7434,7 @@ def PGSettlementFetchRecon(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7473,18 +7530,19 @@ def MarkForSettlement(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7533,7 +7591,7 @@ def MarkForSettlement(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7625,18 +7683,19 @@ def PGOrderFetchSettlement(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SettlementEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7688,7 +7747,7 @@ def PGOrderFetchSettlement(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7775,18 +7834,19 @@ def PGFetchSimulation(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(SimulationResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7838,7 +7898,7 @@ def PGFetchSimulation(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -7921,18 +7981,19 @@ def PGSimulatePayment(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(SimulationResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -7981,7 +8042,7 @@ def PGSimulatePayment(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8075,18 +8136,19 @@ def SubsCreatePayment(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(CreateSubscriptionPaymentResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -8135,7 +8197,7 @@ def SubsCreatePayment(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8229,18 +8291,19 @@ def SubsCreatePlan(self, x_api_version : Annotated[StrictStr, Field(..., descrip :rtype: tuple(PlanEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -8289,7 +8352,7 @@ def SubsCreatePlan(self, x_api_version : Annotated[StrictStr, Field(..., descrip if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8385,18 +8448,19 @@ def SubsCreateRefund(self, x_api_version : Annotated[StrictStr, Field(..., descr :rtype: tuple(SubscriptionPaymentRefundEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -8449,7 +8513,7 @@ def SubsCreateRefund(self, x_api_version : Annotated[StrictStr, Field(..., descr if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8543,18 +8607,19 @@ def SubsCreateSubscription(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SubscriptionEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -8603,7 +8668,7 @@ def SubsCreateSubscription(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8697,18 +8762,19 @@ def SubsFetchPlan(self, x_api_version : Annotated[StrictStr, Field(..., descript :rtype: tuple(PlanEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -8760,7 +8826,7 @@ def SubsFetchPlan(self, x_api_version : Annotated[StrictStr, Field(..., descript if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8843,18 +8909,19 @@ def SubsFetchSubscription(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SubscriptionEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -8906,7 +8973,7 @@ def SubsFetchSubscription(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -8991,18 +9058,19 @@ def SubsFetchSubscriptionPayment(self, x_api_version : Annotated[StrictStr, Fiel :rtype: tuple(SubscriptionPaymentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9058,7 +9126,7 @@ def SubsFetchSubscriptionPayment(self, x_api_version : Annotated[StrictStr, Fiel if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -9141,18 +9209,19 @@ def SubsFetchSubscriptionPayments(self, x_api_version : Annotated[StrictStr, Fie :rtype: tuple(List[SubscriptionPaymentEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9204,7 +9273,7 @@ def SubsFetchSubscriptionPayments(self, x_api_version : Annotated[StrictStr, Fie if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -9290,18 +9359,19 @@ def SubsFetchSubscriptionRefund(self, x_api_version : Annotated[StrictStr, Field :rtype: tuple(SubscriptionPaymentRefundEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9357,7 +9427,7 @@ def SubsFetchSubscriptionRefund(self, x_api_version : Annotated[StrictStr, Field if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -9442,18 +9512,19 @@ def SubsManageSubscription(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SubscriptionEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9506,7 +9577,7 @@ def SubsManageSubscription(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -9604,18 +9675,19 @@ def SubsManageSubscriptionPayment(self, x_api_version : Annotated[StrictStr, Fie :rtype: tuple(SubscriptionPaymentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9672,7 +9744,7 @@ def SubsManageSubscriptionPayment(self, x_api_version : Annotated[StrictStr, Fie if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -9771,18 +9843,19 @@ def SubscriptionDocumentUpload(self, x_api_version : Annotated[StrictStr, Field( :rtype: tuple(UploadPnachImageResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9837,7 +9910,7 @@ def SubscriptionDocumentUpload(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -9937,18 +10010,19 @@ def SubscriptionEligibility(self, x_api_version : Annotated[StrictStr, Field(... :rtype: tuple(SubscriptionEligibilityResponse, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -9997,7 +10071,7 @@ def SubscriptionEligibility(self, x_api_version : Annotated[StrictStr, Field(... if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -10094,18 +10168,19 @@ def PGCustomerDeleteInstrument(self, x_api_version : Annotated[StrictStr, Field( :rtype: tuple(InstrumentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -10161,7 +10236,7 @@ def PGCustomerDeleteInstrument(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -10249,18 +10324,19 @@ def PGCustomerFetchInstrument(self, x_api_version : Annotated[StrictStr, Field(. :rtype: tuple(InstrumentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -10316,7 +10392,7 @@ def PGCustomerFetchInstrument(self, x_api_version : Annotated[StrictStr, Field(. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -10404,18 +10480,19 @@ def PGCustomerFetchInstruments(self, x_api_version : Annotated[StrictStr, Field( :rtype: tuple(List[InstrumentEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -10471,7 +10548,7 @@ def PGCustomerFetchInstruments(self, x_api_version : Annotated[StrictStr, Field( if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -10558,18 +10635,19 @@ def PGCustomerInstrumentsFetchCryptogram(self, x_api_version : Annotated[StrictS :rtype: tuple(CryptogramEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -10625,7 +10703,7 @@ def PGCustomerInstrumentsFetchCryptogram(self, x_api_version : Annotated[StrictS if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -10712,18 +10790,19 @@ def TerminalCreateQrCodes(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(List[StaticQrResponseEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -10772,7 +10851,7 @@ def TerminalCreateQrCodes(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -10869,18 +10948,19 @@ def TerminalGetQrCodes(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(List[StaticQrResponseEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -10936,7 +11016,7 @@ def TerminalGetQrCodes(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11022,18 +11102,19 @@ def SposCreateTerminal(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(TerminalEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -11082,7 +11163,7 @@ def SposCreateTerminal(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11177,18 +11258,19 @@ def SposCreateTerminalTransaction(self, x_api_version : Annotated[StrictStr, Fie :rtype: tuple(TerminalTransactionEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -11237,7 +11319,7 @@ def SposCreateTerminalTransaction(self, x_api_version : Annotated[StrictStr, Fie if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11332,18 +11414,19 @@ def SposDemapSoundboxVpa(self, x_api_version : Annotated[StrictStr, Field(..., d :rtype: tuple(List[SoundboxVpaEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -11392,7 +11475,7 @@ def SposDemapSoundboxVpa(self, x_api_version : Annotated[StrictStr, Field(..., d if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11487,18 +11570,19 @@ def SposFetchTerminal(self, x_api_version : Annotated[StrictStr, Field(..., desc :rtype: tuple(TerminalEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -11550,7 +11634,7 @@ def SposFetchTerminal(self, x_api_version : Annotated[StrictStr, Field(..., desc if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11637,18 +11721,19 @@ def SposFetchTerminalQrCodes(self, x_api_version : Annotated[StrictStr, Field(.. :rtype: tuple(List[FetchTerminalQRCodesEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -11704,7 +11789,7 @@ def SposFetchTerminalQrCodes(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11791,18 +11876,19 @@ def SposFetchTerminalSoundboxVpa(self, x_api_version : Annotated[StrictStr, Fiel :rtype: tuple(List[SoundboxVpaEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -11858,7 +11944,7 @@ def SposFetchTerminalSoundboxVpa(self, x_api_version : Annotated[StrictStr, Fiel if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -11945,18 +12031,19 @@ def SposFetchTerminalTransaction(self, x_api_version : Annotated[StrictStr, Fiel :rtype: tuple(TerminalPaymentEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -12012,7 +12099,7 @@ def SposFetchTerminalTransaction(self, x_api_version : Annotated[StrictStr, Fiel if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -12097,18 +12184,19 @@ def SposOnboardSoundboxVpa(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SoundboxVpaEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -12157,7 +12245,7 @@ def SposOnboardSoundboxVpa(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -12254,18 +12342,19 @@ def SposUpdateSoundboxVpa(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(SoundboxVpaEntity, status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -12318,7 +12407,7 @@ def SposUpdateSoundboxVpa(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -12415,18 +12504,19 @@ def SposUpdateTerminal(self, x_api_version : Annotated[StrictStr, Field(..., des :rtype: tuple(List[UpdateTerminalEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -12479,7 +12569,7 @@ def SposUpdateTerminal(self, x_api_version : Annotated[StrictStr, Field(..., des if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -12576,18 +12666,19 @@ def SposUpdateTerminalStatus(self, x_api_version : Annotated[StrictStr, Field(.. :rtype: tuple(List[UpdateTerminalEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -12640,7 +12731,7 @@ def SposUpdateTerminalStatus(self, x_api_version : Annotated[StrictStr, Field(.. if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -12737,18 +12828,19 @@ def SposUploadTerminalDocs(self, x_api_version : Annotated[StrictStr, Field(..., :rtype: tuple(List[UploadTerminalDocsEntity], status_code(int), headers(HTTPHeaderDict)) """ + x_api_version = self.XApiVersion api_client = ApiClient.get_default() host = "https://api.cashfree.com/pg" - if Cashfree.XEnvironment == CFEnvironment.SANDBOX: - host = "https://sandbox.cashfree.com/pg" + if self.XEnvironment == CFEnvironment.SANDBOX: + host = "https://sandbox.self.com/pg" configuration = Configuration( host = host ) - configuration.api_key['XClientID'] = Cashfree.XClientId - configuration.api_key['XClientSecret'] = Cashfree.XClientSecret - configuration.api_key['XClientSignature'] = Cashfree.XClientSignature - configuration.api_key['XPartnerMerchantId'] = Cashfree.XPartnerMerchantId - configuration.api_key['XPartnerKey'] = Cashfree.XPartnerKey + configuration.api_key['XClientID'] = self.XClientId + configuration.api_key['XClientSecret'] = self.XClientSecret + configuration.api_key['XClientSignature'] = self.XClientSignature + configuration.api_key['XPartnerMerchantId'] = self.XPartnerMerchantId + configuration.api_key['XPartnerKey'] = self.XPartnerKey api_client.configuration = configuration _params = locals() @@ -12801,7 +12893,7 @@ def SposUploadTerminalDocs(self, x_api_version : Annotated[StrictStr, Field(..., if x_idempotency_key: _header_params["x-idempotency-key"] = x_idempotency_key - _header_params["x-sdk-platform"] = "pythonsdk-4.5.1" + _header_params["x-sdk-platform"] = "pythonsdk-5.0.1-beta" # process the form parameters _form_params = [] @@ -12900,7 +12992,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/4.5.1/python' + self.user_agent = 'OpenAPI-Generator/5.0.1-beta/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/cashfree_pg/api_response.py b/cashfree_pg/api_response.py index d81c2ff5..6336dd7c 100644 --- a/cashfree_pg/api_response.py +++ b/cashfree_pg/api_response.py @@ -4,6 +4,8 @@ from typing import Any, Dict, Optional from pydantic import Field, StrictInt, StrictStr +# Updated imports for Pydantic v2 compatibility + class ApiResponse: """ API response object diff --git a/cashfree_pg/configuration.py b/cashfree_pg/configuration.py index 7d008ca2..89082d0a 100644 --- a/cashfree_pg/configuration.py +++ b/cashfree_pg/configuration.py @@ -434,7 +434,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2023-08-01\n"\ - "SDK Package Version: 4.5.1".\ + "SDK Package Version: 5.0.1-beta".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/cashfree_pg/models/address_details.py b/cashfree_pg/models/address_details.py index 664742a4..fd771191 100644 --- a/cashfree_pg/models/address_details.py +++ b/cashfree_pg/models/address_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class AddressDetails(BaseModel): """ @@ -39,10 +40,12 @@ class AddressDetails(BaseModel): email: Optional[StrictStr] = Field(None, description="Cutomer Email Address.") __properties = ["name", "address_line_one", "address_line_two", "country", "country_code", "state", "state_code", "city", "pin_code", "phone", "email"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/adjust_vendor_balance_request.py b/cashfree_pg/models/adjust_vendor_balance_request.py index d9ce2965..00818c84 100644 --- a/cashfree_pg/models/adjust_vendor_balance_request.py +++ b/cashfree_pg/models/adjust_vendor_balance_request.py @@ -21,6 +21,7 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class AdjustVendorBalanceRequest(BaseModel): """ @@ -33,10 +34,12 @@ class AdjustVendorBalanceRequest(BaseModel): tags: Optional[Dict[str, Any]] = Field(None, description="Provide additional data fields using tags.") __properties = ["transfer_from", "transfer_type", "transfer_amount", "remark", "tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/adjust_vendor_balance_response.py b/cashfree_pg/models/adjust_vendor_balance_response.py index 6b731969..41ac941d 100644 --- a/cashfree_pg/models/adjust_vendor_balance_response.py +++ b/cashfree_pg/models/adjust_vendor_balance_response.py @@ -24,6 +24,7 @@ from cashfree_pg.models.balance_details import BalanceDetails from cashfree_pg.models.charges_details import ChargesDetails from cashfree_pg.models.transfer_details import TransferDetails +from pydantic import field_validator class AdjustVendorBalanceResponse(BaseModel): """ @@ -35,10 +36,12 @@ class AdjustVendorBalanceResponse(BaseModel): charges: Optional[ChargesDetails] = None __properties = ["settlement_id", "transfer_details", "balances", "charges"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/api_error.py b/cashfree_pg/models/api_error.py index 6d84b83f..d77e2539 100644 --- a/cashfree_pg/models/api_error.py +++ b/cashfree_pg/models/api_error.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class ApiError(BaseModel): """ @@ -31,7 +32,7 @@ class ApiError(BaseModel): type: Optional[StrictStr] = Field(None, description="api_error") __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('api_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/api_error404.py b/cashfree_pg/models/api_error404.py index e362d25d..efb2e6c9 100644 --- a/cashfree_pg/models/api_error404.py +++ b/cashfree_pg/models/api_error404.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class ApiError404(BaseModel): """ @@ -31,7 +32,7 @@ class ApiError404(BaseModel): type: Optional[StrictStr] = Field(None, description="invalid_request_error") __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('invalid_request_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/api_error409.py b/cashfree_pg/models/api_error409.py index 0b472e14..e77fb43b 100644 --- a/cashfree_pg/models/api_error409.py +++ b/cashfree_pg/models/api_error409.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class ApiError409(BaseModel): """ @@ -31,7 +32,7 @@ class ApiError409(BaseModel): type: Optional[StrictStr] = Field(None, description="invalid_request_error") __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('invalid_request_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/api_error502.py b/cashfree_pg/models/api_error502.py index 0f3675b6..caa1d6b8 100644 --- a/cashfree_pg/models/api_error502.py +++ b/cashfree_pg/models/api_error502.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class ApiError502(BaseModel): """ @@ -31,7 +32,7 @@ class ApiError502(BaseModel): type: Optional[StrictStr] = Field(None, description="api_error") __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('api_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/app.py b/cashfree_pg/models/app.py index 3e823d5d..0f7a9033 100644 --- a/cashfree_pg/models/app.py +++ b/cashfree_pg/models/app.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class App(BaseModel): """ @@ -31,17 +32,19 @@ class App(BaseModel): phone: StrictStr = Field(..., description="Customer phone number associated with a wallet for payment.") __properties = ["channel", "provider", "phone"] - @validator('provider') + @field_validator('provider') def provider_validate_enum(cls, value): """Validates the enum""" if value not in ('gpay', 'phonepe', 'ola', 'paytm', 'amazon', 'airtel', 'freecharge', 'mobikwik', 'jio'): raise ValueError("must be one of enum values ('gpay', 'phonepe', 'ola', 'paytm', 'amazon', 'airtel', 'freecharge', 'mobikwik', 'jio')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/app_payment_method.py b/cashfree_pg/models/app_payment_method.py index 2e3e960f..9342caa9 100644 --- a/cashfree_pg/models/app_payment_method.py +++ b/cashfree_pg/models/app_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.app import App +from pydantic import field_validator class AppPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class AppPaymentMethod(BaseModel): app: App = Field(...) __properties = ["app"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/authentication_error.py b/cashfree_pg/models/authentication_error.py index 1f8b4815..960e823b 100644 --- a/cashfree_pg/models/authentication_error.py +++ b/cashfree_pg/models/authentication_error.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class AuthenticationError(BaseModel): """ @@ -31,10 +32,12 @@ class AuthenticationError(BaseModel): type: Optional[StrictStr] = Field(None, description="authentication_error") __properties = ["message", "code", "type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/authorization_details.py b/cashfree_pg/models/authorization_details.py index f74623b1..851fe4c2 100644 --- a/cashfree_pg/models/authorization_details.py +++ b/cashfree_pg/models/authorization_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class AuthorizationDetails(BaseModel): """ @@ -35,10 +36,12 @@ class AuthorizationDetails(BaseModel): payment_method: Optional[StrictStr] = Field(None, description="Payment method used for the authorization.") __properties = ["authorization_amount", "authorization_amount_refund", "authorization_reference", "authorization_time", "authorization_status", "payment_id", "payment_method"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/authorization_in_payments_entity.py b/cashfree_pg/models/authorization_in_payments_entity.py index f4a0ed30..1405aa33 100644 --- a/cashfree_pg/models/authorization_in_payments_entity.py +++ b/cashfree_pg/models/authorization_in_payments_entity.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic import field_validator class AuthorizationInPaymentsEntity(BaseModel): """ @@ -36,7 +37,7 @@ class AuthorizationInPaymentsEntity(BaseModel): action_time: Optional[StrictStr] = Field(None, description="Time of action (CAPTURE or VOID)") __properties = ["action", "status", "captured_amount", "start_time", "end_time", "approve_by", "action_reference", "action_time"] - @validator('action') + @field_validator('action') def action_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -46,7 +47,7 @@ def action_validate_enum(cls, value): raise ValueError("must be one of enum values ('CAPTURE', 'VOID')") return value - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -56,10 +57,12 @@ def status_validate_enum(cls, value): raise ValueError("must be one of enum values ('SUCCESS', 'PENDING')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/authorize_order_request.py b/cashfree_pg/models/authorize_order_request.py index 02701177..b3a13423 100644 --- a/cashfree_pg/models/authorize_order_request.py +++ b/cashfree_pg/models/authorize_order_request.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic import field_validator class AuthorizeOrderRequest(BaseModel): """ @@ -30,7 +31,7 @@ class AuthorizeOrderRequest(BaseModel): amount: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The amount if you are running a 'CAPTURE'") __properties = ["action", "amount"] - @validator('action') + @field_validator('action') def action_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -40,10 +41,12 @@ def action_validate_enum(cls, value): raise ValueError("must be one of enum values ('CAPTURE', 'VOID')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/bad_request_error.py b/cashfree_pg/models/bad_request_error.py index 3359961e..a377bb2a 100644 --- a/cashfree_pg/models/bad_request_error.py +++ b/cashfree_pg/models/bad_request_error.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr, validator +from pydantic import field_validator class BadRequestError(BaseModel): """ @@ -31,7 +32,7 @@ class BadRequestError(BaseModel): type: Optional[StrictStr] = None __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('invalid_request_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/balance_details.py b/cashfree_pg/models/balance_details.py index 29dcc865..8a2901e5 100644 --- a/cashfree_pg/models/balance_details.py +++ b/cashfree_pg/models/balance_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class BalanceDetails(BaseModel): """ @@ -32,10 +33,12 @@ class BalanceDetails(BaseModel): vendor_unsettled: Optional[Union[StrictFloat, StrictInt]] = None __properties = ["merchant_id", "vendor_id", "merchant_unsettled", "vendor_unsettled"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/bank_details.py b/cashfree_pg/models/bank_details.py index 907d9953..a218245c 100644 --- a/cashfree_pg/models/bank_details.py +++ b/cashfree_pg/models/bank_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class BankDetails(BaseModel): """ @@ -31,10 +32,12 @@ class BankDetails(BaseModel): ifsc: Optional[StrictStr] = None __properties = ["account_number", "account_holder", "ifsc"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/banktransfer.py b/cashfree_pg/models/banktransfer.py index e4a33249..75a5c033 100644 --- a/cashfree_pg/models/banktransfer.py +++ b/cashfree_pg/models/banktransfer.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class Banktransfer(BaseModel): """ @@ -29,10 +30,12 @@ class Banktransfer(BaseModel): channel: Optional[StrictStr] = Field(None, description="The channel for cardless EMI is always `link`") __properties = ["channel"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/banktransfer_payment_method.py b/cashfree_pg/models/banktransfer_payment_method.py index 332581b2..f604ab9b 100644 --- a/cashfree_pg/models/banktransfer_payment_method.py +++ b/cashfree_pg/models/banktransfer_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.banktransfer import Banktransfer +from pydantic import field_validator class BanktransferPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class BanktransferPaymentMethod(BaseModel): banktransfer: Banktransfer = Field(...) __properties = ["banktransfer"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/card.py b/cashfree_pg/models/card.py index 2d985164..3c2daa0b 100644 --- a/cashfree_pg/models/card.py +++ b/cashfree_pg/models/card.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic import field_validator class Card(BaseModel): """ @@ -43,14 +44,14 @@ class Card(BaseModel): emi_tenure: Optional[StrictInt] = Field(None, description="EMI tenure selected by the user") __properties = ["channel", "card_number", "card_holder_name", "card_expiry_mm", "card_expiry_yy", "card_cvv", "instrument_id", "cryptogram", "token_requestor_id", "token_reference_id", "token_type", "card_display", "card_alias", "card_bank_name", "emi_tenure"] - @validator('channel') + @field_validator('channel') def channel_validate_enum(cls, value): """Validates the enum""" if value not in ('link', 'post'): raise ValueError("must be one of enum values ('link', 'post')") return value - @validator('token_type') + @field_validator('token_type') def token_type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -60,7 +61,7 @@ def token_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ISSUER_TOKEN', 'NETWORK_GC_TOKEN', 'ISSUER_GC_TOKEN')") return value - @validator('card_bank_name') + @field_validator('card_bank_name') def card_bank_name_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -70,10 +71,12 @@ def card_bank_name_validate_enum(cls, value): raise ValueError("must be one of enum values ('Kotak', 'ICICI', 'RBL', 'BOB', 'Standard Chartered')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/card_emi.py b/cashfree_pg/models/card_emi.py index 1f28dc82..48d467e5 100644 --- a/cashfree_pg/models/card_emi.py +++ b/cashfree_pg/models/card_emi.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic import field_validator class CardEMI(BaseModel): """ @@ -37,17 +38,19 @@ class CardEMI(BaseModel): emi_tenure: StrictInt = Field(..., description="EMI tenure selected by the user") __properties = ["channel", "card_number", "card_holder_name", "card_expiry_mm", "card_expiry_yy", "card_cvv", "card_alias", "card_bank_name", "emi_tenure"] - @validator('card_bank_name') + @field_validator('card_bank_name') def card_bank_name_validate_enum(cls, value): """Validates the enum""" if value not in ('hdfc', 'kotak', 'icici', 'rbl', 'bob', 'standard chartered', 'axis', 'au', 'yes', 'sbi', 'fed', 'hsbc', 'citi', 'amex'): raise ValueError("must be one of enum values ('hdfc', 'kotak', 'icici', 'rbl', 'bob', 'standard chartered', 'axis', 'au', 'yes', 'sbi', 'fed', 'hsbc', 'citi', 'amex')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/card_emi_payment_method.py b/cashfree_pg/models/card_emi_payment_method.py index 276ecdf6..ba169c94 100644 --- a/cashfree_pg/models/card_emi_payment_method.py +++ b/cashfree_pg/models/card_emi_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.card_emi import CardEMI +from pydantic import field_validator class CardEMIPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class CardEMIPaymentMethod(BaseModel): emi: CardEMI = Field(...) __properties = ["emi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/card_offer.py b/cashfree_pg/models/card_offer.py index 6a0190ce..168ce34e 100644 --- a/cashfree_pg/models/card_offer.py +++ b/cashfree_pg/models/card_offer.py @@ -21,6 +21,7 @@ from typing import List from pydantic import BaseModel, Field, StrictStr, conlist, constr +from pydantic import field_validator class CardOffer(BaseModel): """ @@ -31,10 +32,12 @@ class CardOffer(BaseModel): scheme_name: conlist(StrictStr) = Field(...) __properties = ["type", "bank_name", "scheme_name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/card_payment_method.py b/cashfree_pg/models/card_payment_method.py index 49ad280b..e8333e7c 100644 --- a/cashfree_pg/models/card_payment_method.py +++ b/cashfree_pg/models/card_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.card import Card +from pydantic import field_validator class CardPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class CardPaymentMethod(BaseModel): card: Card = Field(...) __properties = ["card"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cardless_emi.py b/cashfree_pg/models/cardless_emi.py index 5c9cd93a..0fc0fc21 100644 --- a/cashfree_pg/models/cardless_emi.py +++ b/cashfree_pg/models/cardless_emi.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic import field_validator class CardlessEMI(BaseModel): """ @@ -32,7 +33,7 @@ class CardlessEMI(BaseModel): emi_tenure: Optional[StrictInt] = Field(None, description="EMI tenure for the selected provider. This is mandatory when provider is one of [`hdfc`, `icici`, `cashe`, `idfc`, `kotak`]") __properties = ["channel", "provider", "phone", "emi_tenure"] - @validator('provider') + @field_validator('provider') def provider_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -42,10 +43,12 @@ def provider_validate_enum(cls, value): raise ValueError("must be one of enum values ('flexmoney', 'zestmoney', 'hdfc', 'icici', 'cashe', 'idfc', 'kotak', 'snapmint', 'bharatx')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cardless_emi_entity.py b/cashfree_pg/models/cardless_emi_entity.py index 643f2bc4..4f7dc602 100644 --- a/cashfree_pg/models/cardless_emi_entity.py +++ b/cashfree_pg/models/cardless_emi_entity.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, conlist, constr from cashfree_pg.models.emi_plans_array import EMIPlansArray +from pydantic import field_validator class CardlessEMIEntity(BaseModel): """ @@ -31,10 +32,12 @@ class CardlessEMIEntity(BaseModel): emi_plans: Optional[conlist(EMIPlansArray)] = None __properties = ["payment_method", "emi_plans"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cardless_emi_payment_method.py b/cashfree_pg/models/cardless_emi_payment_method.py index 4b7cf74c..7f662d94 100644 --- a/cashfree_pg/models/cardless_emi_payment_method.py +++ b/cashfree_pg/models/cardless_emi_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.cardless_emi import CardlessEMI +from pydantic import field_validator class CardlessEMIPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class CardlessEMIPaymentMethod(BaseModel): cardless_emi: CardlessEMI = Field(...) __properties = ["cardless_emi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cardless_emi_queries.py b/cashfree_pg/models/cardless_emi_queries.py index c562dd77..8979acf7 100644 --- a/cashfree_pg/models/cardless_emi_queries.py +++ b/cashfree_pg/models/cardless_emi_queries.py @@ -22,6 +22,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, confloat, conint, constr from cashfree_pg.models.customer_details_cardless_emi import CustomerDetailsCardlessEMI +from pydantic import field_validator class CardlessEMIQueries(BaseModel): """ @@ -32,10 +33,12 @@ class CardlessEMIQueries(BaseModel): customer_details: Optional[CustomerDetailsCardlessEMI] = None __properties = ["order_id", "amount", "customer_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cart_details.py b/cashfree_pg/models/cart_details.py index 09375440..16b7033d 100644 --- a/cashfree_pg/models/cart_details.py +++ b/cashfree_pg/models/cart_details.py @@ -22,6 +22,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist from cashfree_pg.models.cart_item import CartItem +from pydantic import field_validator class CartDetails(BaseModel): """ @@ -32,10 +33,12 @@ class CartDetails(BaseModel): cart_items: Optional[conlist(CartItem)] = None __properties = ["shipping_charge", "cart_name", "cart_items"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cart_details_entity.py b/cashfree_pg/models/cart_details_entity.py index a5ec68ef..96649c1a 100644 --- a/cashfree_pg/models/cart_details_entity.py +++ b/cashfree_pg/models/cart_details_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CartDetailsEntity(BaseModel): """ @@ -29,10 +30,12 @@ class CartDetailsEntity(BaseModel): cart_id: Optional[StrictStr] = Field(None, description="ID of the cart that was created") __properties = ["cart_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cart_item.py b/cashfree_pg/models/cart_item.py index de8492b3..998683fe 100644 --- a/cashfree_pg/models/cart_item.py +++ b/cashfree_pg/models/cart_item.py @@ -21,6 +21,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import field_validator class CartItem(BaseModel): """ @@ -38,10 +39,12 @@ class CartItem(BaseModel): item_quantity: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Quantity if that item") __properties = ["item_id", "item_name", "item_description", "item_tags", "item_details_url", "item_image_url", "item_original_unit_price", "item_discounted_unit_price", "item_currency", "item_quantity"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cashback_details.py b/cashfree_pg/models/cashback_details.py index 5a02d854..26d717e7 100644 --- a/cashfree_pg/models/cashback_details.py +++ b/cashfree_pg/models/cashback_details.py @@ -21,6 +21,7 @@ from typing import Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, constr, validator +from pydantic import field_validator class CashbackDetails(BaseModel): """ @@ -31,17 +32,19 @@ class CashbackDetails(BaseModel): max_cashback_amount: Union[StrictFloat, StrictInt] = Field(..., description="Maximum Value of Cashback allowed.") __properties = ["cashback_type", "cashback_value", "max_cashback_amount"] - @validator('cashback_type') + @field_validator('cashback_type') def cashback_type_validate_enum(cls, value): """Validates the enum""" if value not in ('flat', 'percentage'): raise ValueError("must be one of enum values ('flat', 'percentage')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/charges_details.py b/cashfree_pg/models/charges_details.py index 1eb8216b..6954aaa5 100644 --- a/cashfree_pg/models/charges_details.py +++ b/cashfree_pg/models/charges_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class ChargesDetails(BaseModel): """ @@ -33,10 +34,12 @@ class ChargesDetails(BaseModel): is_postpaid: Optional[StrictBool] = None __properties = ["service_charges", "service_tax", "amount", "billed_to", "is_postpaid"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/charges_entity.py b/cashfree_pg/models/charges_entity.py index 7239e45a..b42fa5fc 100644 --- a/cashfree_pg/models/charges_entity.py +++ b/cashfree_pg/models/charges_entity.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import field_validator class ChargesEntity(BaseModel): """ @@ -30,10 +31,12 @@ class ChargesEntity(BaseModel): cod_handling_charges: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="COD handling fee for order") __properties = ["shipping_charges", "cod_handling_charges"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_customer_request.py b/cashfree_pg/models/create_customer_request.py index a8a468fd..0a1cbb3e 100644 --- a/cashfree_pg/models/create_customer_request.py +++ b/cashfree_pg/models/create_customer_request.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import field_validator class CreateCustomerRequest(BaseModel): """ @@ -31,10 +32,12 @@ class CreateCustomerRequest(BaseModel): customer_name: Optional[StrictStr] = Field(None, description="Customer Name") __properties = ["customer_phone", "customer_email", "customer_name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_link_request.py b/cashfree_pg/models/create_link_request.py index 571b6a0d..1cb4b9e2 100644 --- a/cashfree_pg/models/create_link_request.py +++ b/cashfree_pg/models/create_link_request.py @@ -25,6 +25,7 @@ from cashfree_pg.models.link_meta_response_entity import LinkMetaResponseEntity from cashfree_pg.models.link_notify_entity import LinkNotifyEntity from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class CreateLinkRequest(BaseModel): """ @@ -45,10 +46,12 @@ class CreateLinkRequest(BaseModel): order_splits: Optional[conlist(VendorSplit)] = Field(None, description="If you have Easy split enabled in your Cashfree account then you can use this option to split the order amount.") __properties = ["link_id", "link_amount", "link_currency", "link_purpose", "customer_details", "link_partial_payments", "link_minimum_partial_amount", "link_expiry_time", "link_notify", "link_auto_reminders", "link_notes", "link_meta", "order_splits"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_offer_request.py b/cashfree_pg/models/create_offer_request.py index bd080d79..035899d8 100644 --- a/cashfree_pg/models/create_offer_request.py +++ b/cashfree_pg/models/create_offer_request.py @@ -25,6 +25,7 @@ from cashfree_pg.models.offer_meta import OfferMeta from cashfree_pg.models.offer_tnc import OfferTnc from cashfree_pg.models.offer_validations import OfferValidations +from pydantic import field_validator class CreateOfferRequest(BaseModel): """ @@ -36,10 +37,12 @@ class CreateOfferRequest(BaseModel): offer_validations: OfferValidations = Field(...) __properties = ["offer_meta", "offer_tnc", "offer_details", "offer_validations"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_order_request.py b/cashfree_pg/models/create_order_request.py index eec61f03..ab1a8677 100644 --- a/cashfree_pg/models/create_order_request.py +++ b/cashfree_pg/models/create_order_request.py @@ -26,6 +26,7 @@ from cashfree_pg.models.order_meta import OrderMeta from cashfree_pg.models.terminal_details import TerminalDetails from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class CreateOrderRequest(BaseModel): """ @@ -44,10 +45,12 @@ class CreateOrderRequest(BaseModel): order_splits: Optional[conlist(VendorSplit)] = Field(None, description="If you have Easy split enabled in your Cashfree account then you can use this option to split the order amount.") __properties = ["order_id", "order_amount", "order_currency", "cart_details", "customer_details", "terminal", "order_meta", "order_expiry_time", "order_note", "order_tags", "order_splits"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_order_settlement_request_body.py b/cashfree_pg/models/create_order_settlement_request_body.py index 5a346565..cf12b491 100644 --- a/cashfree_pg/models/create_order_settlement_request_body.py +++ b/cashfree_pg/models/create_order_settlement_request_body.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field, StrictStr from cashfree_pg.models.create_order_settlement_request_body_meta_data import CreateOrderSettlementRequestBodyMetaData +from pydantic import field_validator class CreateOrderSettlementRequestBody(BaseModel): """ @@ -31,10 +32,12 @@ class CreateOrderSettlementRequestBody(BaseModel): meta_data: CreateOrderSettlementRequestBodyMetaData = Field(...) __properties = ["order_id", "meta_data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_order_settlement_request_body_meta_data.py b/cashfree_pg/models/create_order_settlement_request_body_meta_data.py index 330a3758..361015cc 100644 --- a/cashfree_pg/models/create_order_settlement_request_body_meta_data.py +++ b/cashfree_pg/models/create_order_settlement_request_body_meta_data.py @@ -21,6 +21,7 @@ from datetime import date from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CreateOrderSettlementRequestBodyMetaData(BaseModel): """ @@ -30,10 +31,12 @@ class CreateOrderSettlementRequestBodyMetaData(BaseModel): settlement_date: Optional[date] = Field(None, description="Requested Settlement Date.") __properties = ["cbriks_id", "settlement_date"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_partner_vpa_request.py b/cashfree_pg/models/create_partner_vpa_request.py index c961e150..54656865 100644 --- a/cashfree_pg/models/create_partner_vpa_request.py +++ b/cashfree_pg/models/create_partner_vpa_request.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictInt +from pydantic import field_validator class CreatePartnerVpaRequest(BaseModel): """ @@ -29,10 +30,12 @@ class CreatePartnerVpaRequest(BaseModel): vpa_count: StrictInt = Field(..., description="count of vpa , to create in bulk, max limit:50") __properties = ["vpa_count"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_plan_request.py b/cashfree_pg/models/create_plan_request.py index 7bb87d5e..167047f5 100644 --- a/cashfree_pg/models/create_plan_request.py +++ b/cashfree_pg/models/create_plan_request.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class CreatePlanRequest(BaseModel): """ @@ -38,10 +39,12 @@ class CreatePlanRequest(BaseModel): plan_note: Optional[StrictStr] = Field(None, description="Note for the plan.") __properties = ["plan_id", "plan_name", "plan_type", "plan_currency", "plan_recurring_amount", "plan_max_amount", "plan_max_cycles", "plan_intervals", "plan_interval_type", "plan_note"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_payment_request.py b/cashfree_pg/models/create_subscription_payment_request.py index e1933ebd..65ece4d6 100644 --- a/cashfree_pg/models/create_subscription_payment_request.py +++ b/cashfree_pg/models/create_subscription_payment_request.py @@ -22,6 +22,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr from cashfree_pg.models.create_subscription_payment_request_payment_method import CreateSubscriptionPaymentRequestPaymentMethod +from pydantic import field_validator class CreateSubscriptionPaymentRequest(BaseModel): """ @@ -37,10 +38,12 @@ class CreateSubscriptionPaymentRequest(BaseModel): payment_method: Optional[CreateSubscriptionPaymentRequestPaymentMethod] = None __properties = ["subscription_id", "subscription_session_id", "payment_id", "payment_amount", "payment_schedule_date", "payment_remarks", "payment_type", "payment_method"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_payment_request_card.py b/cashfree_pg/models/create_subscription_payment_request_card.py index 7a5712ea..d1ec127d 100644 --- a/cashfree_pg/models/create_subscription_payment_request_card.py +++ b/cashfree_pg/models/create_subscription_payment_request_card.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CreateSubscriptionPaymentRequestCard(BaseModel): """ @@ -36,10 +37,12 @@ class CreateSubscriptionPaymentRequestCard(BaseModel): card_type: Optional[StrictStr] = Field(None, description="Card type") __properties = ["channel", "card_number", "card_holder_name", "card_expiry_mm", "card_expiry_yy", "card_cvv", "card_network", "card_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_payment_request_enack.py b/cashfree_pg/models/create_subscription_payment_request_enack.py index f4434735..ec62a6cf 100644 --- a/cashfree_pg/models/create_subscription_payment_request_enack.py +++ b/cashfree_pg/models/create_subscription_payment_request_enack.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CreateSubscriptionPaymentRequestEnack(BaseModel): """ @@ -35,10 +36,12 @@ class CreateSubscriptionPaymentRequestEnack(BaseModel): account_ifsc: Optional[StrictStr] = Field(None, description="Account IFSC") __properties = ["channel", "auth_mode", "account_holder_name", "account_number", "account_bank_code", "account_type", "account_ifsc"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_payment_request_payment_method.py b/cashfree_pg/models/create_subscription_payment_request_payment_method.py index e359a614..dbe61582 100644 --- a/cashfree_pg/models/create_subscription_payment_request_payment_method.py +++ b/cashfree_pg/models/create_subscription_payment_request_payment_method.py @@ -48,8 +48,10 @@ class CreateSubscriptionPaymentRequestPaymentMethod(BaseModel): actual_instance: Any one_of_schemas: List[str] = Field(CREATESUBSCRIPTIONPAYMENTREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True) - class Config: - validate_assignment = True + # Updated to Pydantic v2 + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: diff --git a/cashfree_pg/models/create_subscription_payment_request_pnach.py b/cashfree_pg/models/create_subscription_payment_request_pnach.py index 13d53392..9ccef878 100644 --- a/cashfree_pg/models/create_subscription_payment_request_pnach.py +++ b/cashfree_pg/models/create_subscription_payment_request_pnach.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CreateSubscriptionPaymentRequestPnach(BaseModel): """ @@ -36,10 +37,12 @@ class CreateSubscriptionPaymentRequestPnach(BaseModel): mandate_start_date: Optional[StrictStr] = Field(None, description="Mandate start date") __properties = ["channel", "account_holder_name", "account_number", "account_bank_code", "account_type", "account_ifsc", "mandate_creation_date", "mandate_start_date"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_payment_response.py b/cashfree_pg/models/create_subscription_payment_response.py index 287bd965..fc776454 100644 --- a/cashfree_pg/models/create_subscription_payment_response.py +++ b/cashfree_pg/models/create_subscription_payment_response.py @@ -22,6 +22,7 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr from cashfree_pg.models.subscription_payment_entity_failure_details import SubscriptionPaymentEntityFailureDetails +from pydantic import field_validator class CreateSubscriptionPaymentResponse(BaseModel): """ @@ -39,10 +40,12 @@ class CreateSubscriptionPaymentResponse(BaseModel): payment_method: Optional[StrictStr] = Field(None, description="Payment method used for the authorization.") __properties = ["cf_payment_id", "failure_details", "payment_amount", "payment_id", "payment_initiated_date", "payment_status", "payment_type", "subscription_id", "data", "payment_method"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_refund_request.py b/cashfree_pg/models/create_subscription_refund_request.py index aba434d0..a1822a6c 100644 --- a/cashfree_pg/models/create_subscription_refund_request.py +++ b/cashfree_pg/models/create_subscription_refund_request.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class CreateSubscriptionRefundRequest(BaseModel): """ @@ -35,10 +36,12 @@ class CreateSubscriptionRefundRequest(BaseModel): refund_speed: Optional[StrictStr] = Field(None, description="Refund speed. Can be INSTANT or STANDARD. UPI supports only STANDARD refunds, Enach and Pnach supports only INSTANT refunds.") __properties = ["subscription_id", "payment_id", "cf_payment_id", "refund_id", "refund_amount", "refund_note", "refund_speed"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_request.py b/cashfree_pg/models/create_subscription_request.py index 6f87db0c..11ee5815 100644 --- a/cashfree_pg/models/create_subscription_request.py +++ b/cashfree_pg/models/create_subscription_request.py @@ -26,6 +26,7 @@ from cashfree_pg.models.create_subscription_request_subscription_meta import CreateSubscriptionRequestSubscriptionMeta from cashfree_pg.models.subscription_customer_details import SubscriptionCustomerDetails from cashfree_pg.models.subscription_payment_split_item import SubscriptionPaymentSplitItem +from pydantic import field_validator class CreateSubscriptionRequest(BaseModel): """ @@ -43,10 +44,12 @@ class CreateSubscriptionRequest(BaseModel): subscription_payment_splits: Optional[conlist(SubscriptionPaymentSplitItem)] = Field(None, description="Payment splits for the subscription.") __properties = ["subscription_id", "customer_details", "plan_details", "authorization_details", "subscription_meta", "subscription_expiry_time", "subscription_first_charge_time", "subscription_note", "subscription_tags", "subscription_payment_splits"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_request_authorization_details.py b/cashfree_pg/models/create_subscription_request_authorization_details.py index 72db0a9a..b3d28b81 100644 --- a/cashfree_pg/models/create_subscription_request_authorization_details.py +++ b/cashfree_pg/models/create_subscription_request_authorization_details.py @@ -21,6 +21,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import field_validator class CreateSubscriptionRequestAuthorizationDetails(BaseModel): """ @@ -31,10 +32,12 @@ class CreateSubscriptionRequestAuthorizationDetails(BaseModel): payment_methods: Optional[conlist(StrictStr)] = Field(None, description="Payment methods for the subscription. enach, pnach, upi, card are possible values.") __properties = ["authorization_amount", "authorization_amount_refund", "payment_methods"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_request_plan_details.py b/cashfree_pg/models/create_subscription_request_plan_details.py index 9e72e3e5..87d73b64 100644 --- a/cashfree_pg/models/create_subscription_request_plan_details.py +++ b/cashfree_pg/models/create_subscription_request_plan_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class CreateSubscriptionRequestPlanDetails(BaseModel): """ @@ -38,10 +39,12 @@ class CreateSubscriptionRequestPlanDetails(BaseModel): plan_note: Optional[StrictStr] = Field(None, description="Note for the plan.") __properties = ["plan_id", "plan_name", "plan_type", "plan_currency", "plan_amount", "plan_max_amount", "plan_max_cycles", "plan_intervals", "plan_interval_type", "plan_note"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscription_request_subscription_meta.py b/cashfree_pg/models/create_subscription_request_subscription_meta.py index 57f526e2..2d4aedde 100644 --- a/cashfree_pg/models/create_subscription_request_subscription_meta.py +++ b/cashfree_pg/models/create_subscription_request_subscription_meta.py @@ -21,6 +21,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class CreateSubscriptionRequestSubscriptionMeta(BaseModel): """ @@ -30,10 +31,12 @@ class CreateSubscriptionRequestSubscriptionMeta(BaseModel): notification_channel: Optional[conlist(StrictStr)] = Field(None, description="Notification channel for the subscription. SMS, EMAIL are possible values.") __properties = ["return_url", "notification_channel"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_subscripton_payment_request_upi.py b/cashfree_pg/models/create_subscripton_payment_request_upi.py index 4fe58555..4f2d042c 100644 --- a/cashfree_pg/models/create_subscripton_payment_request_upi.py +++ b/cashfree_pg/models/create_subscripton_payment_request_upi.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CreateSubscriptonPaymentRequestUpi(BaseModel): """ @@ -30,10 +31,12 @@ class CreateSubscriptonPaymentRequestUpi(BaseModel): channel: Optional[StrictStr] = Field(None, description="Channel. can be link, qrcode, or collect") __properties = ["upi_id", "channel"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_terminal_request.py b/cashfree_pg/models/create_terminal_request.py index a6a821c6..1201680a 100644 --- a/cashfree_pg/models/create_terminal_request.py +++ b/cashfree_pg/models/create_terminal_request.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, constr from cashfree_pg.models.create_terminal_request_terminal_meta import CreateTerminalRequestTerminalMeta +from pydantic import field_validator class CreateTerminalRequest(BaseModel): """ @@ -37,10 +38,12 @@ class CreateTerminalRequest(BaseModel): terminal_meta: Optional[CreateTerminalRequestTerminalMeta] = None __properties = ["terminal_id", "terminal_phone_no", "terminal_name", "terminal_address", "terminal_email", "terminal_note", "terminal_type", "terminal_meta"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_terminal_request_terminal_meta.py b/cashfree_pg/models/create_terminal_request_terminal_meta.py index 28b97e35..956aff56 100644 --- a/cashfree_pg/models/create_terminal_request_terminal_meta.py +++ b/cashfree_pg/models/create_terminal_request_terminal_meta.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CreateTerminalRequestTerminalMeta(BaseModel): """ @@ -29,10 +30,12 @@ class CreateTerminalRequestTerminalMeta(BaseModel): terminal_operator: Optional[StrictStr] = Field(None, description="name of the STOREFRONT operator.") __properties = ["terminal_operator"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_terminal_transaction_request.py b/cashfree_pg/models/create_terminal_transaction_request.py index 96ec155a..76992464 100644 --- a/cashfree_pg/models/create_terminal_transaction_request.py +++ b/cashfree_pg/models/create_terminal_transaction_request.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import field_validator class CreateTerminalTransactionRequest(BaseModel): """ @@ -33,10 +34,12 @@ class CreateTerminalTransactionRequest(BaseModel): add_invoice: Optional[StrictBool] = Field(None, description="make it true to have request be sent to create a Dynamic GST QR Code.") __properties = ["cf_order_id", "cf_terminal_id", "payment_method", "terminal_phone_no", "add_invoice"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_vendor_request.py b/cashfree_pg/models/create_vendor_request.py index 4bae1085..c15a9759 100644 --- a/cashfree_pg/models/create_vendor_request.py +++ b/cashfree_pg/models/create_vendor_request.py @@ -24,6 +24,7 @@ from cashfree_pg.models.bank_details import BankDetails from cashfree_pg.models.kyc_details import KycDetails from cashfree_pg.models.upi_details import UpiDetails +from pydantic import field_validator class CreateVendorRequest(BaseModel): """ @@ -42,10 +43,12 @@ class CreateVendorRequest(BaseModel): kyc_details: conlist(KycDetails) = Field(..., description="Specify the kyc details that should be updated.") __properties = ["vendor_id", "status", "name", "email", "phone", "verify_account", "dashboard_access", "schedule_option", "bank", "upi", "kyc_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/create_vendor_response.py b/cashfree_pg/models/create_vendor_response.py index c4399f06..c498560e 100644 --- a/cashfree_pg/models/create_vendor_response.py +++ b/cashfree_pg/models/create_vendor_response.py @@ -24,6 +24,7 @@ from cashfree_pg.models.bank_details import BankDetails from cashfree_pg.models.kyc_details import KycDetails from cashfree_pg.models.schedule_option import ScheduleOption +from pydantic import field_validator class CreateVendorResponse(BaseModel): """ @@ -42,10 +43,12 @@ class CreateVendorResponse(BaseModel): bank_details: Optional[StrictStr] = None __properties = ["email", "status", "bank", "upi", "phone", "name", "vendor_id", "schedule_option", "kyc_details", "dashboard_access", "bank_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/cryptogram_entity.py b/cashfree_pg/models/cryptogram_entity.py index e5407a34..995f07c9 100644 --- a/cashfree_pg/models/cryptogram_entity.py +++ b/cashfree_pg/models/cryptogram_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CryptogramEntity(BaseModel): """ @@ -35,10 +36,12 @@ class CryptogramEntity(BaseModel): card_display: Optional[StrictStr] = Field(None, description="last 4 digits of original card number") __properties = ["instrument_id", "token_requestor_id", "card_number", "card_expiry_mm", "card_expiry_yy", "cryptogram", "card_display"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/customer_details.py b/cashfree_pg/models/customer_details.py index b18f5b39..dd1b7f13 100644 --- a/cashfree_pg/models/customer_details.py +++ b/cashfree_pg/models/customer_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class CustomerDetails(BaseModel): """ @@ -36,10 +37,12 @@ class CustomerDetails(BaseModel): customer_uid: Optional[StrictStr] = Field(None, description="Customer identifier at Cashfree. You will get this when you create/get customer") __properties = ["customer_id", "customer_email", "customer_phone", "customer_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code", "customer_uid"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/customer_details_cardless_emi.py b/cashfree_pg/models/customer_details_cardless_emi.py index 0f1a7149..58259e93 100644 --- a/cashfree_pg/models/customer_details_cardless_emi.py +++ b/cashfree_pg/models/customer_details_cardless_emi.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, constr +from pydantic import field_validator class CustomerDetailsCardlessEMI(BaseModel): """ @@ -29,10 +30,12 @@ class CustomerDetailsCardlessEMI(BaseModel): customer_phone: constr(strict=True, max_length=50, min_length=3) = Field(..., description="Phone Number of the customer") __properties = ["customer_phone"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/customer_details_in_disputes_entity.py b/cashfree_pg/models/customer_details_in_disputes_entity.py index 8c378282..157e3e91 100644 --- a/cashfree_pg/models/customer_details_in_disputes_entity.py +++ b/cashfree_pg/models/customer_details_in_disputes_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class CustomerDetailsInDisputesEntity(BaseModel): """ @@ -31,10 +32,12 @@ class CustomerDetailsInDisputesEntity(BaseModel): customer_email: Optional[StrictStr] = None __properties = ["customer_name", "customer_phone", "customer_email"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/customer_details_response.py b/cashfree_pg/models/customer_details_response.py index 11934a8e..bcb5c41f 100644 --- a/cashfree_pg/models/customer_details_response.py +++ b/cashfree_pg/models/customer_details_response.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class CustomerDetailsResponse(BaseModel): """ @@ -36,10 +37,12 @@ class CustomerDetailsResponse(BaseModel): customer_uid: Optional[StrictStr] = Field(None, description="Customer identifier at Cashfree. You will get this when you create/get customer") __properties = ["customer_id", "customer_email", "customer_phone", "customer_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code", "customer_uid"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/customer_entity.py b/cashfree_pg/models/customer_entity.py index c34294dd..e72702de 100644 --- a/cashfree_pg/models/customer_entity.py +++ b/cashfree_pg/models/customer_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class CustomerEntity(BaseModel): """ @@ -32,10 +33,12 @@ class CustomerEntity(BaseModel): customer_name: Optional[StrictStr] = Field(None, description="Customer Name") __properties = ["customer_uid", "customer_phone", "customer_email", "customer_name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/demap_soundbox_vpa_request.py b/cashfree_pg/models/demap_soundbox_vpa_request.py index 07ba246c..37b0577c 100644 --- a/cashfree_pg/models/demap_soundbox_vpa_request.py +++ b/cashfree_pg/models/demap_soundbox_vpa_request.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class DemapSoundboxVpaRequest(BaseModel): """ @@ -30,10 +31,12 @@ class DemapSoundboxVpaRequest(BaseModel): device_serial_no: StrictStr = Field(..., description="Device Serial No of soundbox that need to demap.") __properties = ["cf_terminal_id", "device_serial_no"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/discount_details.py b/cashfree_pg/models/discount_details.py index 73229f11..d40577c9 100644 --- a/cashfree_pg/models/discount_details.py +++ b/cashfree_pg/models/discount_details.py @@ -21,6 +21,7 @@ from typing import Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, constr, validator +from pydantic import field_validator class DiscountDetails(BaseModel): """ @@ -31,17 +32,19 @@ class DiscountDetails(BaseModel): max_discount_amount: Union[StrictFloat, StrictInt] = Field(..., description="Maximum Value of Discount allowed.") __properties = ["discount_type", "discount_value", "max_discount_amount"] - @validator('discount_type') + @field_validator('discount_type') def discount_type_validate_enum(cls, value): """Validates the enum""" if value not in ('flat', 'percentage'): raise ValueError("must be one of enum values ('flat', 'percentage')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/disputes_entity.py b/cashfree_pg/models/disputes_entity.py index 75e159b4..8990c8a4 100644 --- a/cashfree_pg/models/disputes_entity.py +++ b/cashfree_pg/models/disputes_entity.py @@ -25,6 +25,7 @@ from cashfree_pg.models.evidence import Evidence from cashfree_pg.models.evidences_to_contest_dispute import EvidencesToContestDispute from cashfree_pg.models.order_details_in_disputes_entity import OrderDetailsInDisputesEntity +from pydantic import field_validator class DisputesEntity(BaseModel): """ @@ -47,7 +48,7 @@ class DisputesEntity(BaseModel): customer_details: Optional[CustomerDetailsInDisputesEntity] = None __properties = ["dispute_id", "dispute_type", "reason_code", "reason_description", "dispute_amount", "created_at", "respond_by", "updated_at", "resolved_at", "dispute_status", "cf_dispute_remarks", "preferred_evidence", "dispute_evidence", "order_details", "customer_details"] - @validator('dispute_type') + @field_validator('dispute_type') def dispute_type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -57,7 +58,7 @@ def dispute_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('DISPUTE', 'CHARGEBACK', 'RETRIEVAL', 'PRE_ARBITRATION', 'ARBITRATION')") return value - @validator('dispute_status') + @field_validator('dispute_status') def dispute_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -67,10 +68,12 @@ def dispute_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('DISPUTE_CREATED', 'DISPUTE_DOCS_RECEIVED', 'DISPUTE_UNDER_REVIEW', 'DISPUTE_MERCHANT_WON', 'DISPUTE_MERCHANT_LOST', 'DISPUTE_MERCHANT_ACCEPTED', 'DISPUTE_INSUFFICIENT_EVIDENCE', 'CHARGEBACK_CREATED', 'CHARGEBACK_DOCS_RECEIVED', 'CHARGEBACK_UNDER_REVIEW', 'CHARGEBACK_MERCHANT_WON', 'CHARGEBACK_MERCHANT_LOST', 'CHARGEBACK_MERCHANT_ACCEPTED', 'CHARGEBACK_INSUFFICIENT_EVIDENCE', 'RETRIEVAL_CREATED', 'RETRIEVAL_DOCS_RECEIVED', 'RETRIEVAL_UNDER_REVIEW', 'RETRIEVAL_MERCHANT_WON', 'RETRIEVAL_MERCHANT_LOST', 'RETRIEVAL_MERCHANT_ACCEPTED', 'RETRIEVAL_INSUFFICIENT_EVIDENCE', 'PRE_ARBITRATION_CREATED', 'PRE_ARBITRATION_DOCS_RECEIVED', 'PRE_ARBITRATION_UNDER_REVIEW', 'PRE_ARBITRATION_MERCHANT_WON', 'PRE_ARBITRATION_MERCHANT_LOST', 'PRE_ARBITRATION_MERCHANT_ACCEPTED', 'PRE_ARBITRATION_INSUFFICIENT_EVIDENCE', 'ARBITRATION_CREATED', 'ARBITRATION_DOCS_RECEIVED', 'ARBITRATION_UNDER_REVIEW', 'ARBITRATION_MERCHANT_WON', 'ARBITRATION_MERCHANT_LOST', 'ARBITRATION_MERCHANT_ACCEPTED', 'ARBITRATION_INSUFFICIENT_EVIDENCE')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/disputes_entity_merchant_accepted.py b/cashfree_pg/models/disputes_entity_merchant_accepted.py index efbb3562..303d2fad 100644 --- a/cashfree_pg/models/disputes_entity_merchant_accepted.py +++ b/cashfree_pg/models/disputes_entity_merchant_accepted.py @@ -25,6 +25,7 @@ from cashfree_pg.models.evidence import Evidence from cashfree_pg.models.evidences_to_contest_dispute import EvidencesToContestDispute from cashfree_pg.models.order_details_in_disputes_entity import OrderDetailsInDisputesEntity +from pydantic import field_validator class DisputesEntityMerchantAccepted(BaseModel): """ @@ -47,7 +48,7 @@ class DisputesEntityMerchantAccepted(BaseModel): customer_details: Optional[CustomerDetailsInDisputesEntity] = None __properties = ["dispute_id", "dispute_type", "reason_code", "reason_description", "dispute_amount", "created_at", "respond_by", "updated_at", "resolved_at", "dispute_status", "cf_dispute_remarks", "preferred_evidence", "dispute_evidence", "order_details", "customer_details"] - @validator('dispute_type') + @field_validator('dispute_type') def dispute_type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -57,7 +58,7 @@ def dispute_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('DISPUTE', 'CHARGEBACK', 'RETRIEVAL', 'PRE_ARBITRATION', 'ARBITRATION')") return value - @validator('dispute_status') + @field_validator('dispute_status') def dispute_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -67,10 +68,12 @@ def dispute_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('DISPUTE_CREATED', 'DISPUTE_DOCS_RECEIVED', 'DISPUTE_UNDER_REVIEW', 'DISPUTE_MERCHANT_WON', 'DISPUTE_MERCHANT_LOST', 'DISPUTE_MERCHANT_ACCEPTED', 'DISPUTE_INSUFFICIENT_EVIDENCE', 'CHARGEBACK_CREATED', 'CHARGEBACK_DOCS_RECEIVED', 'CHARGEBACK_UNDER_REVIEW', 'CHARGEBACK_MERCHANT_WON', 'CHARGEBACK_MERCHANT_LOST', 'CHARGEBACK_MERCHANT_ACCEPTED', 'CHARGEBACK_INSUFFICIENT_EVIDENCE', 'RETRIEVAL_CREATED', 'RETRIEVAL_DOCS_RECEIVED', 'RETRIEVAL_UNDER_REVIEW', 'RETRIEVAL_MERCHANT_WON', 'RETRIEVAL_MERCHANT_LOST', 'RETRIEVAL_MERCHANT_ACCEPTED', 'RETRIEVAL_INSUFFICIENT_EVIDENCE', 'PRE_ARBITRATION_CREATED', 'PRE_ARBITRATION_DOCS_RECEIVED', 'PRE_ARBITRATION_UNDER_REVIEW', 'PRE_ARBITRATION_MERCHANT_WON', 'PRE_ARBITRATION_MERCHANT_LOST', 'PRE_ARBITRATION_MERCHANT_ACCEPTED', 'PRE_ARBITRATION_INSUFFICIENT_EVIDENCE', 'ARBITRATION_CREATED', 'ARBITRATION_DOCS_RECEIVED', 'ARBITRATION_UNDER_REVIEW', 'ARBITRATION_MERCHANT_WON', 'ARBITRATION_MERCHANT_LOST', 'ARBITRATION_MERCHANT_ACCEPTED', 'ARBITRATION_INSUFFICIENT_EVIDENCE')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_cardless_emi_entity.py b/cashfree_pg/models/eligibility_cardless_emi_entity.py index 734e627a..584efabb 100644 --- a/cashfree_pg/models/eligibility_cardless_emi_entity.py +++ b/cashfree_pg/models/eligibility_cardless_emi_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr from cashfree_pg.models.cardless_emi_entity import CardlessEMIEntity +from pydantic import field_validator class EligibilityCardlessEMIEntity(BaseModel): """ @@ -33,10 +34,12 @@ class EligibilityCardlessEMIEntity(BaseModel): entity_details: Optional[CardlessEMIEntity] = None __properties = ["eligibility", "entity_type", "entity_value", "entity_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_fetch_cardless_emi_request.py b/cashfree_pg/models/eligibility_fetch_cardless_emi_request.py index 0fdf1eea..689af9ad 100644 --- a/cashfree_pg/models/eligibility_fetch_cardless_emi_request.py +++ b/cashfree_pg/models/eligibility_fetch_cardless_emi_request.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.cardless_emi_queries import CardlessEMIQueries +from pydantic import field_validator class EligibilityFetchCardlessEMIRequest(BaseModel): """ @@ -30,10 +31,12 @@ class EligibilityFetchCardlessEMIRequest(BaseModel): queries: CardlessEMIQueries = Field(...) __properties = ["queries"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_fetch_offers_request.py b/cashfree_pg/models/eligibility_fetch_offers_request.py index 0552a8f9..0f4a69e9 100644 --- a/cashfree_pg/models/eligibility_fetch_offers_request.py +++ b/cashfree_pg/models/eligibility_fetch_offers_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.offer_filters import OfferFilters from cashfree_pg.models.offer_queries import OfferQueries +from pydantic import field_validator class EligibilityFetchOffersRequest(BaseModel): """ @@ -32,10 +33,12 @@ class EligibilityFetchOffersRequest(BaseModel): filters: Optional[OfferFilters] = None __properties = ["queries", "filters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_fetch_paylater_request.py b/cashfree_pg/models/eligibility_fetch_paylater_request.py index 7536cc37..dd0f8873 100644 --- a/cashfree_pg/models/eligibility_fetch_paylater_request.py +++ b/cashfree_pg/models/eligibility_fetch_paylater_request.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.cardless_emi_queries import CardlessEMIQueries +from pydantic import field_validator class EligibilityFetchPaylaterRequest(BaseModel): """ @@ -30,10 +31,12 @@ class EligibilityFetchPaylaterRequest(BaseModel): queries: CardlessEMIQueries = Field(...) __properties = ["queries"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_fetch_payment_methods_request.py b/cashfree_pg/models/eligibility_fetch_payment_methods_request.py index bba5d9a9..8d177f0f 100644 --- a/cashfree_pg/models/eligibility_fetch_payment_methods_request.py +++ b/cashfree_pg/models/eligibility_fetch_payment_methods_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.payment_methods_filters import PaymentMethodsFilters from cashfree_pg.models.payment_methods_queries import PaymentMethodsQueries +from pydantic import field_validator class EligibilityFetchPaymentMethodsRequest(BaseModel): """ @@ -32,10 +33,12 @@ class EligibilityFetchPaymentMethodsRequest(BaseModel): filters: Optional[PaymentMethodsFilters] = None __properties = ["queries", "filters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_method_item.py b/cashfree_pg/models/eligibility_method_item.py index 87f49364..35128e0b 100644 --- a/cashfree_pg/models/eligibility_method_item.py +++ b/cashfree_pg/models/eligibility_method_item.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictStr from cashfree_pg.models.eligibility_method_item_entity_details import EligibilityMethodItemEntityDetails +from pydantic import field_validator class EligibilityMethodItem(BaseModel): """ @@ -33,10 +34,12 @@ class EligibilityMethodItem(BaseModel): entity_details: Optional[EligibilityMethodItemEntityDetails] = None __properties = ["eligibility", "entity_type", "entity_value", "entity_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_method_item_entity_details.py b/cashfree_pg/models/eligibility_method_item_entity_details.py index 6f6d1f9b..693adbac 100644 --- a/cashfree_pg/models/eligibility_method_item_entity_details.py +++ b/cashfree_pg/models/eligibility_method_item_entity_details.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, StrictStr, conlist from cashfree_pg.models.eligibility_method_item_entity_details_available_handles_inner import EligibilityMethodItemEntityDetailsAvailableHandlesInner from cashfree_pg.models.subscription_bank_details import SubscriptionBankDetails +from pydantic import field_validator class EligibilityMethodItemEntityDetails(BaseModel): """ @@ -35,10 +36,12 @@ class EligibilityMethodItemEntityDetails(BaseModel): allowed_card_types: Optional[conlist(StrictStr)] = Field(None, description="List of allowed card types. (e.g. DEBIT_CARD, CREDIT_CARD)") __properties = ["account_types", "frequent_bank_details", "all_bank_details", "available_handles", "allowed_card_types"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_method_item_entity_details_available_handles_inner.py b/cashfree_pg/models/eligibility_method_item_entity_details_available_handles_inner.py index 65c310c4..28327361 100644 --- a/cashfree_pg/models/eligibility_method_item_entity_details_available_handles_inner.py +++ b/cashfree_pg/models/eligibility_method_item_entity_details_available_handles_inner.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class EligibilityMethodItemEntityDetailsAvailableHandlesInner(BaseModel): """ @@ -30,10 +31,12 @@ class EligibilityMethodItemEntityDetailsAvailableHandlesInner(BaseModel): application: Optional[StrictStr] = Field(None, description="Application or service related to the VPA handle.") __properties = ["handle", "application"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_offer_entity.py b/cashfree_pg/models/eligibility_offer_entity.py index 9882a3a0..aadf602c 100644 --- a/cashfree_pg/models/eligibility_offer_entity.py +++ b/cashfree_pg/models/eligibility_offer_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr from cashfree_pg.models.offer_entity import OfferEntity +from pydantic import field_validator class EligibilityOfferEntity(BaseModel): """ @@ -33,10 +34,12 @@ class EligibilityOfferEntity(BaseModel): entity_details: Optional[OfferEntity] = None __properties = ["eligibility", "entity_type", "entity_value", "entity_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_paylater_entity.py b/cashfree_pg/models/eligibility_paylater_entity.py index dff20cee..ca59f933 100644 --- a/cashfree_pg/models/eligibility_paylater_entity.py +++ b/cashfree_pg/models/eligibility_paylater_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr from cashfree_pg.models.paylater_entity import PaylaterEntity +from pydantic import field_validator class EligibilityPaylaterEntity(BaseModel): """ @@ -33,10 +34,12 @@ class EligibilityPaylaterEntity(BaseModel): entity_details: Optional[PaylaterEntity] = None __properties = ["eligibility", "entity_type", "entity_value", "entity_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_payment_methods_entity.py b/cashfree_pg/models/eligibility_payment_methods_entity.py index 52fdec26..4f4d3db0 100644 --- a/cashfree_pg/models/eligibility_payment_methods_entity.py +++ b/cashfree_pg/models/eligibility_payment_methods_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictBool, StrictStr from cashfree_pg.models.eligibility_payment_methods_entity_entity_details import EligibilityPaymentMethodsEntityEntityDetails +from pydantic import field_validator class EligibilityPaymentMethodsEntity(BaseModel): """ @@ -33,10 +34,12 @@ class EligibilityPaymentMethodsEntity(BaseModel): entity_details: Optional[EligibilityPaymentMethodsEntityEntityDetails] = None __properties = ["eligibility", "entity_type", "entity_value", "entity_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/eligibility_payment_methods_entity_entity_details.py b/cashfree_pg/models/eligibility_payment_methods_entity_entity_details.py index 77b0406e..f8842f94 100644 --- a/cashfree_pg/models/eligibility_payment_methods_entity_entity_details.py +++ b/cashfree_pg/models/eligibility_payment_methods_entity_entity_details.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, conlist from cashfree_pg.models.payment_mode_details import PaymentModeDetails +from pydantic import field_validator class EligibilityPaymentMethodsEntityEntityDetails(BaseModel): """ @@ -30,10 +31,12 @@ class EligibilityPaymentMethodsEntityEntityDetails(BaseModel): payment_method_details: Optional[conlist(PaymentModeDetails)] = None __properties = ["payment_method_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/emi_offer.py b/cashfree_pg/models/emi_offer.py index 13dd0653..22fbc8f7 100644 --- a/cashfree_pg/models/emi_offer.py +++ b/cashfree_pg/models/emi_offer.py @@ -21,6 +21,7 @@ from typing import List from pydantic import BaseModel, Field, StrictInt, conlist, constr +from pydantic import field_validator class EMIOffer(BaseModel): """ @@ -31,10 +32,12 @@ class EMIOffer(BaseModel): tenures: conlist(StrictInt) = Field(...) __properties = ["type", "issuer", "tenures"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/emi_plans_array.py b/cashfree_pg/models/emi_plans_array.py index 6f45bda7..fbc4a2f4 100644 --- a/cashfree_pg/models/emi_plans_array.py +++ b/cashfree_pg/models/emi_plans_array.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, constr +from pydantic import field_validator class EMIPlansArray(BaseModel): """ @@ -34,10 +35,12 @@ class EMIPlansArray(BaseModel): total_amount: Optional[StrictInt] = None __properties = ["tenure", "interest_rate", "currency", "emi", "total_interest", "total_amount"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/entity_simulation_request.py b/cashfree_pg/models/entity_simulation_request.py index e2ab8592..8fd9ba57 100644 --- a/cashfree_pg/models/entity_simulation_request.py +++ b/cashfree_pg/models/entity_simulation_request.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class EntitySimulationRequest(BaseModel): """ @@ -30,17 +31,19 @@ class EntitySimulationRequest(BaseModel): payment_error_code: Optional[StrictStr] = Field(None, description="Payment Error Code") __properties = ["payment_status", "payment_error_code"] - @validator('payment_status') + @field_validator('payment_status') def payment_status_validate_enum(cls, value): """Validates the enum""" if value not in ('SUCCESS', 'FAILED', 'PENDING', 'USER_DROPPED'): raise ValueError("must be one of enum values ('SUCCESS', 'FAILED', 'PENDING', 'USER_DROPPED')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/entity_simulation_response.py b/cashfree_pg/models/entity_simulation_response.py index 31716063..5892dc8f 100644 --- a/cashfree_pg/models/entity_simulation_response.py +++ b/cashfree_pg/models/entity_simulation_response.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class EntitySimulationResponse(BaseModel): """ @@ -30,10 +31,12 @@ class EntitySimulationResponse(BaseModel): payment_error_code: Optional[StrictStr] = Field(None, description="Payment Error Code") __properties = ["payment_status", "payment_error_code"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/error_details_in_payments_entity.py b/cashfree_pg/models/error_details_in_payments_entity.py index 162612a9..c8484ece 100644 --- a/cashfree_pg/models/error_details_in_payments_entity.py +++ b/cashfree_pg/models/error_details_in_payments_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class ErrorDetailsInPaymentsEntity(BaseModel): """ @@ -35,10 +36,12 @@ class ErrorDetailsInPaymentsEntity(BaseModel): error_subcode_raw: Optional[StrictStr] = None __properties = ["error_code", "error_description", "error_reason", "error_source", "error_code_raw", "error_description_raw", "error_subcode_raw"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_request.py b/cashfree_pg/models/es_order_recon_request.py index cefd337e..0d8e5999 100644 --- a/cashfree_pg/models/es_order_recon_request.py +++ b/cashfree_pg/models/es_order_recon_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.es_order_recon_request_filters import ESOrderReconRequestFilters from cashfree_pg.models.es_order_recon_request_pagination import ESOrderReconRequestPagination +from pydantic import field_validator class ESOrderReconRequest(BaseModel): """ @@ -32,10 +33,12 @@ class ESOrderReconRequest(BaseModel): pagination: ESOrderReconRequestPagination = Field(...) __properties = ["filters", "pagination"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_request_filters.py b/cashfree_pg/models/es_order_recon_request_filters.py index 681ee1fe..de79861a 100644 --- a/cashfree_pg/models/es_order_recon_request_filters.py +++ b/cashfree_pg/models/es_order_recon_request_filters.py @@ -21,6 +21,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class ESOrderReconRequestFilters(BaseModel): """ @@ -31,10 +32,12 @@ class ESOrderReconRequestFilters(BaseModel): order_ids: Optional[conlist(StrictStr)] = Field(None, description="Please provide list of order ids for which you want to get the recon data.") __properties = ["start_date", "end_date", "order_ids"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_request_pagination.py b/cashfree_pg/models/es_order_recon_request_pagination.py index fb82fb4a..d9be6a3f 100644 --- a/cashfree_pg/models/es_order_recon_request_pagination.py +++ b/cashfree_pg/models/es_order_recon_request_pagination.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import field_validator class ESOrderReconRequestPagination(BaseModel): """ @@ -30,10 +31,12 @@ class ESOrderReconRequestPagination(BaseModel): limit: Optional[StrictInt] = Field(None, description="Set the minimum/maximum limit for number of filtered data. Min value - 10, Max value - 100.") __properties = ["cursor", "limit"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_response.py b/cashfree_pg/models/es_order_recon_response.py index dc834d4d..944e0b0d 100644 --- a/cashfree_pg/models/es_order_recon_response.py +++ b/cashfree_pg/models/es_order_recon_response.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, StrictInt, StrictStr, conlist from cashfree_pg.models.es_order_recon_response_data_inner import ESOrderReconResponseDataInner +from pydantic import field_validator class ESOrderReconResponse(BaseModel): """ @@ -32,10 +33,12 @@ class ESOrderReconResponse(BaseModel): limit: Optional[StrictInt] = None __properties = ["cursor", "data", "limit"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_response_data_inner.py b/cashfree_pg/models/es_order_recon_response_data_inner.py index 2df27877..7ddd034f 100644 --- a/cashfree_pg/models/es_order_recon_response_data_inner.py +++ b/cashfree_pg/models/es_order_recon_response_data_inner.py @@ -22,6 +22,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conlist from cashfree_pg.models.es_order_recon_response_data_inner_order_splits_inner import ESOrderReconResponseDataInnerOrderSplitsInner +from pydantic import field_validator class ESOrderReconResponseDataInner(BaseModel): """ @@ -55,10 +56,12 @@ class ESOrderReconResponseDataInner(BaseModel): eligible_split_balance: Optional[StrictStr] = None __properties = ["amount", "settlement_eligibility_time", "merchant_order_id", "tx_time", "settled", "entity_id", "merchant_settlement_utr", "currency", "sale_type", "customer_name", "customer_email", "customer_phone", "merchant_vendor_commission", "split_service_charge", "split_service_tax", "pg_service_tax", "pg_service_charge", "pg_charge_postpaid", "merchant_settlement_id", "added_on", "tags", "entity_type", "settlement_initiated_on", "settlement_time", "order_splits", "eligible_split_balance"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner.py b/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner.py index beca5c6b..e54b701f 100644 --- a/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner.py +++ b/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, StrictStr, conlist from cashfree_pg.models.es_order_recon_response_data_inner_order_splits_inner_split_inner import ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner +from pydantic import field_validator class ESOrderReconResponseDataInnerOrderSplitsInner(BaseModel): """ @@ -31,10 +32,12 @@ class ESOrderReconResponseDataInnerOrderSplitsInner(BaseModel): created_at: Optional[StrictStr] = None __properties = ["split", "created_at"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner_split_inner.py b/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner_split_inner.py index f092c77c..df8e2e8c 100644 --- a/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner_split_inner.py +++ b/cashfree_pg/models/es_order_recon_response_data_inner_order_splits_inner_split_inner.py @@ -21,6 +21,7 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner(BaseModel): """ @@ -31,10 +32,12 @@ class ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner(BaseModel): tags: Optional[Dict[str, Any]] = None __properties = ["merchant_vendor_id", "percentage", "tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/evidence.py b/cashfree_pg/models/evidence.py index 29f76ab6..eeaa35c5 100644 --- a/cashfree_pg/models/evidence.py +++ b/cashfree_pg/models/evidence.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import field_validator class Evidence(BaseModel): """ @@ -31,10 +32,12 @@ class Evidence(BaseModel): document_type: Optional[StrictStr] = None __properties = ["document_id", "document_name", "document_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/evidence_submitted_to_contest_dispute.py b/cashfree_pg/models/evidence_submitted_to_contest_dispute.py index e5edf65c..e6dcd290 100644 --- a/cashfree_pg/models/evidence_submitted_to_contest_dispute.py +++ b/cashfree_pg/models/evidence_submitted_to_contest_dispute.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import field_validator class EvidenceSubmittedToContestDispute(BaseModel): """ @@ -32,10 +33,12 @@ class EvidenceSubmittedToContestDispute(BaseModel): download_url: Optional[StrictStr] = Field(None, alias="downloadUrl") __properties = ["documentId", "documentName", "documentType", "downloadUrl"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/evidences_to_contest_dispute.py b/cashfree_pg/models/evidences_to_contest_dispute.py index a7094b92..0092c4e8 100644 --- a/cashfree_pg/models/evidences_to_contest_dispute.py +++ b/cashfree_pg/models/evidences_to_contest_dispute.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class EvidencesToContestDispute(BaseModel): """ @@ -30,10 +31,12 @@ class EvidencesToContestDispute(BaseModel): document_description: Optional[StrictStr] = None __properties = ["document_type", "document_description"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/extended_cart_details.py b/cashfree_pg/models/extended_cart_details.py index 75dbe7a1..91baadfe 100644 --- a/cashfree_pg/models/extended_cart_details.py +++ b/cashfree_pg/models/extended_cart_details.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist from cashfree_pg.models.cart_item import CartItem +from pydantic import field_validator class ExtendedCartDetails(BaseModel): """ @@ -31,10 +32,12 @@ class ExtendedCartDetails(BaseModel): items: Optional[conlist(CartItem)] = None __properties = ["name", "items"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/extended_customer_details.py b/cashfree_pg/models/extended_customer_details.py index 44ab6481..886a442f 100644 --- a/cashfree_pg/models/extended_customer_details.py +++ b/cashfree_pg/models/extended_customer_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import field_validator class ExtendedCustomerDetails(BaseModel): """ @@ -33,10 +34,12 @@ class ExtendedCustomerDetails(BaseModel): customer_uid: Optional[StrictStr] = Field(None, description="Customer identifier at Cashfree. You will get this when you create/get customer ") __properties = ["customer_id", "customer_email", "customer_phone", "customer_name", "customer_uid"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_recon_request.py b/cashfree_pg/models/fetch_recon_request.py index 612d3d95..1e83acba 100644 --- a/cashfree_pg/models/fetch_recon_request.py +++ b/cashfree_pg/models/fetch_recon_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.fetch_recon_request_filters import FetchReconRequestFilters from cashfree_pg.models.fetch_recon_request_pagination import FetchReconRequestPagination +from pydantic import field_validator class FetchReconRequest(BaseModel): """ @@ -32,10 +33,12 @@ class FetchReconRequest(BaseModel): filters: FetchReconRequestFilters = Field(...) __properties = ["pagination", "filters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_recon_request_filters.py b/cashfree_pg/models/fetch_recon_request_filters.py index 2d208038..2662b885 100644 --- a/cashfree_pg/models/fetch_recon_request_filters.py +++ b/cashfree_pg/models/fetch_recon_request_filters.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class FetchReconRequestFilters(BaseModel): """ @@ -30,10 +31,12 @@ class FetchReconRequestFilters(BaseModel): end_date: StrictStr = Field(..., description="Specify the end date till when you want the settlement reconciliation details.") __properties = ["start_date", "end_date"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_recon_request_pagination.py b/cashfree_pg/models/fetch_recon_request_pagination.py index 6a203b41..edc97e5b 100644 --- a/cashfree_pg/models/fetch_recon_request_pagination.py +++ b/cashfree_pg/models/fetch_recon_request_pagination.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import field_validator class FetchReconRequestPagination(BaseModel): """ @@ -30,10 +31,12 @@ class FetchReconRequestPagination(BaseModel): cursor: Optional[StrictStr] = Field(None, description="Specifies from where the next set of settlement details should be fetched.") __properties = ["limit", "cursor"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_settlements_request.py b/cashfree_pg/models/fetch_settlements_request.py index 9139c2af..60677d26 100644 --- a/cashfree_pg/models/fetch_settlements_request.py +++ b/cashfree_pg/models/fetch_settlements_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.fetch_settlements_request_filters import FetchSettlementsRequestFilters from cashfree_pg.models.fetch_settlements_request_pagination import FetchSettlementsRequestPagination +from pydantic import field_validator class FetchSettlementsRequest(BaseModel): """ @@ -32,10 +33,12 @@ class FetchSettlementsRequest(BaseModel): filters: FetchSettlementsRequestFilters = Field(...) __properties = ["pagination", "filters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_settlements_request_filters.py b/cashfree_pg/models/fetch_settlements_request_filters.py index e273f876..a091ef68 100644 --- a/cashfree_pg/models/fetch_settlements_request_filters.py +++ b/cashfree_pg/models/fetch_settlements_request_filters.py @@ -21,6 +21,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class FetchSettlementsRequestFilters(BaseModel): """ @@ -32,10 +33,12 @@ class FetchSettlementsRequestFilters(BaseModel): end_date: Optional[StrictStr] = Field(None, description="Specify the end date till when you want the settlement reconciliation details.") __properties = ["cf_settlement_ids", "settlement_utrs", "start_date", "end_date"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_settlements_request_pagination.py b/cashfree_pg/models/fetch_settlements_request_pagination.py index 2c07009a..3b8ca12c 100644 --- a/cashfree_pg/models/fetch_settlements_request_pagination.py +++ b/cashfree_pg/models/fetch_settlements_request_pagination.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import field_validator class FetchSettlementsRequestPagination(BaseModel): """ @@ -30,10 +31,12 @@ class FetchSettlementsRequestPagination(BaseModel): cursor: Optional[StrictStr] = Field(None, description="Specifies from where the next set of settlement details should be fetched.") __properties = ["limit", "cursor"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/fetch_terminal_qr_codes_entity.py b/cashfree_pg/models/fetch_terminal_qr_codes_entity.py index 332ece04..6e0439b3 100644 --- a/cashfree_pg/models/fetch_terminal_qr_codes_entity.py +++ b/cashfree_pg/models/fetch_terminal_qr_codes_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class FetchTerminalQRCodesEntity(BaseModel): """ @@ -32,10 +33,12 @@ class FetchTerminalQRCodesEntity(BaseModel): status: Optional[StrictStr] = Field(None, description="Status of the static QR.") __properties = ["bank", "qrCode", "qrCodeUrl", "status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/idempotency_error.py b/cashfree_pg/models/idempotency_error.py index fcc8d89d..65aa4a2c 100644 --- a/cashfree_pg/models/idempotency_error.py +++ b/cashfree_pg/models/idempotency_error.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class IdempotencyError(BaseModel): """ @@ -31,7 +32,7 @@ class IdempotencyError(BaseModel): type: Optional[StrictStr] = Field(None, description="idempotency_error") __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('idempotency_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/instrument_entity.py b/cashfree_pg/models/instrument_entity.py index 5d9b51fe..05616555 100644 --- a/cashfree_pg/models/instrument_entity.py +++ b/cashfree_pg/models/instrument_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator from cashfree_pg.models.saved_instrument_meta import SavedInstrumentMeta +from pydantic import field_validator class InstrumentEntity(BaseModel): """ @@ -38,7 +39,7 @@ class InstrumentEntity(BaseModel): instrument_meta: Optional[SavedInstrumentMeta] = None __properties = ["customer_id", "afa_reference", "instrument_id", "instrument_type", "instrument_uid", "instrument_display", "instrument_status", "created_at", "instrument_meta"] - @validator('instrument_type') + @field_validator('instrument_type') def instrument_type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -48,7 +49,7 @@ def instrument_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('card')") return value - @validator('instrument_status') + @field_validator('instrument_status') def instrument_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -58,10 +59,12 @@ def instrument_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('ACTIVE', 'INACTIVE')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/instrument_webhook.py b/cashfree_pg/models/instrument_webhook.py index 0c078dbe..13c98838 100644 --- a/cashfree_pg/models/instrument_webhook.py +++ b/cashfree_pg/models/instrument_webhook.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.instrument_webhook_data import InstrumentWebhookData +from pydantic import field_validator class InstrumentWebhook(BaseModel): """ @@ -30,10 +31,12 @@ class InstrumentWebhook(BaseModel): data: Optional[InstrumentWebhookData] = None __properties = ["data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/instrument_webhook_data.py b/cashfree_pg/models/instrument_webhook_data.py index f97ceb5f..3f11ebb5 100644 --- a/cashfree_pg/models/instrument_webhook_data.py +++ b/cashfree_pg/models/instrument_webhook_data.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr from cashfree_pg.models.instrument_webhook_data_entity import InstrumentWebhookDataEntity +from pydantic import field_validator class InstrumentWebhookData(BaseModel): """ @@ -32,10 +33,12 @@ class InstrumentWebhookData(BaseModel): type: Optional[StrictStr] = None __properties = ["data", "event_time", "type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/instrument_webhook_data_entity.py b/cashfree_pg/models/instrument_webhook_data_entity.py index f583a049..ef388809 100644 --- a/cashfree_pg/models/instrument_webhook_data_entity.py +++ b/cashfree_pg/models/instrument_webhook_data_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.instrument_entity import InstrumentEntity +from pydantic import field_validator class InstrumentWebhookDataEntity(BaseModel): """ @@ -30,10 +31,12 @@ class InstrumentWebhookDataEntity(BaseModel): instrument: Optional[InstrumentEntity] = None __properties = ["instrument"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/kyc_details.py b/cashfree_pg/models/kyc_details.py index 24c28cc0..63639353 100644 --- a/cashfree_pg/models/kyc_details.py +++ b/cashfree_pg/models/kyc_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class KycDetails(BaseModel): """ @@ -37,10 +38,12 @@ class KycDetails(BaseModel): voter_id: Optional[StrictStr] = None __properties = ["account_type", "business_type", "uidai", "gst", "cin", "pan", "passport_number", "driving_license", "voter_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/link_customer_details_entity.py b/cashfree_pg/models/link_customer_details_entity.py index 16ce95bf..42d61c2c 100644 --- a/cashfree_pg/models/link_customer_details_entity.py +++ b/cashfree_pg/models/link_customer_details_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, validator +from pydantic import field_validator class LinkCustomerDetailsEntity(BaseModel): """ @@ -34,7 +35,7 @@ class LinkCustomerDetailsEntity(BaseModel): customer_bank_code: Optional[StrictInt] = Field(None, description="Customer Bank Code") __properties = ["customer_phone", "customer_email", "customer_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code"] - @validator('customer_bank_code') + @field_validator('customer_bank_code') def customer_bank_code_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -44,10 +45,12 @@ def customer_bank_code_validate_enum(cls, value): raise ValueError("must be one of enum values (3003, 3005, 3006, 3010, 3012, 3016, 3019, 3020, 3021, 3022, 3023, 3024, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3033, 3038, 3039, 3040, 3042, 3044, 3054, 3055, 3058, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3098, 3115, 3117, 7001)") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/link_entity.py b/cashfree_pg/models/link_entity.py index 93406e9e..36b0c5ff 100644 --- a/cashfree_pg/models/link_entity.py +++ b/cashfree_pg/models/link_entity.py @@ -25,6 +25,7 @@ from cashfree_pg.models.link_meta_response_entity import LinkMetaResponseEntity from cashfree_pg.models.link_notify_entity import LinkNotifyEntity from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class LinkEntity(BaseModel): """ @@ -51,10 +52,12 @@ class LinkEntity(BaseModel): order_splits: Optional[conlist(VendorSplit)] = None __properties = ["cf_link_id", "link_id", "link_status", "link_currency", "link_amount", "link_amount_paid", "link_partial_payments", "link_minimum_partial_amount", "link_purpose", "link_created_at", "customer_details", "link_meta", "link_url", "link_expiry_time", "link_notes", "link_auto_reminders", "link_notify", "link_qrcode", "order_splits"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/link_meta_response_entity.py b/cashfree_pg/models/link_meta_response_entity.py index b9d8412f..c4831c69 100644 --- a/cashfree_pg/models/link_meta_response_entity.py +++ b/cashfree_pg/models/link_meta_response_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class LinkMetaResponseEntity(BaseModel): """ @@ -32,10 +33,12 @@ class LinkMetaResponseEntity(BaseModel): payment_methods: Optional[StrictStr] = Field(None, description="Allowed payment modes for this link. Pass comma-separated values among following options - \"cc\", \"dc\", \"ccc\", \"ppc\", \"nb\", \"upi\", \"paypal\", \"app\". Leave it blank to show all available payment methods") __properties = ["notify_url", "upi_intent", "return_url", "payment_methods"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/link_notify_entity.py b/cashfree_pg/models/link_notify_entity.py index c71bea54..7f44c8e8 100644 --- a/cashfree_pg/models/link_notify_entity.py +++ b/cashfree_pg/models/link_notify_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool +from pydantic import field_validator class LinkNotifyEntity(BaseModel): """ @@ -30,10 +31,12 @@ class LinkNotifyEntity(BaseModel): send_email: Optional[StrictBool] = Field(None, description="If \"true\", Cashfree will send email on customer_email") __properties = ["send_sms", "send_email"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/manage_subscription_payment_request.py b/cashfree_pg/models/manage_subscription_payment_request.py index b75a6ffa..119fe211 100644 --- a/cashfree_pg/models/manage_subscription_payment_request.py +++ b/cashfree_pg/models/manage_subscription_payment_request.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr from cashfree_pg.models.manage_subscription_payment_request_action_details import ManageSubscriptionPaymentRequestActionDetails +from pydantic import field_validator class ManageSubscriptionPaymentRequest(BaseModel): """ @@ -33,10 +34,12 @@ class ManageSubscriptionPaymentRequest(BaseModel): action_details: Optional[ManageSubscriptionPaymentRequestActionDetails] = None __properties = ["subscription_id", "payment_id", "action", "action_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/manage_subscription_payment_request_action_details.py b/cashfree_pg/models/manage_subscription_payment_request_action_details.py index 75cc2702..bb1e1b6b 100644 --- a/cashfree_pg/models/manage_subscription_payment_request_action_details.py +++ b/cashfree_pg/models/manage_subscription_payment_request_action_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class ManageSubscriptionPaymentRequestActionDetails(BaseModel): """ @@ -29,10 +30,12 @@ class ManageSubscriptionPaymentRequestActionDetails(BaseModel): next_scheduled_time: Optional[StrictStr] = Field(None, description="Next scheduled time for the retry of the FAILED payment. Required for retry action.") __properties = ["next_scheduled_time"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/manage_subscription_request.py b/cashfree_pg/models/manage_subscription_request.py index 18c92c13..c6d21f78 100644 --- a/cashfree_pg/models/manage_subscription_request.py +++ b/cashfree_pg/models/manage_subscription_request.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr from cashfree_pg.models.manage_subscription_request_action_details import ManageSubscriptionRequestActionDetails +from pydantic import field_validator class ManageSubscriptionRequest(BaseModel): """ @@ -32,10 +33,12 @@ class ManageSubscriptionRequest(BaseModel): action_details: Optional[ManageSubscriptionRequestActionDetails] = None __properties = ["subscription_id", "action", "action_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/manage_subscription_request_action_details.py b/cashfree_pg/models/manage_subscription_request_action_details.py index bd5f5935..cd3bf842 100644 --- a/cashfree_pg/models/manage_subscription_request_action_details.py +++ b/cashfree_pg/models/manage_subscription_request_action_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class ManageSubscriptionRequestActionDetails(BaseModel): """ @@ -30,10 +31,12 @@ class ManageSubscriptionRequestActionDetails(BaseModel): plan_id: Optional[StrictStr] = Field(None, description="Plan ID to update. Required for CHANGE_PLAN action.") __properties = ["next_scheduled_time", "plan_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/net_banking_payment_method.py b/cashfree_pg/models/net_banking_payment_method.py index 401c3ee5..db464b85 100644 --- a/cashfree_pg/models/net_banking_payment_method.py +++ b/cashfree_pg/models/net_banking_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.netbanking import Netbanking +from pydantic import field_validator class NetBankingPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class NetBankingPaymentMethod(BaseModel): netbanking: Netbanking = Field(...) __properties = ["netbanking"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/netbanking.py b/cashfree_pg/models/netbanking.py index 51c82801..4bc6f0f6 100644 --- a/cashfree_pg/models/netbanking.py +++ b/cashfree_pg/models/netbanking.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, conint, constr, validator +from pydantic import field_validator class Netbanking(BaseModel): """ @@ -31,7 +32,7 @@ class Netbanking(BaseModel): netbanking_bank_name: Optional[constr(strict=True)] = Field(None, description="String code for bank") __properties = ["channel", "netbanking_bank_code", "netbanking_bank_name"] - @validator('netbanking_bank_name') + @field_validator('netbanking_bank_name') def netbanking_bank_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: @@ -41,10 +42,12 @@ def netbanking_bank_name_validate_regular_expression(cls, value): raise ValueError(r"must validate the regular expression /^[A-Z]{5}$/") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_all.py b/cashfree_pg/models/offer_all.py index 65d5e369..2f5276bd 100644 --- a/cashfree_pg/models/offer_all.py +++ b/cashfree_pg/models/offer_all.py @@ -21,6 +21,7 @@ from typing import Any, Dict from pydantic import BaseModel, Field +from pydantic import field_validator class OfferAll(BaseModel): """ @@ -29,10 +30,12 @@ class OfferAll(BaseModel): all: Dict[str, Any] = Field(..., description="All offers applicable") __properties = ["all"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_card.py b/cashfree_pg/models/offer_card.py index 7303865d..abcd20e9 100644 --- a/cashfree_pg/models/offer_card.py +++ b/cashfree_pg/models/offer_card.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.card_offer import CardOffer +from pydantic import field_validator class OfferCard(BaseModel): """ @@ -30,10 +31,12 @@ class OfferCard(BaseModel): card: CardOffer = Field(...) __properties = ["card"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_details.py b/cashfree_pg/models/offer_details.py index 077d52a2..3ffcd05e 100644 --- a/cashfree_pg/models/offer_details.py +++ b/cashfree_pg/models/offer_details.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, constr, validator from cashfree_pg.models.cashback_details import CashbackDetails from cashfree_pg.models.discount_details import DiscountDetails +from pydantic import field_validator class OfferDetails(BaseModel): """ @@ -33,17 +34,19 @@ class OfferDetails(BaseModel): cashback_details: Optional[CashbackDetails] = None __properties = ["offer_type", "discount_details", "cashback_details"] - @validator('offer_type') + @field_validator('offer_type') def offer_type_validate_enum(cls, value): """Validates the enum""" if value not in ('DISCOUNT', 'CASHBACK', 'DISCOUNT_AND_CASHBACK', 'NO_COST_EMI'): raise ValueError("must be one of enum values ('DISCOUNT', 'CASHBACK', 'DISCOUNT_AND_CASHBACK', 'NO_COST_EMI')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_emi.py b/cashfree_pg/models/offer_emi.py index d769f6d2..12d4115a 100644 --- a/cashfree_pg/models/offer_emi.py +++ b/cashfree_pg/models/offer_emi.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.emi_offer import EMIOffer +from pydantic import field_validator class OfferEMI(BaseModel): """ @@ -30,10 +31,12 @@ class OfferEMI(BaseModel): emi: EMIOffer = Field(...) __properties = ["emi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_entity.py b/cashfree_pg/models/offer_entity.py index b68e6fa8..7c2beb49 100644 --- a/cashfree_pg/models/offer_entity.py +++ b/cashfree_pg/models/offer_entity.py @@ -25,6 +25,7 @@ from cashfree_pg.models.offer_meta import OfferMeta from cashfree_pg.models.offer_tnc import OfferTnc from cashfree_pg.models.offer_validations import OfferValidations +from pydantic import field_validator class OfferEntity(BaseModel): """ @@ -38,10 +39,12 @@ class OfferEntity(BaseModel): offer_validations: Optional[OfferValidations] = None __properties = ["offer_id", "offer_status", "offer_meta", "offer_tnc", "offer_details", "offer_validations"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_extended_details.py b/cashfree_pg/models/offer_extended_details.py index a47fde6c..bdbef968 100644 --- a/cashfree_pg/models/offer_extended_details.py +++ b/cashfree_pg/models/offer_extended_details.py @@ -25,6 +25,7 @@ from cashfree_pg.models.offer_meta import OfferMeta from cashfree_pg.models.offer_tnc import OfferTnc from cashfree_pg.models.offer_validations import OfferValidations +from pydantic import field_validator class OfferExtendedDetails(BaseModel): """ @@ -38,10 +39,12 @@ class OfferExtendedDetails(BaseModel): offer_validations: Optional[OfferValidations] = None __properties = ["offer_id", "offer_status", "offer_meta", "offer_tnc", "offer_details", "offer_validations"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_filters.py b/cashfree_pg/models/offer_filters.py index 9c040a44..064368a6 100644 --- a/cashfree_pg/models/offer_filters.py +++ b/cashfree_pg/models/offer_filters.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist from cashfree_pg.models.offer_type import OfferType +from pydantic import field_validator class OfferFilters(BaseModel): """ @@ -30,10 +31,12 @@ class OfferFilters(BaseModel): offer_type: Optional[conlist(OfferType)] = Field(None, description="Array of offer_type to be filtered.") __properties = ["offer_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_meta.py b/cashfree_pg/models/offer_meta.py index e22c4bdd..61a6d1af 100644 --- a/cashfree_pg/models/offer_meta.py +++ b/cashfree_pg/models/offer_meta.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import field_validator class OfferMeta(BaseModel): """ @@ -33,10 +34,12 @@ class OfferMeta(BaseModel): offer_end_time: StrictStr = Field(..., description="Expiry Time for the Offer") __properties = ["offer_title", "offer_description", "offer_code", "offer_start_time", "offer_end_time"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_nb.py b/cashfree_pg/models/offer_nb.py index 1293d5b9..c7667d43 100644 --- a/cashfree_pg/models/offer_nb.py +++ b/cashfree_pg/models/offer_nb.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.offer_nb_netbanking import OfferNBNetbanking +from pydantic import field_validator class OfferNB(BaseModel): """ @@ -30,10 +31,12 @@ class OfferNB(BaseModel): netbanking: OfferNBNetbanking = Field(...) __properties = ["netbanking"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_nb_netbanking.py b/cashfree_pg/models/offer_nb_netbanking.py index ab574b93..af3edabe 100644 --- a/cashfree_pg/models/offer_nb_netbanking.py +++ b/cashfree_pg/models/offer_nb_netbanking.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class OfferNBNetbanking(BaseModel): """ @@ -29,10 +30,12 @@ class OfferNBNetbanking(BaseModel): bank_name: Optional[StrictStr] = None __properties = ["bank_name"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_paylater.py b/cashfree_pg/models/offer_paylater.py index c3c05bc2..e347f1f6 100644 --- a/cashfree_pg/models/offer_paylater.py +++ b/cashfree_pg/models/offer_paylater.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.paylater_offer import PaylaterOffer +from pydantic import field_validator class OfferPaylater(BaseModel): """ @@ -30,10 +31,12 @@ class OfferPaylater(BaseModel): paylater: PaylaterOffer = Field(...) __properties = ["paylater"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_queries.py b/cashfree_pg/models/offer_queries.py index 2bfb5d60..922e8e6e 100644 --- a/cashfree_pg/models/offer_queries.py +++ b/cashfree_pg/models/offer_queries.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, confloat, conint, constr +from pydantic import field_validator class OfferQueries(BaseModel): """ @@ -30,10 +31,12 @@ class OfferQueries(BaseModel): amount: Optional[Union[confloat(ge=1, strict=True), conint(ge=1, strict=True)]] = Field(None, description="Amount of the order. OrderId of the order. Either of `order_id` or `order_amount` is mandatory.") __properties = ["order_id", "amount"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_tnc.py b/cashfree_pg/models/offer_tnc.py index 1f1c6734..372db089 100644 --- a/cashfree_pg/models/offer_tnc.py +++ b/cashfree_pg/models/offer_tnc.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, constr, validator +from pydantic import field_validator class OfferTnc(BaseModel): """ @@ -30,17 +31,19 @@ class OfferTnc(BaseModel): offer_tnc_value: constr(strict=True, max_length=100, min_length=3) = Field(..., description="TnC for the Offer.") __properties = ["offer_tnc_type", "offer_tnc_value"] - @validator('offer_tnc_type') + @field_validator('offer_tnc_type') def offer_tnc_type_validate_enum(cls, value): """Validates the enum""" if value not in ('text', 'link'): raise ValueError("must be one of enum values ('text', 'link')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_type.py b/cashfree_pg/models/offer_type.py index 35b2937b..5ec6ef02 100644 --- a/cashfree_pg/models/offer_type.py +++ b/cashfree_pg/models/offer_type.py @@ -19,7 +19,9 @@ from aenum import Enum, no_arg +from pydantic import Field +# Updated imports for Pydantic v2 compatibility class OfferType(str, Enum): diff --git a/cashfree_pg/models/offer_upi.py b/cashfree_pg/models/offer_upi.py index d591731d..a94e26a1 100644 --- a/cashfree_pg/models/offer_upi.py +++ b/cashfree_pg/models/offer_upi.py @@ -21,6 +21,7 @@ from typing import Any, Dict from pydantic import BaseModel, Field +from pydantic import field_validator class OfferUPI(BaseModel): """ @@ -29,10 +30,12 @@ class OfferUPI(BaseModel): upi: Dict[str, Any] = Field(...) __properties = ["upi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_validations.py b/cashfree_pg/models/offer_validations.py index e7134db3..bc4f6b25 100644 --- a/cashfree_pg/models/offer_validations.py +++ b/cashfree_pg/models/offer_validations.py @@ -22,6 +22,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, confloat, conint from cashfree_pg.models.offer_validations_payment_method import OfferValidationsPaymentMethod +from pydantic import field_validator class OfferValidations(BaseModel): """ @@ -32,10 +33,12 @@ class OfferValidations(BaseModel): payment_method: OfferValidationsPaymentMethod = Field(...) __properties = ["min_amount", "max_allowed", "payment_method"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/offer_validations_payment_method.py b/cashfree_pg/models/offer_validations_payment_method.py index dbefc99d..c4caaab8 100644 --- a/cashfree_pg/models/offer_validations_payment_method.py +++ b/cashfree_pg/models/offer_validations_payment_method.py @@ -57,8 +57,10 @@ class OfferValidationsPaymentMethod(BaseModel): actual_instance: Any one_of_schemas: List[str] = Field(OFFERVALIDATIONSPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True) - class Config: - validate_assignment = True + # Updated to Pydantic v2 + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: diff --git a/cashfree_pg/models/offer_wallet.py b/cashfree_pg/models/offer_wallet.py index 27504c29..2eb9d751 100644 --- a/cashfree_pg/models/offer_wallet.py +++ b/cashfree_pg/models/offer_wallet.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.wallet_offer import WalletOffer +from pydantic import field_validator class OfferWallet(BaseModel): """ @@ -30,10 +31,12 @@ class OfferWallet(BaseModel): app: WalletOffer = Field(...) __properties = ["app"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/onboard_soundbox_vpa_request.py b/cashfree_pg/models/onboard_soundbox_vpa_request.py index ec736aac..e9fac957 100644 --- a/cashfree_pg/models/onboard_soundbox_vpa_request.py +++ b/cashfree_pg/models/onboard_soundbox_vpa_request.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class OnboardSoundboxVpaRequest(BaseModel): """ @@ -33,10 +34,12 @@ class OnboardSoundboxVpaRequest(BaseModel): language: Optional[StrictStr] = Field(None, description="language of soundbox,currently English, Hindi, Tamil") __properties = ["vpa", "cf_terminal_id", "device_serial_no", "merchant_name", "language"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_authenticate_entity.py b/cashfree_pg/models/order_authenticate_entity.py index 4b9ef734..8ded40df 100644 --- a/cashfree_pg/models/order_authenticate_entity.py +++ b/cashfree_pg/models/order_authenticate_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class OrderAuthenticateEntity(BaseModel): """ @@ -32,7 +33,7 @@ class OrderAuthenticateEntity(BaseModel): payment_message: Optional[StrictStr] = Field(None, description="Human readable message which describes the status in more detail") __properties = ["cf_payment_id", "action", "authenticate_status", "payment_message"] - @validator('action') + @field_validator('action') def action_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -42,7 +43,7 @@ def action_validate_enum(cls, value): raise ValueError("must be one of enum values ('SUBMIT_OTP', 'RESEND_OTP')") return value - @validator('authenticate_status') + @field_validator('authenticate_status') def authenticate_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -52,10 +53,12 @@ def authenticate_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('FAILED', 'SUCCESS')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_authenticate_payment_request.py b/cashfree_pg/models/order_authenticate_payment_request.py index 834f3d19..1d0253be 100644 --- a/cashfree_pg/models/order_authenticate_payment_request.py +++ b/cashfree_pg/models/order_authenticate_payment_request.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class OrderAuthenticatePaymentRequest(BaseModel): """ @@ -30,17 +31,19 @@ class OrderAuthenticatePaymentRequest(BaseModel): action: StrictStr = Field(..., description="The action for this workflow. Could be either SUBMIT_OTP or RESEND_OTP") __properties = ["otp", "action"] - @validator('action') + @field_validator('action') def action_validate_enum(cls, value): """Validates the enum""" if value not in ('SUBMIT_OTP', 'RESEND_OTP'): raise ValueError("must be one of enum values ('SUBMIT_OTP', 'RESEND_OTP')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_create_refund_request.py b/cashfree_pg/models/order_create_refund_request.py index 1439b72f..4d763961 100644 --- a/cashfree_pg/models/order_create_refund_request.py +++ b/cashfree_pg/models/order_create_refund_request.py @@ -22,6 +22,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, constr, validator from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class OrderCreateRefundRequest(BaseModel): """ @@ -34,7 +35,7 @@ class OrderCreateRefundRequest(BaseModel): refund_splits: Optional[conlist(VendorSplit)] = None __properties = ["refund_amount", "refund_id", "refund_note", "refund_speed", "refund_splits"] - @validator('refund_speed') + @field_validator('refund_speed') def refund_speed_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -44,10 +45,12 @@ def refund_speed_validate_enum(cls, value): raise ValueError("must be one of enum values ('STANDARD', 'INSTANT')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_delivery_status.py b/cashfree_pg/models/order_delivery_status.py index b4a19b31..19a25b50 100644 --- a/cashfree_pg/models/order_delivery_status.py +++ b/cashfree_pg/models/order_delivery_status.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class OrderDeliveryStatus(BaseModel): """ @@ -30,17 +31,19 @@ class OrderDeliveryStatus(BaseModel): reason: Optional[StrictStr] = Field(None, description="Reason of provided order delivery status. This is optional field.") __properties = ["status", "reason"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" if value not in ('AWAITING_PICKUP', 'CANCELLED', 'SELF_FULFILLED', 'PICKED_UP', 'SHIPPED', 'IN_TRANSIT', 'DELAY_COURIER_COMPANY_ISSUES', 'DELAY_INCORRECT_ADDRESS', 'DELAY_SELLER_ISSUES', 'REACHED_DESTINATION_HUB', 'OUT_FOR_DELIVERY', 'DELIVERED', 'POTENTIAL_RTO_DELIVERY_ATTEMPTED', 'RTO', 'LOST', 'DAMAGED', 'UNTRACKABLE_404', 'MANUAL_INTERVENTION_BROKEN_URL', 'ASSOCIATED_WITH_RETURN_PICKUP', 'UNSERVICEABLE'): raise ValueError("must be one of enum values ('AWAITING_PICKUP', 'CANCELLED', 'SELF_FULFILLED', 'PICKED_UP', 'SHIPPED', 'IN_TRANSIT', 'DELAY_COURIER_COMPANY_ISSUES', 'DELAY_INCORRECT_ADDRESS', 'DELAY_SELLER_ISSUES', 'REACHED_DESTINATION_HUB', 'OUT_FOR_DELIVERY', 'DELIVERED', 'POTENTIAL_RTO_DELIVERY_ATTEMPTED', 'RTO', 'LOST', 'DAMAGED', 'UNTRACKABLE_404', 'MANUAL_INTERVENTION_BROKEN_URL', 'ASSOCIATED_WITH_RETURN_PICKUP', 'UNSERVICEABLE')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_details_in_disputes_entity.py b/cashfree_pg/models/order_details_in_disputes_entity.py index 2e0b34f3..cbcc8f36 100644 --- a/cashfree_pg/models/order_details_in_disputes_entity.py +++ b/cashfree_pg/models/order_details_in_disputes_entity.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class OrderDetailsInDisputesEntity(BaseModel): """ @@ -34,10 +35,12 @@ class OrderDetailsInDisputesEntity(BaseModel): payment_amount: Optional[Union[StrictFloat, StrictInt]] = None __properties = ["order_id", "order_currency", "order_amount", "cf_payment_id", "payment_currency", "payment_amount"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_entity.py b/cashfree_pg/models/order_entity.py index 445fc1ef..9fb26d45 100644 --- a/cashfree_pg/models/order_entity.py +++ b/cashfree_pg/models/order_entity.py @@ -25,6 +25,7 @@ from cashfree_pg.models.customer_details_response import CustomerDetailsResponse from cashfree_pg.models.order_meta import OrderMeta from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class OrderEntity(BaseModel): """ @@ -47,10 +48,12 @@ class OrderEntity(BaseModel): cart_details: Optional[CartDetailsEntity] = None __properties = ["cf_order_id", "order_id", "entity", "order_currency", "order_amount", "order_status", "payment_session_id", "order_expiry_time", "order_note", "created_at", "order_splits", "customer_details", "order_meta", "order_tags", "cart_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_extended_data_entity.py b/cashfree_pg/models/order_extended_data_entity.py index 75358bdf..d7d29f62 100644 --- a/cashfree_pg/models/order_extended_data_entity.py +++ b/cashfree_pg/models/order_extended_data_entity.py @@ -26,6 +26,7 @@ from cashfree_pg.models.extended_cart_details import ExtendedCartDetails from cashfree_pg.models.extended_customer_details import ExtendedCustomerDetails from cashfree_pg.models.offer_extended_details import OfferExtendedDetails +from pydantic import field_validator class OrderExtendedDataEntity(BaseModel): """ @@ -44,10 +45,12 @@ class OrderExtendedDataEntity(BaseModel): offer: Optional[OfferExtendedDetails] = None __properties = ["cf_order_id", "order_id", "order_amount", "order_currency", "created_at", "charges", "customer_details", "shipping_address", "billing_address", "cart", "offer"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_meta.py b/cashfree_pg/models/order_meta.py index bdb3b3d6..0d800548 100644 --- a/cashfree_pg/models/order_meta.py +++ b/cashfree_pg/models/order_meta.py @@ -21,6 +21,7 @@ from typing import Any, Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class OrderMeta(BaseModel): """ @@ -31,10 +32,12 @@ class OrderMeta(BaseModel): payment_methods: Optional[Any] = Field(None, description="Allowed payment modes for this order. Pass comma-separated values among following options - \"cc\", \"dc\", \"ccc\", \"ppc\",\"nb\",\"upi\",\"paypal\",\"app\",\"paylater\",\"cardlessemi\",\"dcemi\",\"ccemi\",\"banktransfer\". Leave it blank to show all available payment methods") __properties = ["return_url", "notify_url", "payment_methods"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/order_pay_data.py b/cashfree_pg/models/order_pay_data.py index ac97e641..af089a87 100644 --- a/cashfree_pg/models/order_pay_data.py +++ b/cashfree_pg/models/order_pay_data.py @@ -21,6 +21,7 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class OrderPayData(BaseModel): """ @@ -32,10 +33,12 @@ class OrderPayData(BaseModel): method: Optional[StrictStr] = None __properties = ["url", "payload", "content_type", "method"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/pay_order_entity.py b/cashfree_pg/models/pay_order_entity.py index ada9fb38..00fead12 100644 --- a/cashfree_pg/models/pay_order_entity.py +++ b/cashfree_pg/models/pay_order_entity.py @@ -22,6 +22,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator from cashfree_pg.models.order_pay_data import OrderPayData +from pydantic import field_validator class PayOrderEntity(BaseModel): """ @@ -35,7 +36,7 @@ class PayOrderEntity(BaseModel): data: Optional[OrderPayData] = None __properties = ["payment_amount", "cf_payment_id", "payment_method", "channel", "action", "data"] - @validator('payment_method') + @field_validator('payment_method') def payment_method_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -45,7 +46,7 @@ def payment_method_validate_enum(cls, value): raise ValueError("must be one of enum values ('netbanking', 'card', 'upi', 'app', 'cardless_emi', 'paylater', 'banktransfer')") return value - @validator('channel') + @field_validator('channel') def channel_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -55,7 +56,7 @@ def channel_validate_enum(cls, value): raise ValueError("must be one of enum values ('link', 'collect', 'qrcode', 'post')") return value - @validator('action') + @field_validator('action') def action_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -65,10 +66,12 @@ def action_validate_enum(cls, value): raise ValueError("must be one of enum values ('link', 'custom', 'form', 'post')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/pay_order_request.py b/cashfree_pg/models/pay_order_request.py index 8e2a4e23..2b68dea6 100644 --- a/cashfree_pg/models/pay_order_request.py +++ b/cashfree_pg/models/pay_order_request.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictBool, StrictStr from cashfree_pg.models.pay_order_request_payment_method import PayOrderRequestPaymentMethod +from pydantic import field_validator class PayOrderRequest(BaseModel): """ @@ -33,10 +34,12 @@ class PayOrderRequest(BaseModel): offer_id: Optional[StrictStr] = Field(None, description="This is required if any offers needs to be applied to the order.") __properties = ["payment_session_id", "payment_method", "save_instrument", "offer_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/pay_order_request_payment_method.py b/cashfree_pg/models/pay_order_request_payment_method.py index fe600a29..8d97acf7 100644 --- a/cashfree_pg/models/pay_order_request_payment_method.py +++ b/cashfree_pg/models/pay_order_request_payment_method.py @@ -60,8 +60,10 @@ class PayOrderRequestPaymentMethod(BaseModel): actual_instance: Any one_of_schemas: List[str] = Field(PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True) - class Config: - validate_assignment = True + # Updated to Pydantic v2 + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: diff --git a/cashfree_pg/models/paylater.py b/cashfree_pg/models/paylater.py index 8a9cabe7..a59bdab4 100644 --- a/cashfree_pg/models/paylater.py +++ b/cashfree_pg/models/paylater.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class Paylater(BaseModel): """ @@ -31,7 +32,7 @@ class Paylater(BaseModel): phone: Optional[StrictStr] = Field(None, description="Customers phone number for this payment instrument. If the customer is not eligible you will receive a 400 error with type as 'invalid_request_error' and code as 'invalid_request_error'") __properties = ["channel", "provider", "phone"] - @validator('provider') + @field_validator('provider') def provider_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def provider_validate_enum(cls, value): raise ValueError("must be one of enum values ('kotak', 'flexipay', 'zestmoney', 'lazypay', 'olapostpaid', 'simpl', 'freechargepaylater')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/paylater_entity.py b/cashfree_pg/models/paylater_entity.py index b8706970..a6bee9c1 100644 --- a/cashfree_pg/models/paylater_entity.py +++ b/cashfree_pg/models/paylater_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaylaterEntity(BaseModel): """ @@ -29,10 +30,12 @@ class PaylaterEntity(BaseModel): payment_method: Optional[StrictStr] = None __properties = ["payment_method"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/paylater_offer.py b/cashfree_pg/models/paylater_offer.py index 5f40625d..75cd2cbc 100644 --- a/cashfree_pg/models/paylater_offer.py +++ b/cashfree_pg/models/paylater_offer.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaylaterOffer(BaseModel): """ @@ -29,10 +30,12 @@ class PaylaterOffer(BaseModel): provider: Optional[StrictStr] = None __properties = ["provider"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/paylater_payment_method.py b/cashfree_pg/models/paylater_payment_method.py index e8401205..86d21119 100644 --- a/cashfree_pg/models/paylater_payment_method.py +++ b/cashfree_pg/models/paylater_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.paylater import Paylater +from pydantic import field_validator class PaylaterPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class PaylaterPaymentMethod(BaseModel): paylater: Paylater = Field(...) __properties = ["paylater"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_entity.py b/cashfree_pg/models/payment_entity.py index 58c0b538..e27af668 100644 --- a/cashfree_pg/models/payment_entity.py +++ b/cashfree_pg/models/payment_entity.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, validator from cashfree_pg.models.authorization_in_payments_entity import AuthorizationInPaymentsEntity from cashfree_pg.models.error_details_in_payments_entity import ErrorDetailsInPaymentsEntity +from pydantic import field_validator class PaymentEntity(BaseModel): """ @@ -47,7 +48,7 @@ class PaymentEntity(BaseModel): payment_method: Optional[Dict[str, Any]] = None __properties = ["cf_payment_id", "order_id", "entity", "error_details", "is_captured", "order_amount", "payment_group", "payment_currency", "payment_amount", "payment_time", "payment_completion_time", "payment_status", "payment_message", "bank_reference", "auth_id", "authorization", "payment_method"] - @validator('payment_status') + @field_validator('payment_status') def payment_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -57,10 +58,12 @@ def payment_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('SUCCESS', 'NOT_ATTEMPTED', 'FAILED', 'USER_DROPPED', 'VOID', 'CANCELLED', 'PENDING')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_link_customer_details.py b/cashfree_pg/models/payment_link_customer_details.py index d2a1ad6a..b94cdc23 100644 --- a/cashfree_pg/models/payment_link_customer_details.py +++ b/cashfree_pg/models/payment_link_customer_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class PaymentLinkCustomerDetails(BaseModel): """ @@ -35,10 +36,12 @@ class PaymentLinkCustomerDetails(BaseModel): customer_bank_code: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV)") __properties = ["customer_id", "customer_email", "customer_phone", "customer_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_link_order_entity.py b/cashfree_pg/models/payment_link_order_entity.py index 47ec90be..b01f67ac 100644 --- a/cashfree_pg/models/payment_link_order_entity.py +++ b/cashfree_pg/models/payment_link_order_entity.py @@ -24,6 +24,7 @@ from cashfree_pg.models.order_meta import OrderMeta from cashfree_pg.models.payment_link_customer_details import PaymentLinkCustomerDetails from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class PaymentLinkOrderEntity(BaseModel): """ @@ -46,10 +47,12 @@ class PaymentLinkOrderEntity(BaseModel): order_tags: Optional[Dict[str, constr(strict=True, max_length=255, min_length=1)]] = Field(None, description="Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added") __properties = ["cf_order_id", "link_id", "order_id", "entity", "order_currency", "order_amount", "order_status", "payment_session_id", "order_expiry_time", "order_note", "created_at", "order_splits", "customer_details", "order_meta", "order_tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_app_in_payments_entity.py b/cashfree_pg/models/payment_method_app_in_payments_entity.py index a152f486..5af0b824 100644 --- a/cashfree_pg/models/payment_method_app_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_app_in_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_app_in_payments_entity_app import PaymentMethodAppInPaymentsEntityApp +from pydantic import field_validator class PaymentMethodAppInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodAppInPaymentsEntity(BaseModel): app: Optional[PaymentMethodAppInPaymentsEntityApp] = None __properties = ["app"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_app_in_payments_entity_app.py b/cashfree_pg/models/payment_method_app_in_payments_entity_app.py index db9e183e..8ae3dafa 100644 --- a/cashfree_pg/models/payment_method_app_in_payments_entity_app.py +++ b/cashfree_pg/models/payment_method_app_in_payments_entity_app.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentMethodAppInPaymentsEntityApp(BaseModel): """ @@ -31,10 +32,12 @@ class PaymentMethodAppInPaymentsEntityApp(BaseModel): phone: Optional[StrictStr] = None __properties = ["channel", "provider", "phone"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity.py b/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity.py index 59b9196f..16da74a5 100644 --- a/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_bank_transfer_in_payments_entity_banktransfer import PaymentMethodBankTransferInPaymentsEntityBanktransfer +from pydantic import field_validator class PaymentMethodBankTransferInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodBankTransferInPaymentsEntity(BaseModel): banktransfer: Optional[PaymentMethodBankTransferInPaymentsEntityBanktransfer] = None __properties = ["banktransfer"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity_banktransfer.py b/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity_banktransfer.py index 9254c8cc..f5cd1932 100644 --- a/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity_banktransfer.py +++ b/cashfree_pg/models/payment_method_bank_transfer_in_payments_entity_banktransfer.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentMethodBankTransferInPaymentsEntityBanktransfer(BaseModel): """ @@ -32,10 +33,12 @@ class PaymentMethodBankTransferInPaymentsEntityBanktransfer(BaseModel): banktransfer_account_number: Optional[StrictStr] = None __properties = ["channel", "banktransfer_bank_name", "banktransfer_ifsc", "banktransfer_account_number"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_card_emiin_payments_entity.py b/cashfree_pg/models/payment_method_card_emiin_payments_entity.py index ab8cb57e..63f8c99f 100644 --- a/cashfree_pg/models/payment_method_card_emiin_payments_entity.py +++ b/cashfree_pg/models/payment_method_card_emiin_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_card_emiin_payments_entity_emi import PaymentMethodCardEMIInPaymentsEntityEmi +from pydantic import field_validator class PaymentMethodCardEMIInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodCardEMIInPaymentsEntity(BaseModel): emi: Optional[PaymentMethodCardEMIInPaymentsEntityEmi] = None __properties = ["emi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi.py b/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi.py index e7e478b0..0ddea0a0 100644 --- a/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi.py +++ b/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi.py @@ -22,6 +22,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr from cashfree_pg.models.payment_method_card_emiin_payments_entity_emi_emi_details import PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails +from pydantic import field_validator class PaymentMethodCardEMIInPaymentsEntityEmi(BaseModel): """ @@ -38,10 +39,12 @@ class PaymentMethodCardEMIInPaymentsEntityEmi(BaseModel): emi_details: Optional[PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails] = None __properties = ["channel", "card_number", "card_network", "card_type", "card_country", "card_bank_name", "card_network_reference_id", "emi_tenure", "emi_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi_emi_details.py b/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi_emi_details.py index fd43524e..732c858a 100644 --- a/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi_emi_details.py +++ b/cashfree_pg/models/payment_method_card_emiin_payments_entity_emi_emi_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import field_validator class PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails(BaseModel): """ @@ -31,10 +32,12 @@ class PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails(BaseModel): emi_interest: Optional[Union[StrictFloat, StrictInt]] = None __properties = ["emi_amount", "emi_tenure", "emi_interest"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_card_in_payments_entity.py b/cashfree_pg/models/payment_method_card_in_payments_entity.py index 68bf6fbe..9a95a987 100644 --- a/cashfree_pg/models/payment_method_card_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_card_in_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_card_in_payments_entity_card import PaymentMethodCardInPaymentsEntityCard +from pydantic import field_validator class PaymentMethodCardInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodCardInPaymentsEntity(BaseModel): card: Optional[PaymentMethodCardInPaymentsEntityCard] = None __properties = ["card"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_card_in_payments_entity_card.py b/cashfree_pg/models/payment_method_card_in_payments_entity_card.py index 42e809a7..1716b1d7 100644 --- a/cashfree_pg/models/payment_method_card_in_payments_entity_card.py +++ b/cashfree_pg/models/payment_method_card_in_payments_entity_card.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentMethodCardInPaymentsEntityCard(BaseModel): """ @@ -35,10 +36,12 @@ class PaymentMethodCardInPaymentsEntityCard(BaseModel): card_network_reference_id: Optional[StrictStr] = None __properties = ["channel", "card_number", "card_network", "card_type", "card_country", "card_bank_name", "card_network_reference_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_cardless_emiin_payments_entity.py b/cashfree_pg/models/payment_method_cardless_emiin_payments_entity.py index da63483e..a5ef6193 100644 --- a/cashfree_pg/models/payment_method_cardless_emiin_payments_entity.py +++ b/cashfree_pg/models/payment_method_cardless_emiin_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_app_in_payments_entity_app import PaymentMethodAppInPaymentsEntityApp +from pydantic import field_validator class PaymentMethodCardlessEMIInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodCardlessEMIInPaymentsEntity(BaseModel): cardless_emi: Optional[PaymentMethodAppInPaymentsEntityApp] = None __properties = ["cardless_emi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_net_banking_in_payments_entity.py b/cashfree_pg/models/payment_method_net_banking_in_payments_entity.py index af8ea54e..3266d663 100644 --- a/cashfree_pg/models/payment_method_net_banking_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_net_banking_in_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_net_banking_in_payments_entity_netbanking import PaymentMethodNetBankingInPaymentsEntityNetbanking +from pydantic import field_validator class PaymentMethodNetBankingInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodNetBankingInPaymentsEntity(BaseModel): netbanking: Optional[PaymentMethodNetBankingInPaymentsEntityNetbanking] = None __properties = ["netbanking"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_net_banking_in_payments_entity_netbanking.py b/cashfree_pg/models/payment_method_net_banking_in_payments_entity_netbanking.py index 5ec37c4e..a9f4cfc0 100644 --- a/cashfree_pg/models/payment_method_net_banking_in_payments_entity_netbanking.py +++ b/cashfree_pg/models/payment_method_net_banking_in_payments_entity_netbanking.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import field_validator class PaymentMethodNetBankingInPaymentsEntityNetbanking(BaseModel): """ @@ -33,10 +34,12 @@ class PaymentMethodNetBankingInPaymentsEntityNetbanking(BaseModel): netbanking_account_number: Optional[StrictStr] = None __properties = ["channel", "netbanking_bank_code", "netbanking_bank_name", "netbanking_ifsc", "netbanking_account_number"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_others_in_payments_entity.py b/cashfree_pg/models/payment_method_others_in_payments_entity.py index 103a0032..2d673662 100644 --- a/cashfree_pg/models/payment_method_others_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_others_in_payments_entity.py @@ -21,6 +21,7 @@ from typing import Any, Dict, Optional from pydantic import BaseModel +from pydantic import field_validator class PaymentMethodOthersInPaymentsEntity(BaseModel): """ @@ -29,10 +30,12 @@ class PaymentMethodOthersInPaymentsEntity(BaseModel): others: Optional[Dict[str, Any]] = None __properties = ["others"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_paylater_in_payments_entity.py b/cashfree_pg/models/payment_method_paylater_in_payments_entity.py index 57361b9a..42f2786a 100644 --- a/cashfree_pg/models/payment_method_paylater_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_paylater_in_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_app_in_payments_entity_app import PaymentMethodAppInPaymentsEntityApp +from pydantic import field_validator class PaymentMethodPaylaterInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodPaylaterInPaymentsEntity(BaseModel): paylater: Optional[PaymentMethodAppInPaymentsEntityApp] = None __properties = ["paylater"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_upiin_payments_entity.py b/cashfree_pg/models/payment_method_upiin_payments_entity.py index 986d70b7..2ec2c854 100644 --- a/cashfree_pg/models/payment_method_upiin_payments_entity.py +++ b/cashfree_pg/models/payment_method_upiin_payments_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.payment_method_upiin_payments_entity_upi import PaymentMethodUPIInPaymentsEntityUpi +from pydantic import field_validator class PaymentMethodUPIInPaymentsEntity(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodUPIInPaymentsEntity(BaseModel): upi: Optional[PaymentMethodUPIInPaymentsEntityUpi] = None __properties = ["upi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_method_upiin_payments_entity_upi.py b/cashfree_pg/models/payment_method_upiin_payments_entity_upi.py index afe73cbb..478ab222 100644 --- a/cashfree_pg/models/payment_method_upiin_payments_entity_upi.py +++ b/cashfree_pg/models/payment_method_upiin_payments_entity_upi.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentMethodUPIInPaymentsEntityUpi(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodUPIInPaymentsEntityUpi(BaseModel): upi_id: Optional[StrictStr] = None __properties = ["channel", "upi_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_methods_filters.py b/cashfree_pg/models/payment_methods_filters.py index a4bc2ce3..4d4ef7f5 100644 --- a/cashfree_pg/models/payment_methods_filters.py +++ b/cashfree_pg/models/payment_methods_filters.py @@ -21,6 +21,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class PaymentMethodsFilters(BaseModel): """ @@ -29,10 +30,12 @@ class PaymentMethodsFilters(BaseModel): payment_methods: Optional[conlist(StrictStr)] = Field(None, description="Array of payment methods to be filtered. This is optional, by default all payment methods will be returned. Possible values in [ 'debit_card', 'credit_card', 'prepaid_card', 'corporate_credit_card', 'upi', 'wallet', 'netbanking', 'banktransfer', 'paylater', 'paypal', 'debit_card_emi', 'credit_card_emi', 'upi_credit_card', 'upi_ppi', 'cardless_emi', 'account_based_payment' ] ") __properties = ["payment_methods"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_methods_queries.py b/cashfree_pg/models/payment_methods_queries.py index 0362e484..3e5eddae 100644 --- a/cashfree_pg/models/payment_methods_queries.py +++ b/cashfree_pg/models/payment_methods_queries.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, confloat, conint, constr +from pydantic import field_validator class PaymentMethodsQueries(BaseModel): """ @@ -30,10 +31,12 @@ class PaymentMethodsQueries(BaseModel): order_id: Optional[constr(strict=True, max_length=50, min_length=3)] = Field(None, description="OrderId of the order. Either of `order_id` or `order_amount` is mandatory.") __properties = ["amount", "order_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_mode_details.py b/cashfree_pg/models/payment_mode_details.py index 0a013a6c..8d1a8d02 100644 --- a/cashfree_pg/models/payment_mode_details.py +++ b/cashfree_pg/models/payment_mode_details.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class PaymentModeDetails(BaseModel): """ @@ -32,10 +33,12 @@ class PaymentModeDetails(BaseModel): code: Optional[Union[StrictFloat, StrictInt]] = None __properties = ["nick", "display", "eligibility", "code"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook.py b/cashfree_pg/models/payment_webhook.py index 781edc6d..8b13d844 100644 --- a/cashfree_pg/models/payment_webhook.py +++ b/cashfree_pg/models/payment_webhook.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr from cashfree_pg.models.payment_webhook_data_entity import PaymentWebhookDataEntity +from pydantic import field_validator class PaymentWebhook(BaseModel): """ @@ -32,10 +33,12 @@ class PaymentWebhook(BaseModel): type: Optional[StrictStr] = None __properties = ["data", "event_time", "type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook_customer_entity.py b/cashfree_pg/models/payment_webhook_customer_entity.py index 79c86832..14d2b687 100644 --- a/cashfree_pg/models/payment_webhook_customer_entity.py +++ b/cashfree_pg/models/payment_webhook_customer_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentWebhookCustomerEntity(BaseModel): """ @@ -32,10 +33,12 @@ class PaymentWebhookCustomerEntity(BaseModel): customer_phone: Optional[StrictStr] = None __properties = ["customer_name", "customer_id", "customer_email", "customer_phone"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook_data_entity.py b/cashfree_pg/models/payment_webhook_data_entity.py index cc4b5b9f..5f0e5fac 100644 --- a/cashfree_pg/models/payment_webhook_data_entity.py +++ b/cashfree_pg/models/payment_webhook_data_entity.py @@ -27,6 +27,7 @@ from cashfree_pg.models.payment_webhook_error_entity import PaymentWebhookErrorEntity from cashfree_pg.models.payment_webhook_gateway_details_entity import PaymentWebhookGatewayDetailsEntity from cashfree_pg.models.payment_webhook_order_entity import PaymentWebhookOrderEntity +from pydantic import field_validator class PaymentWebhookDataEntity(BaseModel): """ @@ -40,10 +41,12 @@ class PaymentWebhookDataEntity(BaseModel): payment_offers: Optional[conlist(OfferEntity)] = None __properties = ["order", "payment", "customer_details", "error_details", "payment_gateway_details", "payment_offers"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook_error_entity.py b/cashfree_pg/models/payment_webhook_error_entity.py index 545aabb0..5f9db158 100644 --- a/cashfree_pg/models/payment_webhook_error_entity.py +++ b/cashfree_pg/models/payment_webhook_error_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentWebhookErrorEntity(BaseModel): """ @@ -34,10 +35,12 @@ class PaymentWebhookErrorEntity(BaseModel): error_description_raw: Optional[StrictStr] = None __properties = ["error_code", "error_description", "error_reason", "error_source", "error_code_raw", "error_description_raw"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook_gateway_details_entity.py b/cashfree_pg/models/payment_webhook_gateway_details_entity.py index 20001060..0c07fc99 100644 --- a/cashfree_pg/models/payment_webhook_gateway_details_entity.py +++ b/cashfree_pg/models/payment_webhook_gateway_details_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class PaymentWebhookGatewayDetailsEntity(BaseModel): """ @@ -33,10 +34,12 @@ class PaymentWebhookGatewayDetailsEntity(BaseModel): gateway_settlement: Optional[StrictStr] = None __properties = ["gateway_name", "gateway_order_id", "gateway_payment_id", "gateway_status_code", "gateway_settlement"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook_order_entity.py b/cashfree_pg/models/payment_webhook_order_entity.py index 250d5435..f61d2c4a 100644 --- a/cashfree_pg/models/payment_webhook_order_entity.py +++ b/cashfree_pg/models/payment_webhook_order_entity.py @@ -21,6 +21,7 @@ from typing import Dict, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class PaymentWebhookOrderEntity(BaseModel): """ @@ -32,10 +33,12 @@ class PaymentWebhookOrderEntity(BaseModel): order_tags: Optional[Dict[str, constr(strict=True, max_length=255, min_length=1)]] = Field(None, description="Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added") __properties = ["order_id", "order_amount", "order_currency", "order_tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/plan_entity.py b/cashfree_pg/models/plan_entity.py index c6bb5fdf..24a9f553 100644 --- a/cashfree_pg/models/plan_entity.py +++ b/cashfree_pg/models/plan_entity.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class PlanEntity(BaseModel): """ @@ -39,10 +40,12 @@ class PlanEntity(BaseModel): plan_type: Optional[StrictStr] = Field(None, description="Type of the plan.") __properties = ["plan_currency", "plan_id", "plan_interval_type", "plan_intervals", "plan_max_amount", "plan_max_cycles", "plan_name", "plan_note", "plan_recurring_amount", "plan_status", "plan_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/rate_limit_error.py b/cashfree_pg/models/rate_limit_error.py index f8392b96..0b9a22a7 100644 --- a/cashfree_pg/models/rate_limit_error.py +++ b/cashfree_pg/models/rate_limit_error.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import field_validator class RateLimitError(BaseModel): """ @@ -31,7 +32,7 @@ class RateLimitError(BaseModel): type: Optional[StrictStr] = Field(None, description="rate_limit_error") __properties = ["message", "code", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -41,10 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('rate_limit_error')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/recon_entity.py b/cashfree_pg/models/recon_entity.py index a7d4ecb0..1a05bdce 100644 --- a/cashfree_pg/models/recon_entity.py +++ b/cashfree_pg/models/recon_entity.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist from cashfree_pg.models.recon_entity_data_inner import ReconEntityDataInner +from pydantic import field_validator class ReconEntity(BaseModel): """ @@ -32,10 +33,12 @@ class ReconEntity(BaseModel): data: Optional[conlist(ReconEntityDataInner)] = None __properties = ["cursor", "limit", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/recon_entity_data_inner.py b/cashfree_pg/models/recon_entity_data_inner.py index e1ab50fb..f30a1d6e 100644 --- a/cashfree_pg/models/recon_entity_data_inner.py +++ b/cashfree_pg/models/recon_entity_data_inner.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class ReconEntityDataInner(BaseModel): """ @@ -75,10 +76,12 @@ class ReconEntityDataInner(BaseModel): remarks: Optional[StrictStr] = Field(None, description="Remarks on the settlement.") __properties = ["event_id", "event_type", "event_settlement_amount", "event_amount", "sale_type", "event_status", "entity", "event_time", "event_currency", "order_id", "order_amount", "customer_phone", "customer_email", "customer_name", "payment_amount", "payment_utr", "payment_time", "payment_service_charge", "payment_service_tax", "cf_payment_id", "cf_settlement_id", "settlement_date", "settlement_utr", "split_service_charge", "split_service_tax", "vendor_commission", "closed_in_favor_of", "dispute_resolved_on", "dispute_category", "dispute_note", "refund_processed_at", "refund_arn", "refund_note", "refund_id", "adjustment_remarks", "adjustment", "service_tax", "service_charge", "amount_settled", "payment_from", "payment_till", "reason", "settlement_initiated_on", "settlement_type", "settlement_charge", "settlement_tax", "remarks"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/refund_entity.py b/cashfree_pg/models/refund_entity.py index b1caee29..413f4a18 100644 --- a/cashfree_pg/models/refund_entity.py +++ b/cashfree_pg/models/refund_entity.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, validator from cashfree_pg.models.refund_speed import RefundSpeed from cashfree_pg.models.vendor_split import VendorSplit +from pydantic import field_validator class RefundEntity(BaseModel): """ @@ -49,7 +50,7 @@ class RefundEntity(BaseModel): refund_speed: Optional[RefundSpeed] = None __properties = ["cf_payment_id", "cf_refund_id", "order_id", "refund_id", "entity", "refund_amount", "refund_currency", "refund_note", "refund_status", "refund_arn", "refund_charge", "status_description", "metadata", "refund_splits", "refund_type", "refund_mode", "created_at", "processed_at", "refund_speed"] - @validator('entity') + @field_validator('entity') def entity_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -59,7 +60,7 @@ def entity_validate_enum(cls, value): raise ValueError("must be one of enum values ('refund')") return value - @validator('refund_status') + @field_validator('refund_status') def refund_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -69,7 +70,7 @@ def refund_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('SUCCESS', 'PENDING', 'CANCELLED', 'ONHOLD')") return value - @validator('refund_type') + @field_validator('refund_type') def refund_type_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -79,10 +80,12 @@ def refund_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('PAYMENT_AUTO_REFUND', 'MERCHANT_INITIATED', 'UNRECONCILED_AUTO_REFUND')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/refund_speed.py b/cashfree_pg/models/refund_speed.py index 78a98972..ee4b63f3 100644 --- a/cashfree_pg/models/refund_speed.py +++ b/cashfree_pg/models/refund_speed.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class RefundSpeed(BaseModel): """ @@ -32,10 +33,12 @@ class RefundSpeed(BaseModel): message: Optional[StrictStr] = Field(None, description="Error message, if any for refund_speed request") __properties = ["requested", "accepted", "processed", "message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/refund_webhook.py b/cashfree_pg/models/refund_webhook.py index b0c0a1da..288261ee 100644 --- a/cashfree_pg/models/refund_webhook.py +++ b/cashfree_pg/models/refund_webhook.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr from cashfree_pg.models.refund_webhook_data_entity import RefundWebhookDataEntity +from pydantic import field_validator class RefundWebhook(BaseModel): """ @@ -32,10 +33,12 @@ class RefundWebhook(BaseModel): type: Optional[StrictStr] = None __properties = ["data", "event_time", "type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/refund_webhook_data_entity.py b/cashfree_pg/models/refund_webhook_data_entity.py index 54ff707d..3e82910e 100644 --- a/cashfree_pg/models/refund_webhook_data_entity.py +++ b/cashfree_pg/models/refund_webhook_data_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.refund_entity import RefundEntity +from pydantic import field_validator class RefundWebhookDataEntity(BaseModel): """ @@ -30,10 +31,12 @@ class RefundWebhookDataEntity(BaseModel): refund: Optional[RefundEntity] = None __properties = ["refund"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/saved_instrument_meta.py b/cashfree_pg/models/saved_instrument_meta.py index 42c92145..81e9fda0 100644 --- a/cashfree_pg/models/saved_instrument_meta.py +++ b/cashfree_pg/models/saved_instrument_meta.py @@ -21,6 +21,7 @@ from typing import Any, Dict, Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class SavedInstrumentMeta(BaseModel): """ @@ -33,10 +34,12 @@ class SavedInstrumentMeta(BaseModel): card_token_details: Optional[Dict[str, Any]] = None __properties = ["card_network", "card_bank_name", "card_country", "card_type", "card_token_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/schedule_option.py b/cashfree_pg/models/schedule_option.py index 39a5152f..39c39649 100644 --- a/cashfree_pg/models/schedule_option.py +++ b/cashfree_pg/models/schedule_option.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class ScheduleOption(BaseModel): """ @@ -31,10 +32,12 @@ class ScheduleOption(BaseModel): merchant_default: Optional[StrictBool] = None __properties = ["settlement_schedule_message", "schedule_id", "merchant_default"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_entity.py b/cashfree_pg/models/settlement_entity.py index a123cb09..e230049e 100644 --- a/cashfree_pg/models/settlement_entity.py +++ b/cashfree_pg/models/settlement_entity.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class SettlementEntity(BaseModel): """ @@ -42,10 +43,12 @@ class SettlementEntity(BaseModel): transfer_utr: Optional[StrictStr] = None __properties = ["cf_payment_id", "cf_settlement_id", "settlement_currency", "order_id", "entity", "order_amount", "payment_time", "service_charge", "service_tax", "settlement_amount", "settlement_id", "transfer_id", "transfer_time", "transfer_utr"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_fetch_recon_request.py b/cashfree_pg/models/settlement_fetch_recon_request.py index 81b79572..5dd2f0f1 100644 --- a/cashfree_pg/models/settlement_fetch_recon_request.py +++ b/cashfree_pg/models/settlement_fetch_recon_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.fetch_settlements_request_filters import FetchSettlementsRequestFilters from cashfree_pg.models.fetch_settlements_request_pagination import FetchSettlementsRequestPagination +from pydantic import field_validator class SettlementFetchReconRequest(BaseModel): """ @@ -32,10 +33,12 @@ class SettlementFetchReconRequest(BaseModel): filters: FetchSettlementsRequestFilters = Field(...) __properties = ["pagination", "filters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_recon_entity.py b/cashfree_pg/models/settlement_recon_entity.py index 6cfe69bf..579c29f4 100644 --- a/cashfree_pg/models/settlement_recon_entity.py +++ b/cashfree_pg/models/settlement_recon_entity.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist from cashfree_pg.models.settlement_recon_entity_data_inner import SettlementReconEntityDataInner +from pydantic import field_validator class SettlementReconEntity(BaseModel): """ @@ -32,10 +33,12 @@ class SettlementReconEntity(BaseModel): data: Optional[conlist(SettlementReconEntityDataInner)] = None __properties = ["cursor", "limit", "data"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_recon_entity_data_inner.py b/cashfree_pg/models/settlement_recon_entity_data_inner.py index 4f38ebc7..90b7f685 100644 --- a/cashfree_pg/models/settlement_recon_entity_data_inner.py +++ b/cashfree_pg/models/settlement_recon_entity_data_inner.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class SettlementReconEntityDataInner(BaseModel): """ @@ -63,10 +64,12 @@ class SettlementReconEntityDataInner(BaseModel): adjustment_remarks: Optional[StrictStr] = Field(None, description="Other adjustment remarks.") __properties = ["event_id", "event_type", "event_settlement_amount", "event_amount", "sale_type", "event_status", "entity", "event_time", "event_currency", "order_id", "order_amount", "customer_phone", "customer_email", "customer_name", "payment_amount", "payment_utr", "payment_time", "payment_service_charge", "payment_service_tax", "cf_payment_id", "cf_settlement_id", "settlement_date", "settlement_utr", "split_service_charge", "split_service_tax", "vendor_commission", "closed_in_favor_of", "dispute_resolved_on", "dispute_category", "dispute_note", "refund_processed_at", "refund_arn", "refund_note", "refund_id", "adjustment_remarks"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_webhook.py b/cashfree_pg/models/settlement_webhook.py index ba4dc6a0..611188ab 100644 --- a/cashfree_pg/models/settlement_webhook.py +++ b/cashfree_pg/models/settlement_webhook.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr from cashfree_pg.models.settlement_webhook_data_entity import SettlementWebhookDataEntity +from pydantic import field_validator class SettlementWebhook(BaseModel): """ @@ -32,10 +33,12 @@ class SettlementWebhook(BaseModel): type: Optional[StrictStr] = None __properties = ["data", "event_time", "type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_webhook_data_entity.py b/cashfree_pg/models/settlement_webhook_data_entity.py index aeb86384..108945aa 100644 --- a/cashfree_pg/models/settlement_webhook_data_entity.py +++ b/cashfree_pg/models/settlement_webhook_data_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel from cashfree_pg.models.settlement_entity import SettlementEntity +from pydantic import field_validator class SettlementWebhookDataEntity(BaseModel): """ @@ -30,10 +31,12 @@ class SettlementWebhookDataEntity(BaseModel): settlement: Optional[SettlementEntity] = None __properties = ["settlement"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/shipment_details.py b/cashfree_pg/models/shipment_details.py index 7dc10de3..bd8db4e2 100644 --- a/cashfree_pg/models/shipment_details.py +++ b/cashfree_pg/models/shipment_details.py @@ -21,6 +21,7 @@ from typing import List from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class ShipmentDetails(BaseModel): """ @@ -31,10 +32,12 @@ class ShipmentDetails(BaseModel): tracking_numbers: conlist(StrictStr) = Field(..., description="Tracking Numbers associated with order.") __properties = ["tracking_company", "tracking_urls", "tracking_numbers"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/simulate_request.py b/cashfree_pg/models/simulate_request.py index 3b304ba1..56aaf0b6 100644 --- a/cashfree_pg/models/simulate_request.py +++ b/cashfree_pg/models/simulate_request.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field, StrictStr, validator from cashfree_pg.models.entity_simulation_request import EntitySimulationRequest +from pydantic import field_validator class SimulateRequest(BaseModel): """ @@ -32,17 +33,19 @@ class SimulateRequest(BaseModel): entity_simulation: EntitySimulationRequest = Field(...) __properties = ["entity", "entity_id", "entity_simulation"] - @validator('entity') + @field_validator('entity') def entity_validate_enum(cls, value): """Validates the enum""" if value not in ('PAYMENTS', 'SUBS_PAYMENTS'): raise ValueError("must be one of enum values ('PAYMENTS', 'SUBS_PAYMENTS')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/simulation_response.py b/cashfree_pg/models/simulation_response.py index 1da72a89..c91a3ed9 100644 --- a/cashfree_pg/models/simulation_response.py +++ b/cashfree_pg/models/simulation_response.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr from cashfree_pg.models.entity_simulation_response import EntitySimulationResponse +from pydantic import field_validator class SimulationResponse(BaseModel): """ @@ -33,10 +34,12 @@ class SimulationResponse(BaseModel): entity_simulation: Optional[EntitySimulationResponse] = None __properties = ["simulation_id", "entity", "entity_id", "entity_simulation"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/soundbox_vpa_entity.py b/cashfree_pg/models/soundbox_vpa_entity.py index 333f2400..0fe32809 100644 --- a/cashfree_pg/models/soundbox_vpa_entity.py +++ b/cashfree_pg/models/soundbox_vpa_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class SoundboxVpaEntity(BaseModel): """ @@ -33,10 +34,12 @@ class SoundboxVpaEntity(BaseModel): language: Optional[StrictStr] = None __properties = ["vpa", "cf_terminal_id", "device_serial_no", "merchant_name", "language"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/split_after_payment_request.py b/cashfree_pg/models/split_after_payment_request.py index 64f1c271..06507193 100644 --- a/cashfree_pg/models/split_after_payment_request.py +++ b/cashfree_pg/models/split_after_payment_request.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictBool, conlist from cashfree_pg.models.split_after_payment_request_split_inner import SplitAfterPaymentRequestSplitInner +from pydantic import field_validator class SplitAfterPaymentRequest(BaseModel): """ @@ -31,10 +32,12 @@ class SplitAfterPaymentRequest(BaseModel): disable_split: Optional[StrictBool] = Field(None, description="Specify if you want to end the split or continue creating further splits in future.") __properties = ["split", "disable_split"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/split_after_payment_request_split_inner.py b/cashfree_pg/models/split_after_payment_request_split_inner.py index 273d8bf8..78b17996 100644 --- a/cashfree_pg/models/split_after_payment_request_split_inner.py +++ b/cashfree_pg/models/split_after_payment_request_split_inner.py @@ -21,6 +21,7 @@ from typing import Dict, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import field_validator class SplitAfterPaymentRequestSplitInner(BaseModel): """ @@ -32,10 +33,12 @@ class SplitAfterPaymentRequestSplitInner(BaseModel): tags: Optional[Dict[str, constr(strict=True, max_length=255, min_length=1)]] = Field(None, description="Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added") __properties = ["vendor_id", "amount", "percentage", "tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/split_after_payment_response.py b/cashfree_pg/models/split_after_payment_response.py index 0f40ae07..f3fb8d7a 100644 --- a/cashfree_pg/models/split_after_payment_response.py +++ b/cashfree_pg/models/split_after_payment_response.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class SplitAfterPaymentResponse(BaseModel): """ @@ -30,10 +31,12 @@ class SplitAfterPaymentResponse(BaseModel): message: Optional[StrictStr] = None __properties = ["status", "message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/split_order_recon_success_response.py b/cashfree_pg/models/split_order_recon_success_response.py index 8b24a2d4..a200757e 100644 --- a/cashfree_pg/models/split_order_recon_success_response.py +++ b/cashfree_pg/models/split_order_recon_success_response.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, conlist from cashfree_pg.models.split_order_recon_success_response_settlement import SplitOrderReconSuccessResponseSettlement from cashfree_pg.models.split_order_recon_success_response_vendors_inner import SplitOrderReconSuccessResponseVendorsInner +from pydantic import field_validator class SplitOrderReconSuccessResponse(BaseModel): """ @@ -33,10 +34,12 @@ class SplitOrderReconSuccessResponse(BaseModel): vendors: Optional[conlist(SplitOrderReconSuccessResponseVendorsInner)] = Field(None, description="List of vendor settlements associated with the split settlement.") __properties = ["settlement", "refunds", "vendors"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/split_order_recon_success_response_settlement.py b/cashfree_pg/models/split_order_recon_success_response_settlement.py index b5ab5b83..ee71ea51 100644 --- a/cashfree_pg/models/split_order_recon_success_response_settlement.py +++ b/cashfree_pg/models/split_order_recon_success_response_settlement.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class SplitOrderReconSuccessResponseSettlement(BaseModel): """ @@ -42,10 +43,12 @@ class SplitOrderReconSuccessResponseSettlement(BaseModel): payment_time: Optional[StrictStr] = Field(None, description="Timestamp when payment was made.") __properties = ["entity", "cf_settlement_id", "cf_payment_id", "order_id", "order_currency", "transfer_id", "order_amount", "service_charge", "service_tax", "settlement_amount", "settlement_currency", "transfer_utr", "transfer_time", "payment_time"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/split_order_recon_success_response_vendors_inner.py b/cashfree_pg/models/split_order_recon_success_response_vendors_inner.py index 82c0eb98..f3245b9e 100644 --- a/cashfree_pg/models/split_order_recon_success_response_vendors_inner.py +++ b/cashfree_pg/models/split_order_recon_success_response_vendors_inner.py @@ -21,6 +21,7 @@ from datetime import datetime from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class SplitOrderReconSuccessResponseVendorsInner(BaseModel): """ @@ -32,10 +33,12 @@ class SplitOrderReconSuccessResponseVendorsInner(BaseModel): settlement_eligibility_date: Optional[datetime] = Field(None, description="Date and time when the vendor is eligible for the settlement.") __properties = ["vendor_id", "settlement_id", "settlement_amount", "settlement_eligibility_date"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/static_qr_response_entity.py b/cashfree_pg/models/static_qr_response_entity.py index 69da7c45..cf396805 100644 --- a/cashfree_pg/models/static_qr_response_entity.py +++ b/cashfree_pg/models/static_qr_response_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import field_validator class StaticQrResponseEntity(BaseModel): """ @@ -32,10 +33,12 @@ class StaticQrResponseEntity(BaseModel): qr_code: Optional[StrictStr] = Field(None, alias="qrCode", description="qrcode") __properties = ["cf_terminal_id", "vpa", "status", "qrCode"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/static_split_request.py b/cashfree_pg/models/static_split_request.py index d59c6a57..825a7cb5 100644 --- a/cashfree_pg/models/static_split_request.py +++ b/cashfree_pg/models/static_split_request.py @@ -22,6 +22,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist from cashfree_pg.models.static_split_request_scheme_inner import StaticSplitRequestSchemeInner +from pydantic import field_validator class StaticSplitRequest(BaseModel): """ @@ -34,10 +35,12 @@ class StaticSplitRequest(BaseModel): scheme: conlist(StaticSplitRequestSchemeInner) = Field(..., description="Provide the split scheme details.") __properties = ["active", "terminal_id", "terminal_reference_id", "product_type", "scheme"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/static_split_request_scheme_inner.py b/cashfree_pg/models/static_split_request_scheme_inner.py index df89ab42..a2e4ac0b 100644 --- a/cashfree_pg/models/static_split_request_scheme_inner.py +++ b/cashfree_pg/models/static_split_request_scheme_inner.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class StaticSplitRequestSchemeInner(BaseModel): """ @@ -30,10 +31,12 @@ class StaticSplitRequestSchemeInner(BaseModel): percentage: Optional[StrictStr] = Field(None, description="Specify the percentage of amount to be split.") __properties = ["merchantVendorId", "percentage"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/static_split_response.py b/cashfree_pg/models/static_split_response.py index fbb1053f..fd1ec3db 100644 --- a/cashfree_pg/models/static_split_response.py +++ b/cashfree_pg/models/static_split_response.py @@ -22,6 +22,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr, conlist from cashfree_pg.models.static_split_response_scheme_inner import StaticSplitResponseSchemeInner +from pydantic import field_validator class StaticSplitResponse(BaseModel): """ @@ -35,10 +36,12 @@ class StaticSplitResponse(BaseModel): added_on: Optional[StrictStr] = None __properties = ["active", "terminal_id", "terminal_reference_id", "product_type", "scheme", "added_on"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/static_split_response_scheme_inner.py b/cashfree_pg/models/static_split_response_scheme_inner.py index ac878c20..93066a66 100644 --- a/cashfree_pg/models/static_split_response_scheme_inner.py +++ b/cashfree_pg/models/static_split_response_scheme_inner.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class StaticSplitResponseSchemeInner(BaseModel): """ @@ -30,10 +31,12 @@ class StaticSplitResponseSchemeInner(BaseModel): percentage: Optional[StrictStr] = None __properties = ["merchantVendorId", "percentage"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_bank_details.py b/cashfree_pg/models/subscription_bank_details.py index 3588703c..13f230db 100644 --- a/cashfree_pg/models/subscription_bank_details.py +++ b/cashfree_pg/models/subscription_bank_details.py @@ -21,6 +21,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class SubscriptionBankDetails(BaseModel): """ @@ -31,10 +32,12 @@ class SubscriptionBankDetails(BaseModel): account_auth_modes: Optional[conlist(StrictStr)] = Field(None, description="List of account authentication modes supported by the bank. (e.g. DEBIT_CARD, NET_BANKING, AADHAAR)") __properties = ["bank_id", "bank_name", "account_auth_modes"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_customer_details.py b/cashfree_pg/models/subscription_customer_details.py index 8f8525fd..887480e4 100644 --- a/cashfree_pg/models/subscription_customer_details.py +++ b/cashfree_pg/models/subscription_customer_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class SubscriptionCustomerDetails(BaseModel): """ @@ -36,10 +37,12 @@ class SubscriptionCustomerDetails(BaseModel): customer_bank_account_type: Optional[StrictStr] = Field(None, description="Bank account type of the customer.") __properties = ["customer_name", "customer_email", "customer_phone", "customer_bank_account_holder_name", "customer_bank_account_number", "customer_bank_ifsc", "customer_bank_code", "customer_bank_account_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_eligibility_request.py b/cashfree_pg/models/subscription_eligibility_request.py index 617f24eb..e720aa5e 100644 --- a/cashfree_pg/models/subscription_eligibility_request.py +++ b/cashfree_pg/models/subscription_eligibility_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.subscription_eligibility_request_filters import SubscriptionEligibilityRequestFilters from cashfree_pg.models.subscription_eligibility_request_queries import SubscriptionEligibilityRequestQueries +from pydantic import field_validator class SubscriptionEligibilityRequest(BaseModel): """ @@ -32,10 +33,12 @@ class SubscriptionEligibilityRequest(BaseModel): filters: Optional[SubscriptionEligibilityRequestFilters] = None __properties = ["queries", "filters"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_eligibility_request_filters.py b/cashfree_pg/models/subscription_eligibility_request_filters.py index 0f994916..b149edd0 100644 --- a/cashfree_pg/models/subscription_eligibility_request_filters.py +++ b/cashfree_pg/models/subscription_eligibility_request_filters.py @@ -21,6 +21,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import field_validator class SubscriptionEligibilityRequestFilters(BaseModel): """ @@ -29,10 +30,12 @@ class SubscriptionEligibilityRequestFilters(BaseModel): payment_methods: Optional[conlist(StrictStr)] = Field(None, description="Possbile values in array - enach, pnach, upi, card.") __properties = ["payment_methods"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_eligibility_request_queries.py b/cashfree_pg/models/subscription_eligibility_request_queries.py index 7c85fe10..bb14ed6f 100644 --- a/cashfree_pg/models/subscription_eligibility_request_queries.py +++ b/cashfree_pg/models/subscription_eligibility_request_queries.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class SubscriptionEligibilityRequestQueries(BaseModel): """ @@ -29,10 +30,12 @@ class SubscriptionEligibilityRequestQueries(BaseModel): subscription_id: StrictStr = Field(..., description="A unique ID passed by merchant for identifying the subscription") __properties = ["subscription_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_eligibility_response.py b/cashfree_pg/models/subscription_eligibility_response.py index 8150e055..325d8527 100644 --- a/cashfree_pg/models/subscription_eligibility_response.py +++ b/cashfree_pg/models/subscription_eligibility_response.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, Field, conlist from cashfree_pg.models.eligibility_method_item import EligibilityMethodItem +from pydantic import field_validator class SubscriptionEligibilityResponse(BaseModel): """ @@ -30,10 +31,12 @@ class SubscriptionEligibilityResponse(BaseModel): type: Optional[conlist(EligibilityMethodItem)] = Field(None, description="List of eligibile payment methods for the subscription.") __properties = ["type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_entity.py b/cashfree_pg/models/subscription_entity.py index 54d2338d..977b2255 100644 --- a/cashfree_pg/models/subscription_entity.py +++ b/cashfree_pg/models/subscription_entity.py @@ -26,6 +26,7 @@ from cashfree_pg.models.subscription_customer_details import SubscriptionCustomerDetails from cashfree_pg.models.subscription_entity_subscription_meta import SubscriptionEntitySubscriptionMeta from cashfree_pg.models.subscription_payment_split_item import SubscriptionPaymentSplitItem +from pydantic import field_validator class SubscriptionEntity(BaseModel): """ @@ -46,10 +47,12 @@ class SubscriptionEntity(BaseModel): subscription_tags: Optional[Dict[str, Any]] = Field(None, description="Tags for the subscription.") __properties = ["authorisation_details", "cf_subscription_id", "customer_details", "plan_details", "subscription_expiry_time", "subscription_first_charge_time", "subscription_id", "subscription_meta", "subscription_note", "subscription_session_id", "subscription_payment_splits", "subscription_status", "subscription_tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_entity_subscription_meta.py b/cashfree_pg/models/subscription_entity_subscription_meta.py index 0751e1a2..f02bee03 100644 --- a/cashfree_pg/models/subscription_entity_subscription_meta.py +++ b/cashfree_pg/models/subscription_entity_subscription_meta.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class SubscriptionEntitySubscriptionMeta(BaseModel): """ @@ -29,10 +30,12 @@ class SubscriptionEntitySubscriptionMeta(BaseModel): return_url: Optional[StrictStr] = Field(None, description="Return URL for the subscription.") __properties = ["return_url"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_payment_entity.py b/cashfree_pg/models/subscription_payment_entity.py index 28eabdfb..a59960fa 100644 --- a/cashfree_pg/models/subscription_payment_entity.py +++ b/cashfree_pg/models/subscription_payment_entity.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr from cashfree_pg.models.authorization_details import AuthorizationDetails from cashfree_pg.models.subscription_payment_entity_failure_details import SubscriptionPaymentEntityFailureDetails +from pydantic import field_validator class SubscriptionPaymentEntity(BaseModel): """ @@ -45,10 +46,12 @@ class SubscriptionPaymentEntity(BaseModel): subscription_id: Optional[StrictStr] = Field(None, description="A unique ID passed by merchant for identifying the subscription.") __properties = ["authorization_details", "cf_payment_id", "cf_subscription_id", "cf_txn_id", "cf_order_id", "failure_details", "payment_amount", "payment_id", "payment_initiated_date", "payment_remarks", "payment_schedule_date", "payment_status", "payment_type", "retry_attempts", "subscription_id"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_payment_entity_failure_details.py b/cashfree_pg/models/subscription_payment_entity_failure_details.py index a112d1b7..a263c9fb 100644 --- a/cashfree_pg/models/subscription_payment_entity_failure_details.py +++ b/cashfree_pg/models/subscription_payment_entity_failure_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class SubscriptionPaymentEntityFailureDetails(BaseModel): """ @@ -29,10 +30,12 @@ class SubscriptionPaymentEntityFailureDetails(BaseModel): failure_reason: Optional[StrictStr] = Field(None, description="Failure reason of the payment if the payment_status is failed.") __properties = ["failure_reason"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_payment_refund_entity.py b/cashfree_pg/models/subscription_payment_refund_entity.py index 127b5497..5da980f2 100644 --- a/cashfree_pg/models/subscription_payment_refund_entity.py +++ b/cashfree_pg/models/subscription_payment_refund_entity.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class SubscriptionPaymentRefundEntity(BaseModel): """ @@ -36,10 +37,12 @@ class SubscriptionPaymentRefundEntity(BaseModel): refund_status: Optional[StrictStr] = Field(None, description="Status of the refund.") __properties = ["payment_id", "cf_payment_id", "refund_id", "cf_refund_id", "refund_amount", "refund_note", "refund_speed", "refund_status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/subscription_payment_split_item.py b/cashfree_pg/models/subscription_payment_split_item.py index bc4417cf..35bc8127 100644 --- a/cashfree_pg/models/subscription_payment_split_item.py +++ b/cashfree_pg/models/subscription_payment_split_item.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class SubscriptionPaymentSplitItem(BaseModel): """ @@ -30,10 +31,12 @@ class SubscriptionPaymentSplitItem(BaseModel): percentage: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="Percentage of the payment to be split to vendor") __properties = ["vendor_id", "percentage"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_details.py b/cashfree_pg/models/terminal_details.py index f3828e12..27bd571e 100644 --- a/cashfree_pg/models/terminal_details.py +++ b/cashfree_pg/models/terminal_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import field_validator class TerminalDetails(BaseModel): """ @@ -38,10 +39,12 @@ class TerminalDetails(BaseModel): terminal_type: constr(strict=True, max_length=10, min_length=4) = Field(..., description="To identify the type of terminal product in use, in this case it is SPOS.") __properties = ["added_on", "cf_terminal_id", "last_updated_on", "terminal_address", "terminal_id", "terminal_name", "terminal_note", "terminal_phone_no", "terminal_status", "terminal_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_entity.py b/cashfree_pg/models/terminal_entity.py index 9a073264..28047ff0 100644 --- a/cashfree_pg/models/terminal_entity.py +++ b/cashfree_pg/models/terminal_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr from cashfree_pg.models.create_terminal_request_terminal_meta import CreateTerminalRequestTerminalMeta +from pydantic import field_validator class TerminalEntity(BaseModel): """ @@ -41,10 +42,12 @@ class TerminalEntity(BaseModel): terminal_meta: Optional[CreateTerminalRequestTerminalMeta] = None __properties = ["added_on", "cf_terminal_id", "last_updated_on", "terminal_address", "terminal_email", "terminal_type", "teminal_id", "terminal_name", "terminal_note", "terminal_phone_no", "terminal_status", "terminal_meta"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_payment_entity.py b/cashfree_pg/models/terminal_payment_entity.py index 33f87303..e5ecdd20 100644 --- a/cashfree_pg/models/terminal_payment_entity.py +++ b/cashfree_pg/models/terminal_payment_entity.py @@ -25,6 +25,7 @@ from cashfree_pg.models.customer_details import CustomerDetails from cashfree_pg.models.error_details_in_payments_entity import ErrorDetailsInPaymentsEntity from cashfree_pg.models.terminal_payment_entity_payment_method import TerminalPaymentEntityPaymentMethod +from pydantic import field_validator class TerminalPaymentEntity(BaseModel): """ @@ -50,7 +51,7 @@ class TerminalPaymentEntity(BaseModel): payment_method: Optional[TerminalPaymentEntityPaymentMethod] = None __properties = ["cf_payment_id", "order_id", "entity", "error_details", "is_captured", "order_amount", "payment_group", "payment_currency", "payment_amount", "payment_time", "payment_completion_time", "payment_status", "payment_message", "bank_reference", "auth_id", "authorization", "customer_details", "payment_method"] - @validator('payment_status') + @field_validator('payment_status') def payment_status_validate_enum(cls, value): """Validates the enum""" if value is None: @@ -60,10 +61,12 @@ def payment_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('SUCCESS', 'NOT_ATTEMPTED', 'FAILED', 'USER_DROPPED', 'VOID', 'CANCELLED', 'PENDING')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_payment_entity_payment_method.py b/cashfree_pg/models/terminal_payment_entity_payment_method.py index e06493d3..8879a33b 100644 --- a/cashfree_pg/models/terminal_payment_entity_payment_method.py +++ b/cashfree_pg/models/terminal_payment_entity_payment_method.py @@ -60,8 +60,10 @@ class TerminalPaymentEntityPaymentMethod(BaseModel): actual_instance: Any one_of_schemas: List[str] = Field(TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True) - class Config: - validate_assignment = True + # Updated to Pydantic v2 + model_config = { + "validate_assignment": True + } def __init__(self, *args, **kwargs): if args: diff --git a/cashfree_pg/models/terminal_transaction_entity.py b/cashfree_pg/models/terminal_transaction_entity.py index bea3b37e..9524751c 100644 --- a/cashfree_pg/models/terminal_transaction_entity.py +++ b/cashfree_pg/models/terminal_transaction_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import field_validator class TerminalTransactionEntity(BaseModel): """ @@ -34,10 +35,12 @@ class TerminalTransactionEntity(BaseModel): timeout: Optional[StrictStr] = None __properties = ["cf_payment_id", "payment_amount", "payment_method", "payment_url", "qrcode", "timeout"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/terminate_order_request.py b/cashfree_pg/models/terminate_order_request.py index 1ff0f460..771bcb7c 100644 --- a/cashfree_pg/models/terminate_order_request.py +++ b/cashfree_pg/models/terminate_order_request.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class TerminateOrderRequest(BaseModel): """ @@ -29,10 +30,12 @@ class TerminateOrderRequest(BaseModel): order_status: StrictStr = Field(..., description="To terminate an order, pass order_status as \"TERMINATED\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated.") __properties = ["order_status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/transfer_details.py b/cashfree_pg/models/transfer_details.py index 80ce8920..281fad95 100644 --- a/cashfree_pg/models/transfer_details.py +++ b/cashfree_pg/models/transfer_details.py @@ -22,6 +22,7 @@ from typing import List, Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conlist from cashfree_pg.models.transfer_details_tags_inner import TransferDetailsTagsInner +from pydantic import field_validator class TransferDetails(BaseModel): """ @@ -35,10 +36,12 @@ class TransferDetails(BaseModel): tags: Optional[conlist(TransferDetailsTagsInner)] = None __properties = ["vendor_id", "transfer_from", "transfer_type", "transfer_amount", "remark", "tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/transfer_details_tags_inner.py b/cashfree_pg/models/transfer_details_tags_inner.py index 6a403c12..541f8140 100644 --- a/cashfree_pg/models/transfer_details_tags_inner.py +++ b/cashfree_pg/models/transfer_details_tags_inner.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class TransferDetailsTagsInner(BaseModel): """ @@ -30,10 +31,12 @@ class TransferDetailsTagsInner(BaseModel): size: Optional[Union[StrictFloat, StrictInt]] = None __properties = ["product", "size"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_order_extended_data_entity.py b/cashfree_pg/models/update_order_extended_data_entity.py index 3a127bef..b2552ea6 100644 --- a/cashfree_pg/models/update_order_extended_data_entity.py +++ b/cashfree_pg/models/update_order_extended_data_entity.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, StrictStr, conlist from cashfree_pg.models.order_delivery_status import OrderDeliveryStatus from cashfree_pg.models.shipment_details import ShipmentDetails +from pydantic import field_validator class UpdateOrderExtendedDataEntity(BaseModel): """ @@ -34,10 +35,12 @@ class UpdateOrderExtendedDataEntity(BaseModel): order_delivery_status: Optional[OrderDeliveryStatus] = None __properties = ["cf_order_id", "order_id", "shipment_details", "order_delivery_status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_order_extended_request.py b/cashfree_pg/models/update_order_extended_request.py index af13af96..7301a810 100644 --- a/cashfree_pg/models/update_order_extended_request.py +++ b/cashfree_pg/models/update_order_extended_request.py @@ -23,6 +23,7 @@ from pydantic import BaseModel, Field, conlist from cashfree_pg.models.order_delivery_status import OrderDeliveryStatus from cashfree_pg.models.shipment_details import ShipmentDetails +from pydantic import field_validator class UpdateOrderExtendedRequest(BaseModel): """ @@ -32,10 +33,12 @@ class UpdateOrderExtendedRequest(BaseModel): order_delivery_status: Optional[OrderDeliveryStatus] = None __properties = ["shipment_details", "order_delivery_status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_soundbox_vpa_request.py b/cashfree_pg/models/update_soundbox_vpa_request.py index 0e508e79..6a625de5 100644 --- a/cashfree_pg/models/update_soundbox_vpa_request.py +++ b/cashfree_pg/models/update_soundbox_vpa_request.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class UpdateSoundboxVpaRequest(BaseModel): """ @@ -32,10 +33,12 @@ class UpdateSoundboxVpaRequest(BaseModel): language: Optional[StrictStr] = Field(None, description="language of soundbox,currently English, Hindi, Tamil") __properties = ["vpa", "cf_terminal_id", "merchant_name", "language"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_terminal_entity.py b/cashfree_pg/models/update_terminal_entity.py index f1f838f0..ecbc09f5 100644 --- a/cashfree_pg/models/update_terminal_entity.py +++ b/cashfree_pg/models/update_terminal_entity.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr from cashfree_pg.models.create_terminal_request_terminal_meta import CreateTerminalRequestTerminalMeta +from pydantic import field_validator class UpdateTerminalEntity(BaseModel): """ @@ -41,10 +42,12 @@ class UpdateTerminalEntity(BaseModel): terminal_meta: Optional[CreateTerminalRequestTerminalMeta] = None __properties = ["added_on", "cf_terminal_id", "last_updated_on", "terminal_address", "terminal_email", "terminal_type", "teminal_id", "terminal_name", "terminal_note", "terminal_phone_no", "terminal_status", "terminal_meta"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_terminal_request.py b/cashfree_pg/models/update_terminal_request.py index 08fc0d0e..a3d25f7d 100644 --- a/cashfree_pg/models/update_terminal_request.py +++ b/cashfree_pg/models/update_terminal_request.py @@ -22,6 +22,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr, constr from cashfree_pg.models.update_terminal_request_terminal_meta import UpdateTerminalRequestTerminalMeta +from pydantic import field_validator class UpdateTerminalRequest(BaseModel): """ @@ -33,10 +34,12 @@ class UpdateTerminalRequest(BaseModel): terminal_type: StrictStr = Field(..., description="Mention the terminal type to be updated. Possible values - AGENT, STOREFRONT.") __properties = ["terminal_email", "terminal_phone_no", "terminal_meta", "terminal_type"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_terminal_request_terminal_meta.py b/cashfree_pg/models/update_terminal_request_terminal_meta.py index 9fce63e9..6e388ab5 100644 --- a/cashfree_pg/models/update_terminal_request_terminal_meta.py +++ b/cashfree_pg/models/update_terminal_request_terminal_meta.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class UpdateTerminalRequestTerminalMeta(BaseModel): """ @@ -29,10 +30,12 @@ class UpdateTerminalRequestTerminalMeta(BaseModel): terminal_operator: Optional[StrictStr] = Field(None, description="Name of the operator for the storefront.") __properties = ["terminal_operator"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_terminal_status_request.py b/cashfree_pg/models/update_terminal_status_request.py index fd7d2879..bdd9044d 100644 --- a/cashfree_pg/models/update_terminal_status_request.py +++ b/cashfree_pg/models/update_terminal_status_request.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class UpdateTerminalStatusRequest(BaseModel): """ @@ -29,10 +30,12 @@ class UpdateTerminalStatusRequest(BaseModel): terminal_status: StrictStr = Field(..., description="Status of the terminal to be updated. possible values - ACTIVE, INACTIVE.") __properties = ["terminal_status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_vendor_request.py b/cashfree_pg/models/update_vendor_request.py index 68c2f59a..b9f48e1c 100644 --- a/cashfree_pg/models/update_vendor_request.py +++ b/cashfree_pg/models/update_vendor_request.py @@ -24,6 +24,7 @@ from cashfree_pg.models.bank_details import BankDetails from cashfree_pg.models.kyc_details import KycDetails from cashfree_pg.models.upi_details import UpiDetails +from pydantic import field_validator class UpdateVendorRequest(BaseModel): """ @@ -41,10 +42,12 @@ class UpdateVendorRequest(BaseModel): kyc_details: conlist(KycDetails) = Field(..., description="Specify the kyc details that should be updated.") __properties = ["status", "name", "email", "phone", "verify_account", "dashboard_access", "schedule_option", "bank", "upi", "kyc_details"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/update_vendor_response.py b/cashfree_pg/models/update_vendor_response.py index 04f37d11..f896ab13 100644 --- a/cashfree_pg/models/update_vendor_response.py +++ b/cashfree_pg/models/update_vendor_response.py @@ -25,6 +25,7 @@ from cashfree_pg.models.kyc_details import KycDetails from cashfree_pg.models.schedule_option import ScheduleOption from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner +from pydantic import field_validator class UpdateVendorResponse(BaseModel): """ @@ -49,10 +50,12 @@ class UpdateVendorResponse(BaseModel): related_docs: Optional[conlist(VendorEntityRelatedDocsInner)] = None __properties = ["email", "status", "bank", "upi", "added_on", "updated_on", "vendor_type", "account_type", "business_type", "phone", "name", "vendor_id", "schedule_option", "kyc_details", "dashboard_access", "bank_details", "related_docs"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upi.py b/cashfree_pg/models/upi.py index 497aa862..c13578de 100644 --- a/cashfree_pg/models/upi.py +++ b/cashfree_pg/models/upi.py @@ -22,6 +22,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, validator from cashfree_pg.models.upi_authorize_details import UPIAuthorizeDetails +from pydantic import field_validator class Upi(BaseModel): """ @@ -35,17 +36,19 @@ class Upi(BaseModel): authorization: Optional[UPIAuthorizeDetails] = None __properties = ["channel", "upi_id", "upi_redirect_url", "upi_expiry_minutes", "authorize_only", "authorization"] - @validator('channel') + @field_validator('channel') def channel_validate_enum(cls, value): """Validates the enum""" if value not in ('link', 'collect', 'qrcode'): raise ValueError("must be one of enum values ('link', 'collect', 'qrcode')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upi_authorize_details.py b/cashfree_pg/models/upi_authorize_details.py index 7062ad64..b17e774d 100644 --- a/cashfree_pg/models/upi_authorize_details.py +++ b/cashfree_pg/models/upi_authorize_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class UPIAuthorizeDetails(BaseModel): """ @@ -31,10 +32,12 @@ class UPIAuthorizeDetails(BaseModel): end_time: Optional[StrictStr] = Field(None, description="This is the time when the UPI mandate will be over. If the mandate has not been executed by this time, the funds will be returned back to the customer after this time.") __properties = ["approve_by", "start_time", "end_time"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upi_details.py b/cashfree_pg/models/upi_details.py index 0b25b507..45eafe51 100644 --- a/cashfree_pg/models/upi_details.py +++ b/cashfree_pg/models/upi_details.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class UpiDetails(BaseModel): """ @@ -30,10 +31,12 @@ class UpiDetails(BaseModel): account_holder: Optional[StrictStr] = None __properties = ["vpa", "account_holder"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upi_payment_method.py b/cashfree_pg/models/upi_payment_method.py index 0e6ffe5e..8fde1f92 100644 --- a/cashfree_pg/models/upi_payment_method.py +++ b/cashfree_pg/models/upi_payment_method.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, Field from cashfree_pg.models.upi import Upi +from pydantic import field_validator class UPIPaymentMethod(BaseModel): """ @@ -30,10 +31,12 @@ class UPIPaymentMethod(BaseModel): upi: Upi = Field(...) __properties = ["upi"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upload_pnach_image_response.py b/cashfree_pg/models/upload_pnach_image_response.py index c00c9aed..ae3861b0 100644 --- a/cashfree_pg/models/upload_pnach_image_response.py +++ b/cashfree_pg/models/upload_pnach_image_response.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class UploadPnachImageResponse(BaseModel): """ @@ -32,10 +33,12 @@ class UploadPnachImageResponse(BaseModel): payment_message: Optional[StrictStr] = Field(None, description="Message of the API.") __properties = ["payment_id", "authorization_status", "action", "payment_message"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upload_terminal_docs.py b/cashfree_pg/models/upload_terminal_docs.py index fa46211a..e5b7a75b 100644 --- a/cashfree_pg/models/upload_terminal_docs.py +++ b/cashfree_pg/models/upload_terminal_docs.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, Field, StrictStr +from pydantic import field_validator class UploadTerminalDocs(BaseModel): """ @@ -31,10 +32,12 @@ class UploadTerminalDocs(BaseModel): file: StrictStr = Field(..., description="Select the document that should be uploaded or provide the path of that file. You cannot upload a file that is more than 2MB in size.") __properties = ["doc_type", "doc_value", "file"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upload_terminal_docs_entity.py b/cashfree_pg/models/upload_terminal_docs_entity.py index 15b45dcb..146835ab 100644 --- a/cashfree_pg/models/upload_terminal_docs_entity.py +++ b/cashfree_pg/models/upload_terminal_docs_entity.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import field_validator class UploadTerminalDocsEntity(BaseModel): """ @@ -32,10 +33,12 @@ class UploadTerminalDocsEntity(BaseModel): status: Optional[StrictStr] = None __properties = ["cf_terminal_id", "doc_type", "doc_value", "status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/upload_vendor_documents_response.py b/cashfree_pg/models/upload_vendor_documents_response.py index 1bbc633c..be20db81 100644 --- a/cashfree_pg/models/upload_vendor_documents_response.py +++ b/cashfree_pg/models/upload_vendor_documents_response.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class UploadVendorDocumentsResponse(BaseModel): """ @@ -33,10 +34,12 @@ class UploadVendorDocumentsResponse(BaseModel): remarks: Optional[StrictStr] = None __properties = ["vendor_id", "doc_type", "doc_value", "status", "remarks"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_adjustment_request.py b/cashfree_pg/models/vendor_adjustment_request.py index abcaaf34..575243d5 100644 --- a/cashfree_pg/models/vendor_adjustment_request.py +++ b/cashfree_pg/models/vendor_adjustment_request.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class VendorAdjustmentRequest(BaseModel): """ @@ -33,10 +34,12 @@ class VendorAdjustmentRequest(BaseModel): remarks: Optional[StrictStr] = Field(None, description="Remarks for the adjustment transaction, if any.") __properties = ["vendor_id", "adjustment_id", "amount", "type", "remarks"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_adjustment_success_response.py b/cashfree_pg/models/vendor_adjustment_success_response.py index 37167297..e7de649a 100644 --- a/cashfree_pg/models/vendor_adjustment_success_response.py +++ b/cashfree_pg/models/vendor_adjustment_success_response.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class VendorAdjustmentSuccessResponse(BaseModel): """ @@ -30,10 +31,12 @@ class VendorAdjustmentSuccessResponse(BaseModel): status: Optional[StrictStr] = None __properties = ["message", "status"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_balance.py b/cashfree_pg/models/vendor_balance.py index f077d936..c0b6b26c 100644 --- a/cashfree_pg/models/vendor_balance.py +++ b/cashfree_pg/models/vendor_balance.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class VendorBalance(BaseModel): """ @@ -32,10 +33,12 @@ class VendorBalance(BaseModel): vendor_unsettled: Optional[Union[StrictFloat, StrictInt]] = None __properties = ["merchant_id", "vendor_id", "merchant_unsettled", "vendor_unsettled"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_balance_transfer_charges.py b/cashfree_pg/models/vendor_balance_transfer_charges.py index 2cd0a9f5..09541d4a 100644 --- a/cashfree_pg/models/vendor_balance_transfer_charges.py +++ b/cashfree_pg/models/vendor_balance_transfer_charges.py @@ -21,6 +21,7 @@ from typing import Optional, Union from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class VendorBalanceTransferCharges(BaseModel): """ @@ -33,10 +34,12 @@ class VendorBalanceTransferCharges(BaseModel): is_postpaid: Optional[StrictBool] = None __properties = ["service_charges", "service_tax", "amount", "billed_to", "is_postpaid"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_document_download_response.py b/cashfree_pg/models/vendor_document_download_response.py index f6d78681..8fcf1e34 100644 --- a/cashfree_pg/models/vendor_document_download_response.py +++ b/cashfree_pg/models/vendor_document_download_response.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class VendorDocumentDownloadResponse(BaseModel): """ @@ -29,10 +30,12 @@ class VendorDocumentDownloadResponse(BaseModel): download_url: Optional[StrictStr] = None __properties = ["download_url"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_documents_response.py b/cashfree_pg/models/vendor_documents_response.py index b88c0668..33592782 100644 --- a/cashfree_pg/models/vendor_documents_response.py +++ b/cashfree_pg/models/vendor_documents_response.py @@ -22,6 +22,7 @@ from typing import List, Optional from pydantic import BaseModel, conlist from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner +from pydantic import field_validator class VendorDocumentsResponse(BaseModel): """ @@ -30,10 +31,12 @@ class VendorDocumentsResponse(BaseModel): documents: Optional[conlist(VendorEntityRelatedDocsInner)] = None __properties = ["documents"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_entity.py b/cashfree_pg/models/vendor_entity.py index 36a7bd60..d807bfbe 100644 --- a/cashfree_pg/models/vendor_entity.py +++ b/cashfree_pg/models/vendor_entity.py @@ -24,6 +24,7 @@ from cashfree_pg.models.bank_details import BankDetails from cashfree_pg.models.schedule_option import ScheduleOption from cashfree_pg.models.vendor_entity_related_docs_inner import VendorEntityRelatedDocsInner +from pydantic import field_validator class VendorEntity(BaseModel): """ @@ -46,10 +47,12 @@ class VendorEntity(BaseModel): related_docs: Optional[conlist(VendorEntityRelatedDocsInner)] = None __properties = ["email", "status", "phone", "name", "vendor_id", "added_on", "updated_on", "bank", "upi", "schedule_option", "vendor_type", "account_type", "business_type", "remarks", "related_docs"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_entity_related_docs_inner.py b/cashfree_pg/models/vendor_entity_related_docs_inner.py index 97f2afa3..33e14a54 100644 --- a/cashfree_pg/models/vendor_entity_related_docs_inner.py +++ b/cashfree_pg/models/vendor_entity_related_docs_inner.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class VendorEntityRelatedDocsInner(BaseModel): """ @@ -33,10 +34,12 @@ class VendorEntityRelatedDocsInner(BaseModel): remarks: Optional[StrictStr] = None __properties = ["vendor_id", "doc_type", "doc_value", "status", "remarks"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_split.py b/cashfree_pg/models/vendor_split.py index 31e277c2..903c97f9 100644 --- a/cashfree_pg/models/vendor_split.py +++ b/cashfree_pg/models/vendor_split.py @@ -21,6 +21,7 @@ from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import field_validator class VendorSplit(BaseModel): """ @@ -32,10 +33,12 @@ class VendorSplit(BaseModel): tags: Optional[Dict[str, Dict[str, Any]]] = Field(None, description="Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added") __properties = ["vendor_id", "amount", "percentage", "tags"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/cashfree_pg/models/wallet_offer.py b/cashfree_pg/models/wallet_offer.py index f08d15ae..7d52517e 100644 --- a/cashfree_pg/models/wallet_offer.py +++ b/cashfree_pg/models/wallet_offer.py @@ -21,6 +21,7 @@ from typing import Optional from pydantic import BaseModel, StrictStr +from pydantic import field_validator class WalletOffer(BaseModel): """ @@ -29,10 +30,12 @@ class WalletOffer(BaseModel): provider: Optional[StrictStr] = None __properties = ["provider"] - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + # Updated to Pydantic v2 + """Pydantic configuration""" + model_config = { + "populate_by_name": True, + "validate_assignment": True + } def to_str(self) -> str: """Returns the string representation of the model using alias""" diff --git a/configuration.py b/configuration.py index 5aa108b1..7d008ca2 100644 --- a/configuration.py +++ b/configuration.py @@ -434,7 +434,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2023-08-01\n"\ - "SDK Package Version: 4.3.10".\ + "SDK Package Version: 4.5.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/pyproject.toml b/pyproject.toml index ac739655..d540bbf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cashfree_pg" -version = "4.5.1" +version = "5.0.1-beta" description = "Cashfree Payment Gateway APIs" authors = ["API Support "] license = "Apache 2.0" diff --git a/setup.py b/setup.py index 463a9d6e..c6d20b8f 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "cashfree_pg" -VERSION = "4.5.1" +VERSION = "5.0.1-beta" with open("README.md", "r", encoding="utf-8") as fh: readme = fh.read() PYTHON_REQUIRES = ">=3.7" @@ -30,7 +30,7 @@ "urllib3 >= 1.25.3, < 2.1.0", "python-dateutil", "sentry-sdk >= 1.32.0, < 1.33.0", - "pydantic >= 1.10.24, < 2", + "pydantic >= 2.11.7", "aenum" ]