@getopenpay/client
Version:
OpenPay API TypeScript SDK
54 lines (53 loc) • 2.12 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* OpenPay API
* super charge your subscription management.
*
* The version of the OpenAPI document: 1.2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeFromJSON = NodeFromJSON;
exports.NodeFromJSONTyped = NodeFromJSONTyped;
exports.NodeToJSON = NodeToJSON;
exports.NodeToJSONTyped = NodeToJSONTyped;
const CascadingProcessorsNode_1 = require("./CascadingProcessorsNode");
const SimpleDecisionNodeInput_1 = require("./SimpleDecisionNodeInput");
function NodeFromJSON(json) {
return NodeFromJSONTyped(json, false);
}
function NodeFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
switch (json['node_type']) {
case 'cascading_processors':
return Object.assign({}, (0, CascadingProcessorsNode_1.CascadingProcessorsNodeFromJSONTyped)(json, true), { nodeType: 'cascading_processors' });
case 'simple_decision':
return Object.assign({}, (0, SimpleDecisionNodeInput_1.SimpleDecisionNodeInputFromJSONTyped)(json, true), { nodeType: 'simple_decision' });
default:
throw new Error(`No variant of Node exists with 'nodeType=${json['nodeType']}'`);
}
}
function NodeToJSON(json) {
return NodeToJSONTyped(json, false);
}
function NodeToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
switch (value['nodeType']) {
case 'cascading_processors':
return Object.assign({}, (0, CascadingProcessorsNode_1.CascadingProcessorsNodeToJSON)(value), { nodeType: 'cascading_processors' });
case 'simple_decision':
return Object.assign({}, (0, SimpleDecisionNodeInput_1.SimpleDecisionNodeInputToJSON)(value), { nodeType: 'simple_decision' });
default:
throw new Error(`No variant of Node exists with 'nodeType=${value['nodeType']}'`);
}
}