Refactored model/Refinement.

This commit is contained in:
David Ball 2024-07-17 23:43:12 -04:00
parent 7bcabac672
commit 4a2e1717d8
2 changed files with 29 additions and 58 deletions

View File

@ -64,6 +64,7 @@ import { PartnerType } from "./model/PartnerType";
import { PriceType } from "./model/PriceType"; import { PriceType } from "./model/PriceType";
import { Properties } from "./model/Properties"; import { Properties } from "./model/Properties";
import { Rating } from "./model/Rating"; import { Rating } from "./model/Rating";
import { Refinement } from "./model/Refinement";
import { RefinementBin } from "./model/RefinementBin"; import { RefinementBin } from "./model/RefinementBin";
import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute"; import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute";
import { SingleIntegerValuedAttribute } from "./model/SingleIntegerValuedAttribute"; import { SingleIntegerValuedAttribute } from "./model/SingleIntegerValuedAttribute";

View File

@ -21,45 +21,34 @@
* *
*/ */
(function(root, factory) { /**
if (typeof define === 'function' && define.amd) { * The Refinement model module.
// AMD. Register as an anonymous module. * @module model/Refinement
define(['ApiClient', 'model/RefinementBin'], factory); * @version 1.0.0
} 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';
import { ApiClient } from "../ApiClient";
import { RefinementBin } from "./RefinementBin";
/**
* Constructs a new <code>Refinement</code>.
* @alias module:model/Refinement
* @class
*/
export class Refinement {
/** /**
* The Refinement model module. * @member {Array.<module:model/RefinementBin>} Bins
* @module model/Refinement
* @version 1.0.0
*/ */
public Bins?: RefinementBin[];
/** /**
* Constructs a new <code>Refinement</code>. * @member {String} DisplayName
* @alias module:model/Refinement
* @class
*/ */
var exports = function() { public DisplayName?: string;
var _this = this; /**
* @member {String} Id
*/
public Id?: string;
};
/** /**
* Constructs a <code>Refinement</code> from a plain JavaScript object, optionally creating a new instance. * Constructs a <code>Refinement</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
@ -67,39 +56,20 @@
* @param {module:model/Refinement} obj Optional instance to populate. * @param {module:model/Refinement} obj Optional instance to populate.
* @return {module:model/Refinement} The populated <code>Refinement</code> instance. * @return {module:model/Refinement} The populated <code>Refinement</code> instance.
*/ */
exports.constructFromObject = function(data, obj) { public static constructFromObject(data: any, obj?: Refinement) {
if (data) { if (data) {
obj = obj || new exports(); obj = obj || new Refinement();
if (data.hasOwnProperty('Bins')) { if (data.hasOwnProperty('Bins')) {
obj['Bins'] = ApiClient.convertToType(data['Bins'], [RefinementBin]); obj.Bins = ApiClient.convertToType(data['Bins'], [RefinementBin]);
} }
if (data.hasOwnProperty('DisplayName')) { if (data.hasOwnProperty('DisplayName')) {
obj['DisplayName'] = ApiClient.convertToType(data['DisplayName'], 'String'); obj.DisplayName = ApiClient.convertToType(data['DisplayName'], 'String');
} }
if (data.hasOwnProperty('Id')) { if (data.hasOwnProperty('Id')) {
obj['Id'] = ApiClient.convertToType(data['Id'], 'String'); obj.Id = ApiClient.convertToType(data['Id'], 'String');
} }
} }
return obj; return obj;
} }
};
/**
* @member {Array.<module:model/RefinementBin>} Bins
*/
exports.prototype['Bins'] = undefined;
/**
* @member {String} DisplayName
*/
exports.prototype['DisplayName'] = undefined;
/**
* @member {String} Id
*/
exports.prototype['Id'] = undefined;
return exports;
}));