wallee
Version:
TypeScript/JavaScript client for wallee
54 lines (53 loc) • 3.2 kB
JavaScript
import { ProductFeeTypeFromJSON, ProductFeeTypeToJSON, } from './ProductFeeType';
import { SubscriptionLedgerEntryStateFromJSON, SubscriptionLedgerEntryStateToJSON, } from './SubscriptionLedgerEntryState';
import { TaxFromJSON, } from './Tax';
/**
* Check if a given object implements the SubscriptionLedgerEntry interface.
*/
export function instanceOfSubscriptionLedgerEntry(value) {
return true;
}
export function SubscriptionLedgerEntryFromJSON(json) {
return SubscriptionLedgerEntryFromJSONTyped(json, false);
}
export function SubscriptionLedgerEntryFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'quantity': json['quantity'] == null ? undefined : json['quantity'],
'amountExcludingTax': json['amountExcludingTax'] == null ? undefined : json['amountExcludingTax'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'subscriptionVersion': json['subscriptionVersion'] == null ? undefined : json['subscriptionVersion'],
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'taxes': json['taxes'] == null ? undefined : (new Set(json['taxes'].map(TaxFromJSON))),
'feeType': json['feeType'] == null ? undefined : ProductFeeTypeFromJSON(json['feeType']),
'title': json['title'] == null ? undefined : json['title'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'componentReferenceName': json['componentReferenceName'] == null ? undefined : json['componentReferenceName'],
'subscriptionMetricId': json['subscriptionMetricId'] == null ? undefined : json['subscriptionMetricId'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'proRataCalculated': json['proRataCalculated'] == null ? undefined : json['proRataCalculated'],
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
'componentReferenceSku': json['componentReferenceSku'] == null ? undefined : json['componentReferenceSku'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : SubscriptionLedgerEntryStateFromJSON(json['state']),
'amountIncludingTax': json['amountIncludingTax'] == null ? undefined : json['amountIncludingTax'],
'discountIncludingTax': json['discountIncludingTax'] == null ? undefined : json['discountIncludingTax'],
'taxAmount': json['taxAmount'] == null ? undefined : json['taxAmount'],
'aggregatedTaxRate': json['aggregatedTaxRate'] == null ? undefined : json['aggregatedTaxRate'],
};
}
export function SubscriptionLedgerEntryToJSON(json) {
return SubscriptionLedgerEntryToJSONTyped(json, false);
}
export function SubscriptionLedgerEntryToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'feeType': ProductFeeTypeToJSON(value['feeType']),
'state': SubscriptionLedgerEntryStateToJSON(value['state']),
};
}