wallee
Version:
TypeScript/JavaScript client for wallee
84 lines (83 loc) • 3.53 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 { LineItemAttributeCreateFromJSON, LineItemAttributeCreateToJSON, } from './LineItemAttributeCreate';
import { LineItemTypeFromJSON, LineItemTypeToJSON, } from './LineItemType';
import { TaxCreateFromJSON, TaxCreateToJSON, } from './TaxCreate';
/**
* Check if a given object implements the LineItemCreate interface.
*/
export function instanceOfLineItemCreate(value) {
if (!('quantity' in value) || value['quantity'] === undefined)
return false;
if (!('name' in value) || value['name'] === undefined)
return false;
if (!('amountIncludingTax' in value) || value['amountIncludingTax'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
if (!('uniqueId' in value) || value['uniqueId'] === undefined)
return false;
return true;
}
export function LineItemCreateFromJSON(json) {
return LineItemCreateFromJSONTyped(json, false);
}
export function LineItemCreateFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'shippingRequired': json['shippingRequired'] == null ? undefined : json['shippingRequired'],
'quantity': json['quantity'],
'name': json['name'],
'taxes': json['taxes'] == null ? undefined : (new Set(json['taxes'].map(TaxCreateFromJSON))),
'attributes': json['attributes'] == null ? undefined : (mapValues(json['attributes'], LineItemAttributeCreateFromJSON)),
'amountIncludingTax': json['amountIncludingTax'],
'discountIncludingTax': json['discountIncludingTax'] == null ? undefined : json['discountIncludingTax'],
'sku': json['sku'] == null ? undefined : json['sku'],
'type': LineItemTypeFromJSON(json['type']),
'uniqueId': json['uniqueId'],
};
}
export function LineItemCreateToJSON(json) {
return LineItemCreateToJSONTyped(json, false);
}
export function LineItemCreateToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'shippingRequired': value['shippingRequired'],
'quantity': value['quantity'],
'name': value['name'],
'taxes': value['taxes'] == null ? undefined : (Array.from(value['taxes']).map(TaxCreateToJSON)),
'attributes': value['attributes'] == null ? undefined : (mapValues(value['attributes'], LineItemAttributeCreateToJSON)),
'amountIncludingTax': value['amountIncludingTax'],
'discountIncludingTax': value['discountIncludingTax'],
'sku': value['sku'],
'type': LineItemTypeToJSON(value['type']),
'uniqueId': value['uniqueId'],
};
}