From cfa998e30a76cbe4c2c4029bf111b1ee3e983a8a Mon Sep 17 00:00:00 2001 From: David Ball Date: Wed, 17 Jul 2024 21:06:12 -0400 Subject: [PATCH] Refactored model/BrowseNodeAncestor. --- src/index.ts | 3 +- src/model/BrowseNodeAncestor.ts | 94 +++++++++++---------------------- 2 files changed, 33 insertions(+), 64 deletions(-) diff --git a/src/index.ts b/src/index.ts index c9056fe..3e24a07 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,6 +23,7 @@ import { ApiClient } from "./ApiClient"; import { Availability } from "./model/Availability"; +import { BrowseNodeAncestor } from "./model/BrowseNodeAncestor"; import { BrowseNodeChild } from "./model/BrowseNodeChild"; import { ByLineInfo } from "./model/ByLineInfo"; import { Classifications } from "./model/Classifications"; @@ -85,7 +86,7 @@ export { * The BrowseNodeAncestor model constructor. * @property {module:model/BrowseNodeAncestor} */ - BrowseNodeAncestor: BrowseNodeAncestor, + BrowseNodeAncestor, /** * The BrowseNodeChild model constructor. * @property {module:model/BrowseNodeChild} diff --git a/src/model/BrowseNodeAncestor.ts b/src/model/BrowseNodeAncestor.ts index ed3282a..2a3def1 100644 --- a/src/model/BrowseNodeAncestor.ts +++ b/src/model/BrowseNodeAncestor.ts @@ -21,45 +21,36 @@ * */ -(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.BrowseNodeAncestor = factory(root.ProductAdvertisingAPIv1.ApiClient); - } -}(this, function(ApiClient, BrowseNodeAncestor) { - 'use strict'; - - +/** + * The BrowseNodeAncestor model module. + * @module model/BrowseNodeAncestor + * @version 1.0.0 + */ +import { ApiClient } from "../ApiClient"; +/** + * Constructs a new BrowseNodeAncestor. + * @alias module:model/BrowseNodeAncestor + * @class + */ +export class BrowseNodeAncestor { /** - * The BrowseNodeAncestor model module. - * @module model/BrowseNodeAncestor - * @version 1.0.0 + * @member {module:model/BrowseNodeAncestor} Ancestor */ - + public Ancestor?: BrowseNodeAncestor; /** - * Constructs a new BrowseNodeAncestor. - * @alias module:model/BrowseNodeAncestor - * @class + * @member {String} ContextFreeName */ - var exports = function() { - var _this = this; - - - - - - }; + public ContextFreeName?: string; + /** + * @member {String} DisplayName + */ + public DisplayName?: string; + /** + * @member {String} Id + */ + public Id?: string; /** * Constructs a BrowseNodeAncestor from a plain JavaScript object, optionally creating a new instance. @@ -68,46 +59,23 @@ * @param {module:model/BrowseNodeAncestor} obj Optional instance to populate. * @return {module:model/BrowseNodeAncestor} The populated BrowseNodeAncestor instance. */ - exports.constructFromObject = function(data, obj) { + public static constructFromObject(data: any, obj?: BrowseNodeAncestor) { if (data) { - obj = obj || new exports(); + obj = obj || new BrowseNodeAncestor(); if (data.hasOwnProperty('Ancestor')) { - obj['Ancestor'] = this.constructFromObject(data['Ancestor']); + obj.Ancestor = this.constructFromObject(data['Ancestor']); } if (data.hasOwnProperty('ContextFreeName')) { - obj['ContextFreeName'] = ApiClient.convertToType(data['ContextFreeName'], 'String'); + obj.ContextFreeName = ApiClient.convertToType(data['ContextFreeName'], 'String'); } 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 {module:model/BrowseNodeAncestor} Ancestor - */ - exports.prototype['Ancestor'] = undefined; - /** - * @member {String} ContextFreeName - */ - exports.prototype['ContextFreeName'] = undefined; - /** - * @member {String} DisplayName - */ - exports.prototype['DisplayName'] = undefined; - /** - * @member {String} Id - */ - exports.prototype['Id'] = undefined; - - - - return exports; -})); - - +}; \ No newline at end of file