UNPKG

wallee

Version:
86 lines (85 loc) 5.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfChargeAttempt = instanceOfChargeAttempt; exports.ChargeAttemptFromJSON = ChargeAttemptFromJSON; exports.ChargeAttemptFromJSONTyped = ChargeAttemptFromJSONTyped; exports.ChargeAttemptToJSON = ChargeAttemptToJSON; exports.ChargeAttemptToJSONTyped = ChargeAttemptToJSONTyped; const CustomersPresence_1 = require("./CustomersPresence"); const PaymentConnectorConfiguration_1 = require("./PaymentConnectorConfiguration"); const WalletType_1 = require("./WalletType"); const ChargeAttemptState_1 = require("./ChargeAttemptState"); const ConnectorInvocation_1 = require("./ConnectorInvocation"); const FailureReason_1 = require("./FailureReason"); const TransactionCompletionBehavior_1 = require("./TransactionCompletionBehavior"); const Charge_1 = require("./Charge"); const Label_1 = require("./Label"); const PaymentTerminal_1 = require("./PaymentTerminal"); const TokenVersion_1 = require("./TokenVersion"); const ChargeAttemptEnvironment_1 = require("./ChargeAttemptEnvironment"); /** * Check if a given object implements the ChargeAttempt interface. */ function instanceOfChargeAttempt(value) { return true; } function ChargeAttemptFromJSON(json) { return ChargeAttemptFromJSONTyped(json, false); } function ChargeAttemptFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'language': json['language'] == null ? undefined : json['language'], 'salesChannel': json['salesChannel'] == null ? undefined : json['salesChannel'], 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'initializingTokenVersion': json['initializingTokenVersion'] == null ? undefined : json['initializingTokenVersion'], 'tokenVersion': json['tokenVersion'] == null ? undefined : (0, TokenVersion_1.TokenVersionFromJSON)(json['tokenVersion']), 'succeededOn': json['succeededOn'] == null ? undefined : (new Date(json['succeededOn'])), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : (0, ChargeAttemptState_1.ChargeAttemptStateFromJSON)(json['state']), 'linkedTransaction': json['linkedTransaction'] == null ? undefined : json['linkedTransaction'], 'redirectionUrl': json['redirectionUrl'] == null ? undefined : json['redirectionUrl'], 'charge': json['charge'] == null ? undefined : (0, Charge_1.ChargeFromJSON)(json['charge']), 'wallet': json['wallet'] == null ? undefined : (0, WalletType_1.WalletTypeFromJSON)(json['wallet']), 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'timeZone': json['timeZone'] == null ? undefined : json['timeZone'], 'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'], 'terminal': json['terminal'] == null ? undefined : (0, PaymentTerminal_1.PaymentTerminalFromJSON)(json['terminal']), 'userFailureMessage': json['userFailureMessage'] == null ? undefined : json['userFailureMessage'], 'completionBehavior': json['completionBehavior'] == null ? undefined : (0, TransactionCompletionBehavior_1.TransactionCompletionBehaviorFromJSON)(json['completionBehavior']), 'version': json['version'] == null ? undefined : json['version'], 'labels': json['labels'] == null ? undefined : (new Set(json['labels'].map(Label_1.LabelFromJSON))), 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'timeoutOn': json['timeoutOn'] == null ? undefined : (new Date(json['timeoutOn'])), 'environment': json['environment'] == null ? undefined : (0, ChargeAttemptEnvironment_1.ChargeAttemptEnvironmentFromJSON)(json['environment']), 'invocation': json['invocation'] == null ? undefined : (0, ConnectorInvocation_1.ConnectorInvocationFromJSON)(json['invocation']), 'connectorConfiguration': json['connectorConfiguration'] == null ? undefined : (0, PaymentConnectorConfiguration_1.PaymentConnectorConfigurationFromJSON)(json['connectorConfiguration']), 'nextUpdateOn': json['nextUpdateOn'] == null ? undefined : (new Date(json['nextUpdateOn'])), 'failureReason': json['failureReason'] == null ? undefined : (0, FailureReason_1.FailureReasonFromJSON)(json['failureReason']), 'customersPresence': json['customersPresence'] == null ? undefined : (0, CustomersPresence_1.CustomersPresenceFromJSON)(json['customersPresence']), 'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])), }; } function ChargeAttemptToJSON(json) { return ChargeAttemptToJSONTyped(json, false); } function ChargeAttemptToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'tokenVersion': (0, TokenVersion_1.TokenVersionToJSON)(value['tokenVersion']), 'state': (0, ChargeAttemptState_1.ChargeAttemptStateToJSON)(value['state']), 'charge': (0, Charge_1.ChargeToJSON)(value['charge']), 'wallet': (0, WalletType_1.WalletTypeToJSON)(value['wallet']), 'terminal': (0, PaymentTerminal_1.PaymentTerminalToJSON)(value['terminal']), 'completionBehavior': (0, TransactionCompletionBehavior_1.TransactionCompletionBehaviorToJSON)(value['completionBehavior']), 'environment': (0, ChargeAttemptEnvironment_1.ChargeAttemptEnvironmentToJSON)(value['environment']), 'invocation': (0, ConnectorInvocation_1.ConnectorInvocationToJSON)(value['invocation']), 'connectorConfiguration': (0, PaymentConnectorConfiguration_1.PaymentConnectorConfigurationToJSON)(value['connectorConfiguration']), 'failureReason': (0, FailureReason_1.FailureReasonToJSON)(value['failureReason']), 'customersPresence': (0, CustomersPresence_1.CustomersPresenceToJSON)(value['customersPresence']), }; }