wallee
Version:
TypeScript/JavaScript client for wallee
56 lines (55 loc) • 2.92 kB
JavaScript
import { ConditionFromJSON, ConditionToJSON, } from './Condition';
import { SalesChannelFromJSON, SalesChannelToJSON, } from './SalesChannel';
import { CreationEntityStateFromJSON, CreationEntityStateToJSON, } from './CreationEntityState';
/**
* Check if a given object implements the PaymentConnectorConfigurationCreate interface.
*/
export 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;
}
export function PaymentConnectorConfigurationCreateFromJSON(json) {
return PaymentConnectorConfigurationCreateFromJSONTyped(json, false);
}
export 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(ConditionFromJSON)),
'priority': json['priority'] == null ? undefined : json['priority'],
'enabledSalesChannels': json['enabledSalesChannels'] == null ? undefined : (new Set(json['enabledSalesChannels'].map(SalesChannelFromJSON))),
'paymentMethodConfiguration': json['paymentMethodConfiguration'],
'connector': json['connector'],
'state': CreationEntityStateFromJSON(json['state']),
'processorConfiguration': json['processorConfiguration'],
};
}
export function PaymentConnectorConfigurationCreateToJSON(json) {
return PaymentConnectorConfigurationCreateToJSONTyped(json, false);
}
export 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(ConditionToJSON)),
'priority': value['priority'],
'enabledSalesChannels': value['enabledSalesChannels'] == null ? undefined : (Array.from(value['enabledSalesChannels']).map(SalesChannelToJSON)),
'paymentMethodConfiguration': value['paymentMethodConfiguration'],
'connector': value['connector'],
'state': CreationEntityStateToJSON(value['state']),
'processorConfiguration': value['processorConfiguration'],
};
}