wallee
Version:
TypeScript/JavaScript client for wallee
91 lines (90 loc) • 3.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfLineItemCreate = instanceOfLineItemCreate;
exports.LineItemCreateFromJSON = LineItemCreateFromJSON;
exports.LineItemCreateFromJSONTyped = LineItemCreateFromJSONTyped;
exports.LineItemCreateToJSON = LineItemCreateToJSON;
exports.LineItemCreateToJSONTyped = LineItemCreateToJSONTyped;
/* 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 LineItemAttributeCreate_1 = require("./LineItemAttributeCreate");
const LineItemType_1 = require("./LineItemType");
const TaxCreate_1 = require("./TaxCreate");
/**
* Check if a given object implements the LineItemCreate interface.
*/
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;
}
function LineItemCreateFromJSON(json) {
return LineItemCreateFromJSONTyped(json, false);
}
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(TaxCreate_1.TaxCreateFromJSON))),
'attributes': json['attributes'] == null ? undefined : ((0, runtime_1.mapValues)(json['attributes'], LineItemAttributeCreate_1.LineItemAttributeCreateFromJSON)),
'amountIncludingTax': json['amountIncludingTax'],
'discountIncludingTax': json['discountIncludingTax'] == null ? undefined : json['discountIncludingTax'],
'sku': json['sku'] == null ? undefined : json['sku'],
'type': (0, LineItemType_1.LineItemTypeFromJSON)(json['type']),
'uniqueId': json['uniqueId'],
};
}
function LineItemCreateToJSON(json) {
return LineItemCreateToJSONTyped(json, false);
}
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(TaxCreate_1.TaxCreateToJSON)),
'attributes': value['attributes'] == null ? undefined : ((0, runtime_1.mapValues)(value['attributes'], LineItemAttributeCreate_1.LineItemAttributeCreateToJSON)),
'amountIncludingTax': value['amountIncludingTax'],
'discountIncludingTax': value['discountIncludingTax'],
'sku': value['sku'],
'type': (0, LineItemType_1.LineItemTypeToJSON)(value['type']),
'uniqueId': value['uniqueId'],
};
}