From 16f430289cd18f84cf48e7b015278c99b52a4e8d Mon Sep 17 00:00:00 2001 From: bitbucket-pipelines Date: Mon, 29 Jan 2024 08:46:32 +0000 Subject: [PATCH] Generating Python SDK. --- cashfree_pg/__init__.py | 2 +- cashfree_pg/api_client.py | 66 +++++++++---------- cashfree_pg/configuration.py | 2 +- cashfree_pg/models/api_error.py | 7 +- cashfree_pg/models/api_error404.py | 7 +- cashfree_pg/models/api_error409.py | 7 +- cashfree_pg/models/api_error502.py | 7 +- cashfree_pg/models/app.py | 7 +- cashfree_pg/models/app_payment_method.py | 7 +- cashfree_pg/models/authentication_error.py | 7 +- .../authorization_in_payments_entity.py | 7 +- cashfree_pg/models/authorize_order_request.py | 7 +- cashfree_pg/models/bad_request_error.py | 7 +- cashfree_pg/models/card.py | 7 +- cashfree_pg/models/card_emi.py | 7 +- cashfree_pg/models/card_emi_payment_method.py | 7 +- cashfree_pg/models/card_offer.py | 7 +- cashfree_pg/models/card_payment_method.py | 7 +- cashfree_pg/models/cardless_emi.py | 7 +- cashfree_pg/models/cardless_emi_entity.py | 7 +- .../models/cardless_emi_payment_method.py | 7 +- cashfree_pg/models/cardless_emi_queries.py | 7 +- cashfree_pg/models/cashback_details.py | 7 +- cashfree_pg/models/create_link_request.py | 7 +- cashfree_pg/models/create_offer_request.py | 7 +- cashfree_pg/models/create_order_request.py | 7 +- cashfree_pg/models/create_terminal_request.py | 7 +- .../create_terminal_request_terminal_meta.py | 7 +- .../create_terminal_transaction_request.py | 7 +- cashfree_pg/models/cryptogram_entity.py | 7 +- cashfree_pg/models/customer_details.py | 7 +- .../models/customer_details_cardless_emi.py | 7 +- cashfree_pg/models/discount_details.py | 7 +- .../models/eligibility_cardless_emi_entity.py | 7 +- .../eligibility_fetch_cardless_emi_request.py | 7 +- .../eligibility_fetch_offers_request.py | 7 +- .../eligibility_fetch_paylater_request.py | 7 +- ...igibility_fetch_payment_methods_request.py | 7 +- .../models/eligibility_offer_entity.py | 7 +- .../models/eligibility_paylater_entity.py | 7 +- .../eligibility_payment_methods_entity.py | 7 +- ...y_payment_methods_entity_entity_details.py | 7 +- cashfree_pg/models/emi_offer.py | 7 +- cashfree_pg/models/emi_plans_array.py | 7 +- .../error_details_in_payments_entity.py | 7 +- cashfree_pg/models/fetch_recon_request.py | 7 +- .../models/fetch_recon_request_filters.py | 7 +- .../models/fetch_recon_request_pagination.py | 7 +- .../models/fetch_settlements_request.py | 7 +- .../fetch_settlements_request_filters.py | 7 +- .../fetch_settlements_request_pagination.py | 7 +- .../models/fetch_terminal_qr_codes_entity.py | 7 +- cashfree_pg/models/idempotency_error.py | 7 +- cashfree_pg/models/instrument_entity.py | 7 +- cashfree_pg/models/instrument_webhook.py | 7 +- cashfree_pg/models/instrument_webhook_data.py | 7 +- .../models/instrument_webhook_data_entity.py | 7 +- .../models/link_customer_details_entity.py | 7 +- cashfree_pg/models/link_entity.py | 7 +- cashfree_pg/models/link_meta_entity.py | 7 +- cashfree_pg/models/link_notify_entity.py | 7 +- .../models/net_banking_payment_method.py | 7 +- cashfree_pg/models/netbanking.py | 7 +- cashfree_pg/models/offer_all.py | 7 +- cashfree_pg/models/offer_card.py | 7 +- cashfree_pg/models/offer_details.py | 7 +- cashfree_pg/models/offer_emi.py | 7 +- cashfree_pg/models/offer_entity.py | 7 +- cashfree_pg/models/offer_filters.py | 7 +- cashfree_pg/models/offer_meta.py | 7 +- cashfree_pg/models/offer_nb.py | 7 +- cashfree_pg/models/offer_nb_netbanking.py | 7 +- cashfree_pg/models/offer_paylater.py | 7 +- cashfree_pg/models/offer_queries.py | 7 +- cashfree_pg/models/offer_tnc.py | 7 +- cashfree_pg/models/offer_upi.py | 7 +- cashfree_pg/models/offer_validations.py | 7 +- cashfree_pg/models/offer_wallet.py | 7 +- .../models/order_authenticate_entity.py | 7 +- .../order_authenticate_payment_request.py | 7 +- .../models/order_create_refund_request.py | 7 +- cashfree_pg/models/order_entity.py | 7 +- cashfree_pg/models/order_meta.py | 7 +- cashfree_pg/models/order_pay_data.py | 7 +- cashfree_pg/models/pay_order_entity.py | 7 +- cashfree_pg/models/pay_order_request.py | 7 +- cashfree_pg/models/paylater.py | 7 +- cashfree_pg/models/paylater_entity.py | 7 +- cashfree_pg/models/paylater_offer.py | 7 +- cashfree_pg/models/paylater_payment_method.py | 7 +- cashfree_pg/models/payment_entity.py | 7 +- .../models/payment_link_customer_details.py | 7 +- .../models/payment_link_order_entity.py | 7 +- .../payment_method_app_in_payments_entity.py | 7 +- ...yment_method_app_in_payments_entity_app.py | 7 +- ...yment_method_card_emiin_payments_entity.py | 7 +- ...t_method_card_emiin_payments_entity_emi.py | 7 +- ...d_emiin_payments_entity_emi_emi_details.py | 7 +- .../payment_method_card_in_payments_entity.py | 7 +- ...ent_method_card_in_payments_entity_card.py | 7 +- ...t_method_cardless_emiin_payments_entity.py | 7 +- ...t_method_net_banking_in_payments_entity.py | 7 +- ...t_banking_in_payments_entity_netbanking.py | 7 +- ...ment_method_paylater_in_payments_entity.py | 7 +- .../payment_method_upiin_payments_entity.py | 7 +- ...ayment_method_upiin_payments_entity_upi.py | 7 +- cashfree_pg/models/payment_methods_filters.py | 7 +- cashfree_pg/models/payment_methods_queries.py | 7 +- cashfree_pg/models/payment_mode_details.py | 7 +- cashfree_pg/models/payment_url_object.py | 7 +- cashfree_pg/models/payment_webhook.py | 7 +- .../models/payment_webhook_customer_entity.py | 7 +- .../models/payment_webhook_data_entity.py | 7 +- .../models/payment_webhook_error_entity.py | 7 +- .../payment_webhook_gateway_details_entity.py | 7 +- .../models/payment_webhook_order_entity.py | 7 +- cashfree_pg/models/rate_limit_error.py | 7 +- cashfree_pg/models/recon_entity.py | 7 +- cashfree_pg/models/recon_entity_data_inner.py | 7 +- cashfree_pg/models/refund_entity.py | 7 +- cashfree_pg/models/refund_speed.py | 7 +- cashfree_pg/models/refund_url_object.py | 7 +- cashfree_pg/models/refund_webhook.py | 7 +- .../models/refund_webhook_data_entity.py | 7 +- cashfree_pg/models/saved_instrument_meta.py | 7 +- cashfree_pg/models/settlement_entity.py | 7 +- .../models/settlement_fetch_recon_request.py | 7 +- .../settlement_fetch_recon_request_filters.py | 7 +- cashfree_pg/models/settlement_recon_entity.py | 7 +- .../settlement_recon_entity_data_inner.py | 7 +- cashfree_pg/models/settlement_url_object.py | 7 +- cashfree_pg/models/settlement_webhook.py | 7 +- .../models/settlement_webhook_data_entity.py | 7 +- cashfree_pg/models/terminal_details.py | 7 +- cashfree_pg/models/terminal_entity.py | 7 +- .../models/terminal_transaction_entity.py | 7 +- cashfree_pg/models/upi.py | 7 +- cashfree_pg/models/upi_authorize_details.py | 7 +- cashfree_pg/models/upi_payment_method.py | 7 +- cashfree_pg/models/vendor_split.py | 7 +- cashfree_pg/models/wallet_offer.py | 7 +- configuration.py | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 144 files changed, 590 insertions(+), 452 deletions(-) diff --git a/cashfree_pg/__init__.py b/cashfree_pg/__init__.py index ae6d347..77f88e7 100644 --- a/cashfree_pg/__init__.py +++ b/cashfree_pg/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "3.2.10" +__version__ = "3.2.11" # import apis into sdk package # import ApiClient diff --git a/cashfree_pg/api_client.py b/cashfree_pg/api_client.py index c3b5c21..86bf653 100644 --- a/cashfree_pg/api_client.py +++ b/cashfree_pg/api_client.py @@ -342,7 +342,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -498,7 +498,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -653,7 +653,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -809,7 +809,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -966,7 +966,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -1124,7 +1124,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -1270,7 +1270,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -1428,7 +1428,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -1580,7 +1580,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -1739,7 +1739,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -1884,7 +1884,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2042,7 +2042,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2191,7 +2191,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2343,7 +2343,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2505,7 +2505,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2670,7 +2670,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2819,7 +2819,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -2965,7 +2965,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -3128,7 +3128,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -3293,7 +3293,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -3442,7 +3442,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -3594,7 +3594,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -3755,7 +3755,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -3914,7 +3914,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4070,7 +4070,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4225,7 +4225,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4380,7 +4380,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4534,7 +4534,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4681,7 +4681,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4836,7 +4836,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -4994,7 +4994,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -5148,7 +5148,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-3.2.10" + _header_params["x-sdk-platform"] = "pythonsdk-3.2.11" # process the form parameters _form_params = [] @@ -5237,7 +5237,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/3.2.10/python' + self.user_agent = 'OpenAPI-Generator/3.2.11/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/cashfree_pg/configuration.py b/cashfree_pg/configuration.py index 1d00ee7..179bb94 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: 2022-09-01\n"\ - "SDK Package Version: 3.2.10".\ + "SDK Package Version: 3.2.11".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/cashfree_pg/models/api_error.py b/cashfree_pg/models/api_error.py index 4b4790f..29eeaae 100644 --- a/cashfree_pg/models/api_error.py +++ b/cashfree_pg/models/api_error.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> ApiError: @classmethod def from_json_for_one_of(cls, json_str: str) -> ApiError: """Create an instance of ApiError from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/api_error404.py b/cashfree_pg/models/api_error404.py index 57c6396..f711367 100644 --- a/cashfree_pg/models/api_error404.py +++ b/cashfree_pg/models/api_error404.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> ApiError404: @classmethod def from_json_for_one_of(cls, json_str: str) -> ApiError404: """Create an instance of ApiError404 from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/api_error409.py b/cashfree_pg/models/api_error409.py index 6a2b899..738838c 100644 --- a/cashfree_pg/models/api_error409.py +++ b/cashfree_pg/models/api_error409.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> ApiError409: @classmethod def from_json_for_one_of(cls, json_str: str) -> ApiError409: """Create an instance of ApiError409 from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/api_error502.py b/cashfree_pg/models/api_error502.py index 3b728e3..612ecc8 100644 --- a/cashfree_pg/models/api_error502.py +++ b/cashfree_pg/models/api_error502.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> ApiError502: @classmethod def from_json_for_one_of(cls, json_str: str) -> ApiError502: """Create an instance of ApiError502 from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/app.py b/cashfree_pg/models/app.py index 5fc26cd..3241a23 100644 --- a/cashfree_pg/models/app.py +++ b/cashfree_pg/models/app.py @@ -59,9 +59,10 @@ def from_json(cls, json_str: str) -> App: @classmethod def from_json_for_one_of(cls, json_str: str) -> App: """Create an instance of App from a JSON string""" - if "channel, provider, phone" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, provider, phone"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 afcf2f8..48325d2 100644 --- a/cashfree_pg/models/app_payment_method.py +++ b/cashfree_pg/models/app_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> AppPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> AppPaymentMethod: """Create an instance of AppPaymentMethod from a JSON string""" - if "app" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["app"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/authentication_error.py b/cashfree_pg/models/authentication_error.py index 9949105..62b4315 100644 --- a/cashfree_pg/models/authentication_error.py +++ b/cashfree_pg/models/authentication_error.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> AuthenticationError: @classmethod def from_json_for_one_of(cls, json_str: str) -> AuthenticationError: """Create an instance of AuthenticationError from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b339ec9..212931c 100644 --- a/cashfree_pg/models/authorization_in_payments_entity.py +++ b/cashfree_pg/models/authorization_in_payments_entity.py @@ -77,9 +77,10 @@ def from_json(cls, json_str: str) -> AuthorizationInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> AuthorizationInPaymentsEntity: """Create an instance of AuthorizationInPaymentsEntity from a JSON string""" - if "action, status, captured_amount, start_time, end_time, approve_by, action_reference, action_time" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["action, status, captured_amount, start_time, end_time, approve_by, action_reference, action_time"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 a8ab9d9..ed573b9 100644 --- a/cashfree_pg/models/authorize_order_request.py +++ b/cashfree_pg/models/authorize_order_request.py @@ -61,9 +61,10 @@ def from_json(cls, json_str: str) -> AuthorizeOrderRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> AuthorizeOrderRequest: """Create an instance of AuthorizeOrderRequest from a JSON string""" - if "action, amount" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["action, amount"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 d468a03..76b6890 100644 --- a/cashfree_pg/models/bad_request_error.py +++ b/cashfree_pg/models/bad_request_error.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> BadRequestError: @classmethod def from_json_for_one_of(cls, json_str: str) -> BadRequestError: """Create an instance of BadRequestError from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/card.py b/cashfree_pg/models/card.py index 473760b..30df6b6 100644 --- a/cashfree_pg/models/card.py +++ b/cashfree_pg/models/card.py @@ -90,9 +90,10 @@ def from_json(cls, json_str: str) -> Card: @classmethod def from_json_for_one_of(cls, json_str: str) -> Card: """Create an instance of Card from a JSON string""" - if "channel, card_number, card_holder_name, card_expiry_mm, card_expiry_yy, card_cvv, instrument_id, cryptogram, token_requestor_id, token_type, card_display, card_alias, card_bank_name, emi_tenure" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, card_number, card_holder_name, card_expiry_mm, card_expiry_yy, card_cvv, instrument_id, cryptogram, token_requestor_id, token_type, card_display, card_alias, card_bank_name, emi_tenure"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/card_emi.py b/cashfree_pg/models/card_emi.py index 6deafb1..2e4de9b 100644 --- a/cashfree_pg/models/card_emi.py +++ b/cashfree_pg/models/card_emi.py @@ -65,9 +65,10 @@ def from_json(cls, json_str: str) -> CardEMI: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardEMI: """Create an instance of CardEMI from a JSON string""" - if "channel, card_number, card_holder_name, card_expiry_mm, card_expiry_yy, card_cvv, card_alias, card_bank_name, emi_tenure" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, card_number, card_holder_name, card_expiry_mm, card_expiry_yy, card_cvv, card_alias, card_bank_name, emi_tenure"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 cb1a3b5..9285bd6 100644 --- a/cashfree_pg/models/card_emi_payment_method.py +++ b/cashfree_pg/models/card_emi_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> CardEMIPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardEMIPaymentMethod: """Create an instance of CardEMIPaymentMethod from a JSON string""" - if "emi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["emi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/card_offer.py b/cashfree_pg/models/card_offer.py index 40d7009..13010fe 100644 --- a/cashfree_pg/models/card_offer.py +++ b/cashfree_pg/models/card_offer.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> CardOffer: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardOffer: """Create an instance of CardOffer from a JSON string""" - if "type, bank_name, scheme_name" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["type, bank_name, scheme_name"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 0ffd185..41210d0 100644 --- a/cashfree_pg/models/card_payment_method.py +++ b/cashfree_pg/models/card_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> CardPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardPaymentMethod: """Create an instance of CardPaymentMethod from a JSON string""" - if "card" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["card"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/cardless_emi.py b/cashfree_pg/models/cardless_emi.py index c6cb49e..e083bea 100644 --- a/cashfree_pg/models/cardless_emi.py +++ b/cashfree_pg/models/cardless_emi.py @@ -63,9 +63,10 @@ def from_json(cls, json_str: str) -> CardlessEMI: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardlessEMI: """Create an instance of CardlessEMI from a JSON string""" - if "channel, provider, phone, emi_tenure" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, provider, phone, emi_tenure"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 457d8e1..30353a8 100644 --- a/cashfree_pg/models/cardless_emi_entity.py +++ b/cashfree_pg/models/cardless_emi_entity.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> CardlessEMIEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardlessEMIEntity: """Create an instance of CardlessEMIEntity from a JSON string""" - if "payment_method, emi_plans" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["payment_method, emi_plans"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b97ca0e..b58fa4f 100644 --- a/cashfree_pg/models/cardless_emi_payment_method.py +++ b/cashfree_pg/models/cardless_emi_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> CardlessEMIPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardlessEMIPaymentMethod: """Create an instance of CardlessEMIPaymentMethod from a JSON string""" - if "cardless_emi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cardless_emi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 93234a8..f0a5574 100644 --- a/cashfree_pg/models/cardless_emi_queries.py +++ b/cashfree_pg/models/cardless_emi_queries.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> CardlessEMIQueries: @classmethod def from_json_for_one_of(cls, json_str: str) -> CardlessEMIQueries: """Create an instance of CardlessEMIQueries from a JSON string""" - if "order_id, amount, customer_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["order_id, amount, customer_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/cashback_details.py b/cashfree_pg/models/cashback_details.py index 86b1cf8..64f7d57 100644 --- a/cashfree_pg/models/cashback_details.py +++ b/cashfree_pg/models/cashback_details.py @@ -59,9 +59,10 @@ def from_json(cls, json_str: str) -> CashbackDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> CashbackDetails: """Create an instance of CashbackDetails from a JSON string""" - if "cashback_type, cashback_value, max_cashback_amount" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cashback_type, cashback_value, max_cashback_amount"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 75db648..55bced9 100644 --- a/cashfree_pg/models/create_link_request.py +++ b/cashfree_pg/models/create_link_request.py @@ -64,9 +64,10 @@ def from_json(cls, json_str: str) -> CreateLinkRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> CreateLinkRequest: """Create an instance of CreateLinkRequest from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b2e4b0e..9c07451 100644 --- a/cashfree_pg/models/create_offer_request.py +++ b/cashfree_pg/models/create_offer_request.py @@ -57,9 +57,10 @@ def from_json(cls, json_str: str) -> CreateOfferRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> CreateOfferRequest: """Create an instance of CreateOfferRequest from a JSON string""" - if "offer_meta, offer_tnc, offer_details, offer_validations" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["offer_meta, offer_tnc, offer_details, offer_validations"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 bb10416..4fd795a 100644 --- a/cashfree_pg/models/create_order_request.py +++ b/cashfree_pg/models/create_order_request.py @@ -63,9 +63,10 @@ def from_json(cls, json_str: str) -> CreateOrderRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> CreateOrderRequest: """Create an instance of CreateOrderRequest from a JSON string""" - if "order_id, order_amount, order_currency, customer_details, terminal, order_meta, order_expiry_time, order_note, order_tags, order_splits" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["order_id, order_amount, order_currency, customer_details, terminal, order_meta, order_expiry_time, order_note, order_tags, order_splits"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 46e1f3c..1dfa24b 100644 --- a/cashfree_pg/models/create_terminal_request.py +++ b/cashfree_pg/models/create_terminal_request.py @@ -58,9 +58,10 @@ def from_json(cls, json_str: str) -> CreateTerminalRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> CreateTerminalRequest: """Create an instance of CreateTerminalRequest from a JSON string""" - if "terminal_id, terminal_phone_no, terminal_name, terminal_address, terminal_email, terminal_note, terminal_type, terminal_meta" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["terminal_id, terminal_phone_no, terminal_name, terminal_address, terminal_email, terminal_note, terminal_type, terminal_meta"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 0a22849..d76b98c 100644 --- a/cashfree_pg/models/create_terminal_request_terminal_meta.py +++ b/cashfree_pg/models/create_terminal_request_terminal_meta.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> CreateTerminalRequestTerminalMeta: @classmethod def from_json_for_one_of(cls, json_str: str) -> CreateTerminalRequestTerminalMeta: """Create an instance of CreateTerminalRequestTerminalMeta from a JSON string""" - if "terminal_operator" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["terminal_operator"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b92c9eb..735dc9a 100644 --- a/cashfree_pg/models/create_terminal_transaction_request.py +++ b/cashfree_pg/models/create_terminal_transaction_request.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> CreateTerminalTransactionRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> CreateTerminalTransactionRequest: """Create an instance of CreateTerminalTransactionRequest from a JSON string""" - if "cf_order_id, cf_terminal_id, payment_method, terminal_phone_no" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cf_order_id, cf_terminal_id, payment_method, terminal_phone_no"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/cryptogram_entity.py b/cashfree_pg/models/cryptogram_entity.py index 69eac5b..97c86c7 100644 --- a/cashfree_pg/models/cryptogram_entity.py +++ b/cashfree_pg/models/cryptogram_entity.py @@ -56,9 +56,10 @@ def from_json(cls, json_str: str) -> CryptogramEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> CryptogramEntity: """Create an instance of CryptogramEntity from a JSON string""" - if "instrument_id, token_requestor_id, card_number, card_expiry_mm, card_expiry_yy, cryptogram, card_display" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["instrument_id, token_requestor_id, card_number, card_expiry_mm, card_expiry_yy, cryptogram, card_display"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/customer_details.py b/cashfree_pg/models/customer_details.py index 9920a9f..77781cc 100644 --- a/cashfree_pg/models/customer_details.py +++ b/cashfree_pg/models/customer_details.py @@ -56,9 +56,10 @@ def from_json(cls, json_str: str) -> CustomerDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> CustomerDetails: """Create an instance of CustomerDetails from a JSON string""" - if "customer_id, customer_email, customer_phone, customer_name, customer_bank_account_number, customer_bank_ifsc, customer_bank_code" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["customer_id, customer_email, customer_phone, customer_name, customer_bank_account_number, customer_bank_ifsc, customer_bank_code"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 38da3b8..dd6d4b2 100644 --- a/cashfree_pg/models/customer_details_cardless_emi.py +++ b/cashfree_pg/models/customer_details_cardless_emi.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> CustomerDetailsCardlessEMI: @classmethod def from_json_for_one_of(cls, json_str: str) -> CustomerDetailsCardlessEMI: """Create an instance of CustomerDetailsCardlessEMI from a JSON string""" - if "customer_phone" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["customer_phone"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/discount_details.py b/cashfree_pg/models/discount_details.py index 4853ad4..48e6e27 100644 --- a/cashfree_pg/models/discount_details.py +++ b/cashfree_pg/models/discount_details.py @@ -59,9 +59,10 @@ def from_json(cls, json_str: str) -> DiscountDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> DiscountDetails: """Create an instance of DiscountDetails from a JSON string""" - if "discount_type, discount_value, max_discount_amount" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["discount_type, discount_value, max_discount_amount"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 32b9fb5..012b7db 100644 --- a/cashfree_pg/models/eligibility_cardless_emi_entity.py +++ b/cashfree_pg/models/eligibility_cardless_emi_entity.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> EligibilityCardlessEMIEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityCardlessEMIEntity: """Create an instance of EligibilityCardlessEMIEntity from a JSON string""" - if "eligibility, entity_type, entity_value, entity_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["eligibility, entity_type, entity_value, entity_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 0bd8644..21759c0 100644 --- a/cashfree_pg/models/eligibility_fetch_cardless_emi_request.py +++ b/cashfree_pg/models/eligibility_fetch_cardless_emi_request.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> EligibilityFetchCardlessEMIRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityFetchCardlessEMIRequest: """Create an instance of EligibilityFetchCardlessEMIRequest from a JSON string""" - if "queries" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["queries"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 10b484e..7eee16a 100644 --- a/cashfree_pg/models/eligibility_fetch_offers_request.py +++ b/cashfree_pg/models/eligibility_fetch_offers_request.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> EligibilityFetchOffersRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityFetchOffersRequest: """Create an instance of EligibilityFetchOffersRequest from a JSON string""" - if "queries, filters" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["queries, filters"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 1f27bf7..64ba0d1 100644 --- a/cashfree_pg/models/eligibility_fetch_paylater_request.py +++ b/cashfree_pg/models/eligibility_fetch_paylater_request.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> EligibilityFetchPaylaterRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityFetchPaylaterRequest: """Create an instance of EligibilityFetchPaylaterRequest from a JSON string""" - if "queries" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["queries"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b0d782a..658350c 100644 --- a/cashfree_pg/models/eligibility_fetch_payment_methods_request.py +++ b/cashfree_pg/models/eligibility_fetch_payment_methods_request.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> EligibilityFetchPaymentMethodsRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityFetchPaymentMethodsRequest: """Create an instance of EligibilityFetchPaymentMethodsRequest from a JSON string""" - if "queries, filters" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["queries, filters"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 160495f..469337d 100644 --- a/cashfree_pg/models/eligibility_offer_entity.py +++ b/cashfree_pg/models/eligibility_offer_entity.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> EligibilityOfferEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityOfferEntity: """Create an instance of EligibilityOfferEntity from a JSON string""" - if "eligibility, entity_type, entity_value, entity_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["eligibility, entity_type, entity_value, entity_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b25de12..2c27520 100644 --- a/cashfree_pg/models/eligibility_paylater_entity.py +++ b/cashfree_pg/models/eligibility_paylater_entity.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> EligibilityPaylaterEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityPaylaterEntity: """Create an instance of EligibilityPaylaterEntity from a JSON string""" - if "eligibility, entity_type, entity_value, entity_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["eligibility, entity_type, entity_value, entity_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 4d4316d..fd95349 100644 --- a/cashfree_pg/models/eligibility_payment_methods_entity.py +++ b/cashfree_pg/models/eligibility_payment_methods_entity.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> EligibilityPaymentMethodsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityPaymentMethodsEntity: """Create an instance of EligibilityPaymentMethodsEntity from a JSON string""" - if "eligibility, entity_type, entity_value, entity_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["eligibility, entity_type, entity_value, entity_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 c366e1d..660161a 100644 --- a/cashfree_pg/models/eligibility_payment_methods_entity_entity_details.py +++ b/cashfree_pg/models/eligibility_payment_methods_entity_entity_details.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> EligibilityPaymentMethodsEntityEntityDetail @classmethod def from_json_for_one_of(cls, json_str: str) -> EligibilityPaymentMethodsEntityEntityDetails: """Create an instance of EligibilityPaymentMethodsEntityEntityDetails from a JSON string""" - if "payment_method_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["payment_method_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/emi_offer.py b/cashfree_pg/models/emi_offer.py index 6ec259f..0aa4033 100644 --- a/cashfree_pg/models/emi_offer.py +++ b/cashfree_pg/models/emi_offer.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> EMIOffer: @classmethod def from_json_for_one_of(cls, json_str: str) -> EMIOffer: """Create an instance of EMIOffer from a JSON string""" - if "type, issuer, tenures" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["type, issuer, tenures"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 13d4c1b..17e6f5e 100644 --- a/cashfree_pg/models/emi_plans_array.py +++ b/cashfree_pg/models/emi_plans_array.py @@ -55,9 +55,10 @@ def from_json(cls, json_str: str) -> EMIPlansArray: @classmethod def from_json_for_one_of(cls, json_str: str) -> EMIPlansArray: """Create an instance of EMIPlansArray from a JSON string""" - if "tenure, interest_rate, currency, emi, total_interest, total_amount" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["tenure, interest_rate, currency, emi, total_interest, total_amount"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 2eb9998..5049b07 100644 --- a/cashfree_pg/models/error_details_in_payments_entity.py +++ b/cashfree_pg/models/error_details_in_payments_entity.py @@ -56,9 +56,10 @@ def from_json(cls, json_str: str) -> ErrorDetailsInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> ErrorDetailsInPaymentsEntity: """Create an instance of ErrorDetailsInPaymentsEntity from a JSON string""" - if "error_code, error_description, error_reason, error_source, error_code_raw, error_description_raw, error_subcode_raw" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["error_code, error_description, error_reason, error_source, error_code_raw, error_description_raw, error_subcode_raw"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 ffe6a82..f351458 100644 --- a/cashfree_pg/models/fetch_recon_request.py +++ b/cashfree_pg/models/fetch_recon_request.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> FetchReconRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchReconRequest: """Create an instance of FetchReconRequest from a JSON string""" - if "pagination, filters" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["pagination, filters"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 c6f9efa..47732f2 100644 --- a/cashfree_pg/models/fetch_recon_request_filters.py +++ b/cashfree_pg/models/fetch_recon_request_filters.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> FetchReconRequestFilters: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchReconRequestFilters: """Create an instance of FetchReconRequestFilters from a JSON string""" - if "start_date, end_date" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["start_date, end_date"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 51f342c..bb1aaca 100644 --- a/cashfree_pg/models/fetch_recon_request_pagination.py +++ b/cashfree_pg/models/fetch_recon_request_pagination.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> FetchReconRequestPagination: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchReconRequestPagination: """Create an instance of FetchReconRequestPagination from a JSON string""" - if "limit, cursor" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["limit, cursor"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 0d94f92..1628f92 100644 --- a/cashfree_pg/models/fetch_settlements_request.py +++ b/cashfree_pg/models/fetch_settlements_request.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> FetchSettlementsRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchSettlementsRequest: """Create an instance of FetchSettlementsRequest from a JSON string""" - if "pagination, filters" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["pagination, filters"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 d7193e5..e6783d8 100644 --- a/cashfree_pg/models/fetch_settlements_request_filters.py +++ b/cashfree_pg/models/fetch_settlements_request_filters.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> FetchSettlementsRequestFilters: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchSettlementsRequestFilters: """Create an instance of FetchSettlementsRequestFilters from a JSON string""" - if "cf_settlement_ids, settlement_utrs, start_date, end_date" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cf_settlement_ids, settlement_utrs, start_date, end_date"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 dd04205..7144292 100644 --- a/cashfree_pg/models/fetch_settlements_request_pagination.py +++ b/cashfree_pg/models/fetch_settlements_request_pagination.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> FetchSettlementsRequestPagination: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchSettlementsRequestPagination: """Create an instance of FetchSettlementsRequestPagination from a JSON string""" - if "limit, cursor" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["limit, cursor"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 abdd904..9174cea 100644 --- a/cashfree_pg/models/fetch_terminal_qr_codes_entity.py +++ b/cashfree_pg/models/fetch_terminal_qr_codes_entity.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> FetchTerminalQRCodesEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> FetchTerminalQRCodesEntity: """Create an instance of FetchTerminalQRCodesEntity from a JSON string""" - if "bank, qrCode, qrCodeUrl, status" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["bank, qrCode, qrCodeUrl, status"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/idempotency_error.py b/cashfree_pg/models/idempotency_error.py index bdc4437..889e535 100644 --- a/cashfree_pg/models/idempotency_error.py +++ b/cashfree_pg/models/idempotency_error.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> IdempotencyError: @classmethod def from_json_for_one_of(cls, json_str: str) -> IdempotencyError: """Create an instance of IdempotencyError from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/instrument_entity.py b/cashfree_pg/models/instrument_entity.py index b560272..ff0b18f 100644 --- a/cashfree_pg/models/instrument_entity.py +++ b/cashfree_pg/models/instrument_entity.py @@ -79,9 +79,10 @@ def from_json(cls, json_str: str) -> InstrumentEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> InstrumentEntity: """Create an instance of InstrumentEntity from a JSON string""" - if "customer_id, afa_reference, instrument_id, instrument_type, instrument_uid, instrument_display, instrument_status, created_at, instrument_meta" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["customer_id, afa_reference, instrument_id, instrument_type, instrument_uid, instrument_display, instrument_status, created_at, instrument_meta"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/instrument_webhook.py b/cashfree_pg/models/instrument_webhook.py index d00b731..d714d20 100644 --- a/cashfree_pg/models/instrument_webhook.py +++ b/cashfree_pg/models/instrument_webhook.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> InstrumentWebhook: @classmethod def from_json_for_one_of(cls, json_str: str) -> InstrumentWebhook: """Create an instance of InstrumentWebhook from a JSON string""" - if "data" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["data"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 d333676..7de44a5 100644 --- a/cashfree_pg/models/instrument_webhook_data.py +++ b/cashfree_pg/models/instrument_webhook_data.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> InstrumentWebhookData: @classmethod def from_json_for_one_of(cls, json_str: str) -> InstrumentWebhookData: """Create an instance of InstrumentWebhookData from a JSON string""" - if "data, event_time, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["data, event_time, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 1c9f6e8..c276ebc 100644 --- a/cashfree_pg/models/instrument_webhook_data_entity.py +++ b/cashfree_pg/models/instrument_webhook_data_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> InstrumentWebhookDataEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> InstrumentWebhookDataEntity: """Create an instance of InstrumentWebhookDataEntity from a JSON string""" - if "instrument" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["instrument"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 1f5fba2..765ff56 100644 --- a/cashfree_pg/models/link_customer_details_entity.py +++ b/cashfree_pg/models/link_customer_details_entity.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> LinkCustomerDetailsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> LinkCustomerDetailsEntity: """Create an instance of LinkCustomerDetailsEntity from a JSON string""" - if "customer_phone, customer_email, customer_name" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["customer_phone, customer_email, customer_name"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/link_entity.py b/cashfree_pg/models/link_entity.py index 36041ec..531938a 100644 --- a/cashfree_pg/models/link_entity.py +++ b/cashfree_pg/models/link_entity.py @@ -68,9 +68,10 @@ def from_json(cls, json_str: str) -> LinkEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> LinkEntity: """Create an instance of LinkEntity from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/link_meta_entity.py b/cashfree_pg/models/link_meta_entity.py index 372f999..ea12857 100644 --- a/cashfree_pg/models/link_meta_entity.py +++ b/cashfree_pg/models/link_meta_entity.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> LinkMetaEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> LinkMetaEntity: """Create an instance of LinkMetaEntity from a JSON string""" - if "notify_url, upi_intent, return_url, payment_methods" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["notify_url, upi_intent, return_url, payment_methods"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 3075e53..98b097b 100644 --- a/cashfree_pg/models/link_notify_entity.py +++ b/cashfree_pg/models/link_notify_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> LinkNotifyEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> LinkNotifyEntity: """Create an instance of LinkNotifyEntity from a JSON string""" - if "send_sms, send_email" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["send_sms, send_email"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b823c93..a562447 100644 --- a/cashfree_pg/models/net_banking_payment_method.py +++ b/cashfree_pg/models/net_banking_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> NetBankingPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> NetBankingPaymentMethod: """Create an instance of NetBankingPaymentMethod from a JSON string""" - if "netbanking" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["netbanking"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/netbanking.py b/cashfree_pg/models/netbanking.py index 99b7cb4..b556a90 100644 --- a/cashfree_pg/models/netbanking.py +++ b/cashfree_pg/models/netbanking.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> Netbanking: @classmethod def from_json_for_one_of(cls, json_str: str) -> Netbanking: """Create an instance of Netbanking from a JSON string""" - if "channel, netbanking_bank_code, netbanking_bank_name" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, netbanking_bank_code, netbanking_bank_name"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_all.py b/cashfree_pg/models/offer_all.py index 3dbf325..c5d8504 100644 --- a/cashfree_pg/models/offer_all.py +++ b/cashfree_pg/models/offer_all.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> OfferAll: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferAll: """Create an instance of OfferAll from a JSON string""" - if "all" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["all"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_card.py b/cashfree_pg/models/offer_card.py index b0da2d8..7fb7dae 100644 --- a/cashfree_pg/models/offer_card.py +++ b/cashfree_pg/models/offer_card.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferCard: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferCard: """Create an instance of OfferCard from a JSON string""" - if "card" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["card"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_details.py b/cashfree_pg/models/offer_details.py index a682421..761ca4f 100644 --- a/cashfree_pg/models/offer_details.py +++ b/cashfree_pg/models/offer_details.py @@ -61,9 +61,10 @@ def from_json(cls, json_str: str) -> OfferDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferDetails: """Create an instance of OfferDetails from a JSON string""" - if "offer_type, discount_details, cashback_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["offer_type, discount_details, cashback_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_emi.py b/cashfree_pg/models/offer_emi.py index 878c87e..70067a1 100644 --- a/cashfree_pg/models/offer_emi.py +++ b/cashfree_pg/models/offer_emi.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferEMI: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferEMI: """Create an instance of OfferEMI from a JSON string""" - if "emi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["emi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_entity.py b/cashfree_pg/models/offer_entity.py index d1f9797..0ea0ce0 100644 --- a/cashfree_pg/models/offer_entity.py +++ b/cashfree_pg/models/offer_entity.py @@ -59,9 +59,10 @@ def from_json(cls, json_str: str) -> OfferEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferEntity: """Create an instance of OfferEntity from a JSON string""" - if "offer_id, offer_status, offer_meta, offer_tnc, offer_details, offer_validations" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["offer_id, offer_status, offer_meta, offer_tnc, offer_details, offer_validations"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_filters.py b/cashfree_pg/models/offer_filters.py index 0e964c2..dd80029 100644 --- a/cashfree_pg/models/offer_filters.py +++ b/cashfree_pg/models/offer_filters.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferFilters: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferFilters: """Create an instance of OfferFilters from a JSON string""" - if "offer_type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["offer_type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_meta.py b/cashfree_pg/models/offer_meta.py index df0b27a..3523957 100644 --- a/cashfree_pg/models/offer_meta.py +++ b/cashfree_pg/models/offer_meta.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> OfferMeta: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferMeta: """Create an instance of OfferMeta from a JSON string""" - if "offer_title, offer_description, offer_code, offer_start_time, offer_end_time" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["offer_title, offer_description, offer_code, offer_start_time, offer_end_time"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_nb.py b/cashfree_pg/models/offer_nb.py index 1d888ef..a1dd6f8 100644 --- a/cashfree_pg/models/offer_nb.py +++ b/cashfree_pg/models/offer_nb.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferNB: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferNB: """Create an instance of OfferNB from a JSON string""" - if "netbanking" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["netbanking"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 d08b56b..826304c 100644 --- a/cashfree_pg/models/offer_nb_netbanking.py +++ b/cashfree_pg/models/offer_nb_netbanking.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> OfferNBNetbanking: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferNBNetbanking: """Create an instance of OfferNBNetbanking from a JSON string""" - if "bank_name" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["bank_name"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_paylater.py b/cashfree_pg/models/offer_paylater.py index ef8e1e8..6a023c3 100644 --- a/cashfree_pg/models/offer_paylater.py +++ b/cashfree_pg/models/offer_paylater.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferPaylater: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferPaylater: """Create an instance of OfferPaylater from a JSON string""" - if "paylater" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["paylater"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_queries.py b/cashfree_pg/models/offer_queries.py index df81865..0214b96 100644 --- a/cashfree_pg/models/offer_queries.py +++ b/cashfree_pg/models/offer_queries.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferQueries: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferQueries: """Create an instance of OfferQueries from a JSON string""" - if "order_id, amount" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["order_id, amount"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_tnc.py b/cashfree_pg/models/offer_tnc.py index 19a7741..306cbb5 100644 --- a/cashfree_pg/models/offer_tnc.py +++ b/cashfree_pg/models/offer_tnc.py @@ -58,9 +58,10 @@ def from_json(cls, json_str: str) -> OfferTnc: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferTnc: """Create an instance of OfferTnc from a JSON string""" - if "offer_tnc_type, offer_tnc_value" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["offer_tnc_type, offer_tnc_value"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_upi.py b/cashfree_pg/models/offer_upi.py index 195e08e..420cb6e 100644 --- a/cashfree_pg/models/offer_upi.py +++ b/cashfree_pg/models/offer_upi.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> OfferUPI: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferUPI: """Create an instance of OfferUPI from a JSON string""" - if "upi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["upi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_validations.py b/cashfree_pg/models/offer_validations.py index 948dbe9..0e9c99e 100644 --- a/cashfree_pg/models/offer_validations.py +++ b/cashfree_pg/models/offer_validations.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> OfferValidations: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferValidations: """Create an instance of OfferValidations from a JSON string""" - if "min_amount, payment_method, max_allowed" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["min_amount, payment_method, max_allowed"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/offer_wallet.py b/cashfree_pg/models/offer_wallet.py index 1a5541f..e52f11d 100644 --- a/cashfree_pg/models/offer_wallet.py +++ b/cashfree_pg/models/offer_wallet.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> OfferWallet: @classmethod def from_json_for_one_of(cls, json_str: str) -> OfferWallet: """Create an instance of OfferWallet from a JSON string""" - if "app" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["app"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 6b7073e..1703306 100644 --- a/cashfree_pg/models/order_authenticate_entity.py +++ b/cashfree_pg/models/order_authenticate_entity.py @@ -73,9 +73,10 @@ def from_json(cls, json_str: str) -> OrderAuthenticateEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> OrderAuthenticateEntity: """Create an instance of OrderAuthenticateEntity from a JSON string""" - if "cf_payment_id, action, authenticate_status, payment_message" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cf_payment_id, action, authenticate_status, payment_message"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 af77e80..da5670e 100644 --- a/cashfree_pg/models/order_authenticate_payment_request.py +++ b/cashfree_pg/models/order_authenticate_payment_request.py @@ -58,9 +58,10 @@ def from_json(cls, json_str: str) -> OrderAuthenticatePaymentRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> OrderAuthenticatePaymentRequest: """Create an instance of OrderAuthenticatePaymentRequest from a JSON string""" - if "otp, action" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["otp, action"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 6868117..03eac1d 100644 --- a/cashfree_pg/models/order_create_refund_request.py +++ b/cashfree_pg/models/order_create_refund_request.py @@ -65,9 +65,10 @@ def from_json(cls, json_str: str) -> OrderCreateRefundRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> OrderCreateRefundRequest: """Create an instance of OrderCreateRefundRequest from a JSON string""" - if "refund_amount, refund_id, refund_note, refund_speed, refund_splits" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["refund_amount, refund_id, refund_note, refund_speed, refund_splits"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/order_entity.py b/cashfree_pg/models/order_entity.py index f5f3822..738fea9 100644 --- a/cashfree_pg/models/order_entity.py +++ b/cashfree_pg/models/order_entity.py @@ -72,9 +72,10 @@ def from_json(cls, json_str: str) -> OrderEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> OrderEntity: """Create an instance of OrderEntity from a JSON string""" - if "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, payments, settlements, refunds, order_tags" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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, payments, settlements, refunds, order_tags"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/order_meta.py b/cashfree_pg/models/order_meta.py index 38946a2..b04c7b9 100644 --- a/cashfree_pg/models/order_meta.py +++ b/cashfree_pg/models/order_meta.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> OrderMeta: @classmethod def from_json_for_one_of(cls, json_str: str) -> OrderMeta: """Create an instance of OrderMeta from a JSON string""" - if "return_url, notify_url, payment_methods" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["return_url, notify_url, payment_methods"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 604803d..adbf630 100644 --- a/cashfree_pg/models/order_pay_data.py +++ b/cashfree_pg/models/order_pay_data.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> OrderPayData: @classmethod def from_json_for_one_of(cls, json_str: str) -> OrderPayData: """Create an instance of OrderPayData from a JSON string""" - if "url, payload, content_type, method" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["url, payload, content_type, method"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 f86daff..165b6b1 100644 --- a/cashfree_pg/models/pay_order_entity.py +++ b/cashfree_pg/models/pay_order_entity.py @@ -86,9 +86,10 @@ def from_json(cls, json_str: str) -> PayOrderEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PayOrderEntity: """Create an instance of PayOrderEntity from a JSON string""" - if "payment_amount, cf_payment_id, payment_method, channel, action, data" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["payment_amount, cf_payment_id, payment_method, channel, action, data"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 9ee4904..102325c 100644 --- a/cashfree_pg/models/pay_order_request.py +++ b/cashfree_pg/models/pay_order_request.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> PayOrderRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> PayOrderRequest: """Create an instance of PayOrderRequest from a JSON string""" - if "payment_session_id, payment_method, save_instrument, offer_id" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["payment_session_id, payment_method, save_instrument, offer_id"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/paylater.py b/cashfree_pg/models/paylater.py index 5ba36fe..f019425 100644 --- a/cashfree_pg/models/paylater.py +++ b/cashfree_pg/models/paylater.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> Paylater: @classmethod def from_json_for_one_of(cls, json_str: str) -> Paylater: """Create an instance of Paylater from a JSON string""" - if "channel, provider, phone" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, provider, phone"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/paylater_entity.py b/cashfree_pg/models/paylater_entity.py index 64a8572..c091d6e 100644 --- a/cashfree_pg/models/paylater_entity.py +++ b/cashfree_pg/models/paylater_entity.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> PaylaterEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaylaterEntity: """Create an instance of PaylaterEntity from a JSON string""" - if "payment_method" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["payment_method"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/paylater_offer.py b/cashfree_pg/models/paylater_offer.py index f6bf2ee..2473387 100644 --- a/cashfree_pg/models/paylater_offer.py +++ b/cashfree_pg/models/paylater_offer.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> PaylaterOffer: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaylaterOffer: """Create an instance of PaylaterOffer from a JSON string""" - if "provider" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["provider"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 2188cca..e603f16 100644 --- a/cashfree_pg/models/paylater_payment_method.py +++ b/cashfree_pg/models/paylater_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaylaterPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaylaterPaymentMethod: """Create an instance of PaylaterPaymentMethod from a JSON string""" - if "paylater" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["paylater"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/payment_entity.py b/cashfree_pg/models/payment_entity.py index fb76350..5362658 100644 --- a/cashfree_pg/models/payment_entity.py +++ b/cashfree_pg/models/payment_entity.py @@ -79,9 +79,10 @@ def from_json(cls, json_str: str) -> PaymentEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentEntity: """Create an instance of PaymentEntity from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 b301149..00916bc 100644 --- a/cashfree_pg/models/payment_link_customer_details.py +++ b/cashfree_pg/models/payment_link_customer_details.py @@ -56,9 +56,10 @@ def from_json(cls, json_str: str) -> PaymentLinkCustomerDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentLinkCustomerDetails: """Create an instance of PaymentLinkCustomerDetails from a JSON string""" - if "customer_id, customer_email, customer_phone, customer_name, customer_bank_account_number, customer_bank_ifsc, customer_bank_code" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["customer_id, customer_email, customer_phone, customer_name, customer_bank_account_number, customer_bank_ifsc, customer_bank_code"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 ea43018..06af4b2 100644 --- a/cashfree_pg/models/payment_link_order_entity.py +++ b/cashfree_pg/models/payment_link_order_entity.py @@ -73,9 +73,10 @@ def from_json(cls, json_str: str) -> PaymentLinkOrderEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentLinkOrderEntity: """Create an instance of PaymentLinkOrderEntity from a JSON string""" - if "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, payments, settlements, refunds, order_tags" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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, payments, settlements, refunds, order_tags"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 d7046c4..719c43b 100644 --- a/cashfree_pg/models/payment_method_app_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_app_in_payments_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodAppInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodAppInPaymentsEntity: """Create an instance of PaymentMethodAppInPaymentsEntity from a JSON string""" - if "app" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["app"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 e9e138b..bdf2ed9 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 @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> PaymentMethodAppInPaymentsEntityApp: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodAppInPaymentsEntityApp: """Create an instance of PaymentMethodAppInPaymentsEntityApp from a JSON string""" - if "channel, provider, phone" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, provider, phone"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 5888080..491ce99 100644 --- a/cashfree_pg/models/payment_method_card_emiin_payments_entity.py +++ b/cashfree_pg/models/payment_method_card_emiin_payments_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodCardEMIInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodCardEMIInPaymentsEntity: """Create an instance of PaymentMethodCardEMIInPaymentsEntity from a JSON string""" - if "emi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["emi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 33f5fce..e0a2307 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 @@ -59,9 +59,10 @@ def from_json(cls, json_str: str) -> PaymentMethodCardEMIInPaymentsEntityEmi: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodCardEMIInPaymentsEntityEmi: """Create an instance of PaymentMethodCardEMIInPaymentsEntityEmi from a JSON string""" - if "channel, card_number, card_network, card_type, card_country, card_bank_name, card_network_reference_id, emi_tenure, emi_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, card_number, card_network, card_type, card_country, card_bank_name, card_network_reference_id, emi_tenure, emi_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 78603d8..955bf8e 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 @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> PaymentMethodCardEMIInPaymentsEntityEmiEmiD @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails: """Create an instance of PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails from a JSON string""" - if "emi_amount, emi_tenure, emi_interest" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["emi_amount, emi_tenure, emi_interest"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 a172906..b9c681f 100644 --- a/cashfree_pg/models/payment_method_card_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_card_in_payments_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodCardInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodCardInPaymentsEntity: """Create an instance of PaymentMethodCardInPaymentsEntity from a JSON string""" - if "card" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["card"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 d18e472..15c39ef 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 @@ -56,9 +56,10 @@ def from_json(cls, json_str: str) -> PaymentMethodCardInPaymentsEntityCard: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodCardInPaymentsEntityCard: """Create an instance of PaymentMethodCardInPaymentsEntityCard from a JSON string""" - if "channel, card_number, card_network, card_type, card_country, card_bank_name, card_network_reference_id" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, card_number, card_network, card_type, card_country, card_bank_name, card_network_reference_id"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 bf2e1e4..a12adf4 100644 --- a/cashfree_pg/models/payment_method_cardless_emiin_payments_entity.py +++ b/cashfree_pg/models/payment_method_cardless_emiin_payments_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodCardlessEMIInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodCardlessEMIInPaymentsEntity: """Create an instance of PaymentMethodCardlessEMIInPaymentsEntity from a JSON string""" - if "cardless_emi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cardless_emi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 e12a0e9..6b791b2 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 @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodNetBankingInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodNetBankingInPaymentsEntity: """Create an instance of PaymentMethodNetBankingInPaymentsEntity from a JSON string""" - if "netbanking" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["netbanking"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 14ea6f8..614d284 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 @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> PaymentMethodNetBankingInPaymentsEntityNetb @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodNetBankingInPaymentsEntityNetbanking: """Create an instance of PaymentMethodNetBankingInPaymentsEntityNetbanking from a JSON string""" - if "channel, netbanking_bank_code, netbanking_bank_name" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, netbanking_bank_code, netbanking_bank_name"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 8e32489..e724837 100644 --- a/cashfree_pg/models/payment_method_paylater_in_payments_entity.py +++ b/cashfree_pg/models/payment_method_paylater_in_payments_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodPaylaterInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodPaylaterInPaymentsEntity: """Create an instance of PaymentMethodPaylaterInPaymentsEntity from a JSON string""" - if "paylater" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["paylater"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 6474622..f964841 100644 --- a/cashfree_pg/models/payment_method_upiin_payments_entity.py +++ b/cashfree_pg/models/payment_method_upiin_payments_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodUPIInPaymentsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodUPIInPaymentsEntity: """Create an instance of PaymentMethodUPIInPaymentsEntity from a JSON string""" - if "upi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["upi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 97a3349..d61903f 100644 --- a/cashfree_pg/models/payment_method_upiin_payments_entity_upi.py +++ b/cashfree_pg/models/payment_method_upiin_payments_entity_upi.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodUPIInPaymentsEntityUpi: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodUPIInPaymentsEntityUpi: """Create an instance of PaymentMethodUPIInPaymentsEntityUpi from a JSON string""" - if "channel, upi_id" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, upi_id"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 113db62..d3059b1 100644 --- a/cashfree_pg/models/payment_methods_filters.py +++ b/cashfree_pg/models/payment_methods_filters.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> PaymentMethodsFilters: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodsFilters: """Create an instance of PaymentMethodsFilters from a JSON string""" - if "payment_methods" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["payment_methods"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 6de0e6a..6d477d0 100644 --- a/cashfree_pg/models/payment_methods_queries.py +++ b/cashfree_pg/models/payment_methods_queries.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> PaymentMethodsQueries: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentMethodsQueries: """Create an instance of PaymentMethodsQueries from a JSON string""" - if "amount, order_id" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["amount, order_id"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 f9828e9..25a6ced 100644 --- a/cashfree_pg/models/payment_mode_details.py +++ b/cashfree_pg/models/payment_mode_details.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> PaymentModeDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentModeDetails: """Create an instance of PaymentModeDetails from a JSON string""" - if "nick, display, eligibility, code" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["nick, display, eligibility, code"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/payment_url_object.py b/cashfree_pg/models/payment_url_object.py index 6b10711..ebddd67 100644 --- a/cashfree_pg/models/payment_url_object.py +++ b/cashfree_pg/models/payment_url_object.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> PaymentURLObject: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentURLObject: """Create an instance of PaymentURLObject from a JSON string""" - if "url" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["url"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/payment_webhook.py b/cashfree_pg/models/payment_webhook.py index cfaff9e..b4c96d1 100644 --- a/cashfree_pg/models/payment_webhook.py +++ b/cashfree_pg/models/payment_webhook.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> PaymentWebhook: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentWebhook: """Create an instance of PaymentWebhook from a JSON string""" - if "data, event_time, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["data, event_time, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 4c63cab..2e4522d 100644 --- a/cashfree_pg/models/payment_webhook_customer_entity.py +++ b/cashfree_pg/models/payment_webhook_customer_entity.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> PaymentWebhookCustomerEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentWebhookCustomerEntity: """Create an instance of PaymentWebhookCustomerEntity from a JSON string""" - if "customer_name, customer_id, customer_email, customer_phone" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["customer_name, customer_id, customer_email, customer_phone"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 7876068..9813fb2 100644 --- a/cashfree_pg/models/payment_webhook_data_entity.py +++ b/cashfree_pg/models/payment_webhook_data_entity.py @@ -61,9 +61,10 @@ def from_json(cls, json_str: str) -> PaymentWebhookDataEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentWebhookDataEntity: """Create an instance of PaymentWebhookDataEntity from a JSON string""" - if "order, payment, customer_details, error_details, payment_gateway_details, payment_offers" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["order, payment, customer_details, error_details, payment_gateway_details, payment_offers"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 f01020f..2129709 100644 --- a/cashfree_pg/models/payment_webhook_error_entity.py +++ b/cashfree_pg/models/payment_webhook_error_entity.py @@ -55,9 +55,10 @@ def from_json(cls, json_str: str) -> PaymentWebhookErrorEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentWebhookErrorEntity: """Create an instance of PaymentWebhookErrorEntity from a JSON string""" - if "error_code, error_description, error_reason, error_source, error_code_raw, error_description_raw" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["error_code, error_description, error_reason, error_source, error_code_raw, error_description_raw"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 ac60dff..dc04d9d 100644 --- a/cashfree_pg/models/payment_webhook_gateway_details_entity.py +++ b/cashfree_pg/models/payment_webhook_gateway_details_entity.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> PaymentWebhookGatewayDetailsEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentWebhookGatewayDetailsEntity: """Create an instance of PaymentWebhookGatewayDetailsEntity from a JSON string""" - if "gateway_name, gateway_order_id, gateway_payment_id, gateway_status_code, gateway_settlement" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["gateway_name, gateway_order_id, gateway_payment_id, gateway_status_code, gateway_settlement"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 c0d84a7..114c743 100644 --- a/cashfree_pg/models/payment_webhook_order_entity.py +++ b/cashfree_pg/models/payment_webhook_order_entity.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> PaymentWebhookOrderEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> PaymentWebhookOrderEntity: """Create an instance of PaymentWebhookOrderEntity from a JSON string""" - if "order_id, order_amount, order_currency, order_tags" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["order_id, order_amount, order_currency, order_tags"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 536c5d4..5e29243 100644 --- a/cashfree_pg/models/rate_limit_error.py +++ b/cashfree_pg/models/rate_limit_error.py @@ -62,9 +62,10 @@ def from_json(cls, json_str: str) -> RateLimitError: @classmethod def from_json_for_one_of(cls, json_str: str) -> RateLimitError: """Create an instance of RateLimitError from a JSON string""" - if "message, code, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["message, code, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/recon_entity.py b/cashfree_pg/models/recon_entity.py index 9cea1f3..716ad0f 100644 --- a/cashfree_pg/models/recon_entity.py +++ b/cashfree_pg/models/recon_entity.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> ReconEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> ReconEntity: """Create an instance of ReconEntity from a JSON string""" - if "cursor, limit, data" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cursor, limit, data"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 7977349..f2cd118 100644 --- a/cashfree_pg/models/recon_entity_data_inner.py +++ b/cashfree_pg/models/recon_entity_data_inner.py @@ -96,9 +96,10 @@ def from_json(cls, json_str: str) -> ReconEntityDataInner: @classmethod def from_json_for_one_of(cls, json_str: str) -> ReconEntityDataInner: """Create an instance of ReconEntityDataInner from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/refund_entity.py b/cashfree_pg/models/refund_entity.py index 681cd34..e43d80e 100644 --- a/cashfree_pg/models/refund_entity.py +++ b/cashfree_pg/models/refund_entity.py @@ -110,9 +110,10 @@ def from_json(cls, json_str: str) -> RefundEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> RefundEntity: """Create an instance of RefundEntity from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/refund_speed.py b/cashfree_pg/models/refund_speed.py index 9cee469..4571be8 100644 --- a/cashfree_pg/models/refund_speed.py +++ b/cashfree_pg/models/refund_speed.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> RefundSpeed: @classmethod def from_json_for_one_of(cls, json_str: str) -> RefundSpeed: """Create an instance of RefundSpeed from a JSON string""" - if "requested, accepted, processed, message" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["requested, accepted, processed, message"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/refund_url_object.py b/cashfree_pg/models/refund_url_object.py index 86c02cd..1a77db4 100644 --- a/cashfree_pg/models/refund_url_object.py +++ b/cashfree_pg/models/refund_url_object.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> RefundURLObject: @classmethod def from_json_for_one_of(cls, json_str: str) -> RefundURLObject: """Create an instance of RefundURLObject from a JSON string""" - if "url" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["url"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/refund_webhook.py b/cashfree_pg/models/refund_webhook.py index 87530ef..55a506a 100644 --- a/cashfree_pg/models/refund_webhook.py +++ b/cashfree_pg/models/refund_webhook.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> RefundWebhook: @classmethod def from_json_for_one_of(cls, json_str: str) -> RefundWebhook: """Create an instance of RefundWebhook from a JSON string""" - if "data, event_time, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["data, event_time, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 12bd24e..89b0937 100644 --- a/cashfree_pg/models/refund_webhook_data_entity.py +++ b/cashfree_pg/models/refund_webhook_data_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> RefundWebhookDataEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> RefundWebhookDataEntity: """Create an instance of RefundWebhookDataEntity from a JSON string""" - if "refund" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["refund"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 3a4c35a..193caba 100644 --- a/cashfree_pg/models/saved_instrument_meta.py +++ b/cashfree_pg/models/saved_instrument_meta.py @@ -54,9 +54,10 @@ def from_json(cls, json_str: str) -> SavedInstrumentMeta: @classmethod def from_json_for_one_of(cls, json_str: str) -> SavedInstrumentMeta: """Create an instance of SavedInstrumentMeta from a JSON string""" - if "card_network, card_bank_name, card_country, card_type, card_token_details" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["card_network, card_bank_name, card_country, card_type, card_token_details"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_entity.py b/cashfree_pg/models/settlement_entity.py index 1f9de93..13212da 100644 --- a/cashfree_pg/models/settlement_entity.py +++ b/cashfree_pg/models/settlement_entity.py @@ -63,9 +63,10 @@ def from_json(cls, json_str: str) -> SettlementEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementEntity: """Create an instance of SettlementEntity from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 a8cd2ef..1228f25 100644 --- a/cashfree_pg/models/settlement_fetch_recon_request.py +++ b/cashfree_pg/models/settlement_fetch_recon_request.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> SettlementFetchReconRequest: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementFetchReconRequest: """Create an instance of SettlementFetchReconRequest from a JSON string""" - if "pagination, filters" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["pagination, filters"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_fetch_recon_request_filters.py b/cashfree_pg/models/settlement_fetch_recon_request_filters.py index f64cfe5..7168494 100644 --- a/cashfree_pg/models/settlement_fetch_recon_request_filters.py +++ b/cashfree_pg/models/settlement_fetch_recon_request_filters.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> SettlementFetchReconRequestFilters: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementFetchReconRequestFilters: """Create an instance of SettlementFetchReconRequestFilters from a JSON string""" - if "cf_settlement_ids, settlement_utrs, start_date, end_date" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cf_settlement_ids, settlement_utrs, start_date, end_date"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 42e4e9d..289f139 100644 --- a/cashfree_pg/models/settlement_recon_entity.py +++ b/cashfree_pg/models/settlement_recon_entity.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> SettlementReconEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementReconEntity: """Create an instance of SettlementReconEntity from a JSON string""" - if "cursor, limit, data" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cursor, limit, data"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 5d1dfc4..3f107f2 100644 --- a/cashfree_pg/models/settlement_recon_entity_data_inner.py +++ b/cashfree_pg/models/settlement_recon_entity_data_inner.py @@ -84,9 +84,10 @@ def from_json(cls, json_str: str) -> SettlementReconEntityDataInner: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementReconEntityDataInner: """Create an instance of SettlementReconEntityDataInner from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_url_object.py b/cashfree_pg/models/settlement_url_object.py index 661dd19..bd8793c 100644 --- a/cashfree_pg/models/settlement_url_object.py +++ b/cashfree_pg/models/settlement_url_object.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> SettlementURLObject: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementURLObject: """Create an instance of SettlementURLObject from a JSON string""" - if "url" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["url"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/settlement_webhook.py b/cashfree_pg/models/settlement_webhook.py index 3a57f4a..cbc8774 100644 --- a/cashfree_pg/models/settlement_webhook.py +++ b/cashfree_pg/models/settlement_webhook.py @@ -53,9 +53,10 @@ def from_json(cls, json_str: str) -> SettlementWebhook: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementWebhook: """Create an instance of SettlementWebhook from a JSON string""" - if "data, event_time, type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["data, event_time, type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 27ff932..c2e3895 100644 --- a/cashfree_pg/models/settlement_webhook_data_entity.py +++ b/cashfree_pg/models/settlement_webhook_data_entity.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> SettlementWebhookDataEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> SettlementWebhookDataEntity: """Create an instance of SettlementWebhookDataEntity from a JSON string""" - if "settlement" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["settlement"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_details.py b/cashfree_pg/models/terminal_details.py index f9e0529..e3e6662 100644 --- a/cashfree_pg/models/terminal_details.py +++ b/cashfree_pg/models/terminal_details.py @@ -59,9 +59,10 @@ def from_json(cls, json_str: str) -> TerminalDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> TerminalDetails: """Create an instance of TerminalDetails from a JSON string""" - if "added_on, cf_terminal_id, last_updated_on, terminal_address, terminal_id, terminal_name, terminal_note, terminal_phone_no, terminal_status, terminal_type" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["added_on, cf_terminal_id, last_updated_on, terminal_address, terminal_id, terminal_name, terminal_note, terminal_phone_no, terminal_status, terminal_type"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_entity.py b/cashfree_pg/models/terminal_entity.py index af6feae..1b7f8e0 100644 --- a/cashfree_pg/models/terminal_entity.py +++ b/cashfree_pg/models/terminal_entity.py @@ -61,9 +61,10 @@ def from_json(cls, json_str: str) -> TerminalEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> TerminalEntity: """Create an instance of TerminalEntity from a JSON string""" - if "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" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["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"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/terminal_transaction_entity.py b/cashfree_pg/models/terminal_transaction_entity.py index 4233b48..f36029f 100644 --- a/cashfree_pg/models/terminal_transaction_entity.py +++ b/cashfree_pg/models/terminal_transaction_entity.py @@ -55,9 +55,10 @@ def from_json(cls, json_str: str) -> TerminalTransactionEntity: @classmethod def from_json_for_one_of(cls, json_str: str) -> TerminalTransactionEntity: """Create an instance of TerminalTransactionEntity from a JSON string""" - if "cf_payment_id, payment_amount, payment_method, payment_url, qrcode, timeout" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["cf_payment_id, payment_amount, payment_method, payment_url, qrcode, timeout"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/upi.py b/cashfree_pg/models/upi.py index f05a87c..395cd9e 100644 --- a/cashfree_pg/models/upi.py +++ b/cashfree_pg/models/upi.py @@ -63,9 +63,10 @@ def from_json(cls, json_str: str) -> Upi: @classmethod def from_json_for_one_of(cls, json_str: str) -> Upi: """Create an instance of Upi from a JSON string""" - if "channel, upi_id, upi_redirect_url, upi_expiry_minutes, authorize_only, authorization" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["channel, upi_id, upi_redirect_url, upi_expiry_minutes, authorize_only, authorization"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 32f5319..cbd81b9 100644 --- a/cashfree_pg/models/upi_authorize_details.py +++ b/cashfree_pg/models/upi_authorize_details.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> UPIAuthorizeDetails: @classmethod def from_json_for_one_of(cls, json_str: str) -> UPIAuthorizeDetails: """Create an instance of UPIAuthorizeDetails from a JSON string""" - if "approve_by, start_time, end_time" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["approve_by, start_time, end_time"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary 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 512be76..68f7f4f 100644 --- a/cashfree_pg/models/upi_payment_method.py +++ b/cashfree_pg/models/upi_payment_method.py @@ -51,9 +51,10 @@ def from_json(cls, json_str: str) -> UPIPaymentMethod: @classmethod def from_json_for_one_of(cls, json_str: str) -> UPIPaymentMethod: """Create an instance of UPIPaymentMethod from a JSON string""" - if "upi" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["upi"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/vendor_split.py b/cashfree_pg/models/vendor_split.py index 8eea37e..3cca89f 100644 --- a/cashfree_pg/models/vendor_split.py +++ b/cashfree_pg/models/vendor_split.py @@ -52,9 +52,10 @@ def from_json(cls, json_str: str) -> VendorSplit: @classmethod def from_json_for_one_of(cls, json_str: str) -> VendorSplit: """Create an instance of VendorSplit from a JSON string""" - if "vendor_id, amount, percentage" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["vendor_id, amount, percentage"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/cashfree_pg/models/wallet_offer.py b/cashfree_pg/models/wallet_offer.py index 904080b..0e6c6f9 100644 --- a/cashfree_pg/models/wallet_offer.py +++ b/cashfree_pg/models/wallet_offer.py @@ -50,9 +50,10 @@ def from_json(cls, json_str: str) -> WalletOffer: @classmethod def from_json_for_one_of(cls, json_str: str) -> WalletOffer: """Create an instance of WalletOffer from a JSON string""" - if "provider" not in json_str: - return None - return cls.from_dict(json.loads(json_str)) + temp_dict = json.loads(json_str) + if temp_dict["provider"] in temp_dict.keys(): + return cls.from_dict(json.loads(json_str)) + return None def to_dict(self): """Returns the dictionary representation of the model using alias""" diff --git a/configuration.py b/configuration.py index 9cbd7c9..1d00ee7 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: 2022-09-01\n"\ - "SDK Package Version: 3.2.8".\ + "SDK Package Version: 3.2.10".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/pyproject.toml b/pyproject.toml index c742293..5ca426f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cashfree_pg" -version = "3.2.10" +version = "3.2.11" description = "Cashfree Payment Gateway APIs" authors = ["API Support "] license = "Apache 2.0" diff --git a/setup.py b/setup.py index 48007a2..f8269d5 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "cashfree_pg" -VERSION = "3.2.10" +VERSION = "3.2.11" with open("README.md", "r", encoding="utf-8") as fh: readme = fh.read() PYTHON_REQUIRES = ">=3.7"