UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

64 lines (63 loc) 3.23 kB
"use strict"; /* 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.RouteConfigurationFromJSON = RouteConfigurationFromJSON; exports.RouteConfigurationFromJSONTyped = RouteConfigurationFromJSONTyped; exports.RouteConfigurationToJSON = RouteConfigurationToJSON; exports.RouteConfigurationToJSONTyped = RouteConfigurationToJSONTyped; const CitMitProcessorsRouteConfig_1 = require("./CitMitProcessorsRouteConfig"); const DeprecatedRouteConfig_1 = require("./DeprecatedRouteConfig"); const SimpleMitCitFilterRouteConfig_1 = require("./SimpleMitCitFilterRouteConfig"); const V1StandardRouteConfig_1 = require("./V1StandardRouteConfig"); function RouteConfigurationFromJSON(json) { return RouteConfigurationFromJSONTyped(json, false); } function RouteConfigurationFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } switch (json['route_type']) { case 'cit_mit_processors': return Object.assign({}, (0, CitMitProcessorsRouteConfig_1.CitMitProcessorsRouteConfigFromJSONTyped)(json, true), { routeType: 'cit_mit_processors' }); case 'deprecated': return Object.assign({}, (0, DeprecatedRouteConfig_1.DeprecatedRouteConfigFromJSONTyped)(json, true), { routeType: 'deprecated' }); case 'simple_mit_cit_filter': return Object.assign({}, (0, SimpleMitCitFilterRouteConfig_1.SimpleMitCitFilterRouteConfigFromJSONTyped)(json, true), { routeType: 'simple_mit_cit_filter' }); case 'v1_standard': return Object.assign({}, (0, V1StandardRouteConfig_1.V1StandardRouteConfigFromJSONTyped)(json, true), { routeType: 'v1_standard' }); default: throw new Error(`No variant of RouteConfiguration exists with 'routeType=${json['routeType']}'`); } } function RouteConfigurationToJSON(json) { return RouteConfigurationToJSONTyped(json, false); } function RouteConfigurationToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } switch (value['routeType']) { case 'cit_mit_processors': return Object.assign({}, (0, CitMitProcessorsRouteConfig_1.CitMitProcessorsRouteConfigToJSON)(value), { routeType: 'cit_mit_processors' }); case 'deprecated': return Object.assign({}, (0, DeprecatedRouteConfig_1.DeprecatedRouteConfigToJSON)(value), { routeType: 'deprecated' }); case 'simple_mit_cit_filter': return Object.assign({}, (0, SimpleMitCitFilterRouteConfig_1.SimpleMitCitFilterRouteConfigToJSON)(value), { routeType: 'simple_mit_cit_filter' }); case 'v1_standard': return Object.assign({}, (0, V1StandardRouteConfig_1.V1StandardRouteConfigToJSON)(value), { routeType: 'v1_standard' }); default: throw new Error(`No variant of RouteConfiguration exists with 'routeType=${value['routeType']}'`); } }