Refactored model/SearchRefinements.

This commit is contained in:
David Ball 2024-07-17 23:46:06 -04:00
parent 4a2e1717d8
commit f2a0197648
2 changed files with 28 additions and 58 deletions

View File

@ -66,6 +66,7 @@ import { Properties } from "./model/Properties";
import { Rating } from "./model/Rating"; import { Rating } from "./model/Rating";
import { Refinement } from "./model/Refinement"; import { Refinement } from "./model/Refinement";
import { RefinementBin } from "./model/RefinementBin"; import { RefinementBin } from "./model/RefinementBin";
import { SearchRefinements } from "./model/SearchRefinements";
import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute"; import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute";
import { SingleIntegerValuedAttribute } from "./model/SingleIntegerValuedAttribute"; import { SingleIntegerValuedAttribute } from "./model/SingleIntegerValuedAttribute";
import { SingleStringValuedAttribute } from "./model/SingleStringValuedAttribute"; import { SingleStringValuedAttribute } from "./model/SingleStringValuedAttribute";

View File

@ -21,45 +21,33 @@
* *
*/ */
(function(root, factory) { /**
if (typeof define === 'function' && define.amd) { * The SearchRefinements model module.
// AMD. Register as an anonymous module. * @module model/SearchRefinements
define(['ApiClient', 'model/Refinement'], 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('./Refinement'));
} else {
// Browser globals (root is window)
if (!root.ProductAdvertisingAPIv1) {
root.ProductAdvertisingAPIv1 = {};
}
root.ProductAdvertisingAPIv1.SearchRefinements = factory(root.ProductAdvertisingAPIv1.ApiClient, root.ProductAdvertisingAPIv1.Refinement);
}
}(this, function(ApiClient, Refinement) {
'use strict';
import { ApiClient } from "../ApiClient";
import { Refinement } from "./Refinement";
/**
* Constructs a new <code>SearchRefinements</code>.
* @alias module:model/SearchRefinements
* @class
*/
export class SearchRefinements {
/** /**
* The SearchRefinements model module. * @member {module:model/Refinement} BrowseNode
* @module model/SearchRefinements
* @version 1.0.0
*/ */
public BrowseNode?: Refinement
/** /**
* Constructs a new <code>SearchRefinements</code>. * @member {Array.<module:model/Refinement>} OtherRefinements
* @alias module:model/SearchRefinements
* @class
*/ */
var exports = function() { public OtherRefinements?: Refinement[]
var _this = this; /**
* @member {module:model/Refinement} SearchIndex
*/
public SearchIndex?: Refinement
};
/** /**
* Constructs a <code>SearchRefinements</code> from a plain JavaScript object, optionally creating a new instance. * Constructs a <code>SearchRefinements</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 +55,20 @@
* @param {module:model/SearchRefinements} obj Optional instance to populate. * @param {module:model/SearchRefinements} obj Optional instance to populate.
* @return {module:model/SearchRefinements} The populated <code>SearchRefinements</code> instance. * @return {module:model/SearchRefinements} The populated <code>SearchRefinements</code> instance.
*/ */
exports.constructFromObject = function(data, obj) { public static constructFromObject(data: any, obj?: SearchRefinements) {
if (data) { if (data) {
obj = obj || new exports(); obj = obj || new SearchRefinements();
if (data.hasOwnProperty('BrowseNode')) { if (data.hasOwnProperty('BrowseNode')) {
obj['BrowseNode'] = Refinement.constructFromObject(data['BrowseNode']); obj.BrowseNode = Refinement.constructFromObject(data['BrowseNode']);
} }
if (data.hasOwnProperty('OtherRefinements')) { if (data.hasOwnProperty('OtherRefinements')) {
obj['OtherRefinements'] = ApiClient.convertToType(data['OtherRefinements'], [Refinement]); obj.OtherRefinements = ApiClient.convertToType(data['OtherRefinements'], [Refinement]);
} }
if (data.hasOwnProperty('SearchIndex')) { if (data.hasOwnProperty('SearchIndex')) {
obj['SearchIndex'] = Refinement.constructFromObject(data['SearchIndex']); obj.SearchIndex = Refinement.constructFromObject(data['SearchIndex']);
} }
} }
return obj; return obj;
} }
};
/**
* @member {module:model/Refinement} BrowseNode
*/
exports.prototype['BrowseNode'] = undefined;
/**
* @member {Array.<module:model/Refinement>} OtherRefinements
*/
exports.prototype['OtherRefinements'] = undefined;
/**
* @member {module:model/Refinement} SearchIndex
*/
exports.prototype['SearchIndex'] = undefined;
return exports;
}));