wallee
Version:
TypeScript/JavaScript client for wallee
83 lines (82 loc) • 4.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfLineItem = instanceOfLineItem;
exports.LineItemFromJSON = LineItemFromJSON;
exports.LineItemFromJSONTyped = LineItemFromJSONTyped;
exports.LineItemToJSON = LineItemToJSON;
exports.LineItemToJSONTyped = LineItemToJSONTyped;
/* tslint:disable */
/* eslint-disable */
/**
* Wallee AG TypeScript SDK
*
* This library allows to interact with the Wallee AG payment service.
*
* Copyright owner: Wallee AG
* Website: https://en.wallee.com
* Developer email: ecosystem-team@wallee.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const runtime_1 = require("../runtime");
const LineItemType_1 = require("./LineItemType");
const LineItemAttribute_1 = require("./LineItemAttribute");
const Tax_1 = require("./Tax");
/**
* Check if a given object implements the LineItem interface.
*/
function instanceOfLineItem(value) {
return true;
}
function LineItemFromJSON(json) {
return LineItemFromJSONTyped(json, false);
}
function LineItemFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'taxAmountPerUnit': json['taxAmountPerUnit'] == null ? undefined : json['taxAmountPerUnit'],
'undiscountedAmountExcludingTax': json['undiscountedAmountExcludingTax'] == null ? undefined : json['undiscountedAmountExcludingTax'],
'quantity': json['quantity'] == null ? undefined : json['quantity'],
'undiscountedUnitPriceIncludingTax': json['undiscountedUnitPriceIncludingTax'] == null ? undefined : json['undiscountedUnitPriceIncludingTax'],
'amountExcludingTax': json['amountExcludingTax'] == null ? undefined : json['amountExcludingTax'],
'undiscountedAmountIncludingTax': json['undiscountedAmountIncludingTax'] == null ? undefined : json['undiscountedAmountIncludingTax'],
'taxes': json['taxes'] == null ? undefined : (new Set(json['taxes'].map(Tax_1.TaxFromJSON))),
'type': json['type'] == null ? undefined : (0, LineItemType_1.LineItemTypeFromJSON)(json['type']),
'unitPriceIncludingTax': json['unitPriceIncludingTax'] == null ? undefined : json['unitPriceIncludingTax'],
'discountExcludingTax': json['discountExcludingTax'] == null ? undefined : json['discountExcludingTax'],
'shippingRequired': json['shippingRequired'] == null ? undefined : json['shippingRequired'],
'unitPriceExcludingTax': json['unitPriceExcludingTax'] == null ? undefined : json['unitPriceExcludingTax'],
'name': json['name'] == null ? undefined : json['name'],
'attributes': json['attributes'] == null ? undefined : ((0, runtime_1.mapValues)(json['attributes'], LineItemAttribute_1.LineItemAttributeFromJSON)),
'undiscountedUnitPriceExcludingTax': json['undiscountedUnitPriceExcludingTax'] == null ? undefined : json['undiscountedUnitPriceExcludingTax'],
'amountIncludingTax': json['amountIncludingTax'] == null ? undefined : json['amountIncludingTax'],
'discountIncludingTax': json['discountIncludingTax'] == null ? undefined : json['discountIncludingTax'],
'sku': json['sku'] == null ? undefined : json['sku'],
'taxAmount': json['taxAmount'] == null ? undefined : json['taxAmount'],
'aggregatedTaxRate': json['aggregatedTaxRate'] == null ? undefined : json['aggregatedTaxRate'],
'uniqueId': json['uniqueId'] == null ? undefined : json['uniqueId'],
};
}
function LineItemToJSON(json) {
return LineItemToJSONTyped(json, false);
}
function LineItemToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'type': (0, LineItemType_1.LineItemTypeToJSON)(value['type']),
};
}