From bef53bfbacf8b1b816a6a83e2b821c6c6e1e7d8e Mon Sep 17 00:00:00 2001 From: James Kachel Date: Thu, 29 Feb 2024 09:33:33 -0600 Subject: [PATCH] Updating OpenAPI, getting tests to run properly --- frontends/api/src/generated/api.ts | 2935 +++++++----------- frontends/api/src/generated/base.ts | 52 +- frontends/api/src/generated/common.ts | 188 +- frontends/api/src/generated/configuration.ts | 182 +- frontends/api/src/generated/index.ts | 5 +- openapi.yaml | 56 +- poetry.lock | 31 +- pyproject.toml | 1 + 8 files changed, 1410 insertions(+), 2040 deletions(-) diff --git a/frontends/api/src/generated/api.ts b/frontends/api/src/generated/api.ts index 55786959..91de6ce0 100644 --- a/frontends/api/src/generated/api.ts +++ b/frontends/api/src/generated/api.ts @@ -12,26 +12,16 @@ * Do not edit the class manually. */ -import type { Configuration } from "./configuration" -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios" -import globalAxios from "axios" + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "./common" -import type { RequestArgs } from "./base" +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from "./base" +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; /** * Serializer for IntegratedSystem model. @@ -39,54 +29,30 @@ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from "./base" * @interface IntegratedSystem */ export interface IntegratedSystem { - /** - * - * @type {number} - * @memberof IntegratedSystem - */ - id: number - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - deleted_on: string | null - /** - * - * @type {boolean} - * @memberof IntegratedSystem - */ - deleted_by_cascade: boolean - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - created_on: string - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - updated_on: string - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - name: string - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - description?: string - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - api_key?: string + /** + * + * @type {number} + * @memberof IntegratedSystem + */ + 'id': number; + /** + * + * @type {string} + * @memberof IntegratedSystem + */ + 'name': string; + /** + * + * @type {string} + * @memberof IntegratedSystem + */ + 'slug'?: string | null; + /** + * + * @type {string} + * @memberof IntegratedSystem + */ + 'description'?: string; } /** * @@ -94,30 +60,30 @@ export interface IntegratedSystem { * @interface PaginatedIntegratedSystemList */ export interface PaginatedIntegratedSystemList { - /** - * - * @type {number} - * @memberof PaginatedIntegratedSystemList - */ - count?: number - /** - * - * @type {string} - * @memberof PaginatedIntegratedSystemList - */ - next?: string | null - /** - * - * @type {string} - * @memberof PaginatedIntegratedSystemList - */ - previous?: string | null - /** - * - * @type {Array} - * @memberof PaginatedIntegratedSystemList - */ - results?: Array + /** + * + * @type {number} + * @memberof PaginatedIntegratedSystemList + */ + 'count'?: number; + /** + * + * @type {string} + * @memberof PaginatedIntegratedSystemList + */ + 'next'?: string | null; + /** + * + * @type {string} + * @memberof PaginatedIntegratedSystemList + */ + 'previous'?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedIntegratedSystemList + */ + 'results'?: Array; } /** * @@ -125,30 +91,30 @@ export interface PaginatedIntegratedSystemList { * @interface PaginatedProductList */ export interface PaginatedProductList { - /** - * - * @type {number} - * @memberof PaginatedProductList - */ - count?: number - /** - * - * @type {string} - * @memberof PaginatedProductList - */ - next?: string | null - /** - * - * @type {string} - * @memberof PaginatedProductList - */ - previous?: string | null - /** - * - * @type {Array} - * @memberof PaginatedProductList - */ - results?: Array + /** + * + * @type {number} + * @memberof PaginatedProductList + */ + 'count'?: number; + /** + * + * @type {string} + * @memberof PaginatedProductList + */ + 'next'?: string | null; + /** + * + * @type {string} + * @memberof PaginatedProductList + */ + 'previous'?: string | null; + /** + * + * @type {Array} + * @memberof PaginatedProductList + */ + 'results'?: Array; } /** * Serializer for IntegratedSystem model. @@ -156,54 +122,30 @@ export interface PaginatedProductList { * @interface PatchedIntegratedSystem */ export interface PatchedIntegratedSystem { - /** - * - * @type {number} - * @memberof PatchedIntegratedSystem - */ - id?: number - /** - * - * @type {string} - * @memberof PatchedIntegratedSystem - */ - deleted_on?: string | null - /** - * - * @type {boolean} - * @memberof PatchedIntegratedSystem - */ - deleted_by_cascade?: boolean - /** - * - * @type {string} - * @memberof PatchedIntegratedSystem - */ - created_on?: string - /** - * - * @type {string} - * @memberof PatchedIntegratedSystem - */ - updated_on?: string - /** - * - * @type {string} - * @memberof PatchedIntegratedSystem - */ - name?: string - /** - * - * @type {string} - * @memberof PatchedIntegratedSystem - */ - description?: string - /** - * - * @type {string} - * @memberof PatchedIntegratedSystem - */ - api_key?: string + /** + * + * @type {number} + * @memberof PatchedIntegratedSystem + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof PatchedIntegratedSystem + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof PatchedIntegratedSystem + */ + 'slug'?: string | null; + /** + * + * @type {string} + * @memberof PatchedIntegratedSystem + */ + 'description'?: string; } /** * Serializer for Product model. @@ -211,772 +153,533 @@ export interface PatchedIntegratedSystem { * @interface PatchedProduct */ export interface PatchedProduct { - /** - * - * @type {number} - * @memberof PatchedProduct - */ - id?: number - /** - * - * @type {string} - * @memberof PatchedProduct - */ - deleted_on?: string | null - /** - * - * @type {boolean} - * @memberof PatchedProduct - */ - deleted_by_cascade?: boolean - /** - * - * @type {string} - * @memberof PatchedProduct - */ - created_on?: string - /** - * - * @type {string} - * @memberof PatchedProduct - */ - updated_on?: string - /** - * SKU of the product. - * @type {string} - * @memberof PatchedProduct - */ - sku?: string - /** - * Short name of the product, displayed in carts/etc. - * @type {string} - * @memberof PatchedProduct - */ - name?: string - /** - * Price (decimal to two places) - * @type {string} - * @memberof PatchedProduct - */ - price?: string - /** - * Long description of the product. - * @type {string} - * @memberof PatchedProduct - */ - description?: string - /** - * System-specific data for the product (in JSON). - * @type {any} - * @memberof PatchedProduct - */ - system_data?: any | null - /** - * Owner system of the product. - * @type {number} - * @memberof PatchedProduct - */ - system?: number -} -/** - * Serializer for Product model. - * @export - * @interface Product - */ -export interface Product { - /** - * - * @type {number} - * @memberof Product - */ - id: number - /** - * - * @type {string} - * @memberof Product - */ - deleted_on: string | null - /** - * - * @type {boolean} - * @memberof Product - */ - deleted_by_cascade: boolean - /** - * - * @type {string} - * @memberof Product - */ - created_on: string - /** - * - * @type {string} - * @memberof Product - */ - updated_on: string - /** - * SKU of the product. - * @type {string} - * @memberof Product - */ - sku: string - /** - * Short name of the product, displayed in carts/etc. - * @type {string} - * @memberof Product - */ - name: string - /** - * Price (decimal to two places) - * @type {string} - * @memberof Product - */ - price: string - /** - * Long description of the product. - * @type {string} - * @memberof Product - */ - description: string - /** - * System-specific data for the product (in JSON). - * @type {any} - * @memberof Product - */ - system_data?: any | null - /** - * Owner system of the product. - * @type {number} - * @memberof Product - */ - system: number -} - -/** - * IntegratedSystemApi - axios parameter creator - * @export - */ -export const IntegratedSystemApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystem} IntegratedSystem - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {number} + * @memberof PatchedProduct */ - integratedSystemCreate: async ( - IntegratedSystem: IntegratedSystem, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'IntegratedSystem' is not null or undefined - assertParamExists( - "integratedSystemCreate", - "IntegratedSystem", - IntegratedSystem, - ) - const localVarPath = `/integrated_system/` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "POST", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - IntegratedSystem, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + 'id'?: number; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {string} + * @memberof PatchedProduct */ - integratedSystemDestroy: async ( - id: number, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("integratedSystemDestroy", "id", id) - const localVarPath = `/integrated_system/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "DELETE", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + 'deleted_on'?: string | null; /** - * Viewset for IntegratedSystem model. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - integratedSystemList: async ( - limit?: number, - offset?: number, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/integrated_system/` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit - } - - if (offset !== undefined) { - localVarQueryParameter["offset"] = offset - } - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {PatchedIntegratedSystem} [PatchedIntegratedSystem] - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {boolean} + * @memberof PatchedProduct */ - integratedSystemPartialUpdate: async ( - id: number, - PatchedIntegratedSystem?: PatchedIntegratedSystem, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("integratedSystemPartialUpdate", "id", id) - const localVarPath = `/integrated_system/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "PATCH", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - PatchedIntegratedSystem, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + 'deleted_by_cascade'?: boolean; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {string} + * @memberof PatchedProduct */ - integratedSystemRetrieve: async ( - id: number, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("integratedSystemRetrieve", "id", id) - const localVarPath = `/integrated_system/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + 'created_on'?: string; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {IntegratedSystem} IntegratedSystem - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {string} + * @memberof PatchedProduct */ - integratedSystemUpdate: async ( - id: number, - IntegratedSystem: IntegratedSystem, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("integratedSystemUpdate", "id", id) - // verify required parameter 'IntegratedSystem' is not null or undefined - assertParamExists( - "integratedSystemUpdate", - "IntegratedSystem", - IntegratedSystem, - ) - const localVarPath = `/integrated_system/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "PUT", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - IntegratedSystem, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - } -} - -/** - * IntegratedSystemApi - functional programming interface - * @export - */ -export const IntegratedSystemApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - IntegratedSystemApiAxiosParamCreator(configuration) - return { + 'updated_on'?: string; /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystem} IntegratedSystem - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * SKU of the product. + * @type {string} + * @memberof PatchedProduct */ - async integratedSystemCreate( - IntegratedSystem: IntegratedSystem, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.integratedSystemCreate( - IntegratedSystem, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, + 'sku'?: string; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * Short name of the product, displayed in carts/etc. + * @type {string} + * @memberof PatchedProduct */ - async integratedSystemDestroy( - id: number, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.integratedSystemDestroy(id, options) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, + 'name'?: string; /** - * Viewset for IntegratedSystem model. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * Price (decimal to two places) + * @type {string} + * @memberof PatchedProduct */ - async integratedSystemList( - limit?: number, - offset?: number, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.integratedSystemList( - limit, - offset, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, + 'price'?: string; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {PatchedIntegratedSystem} [PatchedIntegratedSystem] - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * Long description of the product. + * @type {string} + * @memberof PatchedProduct */ - async integratedSystemPartialUpdate( - id: number, - PatchedIntegratedSystem?: PatchedIntegratedSystem, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.integratedSystemPartialUpdate( - id, - PatchedIntegratedSystem, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, + 'description'?: string; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * System-specific data for the product (in JSON). + * @type {any} + * @memberof PatchedProduct */ - async integratedSystemRetrieve( - id: number, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.integratedSystemRetrieve(id, options) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, + 'system_data'?: any | null; /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {IntegratedSystem} IntegratedSystem - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * Owner system of the product. + * @type {number} + * @memberof PatchedProduct */ - async integratedSystemUpdate( - id: number, - IntegratedSystem: IntegratedSystem, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.integratedSystemUpdate( - id, - IntegratedSystem, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - } + 'system'?: number; } - /** - * IntegratedSystemApi - factory interface + * Serializer for Product model. * @export + * @interface Product */ -export const IntegratedSystemApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = IntegratedSystemApiFp(configuration) - return { +export interface Product { /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {number} + * @memberof Product */ - integratedSystemCreate( - requestParameters: IntegratedSystemApiIntegratedSystemCreateRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .integratedSystemCreate(requestParameters.IntegratedSystem, options) - .then((request) => request(axios, basePath)) - }, + 'id': number; /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {string} + * @memberof Product */ - integratedSystemDestroy( - requestParameters: IntegratedSystemApiIntegratedSystemDestroyRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .integratedSystemDestroy(requestParameters.id, options) - .then((request) => request(axios, basePath)) - }, + 'deleted_on': string | null; /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {boolean} + * @memberof Product */ - integratedSystemList( - requestParameters: IntegratedSystemApiIntegratedSystemListRequest = {}, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .integratedSystemList( - requestParameters.limit, - requestParameters.offset, - options, - ) - .then((request) => request(axios, basePath)) - }, + 'deleted_by_cascade': boolean; /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {string} + * @memberof Product */ - integratedSystemPartialUpdate( - requestParameters: IntegratedSystemApiIntegratedSystemPartialUpdateRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .integratedSystemPartialUpdate( - requestParameters.id, - requestParameters.PatchedIntegratedSystem, - options, - ) - .then((request) => request(axios, basePath)) - }, + 'created_on': string; /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * + * @type {string} + * @memberof Product */ - integratedSystemRetrieve( - requestParameters: IntegratedSystemApiIntegratedSystemRetrieveRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .integratedSystemRetrieve(requestParameters.id, options) - .then((request) => request(axios, basePath)) - }, + 'updated_on': string; /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} + * SKU of the product. + * @type {string} + * @memberof Product + */ + 'sku': string; + /** + * Short name of the product, displayed in carts/etc. + * @type {string} + * @memberof Product + */ + 'name': string; + /** + * Price (decimal to two places) + * @type {string} + * @memberof Product + */ + 'price': string; + /** + * Long description of the product. + * @type {string} + * @memberof Product + */ + 'description': string; + /** + * System-specific data for the product (in JSON). + * @type {any} + * @memberof Product + */ + 'system_data'?: any | null; + /** + * Owner system of the product. + * @type {number} + * @memberof Product */ - integratedSystemUpdate( - requestParameters: IntegratedSystemApiIntegratedSystemUpdateRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .integratedSystemUpdate( - requestParameters.id, - requestParameters.IntegratedSystem, - options, - ) - .then((request) => request(axios, basePath)) - }, - } + 'system': number; } +/** + * IntegratedSystemApi - axios parameter creator + * @export + */ +export const IntegratedSystemApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystem} IntegratedSystem + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemCreate: async (IntegratedSystem: IntegratedSystem, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'IntegratedSystem' is not null or undefined + assertParamExists('integratedSystemCreate', 'IntegratedSystem', IntegratedSystem) + const localVarPath = `/integrated_system/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(IntegratedSystem, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('integratedSystemDestroy', 'id', id) + const localVarPath = `/integrated_system/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemList: async (limit?: number, offset?: number, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/integrated_system/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {PatchedIntegratedSystem} [PatchedIntegratedSystem] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemPartialUpdate: async (id: number, PatchedIntegratedSystem?: PatchedIntegratedSystem, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('integratedSystemPartialUpdate', 'id', id) + const localVarPath = `/integrated_system/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(PatchedIntegratedSystem, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('integratedSystemRetrieve', 'id', id) + const localVarPath = `/integrated_system/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {IntegratedSystem} IntegratedSystem + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemUpdate: async (id: number, IntegratedSystem: IntegratedSystem, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('integratedSystemUpdate', 'id', id) + // verify required parameter 'IntegratedSystem' is not null or undefined + assertParamExists('integratedSystemUpdate', 'IntegratedSystem', IntegratedSystem) + const localVarPath = `/integrated_system/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(IntegratedSystem, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * IntegratedSystemApi - functional programming interface + * @export + */ +export const IntegratedSystemApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = IntegratedSystemApiAxiosParamCreator(configuration) + return { + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystem} IntegratedSystem + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async integratedSystemCreate(IntegratedSystem: IntegratedSystem, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.integratedSystemCreate(IntegratedSystem, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async integratedSystemDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.integratedSystemDestroy(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async integratedSystemList(limit?: number, offset?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.integratedSystemList(limit, offset, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {PatchedIntegratedSystem} [PatchedIntegratedSystem] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async integratedSystemPartialUpdate(id: number, PatchedIntegratedSystem?: PatchedIntegratedSystem, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.integratedSystemPartialUpdate(id, PatchedIntegratedSystem, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async integratedSystemRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.integratedSystemRetrieve(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {IntegratedSystem} IntegratedSystem + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async integratedSystemUpdate(id: number, IntegratedSystem: IntegratedSystem, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.integratedSystemUpdate(id, IntegratedSystem, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * IntegratedSystemApi - factory interface + * @export + */ +export const IntegratedSystemApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = IntegratedSystemApiFp(configuration) + return { + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemCreate(requestParameters: IntegratedSystemApiIntegratedSystemCreateRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.integratedSystemCreate(requestParameters.IntegratedSystem, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemDestroy(requestParameters: IntegratedSystemApiIntegratedSystemDestroyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.integratedSystemDestroy(requestParameters.id, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemList(requestParameters: IntegratedSystemApiIntegratedSystemListRequest = {}, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.integratedSystemList(requestParameters.limit, requestParameters.offset, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemPartialUpdate(requestParameters: IntegratedSystemApiIntegratedSystemPartialUpdateRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.integratedSystemPartialUpdate(requestParameters.id, requestParameters.PatchedIntegratedSystem, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemRetrieve(requestParameters: IntegratedSystemApiIntegratedSystemRetrieveRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.integratedSystemRetrieve(requestParameters.id, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + integratedSystemUpdate(requestParameters: IntegratedSystemApiIntegratedSystemUpdateRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.integratedSystemUpdate(requestParameters.id, requestParameters.IntegratedSystem, options).then((request) => request(axios, basePath)); + }, + }; +}; + /** * Request parameters for integratedSystemCreate operation in IntegratedSystemApi. * @export * @interface IntegratedSystemApiIntegratedSystemCreateRequest */ export interface IntegratedSystemApiIntegratedSystemCreateRequest { - /** - * - * @type {IntegratedSystem} - * @memberof IntegratedSystemApiIntegratedSystemCreate - */ - readonly IntegratedSystem: IntegratedSystem + /** + * + * @type {IntegratedSystem} + * @memberof IntegratedSystemApiIntegratedSystemCreate + */ + readonly IntegratedSystem: IntegratedSystem } /** @@ -985,12 +688,12 @@ export interface IntegratedSystemApiIntegratedSystemCreateRequest { * @interface IntegratedSystemApiIntegratedSystemDestroyRequest */ export interface IntegratedSystemApiIntegratedSystemDestroyRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof IntegratedSystemApiIntegratedSystemDestroy - */ - readonly id: number + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof IntegratedSystemApiIntegratedSystemDestroy + */ + readonly id: number } /** @@ -999,19 +702,19 @@ export interface IntegratedSystemApiIntegratedSystemDestroyRequest { * @interface IntegratedSystemApiIntegratedSystemListRequest */ export interface IntegratedSystemApiIntegratedSystemListRequest { - /** - * Number of results to return per page. - * @type {number} - * @memberof IntegratedSystemApiIntegratedSystemList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof IntegratedSystemApiIntegratedSystemList - */ - readonly offset?: number + /** + * Number of results to return per page. + * @type {number} + * @memberof IntegratedSystemApiIntegratedSystemList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof IntegratedSystemApiIntegratedSystemList + */ + readonly offset?: number } /** @@ -1020,19 +723,19 @@ export interface IntegratedSystemApiIntegratedSystemListRequest { * @interface IntegratedSystemApiIntegratedSystemPartialUpdateRequest */ export interface IntegratedSystemApiIntegratedSystemPartialUpdateRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof IntegratedSystemApiIntegratedSystemPartialUpdate - */ - readonly id: number - - /** - * - * @type {PatchedIntegratedSystem} - * @memberof IntegratedSystemApiIntegratedSystemPartialUpdate - */ - readonly PatchedIntegratedSystem?: PatchedIntegratedSystem + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof IntegratedSystemApiIntegratedSystemPartialUpdate + */ + readonly id: number + + /** + * + * @type {PatchedIntegratedSystem} + * @memberof IntegratedSystemApiIntegratedSystemPartialUpdate + */ + readonly PatchedIntegratedSystem?: PatchedIntegratedSystem } /** @@ -1041,12 +744,12 @@ export interface IntegratedSystemApiIntegratedSystemPartialUpdateRequest { * @interface IntegratedSystemApiIntegratedSystemRetrieveRequest */ export interface IntegratedSystemApiIntegratedSystemRetrieveRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof IntegratedSystemApiIntegratedSystemRetrieve - */ - readonly id: number + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof IntegratedSystemApiIntegratedSystemRetrieve + */ + readonly id: number } /** @@ -1055,19 +758,19 @@ export interface IntegratedSystemApiIntegratedSystemRetrieveRequest { * @interface IntegratedSystemApiIntegratedSystemUpdateRequest */ export interface IntegratedSystemApiIntegratedSystemUpdateRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof IntegratedSystemApiIntegratedSystemUpdate - */ - readonly id: number - - /** - * - * @type {IntegratedSystem} - * @memberof IntegratedSystemApiIntegratedSystemUpdate - */ - readonly IntegratedSystem: IntegratedSystem + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof IntegratedSystemApiIntegratedSystemUpdate + */ + readonly id: number + + /** + * + * @type {IntegratedSystem} + * @memberof IntegratedSystemApiIntegratedSystemUpdate + */ + readonly IntegratedSystem: IntegratedSystem } /** @@ -1077,699 +780,459 @@ export interface IntegratedSystemApiIntegratedSystemUpdateRequest { * @extends {BaseAPI} */ export class IntegratedSystemApi extends BaseAPI { - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IntegratedSystemApi - */ - public integratedSystemCreate( - requestParameters: IntegratedSystemApiIntegratedSystemCreateRequest, - options?: AxiosRequestConfig, - ) { - return IntegratedSystemApiFp(this.configuration) - .integratedSystemCreate(requestParameters.IntegratedSystem, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IntegratedSystemApi - */ - public integratedSystemDestroy( - requestParameters: IntegratedSystemApiIntegratedSystemDestroyRequest, - options?: AxiosRequestConfig, - ) { - return IntegratedSystemApiFp(this.configuration) - .integratedSystemDestroy(requestParameters.id, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IntegratedSystemApi - */ - public integratedSystemList( - requestParameters: IntegratedSystemApiIntegratedSystemListRequest = {}, - options?: AxiosRequestConfig, - ) { - return IntegratedSystemApiFp(this.configuration) - .integratedSystemList( - requestParameters.limit, - requestParameters.offset, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IntegratedSystemApi - */ - public integratedSystemPartialUpdate( - requestParameters: IntegratedSystemApiIntegratedSystemPartialUpdateRequest, - options?: AxiosRequestConfig, - ) { - return IntegratedSystemApiFp(this.configuration) - .integratedSystemPartialUpdate( - requestParameters.id, - requestParameters.PatchedIntegratedSystem, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IntegratedSystemApi - */ - public integratedSystemRetrieve( - requestParameters: IntegratedSystemApiIntegratedSystemRetrieveRequest, - options?: AxiosRequestConfig, - ) { - return IntegratedSystemApiFp(this.configuration) - .integratedSystemRetrieve(requestParameters.id, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemApiIntegratedSystemUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IntegratedSystemApi - */ - public integratedSystemUpdate( - requestParameters: IntegratedSystemApiIntegratedSystemUpdateRequest, - options?: AxiosRequestConfig, - ) { - return IntegratedSystemApiFp(this.configuration) - .integratedSystemUpdate( - requestParameters.id, - requestParameters.IntegratedSystem, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } -} - -/** - * ProductApi - axios parameter creator - * @export - */ -export const ProductApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { /** - * Viewset for Product model. - * @param {Product} Product + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemCreateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof IntegratedSystemApi */ - productCreate: async ( - Product: Product, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'Product' is not null or undefined - assertParamExists("productCreate", "Product", Product) - const localVarPath = `/product/` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "POST", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - Product, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + public integratedSystemCreate(requestParameters: IntegratedSystemApiIntegratedSystemCreateRequest, options?: AxiosRequestConfig) { + return IntegratedSystemApiFp(this.configuration).integratedSystemCreate(requestParameters.IntegratedSystem, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemDestroyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof IntegratedSystemApi */ - productDestroy: async ( - id: number, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("productDestroy", "id", id) - const localVarPath = `/product/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "DELETE", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + public integratedSystemDestroy(requestParameters: IntegratedSystemApiIntegratedSystemDestroyRequest, options?: AxiosRequestConfig) { + return IntegratedSystemApiFp(this.configuration).integratedSystemDestroy(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Viewset for Product model. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof IntegratedSystemApi */ - productList: async ( - limit?: number, - offset?: number, - options: AxiosRequestConfig = {}, - ): Promise => { - const localVarPath = `/product/` - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit - } - - if (offset !== undefined) { - localVarQueryParameter["offset"] = offset - } - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + public integratedSystemList(requestParameters: IntegratedSystemApiIntegratedSystemListRequest = {}, options?: AxiosRequestConfig) { + return IntegratedSystemApiFp(this.configuration).integratedSystemList(requestParameters.limit, requestParameters.offset, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {PatchedProduct} [PatchedProduct] + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof IntegratedSystemApi */ - productPartialUpdate: async ( - id: number, - PatchedProduct?: PatchedProduct, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("productPartialUpdate", "id", id) - const localVarPath = `/product/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "PATCH", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - PatchedProduct, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + public integratedSystemPartialUpdate(requestParameters: IntegratedSystemApiIntegratedSystemPartialUpdateRequest, options?: AxiosRequestConfig) { + return IntegratedSystemApiFp(this.configuration).integratedSystemPartialUpdate(requestParameters.id, requestParameters.PatchedIntegratedSystem, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemRetrieveRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof IntegratedSystemApi */ - productRetrieve: async ( - id: number, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("productRetrieve", "id", id) - const localVarPath = `/product/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, + public integratedSystemRetrieve(requestParameters: IntegratedSystemApiIntegratedSystemRetrieveRequest, options?: AxiosRequestConfig) { + return IntegratedSystemApiFp(this.configuration).integratedSystemRetrieve(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + } + /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {Product} Product + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemApiIntegratedSystemUpdateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} + * @memberof IntegratedSystemApi */ - productUpdate: async ( - id: number, - Product: Product, - options: AxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists("productUpdate", "id", id) - // verify required parameter 'Product' is not null or undefined - assertParamExists("productUpdate", "Product", Product) - const localVarPath = `/product/{id}/`.replace( - `{${"id"}}`, - encodeURIComponent(String(id)), - ) - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) - let baseOptions - if (configuration) { - baseOptions = configuration.baseOptions - } - - const localVarRequestOptions = { - method: "PUT", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - // authentication cookieAuth required - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - Product, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - } + public integratedSystemUpdate(requestParameters: IntegratedSystemApiIntegratedSystemUpdateRequest, options?: AxiosRequestConfig) { + return IntegratedSystemApiFp(this.configuration).integratedSystemUpdate(requestParameters.id, requestParameters.IntegratedSystem, options).then((request) => request(this.axios, this.basePath)); + } } + +/** + * ProductApi - axios parameter creator + * @export + */ +export const ProductApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Viewset for Product model. + * @param {Product} Product + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productCreate: async (Product: Product, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'Product' is not null or undefined + assertParamExists('productCreate', 'Product', Product) + const localVarPath = `/product/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(Product, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productDestroy: async (id: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('productDestroy', 'id', id) + const localVarPath = `/product/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for Product model. + * @param {number} [limit] Number of results to return per page. + * @param {string} [name] + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [system__slug] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productList: async (limit?: number, name?: string, offset?: number, system__slug?: string, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/product/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + if (system__slug !== undefined) { + localVarQueryParameter['system__slug'] = system__slug; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {PatchedProduct} [PatchedProduct] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productPartialUpdate: async (id: number, PatchedProduct?: PatchedProduct, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('productPartialUpdate', 'id', id) + const localVarPath = `/product/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(PatchedProduct, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('productRetrieve', 'id', id) + const localVarPath = `/product/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {Product} Product + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productUpdate: async (id: number, Product: Product, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('productUpdate', 'id', id) + // verify required parameter 'Product' is not null or undefined + assertParamExists('productUpdate', 'Product', Product) + const localVarPath = `/product/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication cookieAuth required + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(Product, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + /** * ProductApi - functional programming interface * @export */ -export const ProductApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = ProductApiAxiosParamCreator(configuration) - return { - /** - * Viewset for Product model. - * @param {Product} Product - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async productCreate( - Product: Product, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.productCreate( - Product, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async productDestroy( - id: number, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.productDestroy( - id, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - /** - * Viewset for Product model. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async productList( - limit?: number, - offset?: number, - options?: AxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.productList( - limit, - offset, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {PatchedProduct} [PatchedProduct] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async productPartialUpdate( - id: number, - PatchedProduct?: PatchedProduct, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.productPartialUpdate( - id, - PatchedProduct, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async productRetrieve( - id: number, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.productRetrieve( - id, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {Product} Product - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async productUpdate( - id: number, - Product: Product, - options?: AxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.productUpdate( - id, - Product, - options, - ) - return createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - ) - }, - } -} +export const ProductApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProductApiAxiosParamCreator(configuration) + return { + /** + * Viewset for Product model. + * @param {Product} Product + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async productCreate(Product: Product, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.productCreate(Product, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async productDestroy(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.productDestroy(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for Product model. + * @param {number} [limit] Number of results to return per page. + * @param {string} [name] + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [system__slug] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async productList(limit?: number, name?: string, offset?: number, system__slug?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.productList(limit, name, offset, system__slug, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {PatchedProduct} [PatchedProduct] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async productPartialUpdate(id: number, PatchedProduct?: PatchedProduct, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.productPartialUpdate(id, PatchedProduct, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async productRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.productRetrieve(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {Product} Product + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async productUpdate(id: number, Product: Product, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.productUpdate(id, Product, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; /** * ProductApi - factory interface * @export */ -export const ProductApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = ProductApiFp(configuration) - return { - /** - * Viewset for Product model. - * @param {ProductApiProductCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - productCreate( - requestParameters: ProductApiProductCreateRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .productCreate(requestParameters.Product, options) - .then((request) => request(axios, basePath)) - }, - /** - * Viewset for Product model. - * @param {ProductApiProductDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - productDestroy( - requestParameters: ProductApiProductDestroyRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .productDestroy(requestParameters.id, options) - .then((request) => request(axios, basePath)) - }, - /** - * Viewset for Product model. - * @param {ProductApiProductListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - productList( - requestParameters: ProductApiProductListRequest = {}, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .productList(requestParameters.limit, requestParameters.offset, options) - .then((request) => request(axios, basePath)) - }, - /** - * Viewset for Product model. - * @param {ProductApiProductPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - productPartialUpdate( - requestParameters: ProductApiProductPartialUpdateRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .productPartialUpdate( - requestParameters.id, - requestParameters.PatchedProduct, - options, - ) - .then((request) => request(axios, basePath)) - }, - /** - * Viewset for Product model. - * @param {ProductApiProductRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - productRetrieve( - requestParameters: ProductApiProductRetrieveRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .productRetrieve(requestParameters.id, options) - .then((request) => request(axios, basePath)) - }, - /** - * Viewset for Product model. - * @param {ProductApiProductUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - productUpdate( - requestParameters: ProductApiProductUpdateRequest, - options?: AxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .productUpdate(requestParameters.id, requestParameters.Product, options) - .then((request) => request(axios, basePath)) - }, - } -} +export const ProductApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProductApiFp(configuration) + return { + /** + * Viewset for Product model. + * @param {ProductApiProductCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productCreate(requestParameters: ProductApiProductCreateRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.productCreate(requestParameters.Product, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for Product model. + * @param {ProductApiProductDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productDestroy(requestParameters: ProductApiProductDestroyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.productDestroy(requestParameters.id, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for Product model. + * @param {ProductApiProductListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productList(requestParameters: ProductApiProductListRequest = {}, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.productList(requestParameters.limit, requestParameters.name, requestParameters.offset, requestParameters.system__slug, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for Product model. + * @param {ProductApiProductPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productPartialUpdate(requestParameters: ProductApiProductPartialUpdateRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.productPartialUpdate(requestParameters.id, requestParameters.PatchedProduct, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for Product model. + * @param {ProductApiProductRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productRetrieve(requestParameters: ProductApiProductRetrieveRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.productRetrieve(requestParameters.id, options).then((request) => request(axios, basePath)); + }, + /** + * Viewset for Product model. + * @param {ProductApiProductUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + productUpdate(requestParameters: ProductApiProductUpdateRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.productUpdate(requestParameters.id, requestParameters.Product, options).then((request) => request(axios, basePath)); + }, + }; +}; /** * Request parameters for productCreate operation in ProductApi. @@ -1777,12 +1240,12 @@ export const ProductApiFactory = function ( * @interface ProductApiProductCreateRequest */ export interface ProductApiProductCreateRequest { - /** - * - * @type {Product} - * @memberof ProductApiProductCreate - */ - readonly Product: Product + /** + * + * @type {Product} + * @memberof ProductApiProductCreate + */ + readonly Product: Product } /** @@ -1791,12 +1254,12 @@ export interface ProductApiProductCreateRequest { * @interface ProductApiProductDestroyRequest */ export interface ProductApiProductDestroyRequest { - /** - * A unique integer value identifying this product. - * @type {number} - * @memberof ProductApiProductDestroy - */ - readonly id: number + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof ProductApiProductDestroy + */ + readonly id: number } /** @@ -1805,19 +1268,33 @@ export interface ProductApiProductDestroyRequest { * @interface ProductApiProductListRequest */ export interface ProductApiProductListRequest { - /** - * Number of results to return per page. - * @type {number} - * @memberof ProductApiProductList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof ProductApiProductList - */ - readonly offset?: number + /** + * Number of results to return per page. + * @type {number} + * @memberof ProductApiProductList + */ + readonly limit?: number + + /** + * + * @type {string} + * @memberof ProductApiProductList + */ + readonly name?: string + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof ProductApiProductList + */ + readonly offset?: number + + /** + * + * @type {string} + * @memberof ProductApiProductList + */ + readonly system__slug?: string } /** @@ -1826,19 +1303,19 @@ export interface ProductApiProductListRequest { * @interface ProductApiProductPartialUpdateRequest */ export interface ProductApiProductPartialUpdateRequest { - /** - * A unique integer value identifying this product. - * @type {number} - * @memberof ProductApiProductPartialUpdate - */ - readonly id: number - - /** - * - * @type {PatchedProduct} - * @memberof ProductApiProductPartialUpdate - */ - readonly PatchedProduct?: PatchedProduct + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof ProductApiProductPartialUpdate + */ + readonly id: number + + /** + * + * @type {PatchedProduct} + * @memberof ProductApiProductPartialUpdate + */ + readonly PatchedProduct?: PatchedProduct } /** @@ -1847,12 +1324,12 @@ export interface ProductApiProductPartialUpdateRequest { * @interface ProductApiProductRetrieveRequest */ export interface ProductApiProductRetrieveRequest { - /** - * A unique integer value identifying this product. - * @type {number} - * @memberof ProductApiProductRetrieve - */ - readonly id: number + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof ProductApiProductRetrieve + */ + readonly id: number } /** @@ -1861,19 +1338,19 @@ export interface ProductApiProductRetrieveRequest { * @interface ProductApiProductUpdateRequest */ export interface ProductApiProductUpdateRequest { - /** - * A unique integer value identifying this product. - * @type {number} - * @memberof ProductApiProductUpdate - */ - readonly id: number - - /** - * - * @type {Product} - * @memberof ProductApiProductUpdate - */ - readonly Product: Product + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof ProductApiProductUpdate + */ + readonly id: number + + /** + * + * @type {Product} + * @memberof ProductApiProductUpdate + */ + readonly Product: Product } /** @@ -1883,103 +1360,69 @@ export interface ProductApiProductUpdateRequest { * @extends {BaseAPI} */ export class ProductApi extends BaseAPI { - /** - * Viewset for Product model. - * @param {ProductApiProductCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProductApi - */ - public productCreate( - requestParameters: ProductApiProductCreateRequest, - options?: AxiosRequestConfig, - ) { - return ProductApiFp(this.configuration) - .productCreate(requestParameters.Product, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for Product model. - * @param {ProductApiProductDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProductApi - */ - public productDestroy( - requestParameters: ProductApiProductDestroyRequest, - options?: AxiosRequestConfig, - ) { - return ProductApiFp(this.configuration) - .productDestroy(requestParameters.id, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for Product model. - * @param {ProductApiProductListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProductApi - */ - public productList( - requestParameters: ProductApiProductListRequest = {}, - options?: AxiosRequestConfig, - ) { - return ProductApiFp(this.configuration) - .productList(requestParameters.limit, requestParameters.offset, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for Product model. - * @param {ProductApiProductPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProductApi - */ - public productPartialUpdate( - requestParameters: ProductApiProductPartialUpdateRequest, - options?: AxiosRequestConfig, - ) { - return ProductApiFp(this.configuration) - .productPartialUpdate( - requestParameters.id, - requestParameters.PatchedProduct, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for Product model. - * @param {ProductApiProductRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProductApi - */ - public productRetrieve( - requestParameters: ProductApiProductRetrieveRequest, - options?: AxiosRequestConfig, - ) { - return ProductApiFp(this.configuration) - .productRetrieve(requestParameters.id, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Viewset for Product model. - * @param {ProductApiProductUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ProductApi - */ - public productUpdate( - requestParameters: ProductApiProductUpdateRequest, - options?: AxiosRequestConfig, - ) { - return ProductApiFp(this.configuration) - .productUpdate(requestParameters.id, requestParameters.Product, options) - .then((request) => request(this.axios, this.basePath)) - } + /** + * Viewset for Product model. + * @param {ProductApiProductCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProductApi + */ + public productCreate(requestParameters: ProductApiProductCreateRequest, options?: AxiosRequestConfig) { + return ProductApiFp(this.configuration).productCreate(requestParameters.Product, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Viewset for Product model. + * @param {ProductApiProductDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProductApi + */ + public productDestroy(requestParameters: ProductApiProductDestroyRequest, options?: AxiosRequestConfig) { + return ProductApiFp(this.configuration).productDestroy(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Viewset for Product model. + * @param {ProductApiProductListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProductApi + */ + public productList(requestParameters: ProductApiProductListRequest = {}, options?: AxiosRequestConfig) { + return ProductApiFp(this.configuration).productList(requestParameters.limit, requestParameters.name, requestParameters.offset, requestParameters.system__slug, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Viewset for Product model. + * @param {ProductApiProductPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProductApi + */ + public productPartialUpdate(requestParameters: ProductApiProductPartialUpdateRequest, options?: AxiosRequestConfig) { + return ProductApiFp(this.configuration).productPartialUpdate(requestParameters.id, requestParameters.PatchedProduct, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Viewset for Product model. + * @param {ProductApiProductRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProductApi + */ + public productRetrieve(requestParameters: ProductApiProductRetrieveRequest, options?: AxiosRequestConfig) { + return ProductApiFp(this.configuration).productRetrieve(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Viewset for Product model. + * @param {ProductApiProductUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProductApi + */ + public productUpdate(requestParameters: ProductApiProductUpdateRequest, options?: AxiosRequestConfig) { + return ProductApiFp(this.configuration).productUpdate(requestParameters.id, requestParameters.Product, options).then((request) => request(this.axios, this.basePath)); + } } diff --git a/frontends/api/src/generated/base.ts b/frontends/api/src/generated/base.ts index 60afc07b..d524b79f 100644 --- a/frontends/api/src/generated/base.ts +++ b/frontends/api/src/generated/base.ts @@ -12,24 +12,25 @@ * Do not edit the class manually. */ -import type { Configuration } from "./configuration" + +import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios" -import globalAxios from "axios" +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; -export const BASE_PATH = "http://localhost".replace(/\/+$/, "") +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); /** * * @export */ export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -} + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; /** * @@ -37,8 +38,8 @@ export const COLLECTION_FORMATS = { * @interface RequestArgs */ export interface RequestArgs { - url: string - options: AxiosRequestConfig + url: string; + options: AxiosRequestConfig; } /** @@ -47,19 +48,15 @@ export interface RequestArgs { * @class BaseAPI */ export class BaseAPI { - protected configuration: Configuration | undefined + protected configuration: Configuration | undefined; - constructor( - configuration?: Configuration, - protected basePath: string = BASE_PATH, - protected axios: AxiosInstance = globalAxios, - ) { - if (configuration) { - this.configuration = configuration - this.basePath = configuration.basePath || this.basePath + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } } - } -} +}; /** * @@ -68,11 +65,8 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - constructor( - public field: string, - msg?: string, - ) { - super(msg) - this.name = "RequiredError" - } + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } } diff --git a/frontends/api/src/generated/common.ts b/frontends/api/src/generated/common.ts index 6bf04e2a..0f86b2c8 100644 --- a/frontends/api/src/generated/common.ts +++ b/frontends/api/src/generated/common.ts @@ -12,132 +12,98 @@ * Do not edit the class manually. */ -import type { Configuration } from "./configuration" -import type { RequestArgs } from "./base" -import type { AxiosInstance, AxiosResponse } from "axios" -import { RequiredError } from "./base" + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; /** * * @export */ -export const DUMMY_BASE_URL = "https://example.com" +export const DUMMY_BASE_URL = 'https://example.com' /** * * @throws {RequiredError} * @export */ -export const assertParamExists = function ( - functionName: string, - paramName: string, - paramValue: unknown, -) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError( - paramName, - `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, - ) - } +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } } /** * * @export */ -export const setApiKeyToObject = async function ( - object: any, - keyParamName: string, - configuration?: Configuration, -) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = - typeof configuration.apiKey === "function" - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey - object[keyParamName] = localVarApiKeyValue - } +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } } /** * * @export */ -export const setBasicAuthToObject = function ( - object: any, - configuration?: Configuration, -) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { - username: configuration.username, - password: configuration.password, +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; } - } } /** * * @export */ -export const setBearerAuthToObject = async function ( - object: any, - configuration?: Configuration, -) { - if (configuration && configuration.accessToken) { - const accessToken = - typeof configuration.accessToken === "function" - ? await configuration.accessToken() - : await configuration.accessToken - object["Authorization"] = "Bearer " + accessToken - } +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } } /** * * @export */ -export const setOAuthToObject = async function ( - object: any, - name: string, - scopes: string[], - configuration?: Configuration, -) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = - typeof configuration.accessToken === "function" - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken - object["Authorization"] = "Bearer " + localVarAccessTokenValue - } +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } } -function setFlattenedQueryParams( - urlSearchParams: URLSearchParams, - parameter: any, - key: string = "", -): void { - if (parameter == null) return - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - ;(parameter as any[]).forEach((item) => - setFlattenedQueryParams(urlSearchParams, item, key), - ) - } else { - Object.keys(parameter).forEach((currentKey) => - setFlattenedQueryParams( - urlSearchParams, - parameter[currentKey], - `${key}${key !== "" ? "." : ""}${currentKey}`, - ), - ) +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } } - } else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter) - } else { - urlSearchParams.set(key, parameter) + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } } - } } /** @@ -145,28 +111,23 @@ function setFlattenedQueryParams( * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search) - setFlattenedQueryParams(searchParams, objects) - url.search = searchParams.toString() + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); } /** * * @export */ -export const serializeDataIfNeeded = function ( - value: any, - requestOptions: any, - configuration?: Configuration, -) { - const nonString = typeof value !== "string" - const needsSerialization = - nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) - : nonString - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : value || "" +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); } /** @@ -174,27 +135,16 @@ export const serializeDataIfNeeded = function ( * @export */ export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash + return url.pathname + url.search + url.hash } /** * * @export */ -export const createRequestFunction = function ( - axiosArgs: RequestArgs, - globalAxios: AxiosInstance, - BASE_PATH: string, - configuration?: Configuration, -) { - return >( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs = { - ...axiosArgs.options, - url: (configuration?.basePath || basePath) + axiosArgs.url, - } - return axios.request(axiosRequestArgs) - } +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; } diff --git a/frontends/api/src/generated/configuration.ts b/frontends/api/src/generated/configuration.ts index 11ad008f..0dc39217 100644 --- a/frontends/api/src/generated/configuration.ts +++ b/frontends/api/src/generated/configuration.ts @@ -12,112 +12,90 @@ * Do not edit the class manually. */ + export interface ConfigurationParameters { - apiKey?: - | string - | Promise - | ((name: string) => string) - | ((name: string) => Promise) - username?: string - password?: string - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string) - | ((name?: string, scopes?: string[]) => Promise) - basePath?: string - baseOptions?: any - formDataCtor?: new () => any + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; } export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: - | string - | Promise - | ((name: string) => string) - | ((name: string) => Promise) - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string) - | ((name?: string, scopes?: string[]) => Promise) - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey - this.username = param.username - this.password = param.password - this.accessToken = param.accessToken - this.basePath = param.basePath - this.baseOptions = param.baseOptions - this.formDataCtor = param.formDataCtor - } + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp( - "^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", - "i", - ) - return ( - mime !== null && - (jsonMime.test(mime) || - mime.toLowerCase() === "application/json-patch+json") - ) - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } } diff --git a/frontends/api/src/generated/index.ts b/frontends/api/src/generated/index.ts index 25b43205..b65b6c20 100644 --- a/frontends/api/src/generated/index.ts +++ b/frontends/api/src/generated/index.ts @@ -12,5 +12,6 @@ * Do not edit the class manually. */ -export * from "./api" -export * from "./configuration" + +export * from "./api"; +export * from "./configuration"; diff --git a/openapi.yaml b/openapi.yaml index 629bf406..b24a811c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -172,12 +172,20 @@ paths: description: Number of results to return per page. schema: type: integer + - in: query + name: name + schema: + type: string - name: offset required: false in: query description: The initial index from which to return the results. schema: type: integer + - in: query + name: system__slug + schema: + type: string tags: - product security: @@ -328,36 +336,18 @@ components: id: type: integer readOnly: true - deleted_on: - type: string - format: date-time - readOnly: true - nullable: true - deleted_by_cascade: - type: boolean - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true name: type: string maxLength: 255 - description: + slug: type: string - api_key: + nullable: true + maxLength: 80 + description: type: string required: - - created_on - - deleted_by_cascade - - deleted_on - id - name - - updated_on PaginatedIntegratedSystemList: type: object properties: @@ -405,28 +395,14 @@ components: id: type: integer readOnly: true - deleted_on: - type: string - format: date-time - readOnly: true - nullable: true - deleted_by_cascade: - type: boolean - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true name: type: string maxLength: 255 - description: + slug: type: string - api_key: + nullable: true + maxLength: 80 + description: type: string PatchedProduct: type: object diff --git a/poetry.lock b/poetry.lock index fccdae06..a1eb0d4e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2955,6 +2955,23 @@ files = [ {file = "python_rapidjson-1.14-cp39-cp39-win_amd64.whl", hash = "sha256:f827fc652ab51e3777b375d17867132351eb9b4e53578a139c24fb5c559fdb45"}, ] +[[package]] +name = "python-slugify" +version = "8.0.4" +description = "A Python slugify application that also handles Unicode" +optional = false +python-versions = ">=3.7" +files = [ + {file = "python-slugify-8.0.4.tar.gz", hash = "sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856"}, + {file = "python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8"}, +] + +[package.dependencies] +text-unidecode = ">=1.3" + +[package.extras] +unidecode = ["Unidecode (>=1.1.1)"] + [[package]] name = "python3-openid" version = "3.2.0" @@ -3020,7 +3037,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -3636,6 +3652,17 @@ files = [ genshimagic = ["Genshi"] kidmagic = ["kid"] +[[package]] +name = "text-unidecode" +version = "1.3" +description = "The most basic Text::Unidecode port" +optional = false +python-versions = "*" +files = [ + {file = "text-unidecode-1.3.tar.gz", hash = "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93"}, + {file = "text_unidecode-1.3-py2.py3-none-any.whl", hash = "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8"}, +] + [[package]] name = "tinycss2" version = "1.2.1" @@ -3997,4 +4024,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.11.0" -content-hash = "5ac982b050f997d7e5086a4424361f1e2649d7a658bccd3cbdfb8cc3a023fa2b" +content-hash = "818d5f7aeea7e853a06e13c6f55f30f9b7cc6ca103a72d28832f258cdad965cb" diff --git a/pyproject.toml b/pyproject.toml index b5f2f308..f71f6fdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,7 @@ mitol-django-common = "^2023.12.19" mitol-django-payment-gateway = "^2023.12.19" deepdiff = "^6.7.1" django-safedelete = "^1.3.3" +python-slugify = "^8.0.1" [tool.poetry.group.dev.dependencies] bpython = "^0.24"