wallee
Version:
TypeScript/JavaScript client for wallee
76 lines (75 loc) • 3.93 kB
JavaScript
/* 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.
*/
import { mapValues } from '../runtime';
import { LineItemTypeFromJSON, LineItemTypeToJSON, } from './LineItemType';
import { LineItemAttributeFromJSON, } from './LineItemAttribute';
import { TaxFromJSON, } from './Tax';
/**
* Check if a given object implements the LineItem interface.
*/
export function instanceOfLineItem(value) {
return true;
}
export function LineItemFromJSON(json) {
return LineItemFromJSONTyped(json, false);
}
export 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(TaxFromJSON))),
'type': json['type'] == null ? undefined : 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 : (mapValues(json['attributes'], 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'],
};
}
export function LineItemToJSON(json) {
return LineItemToJSONTyped(json, false);
}
export function LineItemToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'type': LineItemTypeToJSON(value['type']),
};
}