From 29d1079d022eacb743577ca3cb3314e849e5d261 Mon Sep 17 00:00:00 2001 From: David Ball Date: Wed, 17 Jul 2024 23:57:20 -0400 Subject: [PATCH] Refactored model/TradeInPrice. --- src/index.ts | 1 + src/model/TradeInPrice.ts | 85 +++++++++++++-------------------------- 2 files changed, 28 insertions(+), 58 deletions(-) diff --git a/src/index.ts b/src/index.ts index 85eb2ce..95c6d3f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -71,6 +71,7 @@ import { SearchRefinements } from "./model/SearchRefinements"; import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute"; import { SingleIntegerValuedAttribute } from "./model/SingleIntegerValuedAttribute"; import { SingleStringValuedAttribute } from "./model/SingleStringValuedAttribute"; +import { TradeInPrice } from "./model/TradeInPrice"; import { UnitBasedAttribute } from "./model/UnitBasedAttribute"; import { VariationDimension } from "./model/VariationDimension"; import { VariationSummary } from "./model/VariationSummary"; diff --git a/src/model/TradeInPrice.ts b/src/model/TradeInPrice.ts index ac9e497..ce71844 100644 --- a/src/model/TradeInPrice.ts +++ b/src/model/TradeInPrice.ts @@ -21,45 +21,33 @@ * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.ProductAdvertisingAPIv1) { - root.ProductAdvertisingAPIv1 = {}; - } - root.ProductAdvertisingAPIv1.TradeInPrice = factory(root.ProductAdvertisingAPIv1.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - +/** + * The TradeInPrice model module. + * @module model/TradeInPrice + * @version 1.0.0 + */ +import { ApiClient } from "../ApiClient"; +/** + * Constructs a new TradeInPrice. + * @alias module:model/TradeInPrice + * @class + */ +export class TradeInPrice { /** - * The TradeInPrice model module. - * @module model/TradeInPrice - * @version 1.0.0 + * @member {Number} Amount */ - + public Amount?: number; /** - * Constructs a new TradeInPrice. - * @alias module:model/TradeInPrice - * @class + * @member {String} Currency */ - var exports = function() { - var _this = this; - - - - - }; - + public Currency?: string; + /** + * @member {String} DisplayAmount + */ + public DisplayAmount?: string; + /** * Constructs a TradeInPrice from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from data to obj if supplied or a new instance if not. @@ -67,39 +55,20 @@ * @param {module:model/TradeInPrice} obj Optional instance to populate. * @return {module:model/TradeInPrice} The populated TradeInPrice instance. */ - exports.constructFromObject = function(data, obj) { + public static constructFromObject(data: any, obj?: TradeInPrice) { if (data) { - obj = obj || new exports(); + obj = obj || new TradeInPrice(); if (data.hasOwnProperty('Amount')) { - obj['Amount'] = ApiClient.convertToType(data['Amount'], 'Number'); + obj.Amount = ApiClient.convertToType(data['Amount'], 'Number'); } if (data.hasOwnProperty('Currency')) { - obj['Currency'] = ApiClient.convertToType(data['Currency'], 'String'); + obj.Currency = ApiClient.convertToType(data['Currency'], 'String'); } if (data.hasOwnProperty('DisplayAmount')) { - obj['DisplayAmount'] = ApiClient.convertToType(data['DisplayAmount'], 'String'); + obj.DisplayAmount = ApiClient.convertToType(data['DisplayAmount'], 'String'); } } return obj; } - - /** - * @member {Number} Amount - */ - exports.prototype['Amount'] = undefined; - /** - * @member {String} Currency - */ - exports.prototype['Currency'] = undefined; - /** - * @member {String} DisplayAmount - */ - exports.prototype['DisplayAmount'] = undefined; - - - - return exports; -})); - - +};