UNPKG

wallee

Version:
61 lines (60 loc) 2.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfSubscriptionLedgerEntryCreate = instanceOfSubscriptionLedgerEntryCreate; exports.SubscriptionLedgerEntryCreateFromJSON = SubscriptionLedgerEntryCreateFromJSON; exports.SubscriptionLedgerEntryCreateFromJSONTyped = SubscriptionLedgerEntryCreateFromJSONTyped; exports.SubscriptionLedgerEntryCreateToJSON = SubscriptionLedgerEntryCreateToJSON; exports.SubscriptionLedgerEntryCreateToJSONTyped = SubscriptionLedgerEntryCreateToJSONTyped; const TaxCreate_1 = require("./TaxCreate"); /** * Check if a given object implements the SubscriptionLedgerEntryCreate interface. */ function instanceOfSubscriptionLedgerEntryCreate(value) { if (!('quantity' in value) || value['quantity'] === undefined) return false; if (!('subscriptionVersion' in value) || value['subscriptionVersion'] === undefined) return false; if (!('externalId' in value) || value['externalId'] === undefined) return false; if (!('amountIncludingTax' in value) || value['amountIncludingTax'] === undefined) return false; if (!('title' in value) || value['title'] === undefined) return false; return true; } function SubscriptionLedgerEntryCreateFromJSON(json) { return SubscriptionLedgerEntryCreateFromJSONTyped(json, false); } function SubscriptionLedgerEntryCreateFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'quantity': json['quantity'], 'subscriptionVersion': json['subscriptionVersion'], 'externalId': json['externalId'], 'taxes': json['taxes'] == null ? undefined : (new Set(json['taxes'].map(TaxCreate_1.TaxCreateFromJSON))), 'amountIncludingTax': json['amountIncludingTax'], 'title': json['title'], 'componentReferenceName': json['componentReferenceName'] == null ? undefined : json['componentReferenceName'], 'subscriptionMetricId': json['subscriptionMetricId'] == null ? undefined : json['subscriptionMetricId'], }; } function SubscriptionLedgerEntryCreateToJSON(json) { return SubscriptionLedgerEntryCreateToJSONTyped(json, false); } function SubscriptionLedgerEntryCreateToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'quantity': value['quantity'], 'subscriptionVersion': value['subscriptionVersion'], 'externalId': value['externalId'], 'taxes': value['taxes'] == null ? undefined : (Array.from(value['taxes']).map(TaxCreate_1.TaxCreateToJSON)), 'amountIncludingTax': value['amountIncludingTax'], 'title': value['title'], 'componentReferenceName': value['componentReferenceName'], 'subscriptionMetricId': value['subscriptionMetricId'], }; }