Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(manufacturers): use openapi to get manufacturers #98

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions client/src/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ api/get-instrument-by-id-api.ts
api/get-instrument-types-api.ts
api/get-instruments-by-criteria-api.ts
api/get-instruments-by-criteria-paginated-api.ts
api/get-manufacturers-api.ts
api/get-user-profile-api.ts
api/list-favorite-api.ts
api/remove-favorite-api.ts
Expand All @@ -28,12 +29,14 @@ model/get-instrument-by-criteria-page-response.ts
model/get-instrument-criteria-request-body.ts
model/get-instrument-types-response.ts
model/get-instruments-by-criteria-response.ts
model/get-manufacturers-response.ts
model/index.ts
model/instrument-basic-material.ts
model/instrument-detail.ts
model/instrument-type.ts
model/jwt-response.ts
model/list-favorite-response-body.ts
model/manufacturer.ts
model/profile-details.ts
model/registration-request.ts
model/remove-favorite-request-body.ts
Expand Down
1 change: 1 addition & 0 deletions client/src/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export * from "./api/get-instrument-by-id-api";
export * from "./api/get-instrument-types-api";
export * from "./api/get-instruments-by-criteria-api";
export * from "./api/get-instruments-by-criteria-paginated-api";
export * from "./api/get-manufacturers-api";
export * from "./api/get-user-profile-api";
export * from "./api/list-favorite-api";
export * from "./api/remove-favorite-api";
Expand Down
183 changes: 183 additions & 0 deletions client/src/generated/api/get-countries-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/* tslint:disable */
/* eslint-disable */
/**
* Client Error
* Client Error
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import type { Configuration } from "../configuration";
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } 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";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
type RequestArgs,
BaseAPI,
RequiredError,
operationServerMap,
} from "../base";
// @ts-ignore
import type { ClientError } from "../model";
// @ts-ignore
import type { GetCountriesResponse } from "../model";
// @ts-ignore
import type { ServerError } from "../model";
/**
* GetCountriesApi - axios parameter creator
* @export
*/
export const GetCountriesApiAxiosParamCreator = function (
configuration?: Configuration,
) {
return {
/**
* Get Countries
* @summary Get Countries
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCountries: async (
options: RawAxiosRequestConfig = {},
): Promise<RequestArgs> => {
const localVarPath = `/countries`;
// 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;

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};

/**
* GetCountriesApi - functional programming interface
* @export
*/
export const GetCountriesApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator =
GetCountriesApiAxiosParamCreator(configuration);
return {
/**
* Get Countries
* @summary Get Countries
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCountries(
options?: RawAxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<GetCountriesResponse>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.getCountries(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap["GetCountriesApi.getCountries"]?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
)(axios, localVarOperationServerBasePath || basePath);
},
};
};

/**
* GetCountriesApi - factory interface
* @export
*/
export const GetCountriesApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) {
const localVarFp = GetCountriesApiFp(configuration);
return {
/**
* Get Countries
* @summary Get Countries
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCountries(
options?: RawAxiosRequestConfig,
): AxiosPromise<GetCountriesResponse> {
return localVarFp
.getCountries(options)
.then((request) => request(axios, basePath));
},
};
};

/**
* GetCountriesApi - object-oriented interface
* @export
* @class GetCountriesApi
* @extends {BaseAPI}
*/
export class GetCountriesApi extends BaseAPI {
/**
* Get Countries
* @summary Get Countries
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GetCountriesApi
*/
public getCountries(options?: RawAxiosRequestConfig) {
return GetCountriesApiFp(this.configuration)
.getCountries(options)
.then((request) => request(this.axios, this.basePath));
}
}
183 changes: 183 additions & 0 deletions client/src/generated/api/get-manufacturers-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/* tslint:disable */
/* eslint-disable */
/**
* Client Error
* Client Error
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import type { Configuration } from "../configuration";
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } 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";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
type RequestArgs,
BaseAPI,
RequiredError,
operationServerMap,
} from "../base";
// @ts-ignore
import type { ClientError } from "../model";
// @ts-ignore
import type { GetManufacturersResponse } from "../model";
// @ts-ignore
import type { ServerError } from "../model";
/**
* GetManufacturersApi - axios parameter creator
* @export
*/
export const GetManufacturersApiAxiosParamCreator = function (
configuration?: Configuration,
) {
return {
/**
* Get Manufacturers
* @summary Get Manufacturers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getManufacturers: async (
options: RawAxiosRequestConfig = {},
): Promise<RequestArgs> => {
const localVarPath = `/manufacturer`;
// 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;

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};

/**
* GetManufacturersApi - functional programming interface
* @export
*/
export const GetManufacturersApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator =
GetManufacturersApiAxiosParamCreator(configuration);
return {
/**
* Get Manufacturers
* @summary Get Manufacturers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getManufacturers(
options?: RawAxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<GetManufacturersResponse>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.getManufacturers(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap["GetManufacturersApi.getManufacturers"]?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
)(axios, localVarOperationServerBasePath || basePath);
},
};
};

/**
* GetManufacturersApi - factory interface
* @export
*/
export const GetManufacturersApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) {
const localVarFp = GetManufacturersApiFp(configuration);
return {
/**
* Get Manufacturers
* @summary Get Manufacturers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getManufacturers(
options?: RawAxiosRequestConfig,
): AxiosPromise<GetManufacturersResponse> {
return localVarFp
.getManufacturers(options)
.then((request) => request(axios, basePath));
},
};
};

/**
* GetManufacturersApi - object-oriented interface
* @export
* @class GetManufacturersApi
* @extends {BaseAPI}
*/
export class GetManufacturersApi extends BaseAPI {
/**
* Get Manufacturers
* @summary Get Manufacturers
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GetManufacturersApi
*/
public getManufacturers(options?: RawAxiosRequestConfig) {
return GetManufacturersApiFp(this.configuration)
.getManufacturers(options)
.then((request) => request(this.axios, this.basePath));
}
}
Loading
Loading