Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@classmethod
def de_json(cls, json_string):
obj = cls.check_json(json_string)
id = obj['id']
from_user = User.de_json(obj['from'])
currency = obj['currency']
total_amount = obj['total_amount']
invoice_payload = obj['invoice_payload']
shipping_option_id = obj.get('shipping_option_id')
order_info = None
if 'order_info' in obj:
order_info = OrderInfo.de_json(obj['order_info'])
return cls(id, from_user, currency, total_amount, invoice_payload, shipping_option_id, order_info)
@classmethod
def de_json(cls, json_string):
obj = cls.check_json(json_string)
currency = obj['currency']
total_amount = obj['total_amount']
invoice_payload = obj['invoice_payload']
shipping_option_id = obj.get('shipping_option_id')
order_info = None
if 'order_info' in obj:
order_info = OrderInfo.de_json(obj['order_info'])
telegram_payment_charge_id = obj['telegram_payment_charge_id']
provider_payment_charge_id = obj['provider_payment_charge_id']
return cls(currency, total_amount, invoice_payload, shipping_option_id, order_info,
telegram_payment_charge_id, provider_payment_charge_id)