UNPKG

wallee

Version:
47 lines (46 loc) 2.56 kB
import { ExpressCheckoutWalletTypeFromJSON, ExpressCheckoutWalletTypeToJSON, } from './ExpressCheckoutWalletType'; import { AddressFromJSON, AddressToJSON, } from './Address'; import { ExpressCheckoutSessionStateFromJSON, ExpressCheckoutSessionStateToJSON, } from './ExpressCheckoutSessionState'; import { LineItemFromJSON, } from './LineItem'; import { ExpressCheckoutShippingOptionFromJSON, } from './ExpressCheckoutShippingOption'; /** * Check if a given object implements the ExpressCheckoutSession interface. */ export function instanceOfExpressCheckoutSession(value) { return true; } export function ExpressCheckoutSessionFromJSON(json) { return ExpressCheckoutSessionFromJSONTyped(json, false); } export function ExpressCheckoutSessionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemFromJSON)), 'merchantShippingCallbackUrl': json['merchantShippingCallbackUrl'] == null ? undefined : json['merchantShippingCallbackUrl'], 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'metaData': json['metaData'] == null ? undefined : json['metaData'], 'walletType': json['walletType'] == null ? undefined : ExpressCheckoutWalletTypeFromJSON(json['walletType']), 'shippingAddress': json['shippingAddress'] == null ? undefined : AddressFromJSON(json['shippingAddress']), 'currency': json['currency'] == null ? undefined : json['currency'], 'billingAddress': json['billingAddress'] == null ? undefined : AddressFromJSON(json['billingAddress']), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : ExpressCheckoutSessionStateFromJSON(json['state']), 'shippingOptions': json['shippingOptions'] == null ? undefined : (json['shippingOptions'].map(ExpressCheckoutShippingOptionFromJSON)), }; } export function ExpressCheckoutSessionToJSON(json) { return ExpressCheckoutSessionToJSONTyped(json, false); } export function ExpressCheckoutSessionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'walletType': ExpressCheckoutWalletTypeToJSON(value['walletType']), 'shippingAddress': AddressToJSON(value['shippingAddress']), 'billingAddress': AddressToJSON(value['billingAddress']), 'state': ExpressCheckoutSessionStateToJSON(value['state']), }; }