UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

64 lines (63 loc) 2.41 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.instanceOfCondition = instanceOfCondition; exports.ConditionFromJSON = ConditionFromJSON; exports.ConditionFromJSONTyped = ConditionFromJSONTyped; exports.ConditionToJSON = ConditionToJSON; exports.ConditionToJSONTyped = ConditionToJSONTyped; const RouteConditionAttribute_1 = require("./RouteConditionAttribute"); const RouteConditionOperator_1 = require("./RouteConditionOperator"); const Value_1 = require("./Value"); /** * Check if a given object implements the Condition interface. */ function instanceOfCondition(value) { if (!('attributeName' in value) || value['attributeName'] === undefined) return false; if (!('operator' in value) || value['operator'] === undefined) return false; if (!('value' in value) || value['value'] === undefined) return false; return true; } function ConditionFromJSON(json) { return ConditionFromJSONTyped(json, false); } function ConditionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'attributeName': (0, RouteConditionAttribute_1.RouteConditionAttributeFromJSON)(json['attribute_name']), 'attributePropertiesId': json['attribute_properties_id'] == null ? undefined : json['attribute_properties_id'], 'operator': (0, RouteConditionOperator_1.RouteConditionOperatorFromJSON)(json['operator']), 'value': (0, Value_1.ValueFromJSON)(json['value']), }; } function ConditionToJSON(json) { return ConditionToJSONTyped(json, false); } function ConditionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'attribute_name': (0, RouteConditionAttribute_1.RouteConditionAttributeToJSON)(value['attributeName']), 'attribute_properties_id': value['attributePropertiesId'], 'operator': (0, RouteConditionOperator_1.RouteConditionOperatorToJSON)(value['operator']), 'value': (0, Value_1.ValueToJSON)(value['value']), }; }