@getopenpay/client
Version:
OpenPay API TypeScript SDK
54 lines (53 loc) • 2.14 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.Node1FromJSON = Node1FromJSON;
exports.Node1FromJSONTyped = Node1FromJSONTyped;
exports.Node1ToJSON = Node1ToJSON;
exports.Node1ToJSONTyped = Node1ToJSONTyped;
const CascadingProcessorsNode_1 = require("./CascadingProcessorsNode");
const SimpleDecisionNodeOutput_1 = require("./SimpleDecisionNodeOutput");
function Node1FromJSON(json) {
return Node1FromJSONTyped(json, false);
}
function Node1FromJSONTyped(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, SimpleDecisionNodeOutput_1.SimpleDecisionNodeOutputFromJSONTyped)(json, true), { nodeType: 'simple_decision' });
default:
throw new Error(`No variant of Node1 exists with 'nodeType=${json['nodeType']}'`);
}
}
function Node1ToJSON(json) {
return Node1ToJSONTyped(json, false);
}
function Node1ToJSONTyped(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, SimpleDecisionNodeOutput_1.SimpleDecisionNodeOutputToJSON)(value), { nodeType: 'simple_decision' });
default:
throw new Error(`No variant of Node1 exists with 'nodeType=${value['nodeType']}'`);
}
}