diff --git a/src/index.ts b/src/index.ts index e8edc0f..6a7d117 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,6 +64,7 @@ import { PartnerType } from "./model/PartnerType"; import { PriceType } from "./model/PriceType"; import { Properties } from "./model/Properties"; import { Rating } from "./model/Rating"; +import { Refinement } from "./model/Refinement"; import { RefinementBin } from "./model/RefinementBin"; import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute"; import { SingleIntegerValuedAttribute } from "./model/SingleIntegerValuedAttribute"; diff --git a/src/model/Refinement.ts b/src/model/Refinement.ts index 72368fa..7844b99 100644 --- a/src/model/Refinement.ts +++ b/src/model/Refinement.ts @@ -21,45 +21,34 @@ * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'model/RefinementBin'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./RefinementBin')); - } else { - // Browser globals (root is window) - if (!root.ProductAdvertisingAPIv1) { - root.ProductAdvertisingAPIv1 = {}; - } - root.ProductAdvertisingAPIv1.Refinement = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.RefinementBin); - } -}(this, function(ApiClient, RefinementBin) { - 'use strict'; - - +/** + * The Refinement model module. + * @module model/Refinement + * @version 1.0.0 + */ +import { ApiClient } from "../ApiClient"; +import { RefinementBin } from "./RefinementBin"; +/** + * Constructs a new Refinement. + * @alias module:model/Refinement + * @class + */ +export class Refinement { /** - * The Refinement model module. - * @module model/Refinement - * @version 1.0.0 + * @member {Array.} Bins */ - + public Bins?: RefinementBin[]; /** - * Constructs a new Refinement. - * @alias module:model/Refinement - * @class + * @member {String} DisplayName */ - var exports = function() { - var _this = this; - - - - - }; - + public DisplayName?: string; + /** + * @member {String} Id + */ + public Id?: string; + /** * Constructs a Refinement 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 +56,20 @@ * @param {module:model/Refinement} obj Optional instance to populate. * @return {module:model/Refinement} The populated Refinement instance. */ - exports.constructFromObject = function(data, obj) { + public static constructFromObject(data: any, obj?: Refinement) { if (data) { - obj = obj || new exports(); + obj = obj || new Refinement(); if (data.hasOwnProperty('Bins')) { - obj['Bins'] = ApiClient.convertToType(data['Bins'], [RefinementBin]); + obj.Bins = ApiClient.convertToType(data['Bins'], [RefinementBin]); } if (data.hasOwnProperty('DisplayName')) { - obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); + obj.DisplayName = ApiClient.convertToType(data['DisplayName'], 'String'); } if (data.hasOwnProperty('Id')) { - obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); + obj.Id = ApiClient.convertToType(data['Id'], 'String'); } } return obj; } - - /** - * @member {Array.} Bins - */ - exports.prototype['Bins'] = undefined; - /** - * @member {String} DisplayName - */ - exports.prototype['DisplayName'] = undefined; - /** - * @member {String} Id - */ - exports.prototype['Id'] = undefined; - - - - return exports; -})); - - +};