From f49cdea4581dbc06bc9740769e290806e15bf5e7 Mon Sep 17 00:00:00 2001 From: David Ball Date: Thu, 18 Jul 2024 00:18:38 -0400 Subject: [PATCH] Refactored model/OfferSubCondition. --- src/index.ts | 1 + src/model/OfferSubCondition.ts | 94 +++++++++++----------------------- 2 files changed, 32 insertions(+), 63 deletions(-) diff --git a/src/index.ts b/src/index.ts index fbb43d2..3905c80 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,6 +63,7 @@ import { OfferConditionNote } from "./model/OfferConditionNote"; import { OfferCount } from "./model/OfferCount"; import { OfferPrice } from "./model/OfferPrice"; import { OfferSavings } from "./model/OfferSavings"; +import { OfferSubCondition } from "./model/OfferSubCondition"; import { PartnerType } from "./model/PartnerType"; import { Price } from "./model/Price"; import { PriceType } from "./model/PriceType"; diff --git a/src/model/OfferSubCondition.ts b/src/model/OfferSubCondition.ts index 69efd51..52ab923 100644 --- a/src/model/OfferSubCondition.ts +++ b/src/model/OfferSubCondition.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.OfferSubCondition = factory(root.ProductAdvertisingAPIv1.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - +/** + * The OfferSubCondition model module. + * @module model/OfferSubCondition + * @version 1.0.0 + */ +import { ApiClient } from "../ApiClient"; +/** + * Constructs a new OfferSubCondition. + * @alias module:model/OfferSubCondition + * @class + */ +export class OfferSubCondition { /** - * The OfferSubCondition model module. - * @module model/OfferSubCondition - * @version 1.0.0 + * @member {String} DisplayValue */ - + public DisplayValue?: string; /** - * Constructs a new OfferSubCondition. - * @alias module:model/OfferSubCondition - * @class + * @member {String} Label */ - var exports = function() { - var _this = this; - - - - - - }; + public Label?: string; + /** + * @member {String} Locale + */ + public Locale?: string; + /** + * @member {String} Value + */ + public Value?: string; /** * Constructs a OfferSubCondition from a plain JavaScript object, optionally creating a new instance. @@ -68,46 +59,23 @@ * @param {module:model/OfferSubCondition} obj Optional instance to populate. * @return {module:model/OfferSubCondition} The populated OfferSubCondition instance. */ - exports.constructFromObject = function(data, obj) { + public static constructFromObject(data: any, obj?: OfferSubCondition) { if (data) { - obj = obj || new exports(); + obj = obj || new OfferSubCondition(); if (data.hasOwnProperty('DisplayValue')) { - obj['DisplayValue'] = ApiClient.convertToType(data['DisplayValue'], 'String'); + obj.DisplayValue = ApiClient.convertToType(data['DisplayValue'], 'String'); } if (data.hasOwnProperty('Label')) { - obj['Label'] = ApiClient.convertToType(data['Label'], 'String'); + obj.Label = ApiClient.convertToType(data['Label'], 'String'); } if (data.hasOwnProperty('Locale')) { - obj['Locale'] = ApiClient.convertToType(data['Locale'], 'String'); + obj.Locale = ApiClient.convertToType(data['Locale'], 'String'); } if (data.hasOwnProperty('Value')) { - obj['Value'] = ApiClient.convertToType(data['Value'], 'String'); + obj.Value = ApiClient.convertToType(data['Value'], 'String'); } } return obj; } - - /** - * @member {String} DisplayValue - */ - exports.prototype['DisplayValue'] = undefined; - /** - * @member {String} Label - */ - exports.prototype['Label'] = undefined; - /** - * @member {String} Locale - */ - exports.prototype['Locale'] = undefined; - /** - * @member {String} Value - */ - exports.prototype['Value'] = undefined; - - - - return exports; -})); - - +};