From 65ad911dd5b72cabe17b711a2542c92e042e683f Mon Sep 17 00:00:00 2001 From: David Ball Date: Wed, 17 Jul 2024 22:13:53 -0400 Subject: [PATCH] Refactored model/PartnerType. Fixed a couple things in GetBrowseNodesResource. --- src/index.ts | 1 + src/model/GetBrowseNodesResource.ts | 7 +++- src/model/PartnerType.ts | 59 ++++++++++++----------------- 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/index.ts b/src/index.ts index cd75dcc..51e6721 100644 --- a/src/index.ts +++ b/src/index.ts @@ -49,6 +49,7 @@ import { LanguageType } from "./model/LanguageType"; import { MultiValuedAttribute } from "./model/MultiValuedAttribute"; import { OfferPrice } from "./model/OfferPrice"; import { OfferSavings } from "./model/OfferSavings"; +import { PartnerType } from "./model/PartnerType"; import { PriceType } from "./model/PriceType"; import { Rating } from "./model/Rating"; import { SingleBooleanValuedAttribute } from "./model/SingleBooleanValuedAttribute"; diff --git a/src/model/GetBrowseNodesResource.ts b/src/model/GetBrowseNodesResource.ts index a91bd55..dfa2a5d 100644 --- a/src/model/GetBrowseNodesResource.ts +++ b/src/model/GetBrowseNodesResource.ts @@ -39,6 +39,11 @@ export const enum GetBrowseNodesResourceValues { Children = "BrowseNodes.Children" }; +/** + * Enum class GetBrowseNodesResource. + * @enum {} + * @readonly + */ export class GetBrowseNodesResource extends String { /** * value: "BrowseNodes.Ancestor" @@ -55,5 +60,5 @@ export class GetBrowseNodesResource extends String { * @param {Object} data The plain JavaScript object containing the name of the enum value. * @return {module:model/GetBrowseNodesResource} The enum GetBrowseNodesResource value. */ - public static constructFromObject(object: string) { return object; } + public static constructFromObject(object: GetBrowseNodesResource|GetBrowseNodesResourceValues|string) { return object; } }; diff --git a/src/model/PartnerType.ts b/src/model/PartnerType.ts index c9fca93..4c7291c 100644 --- a/src/model/PartnerType.ts +++ b/src/model/PartnerType.ts @@ -21,46 +21,35 @@ * */ -(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.PartnerType = factory(root.ProductAdvertisingAPIv1.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - +/** + * Enum class PartnerType. + * @enum {} + * @readonly + */ +export enum PartnerTypeValues { /** - * Enum class PartnerType. - * @enum {} - * @readonly + * value: "Associates" + * @const */ - var exports = { - /** - * value: "Associates" - * @const - */ - "Associates": "Associates" }; + Associates = "Associates" +}; +/** + * Enum class PartnerType. + * @enum {} + * @readonly + */ +export class PartnerType extends String { + /** + * value: "Associates" + * @const + */ + public static get Associates() { return PartnerTypeValues.Associates; } + /** * Returns a PartnerType enum value from a Javascript object name. * @param {Object} data The plain JavaScript object containing the name of the enum value. * @return {module:model/PartnerType} The enum PartnerType value. */ - exports.constructFromObject = function(object) { - return object; - } - - return exports; -})); - - + public constructFromObject(object: PartnerType|PartnerTypeValues|string) { return object; } +};