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 { 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";

View File

@ -21,44 +21,33 @@
*
*/
(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 <code>Refinement</code>.
* @alias module:model/Refinement
* @class
*/
var exports = function() {
var _this = this;
};
export class Refinement {
/**
* @member {Array.<module:model/RefinementBin>} Bins
*/
public Bins?: RefinementBin[];
/**
* @member {String} DisplayName
*/
public DisplayName?: string;
/**
* @member {String} Id
*/
public Id?: string;
/**
* Constructs a <code>Refinement</code> from a plain JavaScript object, optionally creating a new instance.
@ -67,39 +56,20 @@
* @param {module:model/Refinement} obj Optional instance to populate.
* @return {module:model/Refinement} The populated <code>Refinement</code> 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.<module:model/RefinementBin>} Bins
*/
exports.prototype['Bins'] = undefined;
/**
* @member {String} DisplayName
*/
exports.prototype['DisplayName'] = undefined;
/**
* @member {String} Id
*/
exports.prototype['Id'] = undefined;
return exports;
}));
};