UNPKG

wallee

Version:
63 lines (62 loc) 3.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfPaymentConnectorConfigurationCreate = instanceOfPaymentConnectorConfigurationCreate; exports.PaymentConnectorConfigurationCreateFromJSON = PaymentConnectorConfigurationCreateFromJSON; exports.PaymentConnectorConfigurationCreateFromJSONTyped = PaymentConnectorConfigurationCreateFromJSONTyped; exports.PaymentConnectorConfigurationCreateToJSON = PaymentConnectorConfigurationCreateToJSON; exports.PaymentConnectorConfigurationCreateToJSONTyped = PaymentConnectorConfigurationCreateToJSONTyped; const Condition_1 = require("./Condition"); const SalesChannel_1 = require("./SalesChannel"); const CreationEntityState_1 = require("./CreationEntityState"); /** * Check if a given object implements the PaymentConnectorConfigurationCreate interface. */ function instanceOfPaymentConnectorConfigurationCreate(value) { if (!('paymentMethodConfiguration' in value) || value['paymentMethodConfiguration'] === undefined) return false; if (!('connector' in value) || value['connector'] === undefined) return false; if (!('state' in value) || value['state'] === undefined) return false; if (!('processorConfiguration' in value) || value['processorConfiguration'] === undefined) return false; return true; } function PaymentConnectorConfigurationCreateFromJSON(json) { return PaymentConnectorConfigurationCreateFromJSONTyped(json, false); } function PaymentConnectorConfigurationCreateFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'name': json['name'] == null ? undefined : json['name'], 'enabledSpaceViews': json['enabledSpaceViews'] == null ? undefined : new Set(json['enabledSpaceViews']), 'conditions': json['conditions'] == null ? undefined : (json['conditions'].map(Condition_1.ConditionFromJSON)), 'priority': json['priority'] == null ? undefined : json['priority'], 'enabledSalesChannels': json['enabledSalesChannels'] == null ? undefined : (new Set(json['enabledSalesChannels'].map(SalesChannel_1.SalesChannelFromJSON))), 'paymentMethodConfiguration': json['paymentMethodConfiguration'], 'connector': json['connector'], 'state': (0, CreationEntityState_1.CreationEntityStateFromJSON)(json['state']), 'processorConfiguration': json['processorConfiguration'], }; } function PaymentConnectorConfigurationCreateToJSON(json) { return PaymentConnectorConfigurationCreateToJSONTyped(json, false); } function PaymentConnectorConfigurationCreateToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'name': value['name'], 'enabledSpaceViews': value['enabledSpaceViews'] == null ? undefined : Array.from(value['enabledSpaceViews']), 'conditions': value['conditions'] == null ? undefined : (value['conditions'].map(Condition_1.ConditionToJSON)), 'priority': value['priority'], 'enabledSalesChannels': value['enabledSalesChannels'] == null ? undefined : (Array.from(value['enabledSalesChannels']).map(SalesChannel_1.SalesChannelToJSON)), 'paymentMethodConfiguration': value['paymentMethodConfiguration'], 'connector': value['connector'], 'state': (0, CreationEntityState_1.CreationEntityStateToJSON)(value['state']), 'processorConfiguration': value['processorConfiguration'], }; }