From 523d8c2ca95319e6fbbd28cd8c955707d5bc040e Mon Sep 17 00:00:00 2001 From: "Marco (Valandur)" Date: Thu, 23 Aug 2018 12:10:29 +0200 Subject: [PATCH 1/4] feat(integration): Add VillagerShops page --- src/containers/Full/Views.tsx | 18 + src/fetch/api.ts | 3671 +++++++++++++++++ src/types/index.ts | 3 +- src/views/Integrations/HuskyCrates/Crates.tsx | 7 +- .../Integrations/VillagerShops/ShopItem.tsx | 137 + .../Integrations/VillagerShops/Shops.tsx | 313 ++ 6 files changed, 4145 insertions(+), 4 deletions(-) create mode 100644 src/views/Integrations/VillagerShops/ShopItem.tsx create mode 100644 src/views/Integrations/VillagerShops/Shops.tsx diff --git a/src/containers/Full/Views.tsx b/src/containers/Full/Views.tsx index ef081e3..8882ff4 100644 --- a/src/containers/Full/Views.tsx +++ b/src/containers/Full/Views.tsx @@ -61,6 +61,9 @@ const UMItems = load(() => const WebBooksBooks = load(() => import('../../views/Integrations/WebBooks/Books') ); +const VShopsShops = load(() => + import('../../views/Integrations/VillagerShops/Shops') +); export const views: Array = [ { @@ -251,6 +254,21 @@ export const views: Array = [ } ] }, + { + title: 'VShops', + path: '/vshop', + perms: ['vshop'], + servlets: ['/vshop'], + views: [ + { + title: 'VShopShops', + path: '/vshop/shop', + icon: 'shop', + perms: ['vshop', 'shop'], + component: VShopsShops + } + ] + }, { title: 'WebBooks', path: '/web-books', diff --git a/src/fetch/api.ts b/src/fetch/api.ts index 7ce035e..1115921 100644 --- a/src/fetch/api.ts +++ b/src/fetch/api.ts @@ -605,6 +605,26 @@ export interface CatalogTypeAdvancementTree { name: string; } +/** + * + * @export + * @interface CatalogTypeCurrency + */ +export interface CatalogTypeCurrency { + /** + * The unique id that indexes this catalog type + * @type {string} + * @memberof CatalogTypeCurrency + */ + id: string; + /** + * The name of the catalog type + * @type {string} + * @memberof CatalogTypeCurrency + */ + name: string; +} + /** * * @export @@ -645,6 +665,26 @@ export interface CatalogTypeDimensionType { name: string; } +/** + * + * @export + * @interface CatalogTypeEntityType + */ +export interface CatalogTypeEntityType { + /** + * The unique id that indexes this catalog type + * @type {string} + * @memberof CatalogTypeEntityType + */ + id: string; + /** + * The name of the catalog type + * @type {string} + * @memberof CatalogTypeEntityType + */ + name: string; +} + /** * * @export @@ -12464,6 +12504,142 @@ export interface VehicleData { vehicle: EntitySnapshot; } +/** + * + * @export + * @interface VillagerShopsShop + */ +export interface VillagerShopsShop { + /** + * The minecraft entity type string for this shops visual entity + * @type {CatalogTypeEntityType} + * @memberof VillagerShopsShop + */ + entityType: CatalogTypeEntityType; + /** + * The API link that can be used to obtain more information about this object + * @type {string} + * @memberof VillagerShopsShop + */ + link: string; + /** + * A very dynamic variant string for vanilla mobs, most variants as in the minecraft wiki should be supported + * @type {string} + * @memberof VillagerShopsShop + */ + entityVariant?: string; + /** + * Where the shop is currently located + * @type {Location} + * @memberof VillagerShopsShop + */ + location?: Location; + /** + * The escaped shop name + * @type {string} + * @memberof VillagerShopsShop + */ + name?: string; + /** + * If this shop is a player shop this conatins the UUID of this shops owner. Omitting this field or setting it to null will remove the player-shop association. + * @type {string} + * @memberof VillagerShopsShop + */ + owner?: string; + /** + * The mobs roations around their up-axis + * @type {number} + * @memberof VillagerShopsShop + */ + rotation?: number; + /** + * Location where a container should reside for stocking items. Omitting this field or setting it to null will remove the stock container. Having a player-shop without container is undefined behaviour! + * @type {Location} + * @memberof VillagerShopsShop + */ + stockContainer?: Location; + /** + * Returns a list of all stock items currently listed. This property is read only. + * @type {Array<VillagerShopsStockItem>} + * @memberof VillagerShopsShop + */ + stockItems?: Array; + /** + * The unique shop identifier; this is not the mob uuid + * @type {string} + * @memberof VillagerShopsShop + */ + uid?: string; +} + +/** + * + * @export + * @interface VillagerShopsStockItem + */ +export interface VillagerShopsStockItem { + /** + * The amount of money this stack consts to buy as player + * @type {number} + * @memberof VillagerShopsStockItem + */ + buyPrice: number; + /** + * The currency for this item listing + * @type {CatalogTypeCurrency} + * @memberof VillagerShopsStockItem + */ + currency: CatalogTypeCurrency; + /** + * Returns wether this shop has a limited stock + * @type {boolean} + * @memberof VillagerShopsStockItem + */ + hasStock: boolean; + /** + * The raw ItemStack data for this shop listing + * @type {ItemStack} + * @memberof VillagerShopsStockItem + */ + item: ItemStack; + /** + * If this shop has a limited stock, returns how many of these items can be stocked, 0 is unlimited + * @type {number} + * @memberof VillagerShopsStockItem + */ + maxStock: number; + /** + * The amount of money this stack earns the player when selling + * @type {number} + * @memberof VillagerShopsStockItem + */ + sellPrice: number; + /** + * The shop uuid offering this item listing + * @type {string} + * @memberof VillagerShopsStockItem + */ + shopId: string; + /** + * If this shop has a limited stock, returns how many items are stocked, otherwise returns items stack size + * @type {number} + * @memberof VillagerShopsStockItem + */ + stock: number; + /** + * The index of this item withing the shops inventory + * @type {number} + * @memberof VillagerShopsStockItem + */ + id?: number; + /** + * + * @type {string} + * @memberof VillagerShopsStockItem + */ + link?: string; +} + /** * * @export @@ -25399,6 +25575,3501 @@ export class UserApi extends BaseAPI { } +/** + * VShopsApi - fetch parameter creator + * @export + */ +export const VShopsApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling addShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsStockItem" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + const localVarPath = `/vshop/shop`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsShop" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling deleteShop.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling deleteShopItem.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling deleteShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling getShop.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling getShopItem.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling getShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling listShopItems.'); + } + const localVarPath = `/vshop/shop/{id}/item` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops(details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + const localVarPath = `/vshop/shop`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling updateShop.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsShop" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling updateShopItem.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling updateShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsStockItem" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * VShopsApi - functional programming interface + * @export + */ +export const VShopsApiFp = function(configuration?: Configuration) { + return { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).addShopItem(id, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).createShop(body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).deleteShop(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).deleteShopItem(id, item, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).getShop(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).getShopItem(id, item, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).listShopItems(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops(details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).listShops(details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).updateShop(id, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VShopsApiFetchParamCreator(configuration).updateShopItem(id, item, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + } +}; + +/** + * VShopsApi - factory interface + * @export + */ +export const VShopsApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) { + return { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).addShopItem(id, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).createShop(body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).deleteShop(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).deleteShopItem(id, item, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).getShop(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).getShopItem(id, item, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).listShopItems(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops(details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).listShops(details, accept, pretty, options)(fetch, basePath); + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).updateShop(id, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(configuration).updateShopItem(id, item, body, details, accept, pretty, options)(fetch, basePath); + }, + }; +}; + +/** + * VShopsApi - object-oriented interface + * @export + * @class VShopsApi + * @extends {BaseAPI} + */ +export class VShopsApi extends BaseAPI { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {} id + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).addShopItem(id, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).createShop(body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).deleteShop(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {} id + * @param {} item + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).deleteShopItem(id, item, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).getShop(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {} id + * @param {} item + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).getShopItem(id, item, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).listShopItems(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public listShops(details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).listShops(details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {} id + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).updateShop(id, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {} id + * @param {} item + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VShopsApi + */ + public updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VShopsApiFp(this.configuration).updateShopItem(id, item, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + +} + +/** + * VillagerShopsApi - fetch parameter creator + * @export + */ +export const VillagerShopsApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling addShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsStockItem" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem_1(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling addShopItem_1.'); + } + const localVarPath = `/vshop/shop/{id}/item` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsStockItem" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + const localVarPath = `/vshop/shop`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsShop" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop_2(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + const localVarPath = `/vshop/shop`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsShop" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling deleteShop.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling deleteShopItem.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling deleteShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem_3(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling deleteShopItem_3.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling deleteShopItem_3.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop_4(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling deleteShop_4.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling getShop.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling getShopItem.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling getShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem_5(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling getShopItem_5.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling getShopItem_5.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop_6(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling getShop_6.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling listShopItems.'); + } + const localVarPath = `/vshop/shop/{id}/item` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems_7(id: string, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling listShopItems_7.'); + } + const localVarPath = `/vshop/shop/{id}/item` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops(details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + const localVarPath = `/vshop/shop`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops_8(details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + const localVarPath = `/vshop/shop`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling updateShop.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsShop" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling updateShopItem.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling updateShopItem.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsStockItem" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem_9(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling updateShopItem_9.'); + } + // verify required parameter 'item' is not null or undefined + if (item === null || item === undefined) { + throw new RequiredError('item','Required parameter item was null or undefined when calling updateShopItem_9.'); + } + const localVarPath = `/vshop/shop/{id}/item/{item}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) + .replace(`{${"item"}}`, encodeURIComponent(String(item))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsStockItem" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop_10(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options: any = {}): FetchArgs { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling updateShop_10.'); + } + const localVarPath = `/vshop/shop/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication ApiKeyHeader required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("X-WebAPI-Key") + : configuration.apiKey; + localVarHeaderParameter["X-WebAPI-Key"] = localVarApiKeyValue; + } + + // authentication ApiKeyQuery required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("key") + : configuration.apiKey; + localVarQueryParameter["key"] = localVarApiKeyValue; + } + + if (details !== undefined) { + localVarQueryParameter['details'] = details; + } + + if (accept !== undefined) { + localVarQueryParameter['accept'] = accept; + } + + if (pretty !== undefined) { + localVarQueryParameter['pretty'] = pretty; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = ("VillagerShopsShop" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * VillagerShopsApi - functional programming interface + * @export + */ +export const VillagerShopsApiFp = function(configuration?: Configuration) { + return { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).addShopItem(id, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem_1(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).addShopItem_1(id, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).createShop(body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop_2(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).createShop_2(body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).deleteShop(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).deleteShopItem(id, item, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem_3(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).deleteShopItem_3(id, item, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop_4(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).deleteShop_4(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).getShop(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).getShopItem(id, item, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem_5(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).getShopItem_5(id, item, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop_6(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).getShop_6(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).listShopItems(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems_7(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).listShopItems_7(id, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops(details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).listShops(details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops_8(details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).listShops_8(details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).updateShop(id, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).updateShopItem(id, item, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem_9(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).updateShopItem_9(id, item, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop_10(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const localVarFetchArgs = VillagerShopsApiFetchParamCreator(configuration).updateShop_10(id, body, details, accept, pretty, options); + return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + } +}; + +/** + * VillagerShopsApi - factory interface + * @export + */ +export const VillagerShopsApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) { + return { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).addShopItem(id, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {string} id + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addShopItem_1(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).addShopItem_1(id, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).createShop(body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createShop_2(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).createShop_2(body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).deleteShop(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).deleteShopItem(id, item, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShopItem_3(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).deleteShopItem_3(id, item, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteShop_4(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).deleteShop_4(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).getShop(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).getShopItem(id, item, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {string} id + * @param {number} item + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShopItem_5(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).getShopItem_5(id, item, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getShop_6(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).getShop_6(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).listShopItems(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {string} id + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShopItems_7(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).listShopItems_7(id, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops(details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).listShops(details, accept, pretty, options)(fetch, basePath); + }, + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listShops_8(details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).listShops_8(details, accept, pretty, options)(fetch, basePath); + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).updateShop(id, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).updateShopItem(id, item, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {string} id + * @param {number} item + * @param {VillagerShopsStockItem} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShopItem_9(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).updateShopItem_9(id, item, body, details, accept, pretty, options)(fetch, basePath); + }, + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {string} id + * @param {VillagerShopsShop} [body] + * @param {boolean} [details] Add to include additional details, omit or false otherwise + * @param {string} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {boolean} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateShop_10(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(configuration).updateShop_10(id, body, details, accept, pretty, options)(fetch, basePath); + }, + }; +}; + +/** + * VillagerShopsApi - object-oriented interface + * @export + * @class VillagerShopsApi + * @extends {BaseAPI} + */ +export class VillagerShopsApi extends BaseAPI { + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {} id + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public addShopItem(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).addShopItem(id, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Add a item to the shops listing **Required permissions:** - **vshop.vshop.item.create** + * @summary Add Shop Item + * @param {} id + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public addShopItem_1(id: string, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).addShopItem_1(id, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public createShop(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).createShop(body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Spawn a new shop with base values; Some values are only set by update **Required permissions:** - **vshop.vshop.create** + * @summary Create Shops + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public createShop_2(body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).createShop_2(body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public deleteShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).deleteShop(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {} id + * @param {} item + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public deleteShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).deleteShopItem(id, item, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Remove an item from this shop **Required permissions:** - **vshop.vshop.item.delete** + * @summary Removes a Shop Item + * @param {} id + * @param {} item + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public deleteShopItem_3(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).deleteShopItem_3(id, item, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Permanently delete a shop from the server **Required permissions:** - **vshop.vshop.delete** + * @summary Delete a Shop + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public deleteShop_4(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).deleteShop_4(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public getShop(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).getShop(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {} id + * @param {} item + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public getShopItem(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).getShopItem(id, item, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Get detailed information about a shop item **Required permissions:** - **vshop.vshop.item.one** + * @summary Get a Shop + * @param {} id + * @param {} item + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public getShopItem_5(id: string, item: number, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).getShopItem_5(id, item, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Get detailed information about a shop **Required permissions:** - **vshop.vshop.one** + * @summary Get a Shop + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public getShop_6(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).getShop_6(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public listShopItems(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).listShopItems(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Return a list of all shops items **Required permissions:** - **vshop.vshop.item.list** + * @summary List Shop Items + * @param {} id + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public listShopItems_7(id: string, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).listShopItems_7(id, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public listShops(details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).listShops(details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Return a list of all shops **Required permissions:** - **vshop.vshop.list** + * @summary List Shops + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public listShops_8(details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).listShops_8(details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {} id + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public updateShop(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).updateShop(id, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {} id + * @param {} item + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public updateShopItem(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).updateShopItem(id, item, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Modifies values for this shop item **Required permissions:** - **vshop.vshop.item.edit** + * @summary Change Shop Item + * @param {} id + * @param {} item + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public updateShopItem_9(id: string, item: number, body?: VillagerShopsStockItem, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).updateShopItem_9(id, item, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + + /** + * Modifies values for this shop, but items **Required permissions:** - **vshop.vshop.edit** + * @summary Change Shop + * @param {} id + * @param {} [body] + * @param {} [details] Add to include additional details, omit or false otherwise + * @param {} [accept] Override the 'Accept' request header (useful for debugging your requests) + * @param {} [pretty] Add to make the Web-API pretty print the response (useful for debugging your requests) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof VillagerShopsApi + */ + public updateShop_10(id: string, body?: VillagerShopsShop, details?: boolean, accept?: string, pretty?: boolean, options?: any) { + return VillagerShopsApiFp(this.configuration).updateShop_10(id, body, details, accept, pretty, options)(this.fetch, this.basePath); + } + +} + /** * WebBooksApi - fetch parameter creator * @export diff --git a/src/types/index.ts b/src/types/index.ts index 353fa52..696435e 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -170,7 +170,8 @@ export enum CatalogTypeKeys { GameMode = 'entity.living.player.gamemode.GameMode', Generator = 'world.GeneratorType', Item = 'item.ItemType', - TileEntity = 'block.tileentity.TileEntityType' + TileEntity = 'block.tileentity.TileEntityType', + Currency = 'service.economy.Currency' } export enum PreferenceKey { diff --git a/src/views/Integrations/HuskyCrates/Crates.tsx b/src/views/Integrations/HuskyCrates/Crates.tsx index 35d3185..cc5c22d 100644 --- a/src/views/Integrations/HuskyCrates/Crates.tsx +++ b/src/views/Integrations/HuskyCrates/Crates.tsx @@ -106,7 +106,7 @@ class Crates extends React.Component { type: crate ? crate.type : undefined, free: crate ? crate.free : undefined, freeDelay: crate ? crate.freeDelay : undefined, - rewards: crate ? crate.rewards.map(r => _.assign({}, r)) : [] + rewards: crate ? crate.rewards.map(r => ({ ...r })) : [] }); } @@ -122,7 +122,7 @@ class Crates extends React.Component { data: DropdownProps ) { const cb = (name: string, value: string) => { - const newReward = _.assign({}, reward); + const newReward = _.cloneDeep(reward); _.set(newReward, name, value); this.setState({ @@ -429,7 +429,8 @@ class Crates extends React.Component {   + +   diff --git a/src/views/Integrations/VillagerShops/ShopItem.tsx b/src/views/Integrations/VillagerShops/ShopItem.tsx new file mode 100644 index 0000000..1bef6dd --- /dev/null +++ b/src/views/Integrations/VillagerShops/ShopItem.tsx @@ -0,0 +1,137 @@ +import * as React from 'react'; +import { + Button, + Dropdown, + DropdownProps, + Form, + Input, + Table +} from 'semantic-ui-react'; + +import { renderCatalogTypeOptions } from '../../../components/Util'; +import { CatalogType, VillagerShopsStockItem } from '../../../fetch'; + +interface Props extends reactI18Next.InjectedTranslateProps { + item: VillagerShopsStockItem; + itemTypes: CatalogType[]; + currencies: CatalogType[]; + onChange: ( + event: React.SyntheticEvent, + data?: DropdownProps + ) => void; + onRemove: () => void; +} + +interface OwnState {} + +class ShopItem extends React.Component { + shouldComponentUpdate(nextProps: Props, nextState: OwnState) { + console.log(this.props); + console.log(nextProps); + return ( + !nextProps.item || + !this.props.item || + nextProps.item.id !== this.props.item.id || + nextProps.item.item.quantity !== this.props.item.item.quantity || + nextProps.item.item.type.id !== this.props.item.item.type.id || + nextProps.item.buyPrice !== this.props.item.buyPrice || + nextProps.item.sellPrice !== this.props.item.sellPrice || + nextProps.item.stock !== this.props.item.stock || + nextProps.item.maxStock !== this.props.item.maxStock || + nextProps.item.currency.id !== this.props.item.currency.id + ); + } + + render() { + const { item, t, onChange, onRemove } = this.props; + + return ( + + + onChange(e, val)} + /> + + + onChange(e)} + value={item.item.quantity} + /> + + + onChange(e)} + value={item.buyPrice} + /> + + + onChange(e)} + value={item.sellPrice} + /> + + + onChange(e, val)} + /> + + + onChange(e)} + value={item.stock} + /> + + + onChange(e)} + value={item.maxStock} + /> + + + +   + + + + ); + } +} + +const mapStateToProps = (state: AppState) => { + return { + entityTypes: state.api.types[CatalogTypeKeys.Entity], + itemTypes: state.api.types[CatalogTypeKeys.Item], + currencies: state.api.types[CatalogTypeKeys.Currency] + }; +}; + +const mapDispatchToProps = (dispatch: Dispatch) => { + return { + requestCatalog: (type: string): AppAction => dispatch(requestCatalog(type)) + }; +}; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(translate('Integrations.VShop')(Shops)); From edeee30a6354cdbda8826f11a4533f8116e8441b Mon Sep 17 00:00:00 2001 From: "Marco (Valandur)" Date: Thu, 23 Aug 2018 12:10:40 +0200 Subject: [PATCH 2/4] chore(ts): Update tsconfig.json --- tsconfig.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 5ca968b..a9ce3ed 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,9 @@ "module": "esnext", "target": "es5", "lib": [ - "es7", + "es2016", + "es2017", + "es2018", "dom" ], "sourceMap": true, @@ -30,4 +32,4 @@ "jest", "src/setupTests.ts" ] -} \ No newline at end of file +} From c1a66a110c43494b7a98ba2c0e072a155052be0b Mon Sep 17 00:00:00 2001 From: Valandur Date: Thu, 23 Aug 2018 12:20:52 +0200 Subject: [PATCH 3/4] fix(api): Fix mixed content requests --- src/services/api.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/api.ts b/src/services/api.ts index 8a50be7..34f2900 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -64,7 +64,9 @@ const api = ({ const state = getState(); const makeUrl = (path: string) => - state.api.server.apiUrl + + (window.location.protocol === 'https:' && state.api.server.apiUrlHttps + ? state.api.server.apiUrlHttps + : state.api.server.apiUrl) + '/api/v5/' + path + (path.indexOf('?') >= 0 ? '&' : '?') + From d83b15c082371edf90bd06b459627dd5ae8c2afa Mon Sep 17 00:00:00 2001 From: "Marco (Valandur)" Date: Thu, 23 Aug 2018 12:22:35 +0200 Subject: [PATCH 4/4] chore(version): Bump version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9eb501..2295919 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webapi-admin-panel", - "version": "5.2.1", + "version": "5.3.0", "homepage": ".", "proxy": "http://localhost:8080/", "devDependencies": {