UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

78 lines (77 loc) 2.94 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.instanceOfProductFamilyExternal = instanceOfProductFamilyExternal; exports.ProductFamilyExternalFromJSON = ProductFamilyExternalFromJSON; exports.ProductFamilyExternalFromJSONTyped = ProductFamilyExternalFromJSONTyped; exports.ProductFamilyExternalToJSON = ProductFamilyExternalToJSON; exports.ProductFamilyExternalToJSONTyped = ProductFamilyExternalToJSONTyped; const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the ProductFamilyExternal interface. */ function instanceOfProductFamilyExternal(value) { if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('description' in value) || value['description'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('products' in value) || value['products'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; } function ProductFamilyExternalFromJSON(json) { return ProductFamilyExternalFromJSONTyped(json, false); } function ProductFamilyExternalFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'createdAt': (new Date(json['created_at'])), 'description': json['description'], 'hierarchy': json['hierarchy'] == null ? undefined : json['hierarchy'], 'id': json['id'], 'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'], 'name': json['name'], 'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']), 'products': json['products'], 'updatedAt': (new Date(json['updated_at'])), }; } function ProductFamilyExternalToJSON(json) { return ProductFamilyExternalToJSONTyped(json, false); } function ProductFamilyExternalToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'created_at': ((value['createdAt']).toISOString()), 'description': value['description'], 'hierarchy': value['hierarchy'], 'id': value['id'], 'is_deleted': value['isDeleted'], 'name': value['name'], 'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']), 'products': value['products'], 'updated_at': ((value['updatedAt']).toISOString()), }; }