Skip to content

Commit

Permalink
最新のOpenAPI仕様書を元にクライアントコードを生成。 (#570)
Browse files Browse the repository at this point in the history
Co-authored-by: Fumika Koyama <[email protected]>
  • Loading branch information
fkoyama and Fumika Koyama authored Nov 14, 2023
1 parent c7a72e5 commit f55bbe5
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ api/basket-items-api.ts
api/catalog-brands-api.ts
api/catalog-categories-api.ts
api/catalog-items-api.ts
api/health-checks-api.ts
api/orders-api.ts
base.ts
common.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export * from './api/basket-items-api';
export * from './api/catalog-brands-api';
export * from './api/catalog-categories-api';
export * from './api/catalog-items-api';
export * from './api/health-checks-api';
export * from './api/orders-api';

Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/* tslint:disable */
/* eslint-disable */
/**
* Dressca Web API
* Dressca の Web API 仕様
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// 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, RequestArgs, BaseAPI, RequiredError } from '../base';
/**
* HealthChecksApi - axios parameter creator
* @export
*/
export const HealthChecksApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthChecksApiHealthGET: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/health`;
// 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,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthChecksApiHealthHEAD: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/health`;
// 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: 'HEAD', ...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,
};
},
}
};

/**
* HealthChecksApi - functional programming interface
* @export
*/
export const HealthChecksApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = HealthChecksApiAxiosParamCreator(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async healthChecksApiHealthGET(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.healthChecksApiHealthGET(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async healthChecksApiHealthHEAD(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.healthChecksApiHealthHEAD(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* HealthChecksApi - factory interface
* @export
*/
export const HealthChecksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = HealthChecksApiFp(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthChecksApiHealthGET(options?: any): AxiosPromise<string> {
return localVarFp.healthChecksApiHealthGET(options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthChecksApiHealthHEAD(options?: any): AxiosPromise<void> {
return localVarFp.healthChecksApiHealthHEAD(options).then((request) => request(axios, basePath));
},
};
};

/**
* HealthChecksApi - object-oriented interface
* @export
* @class HealthChecksApi
* @extends {BaseAPI}
*/
export class HealthChecksApi extends BaseAPI {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HealthChecksApi
*/
public healthChecksApiHealthGET(options?: AxiosRequestConfig) {
return HealthChecksApiFp(this.configuration).healthChecksApiHealthGET(options).then((request) => request(this.axios, this.basePath));
}

/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HealthChecksApi
*/
public healthChecksApiHealthHEAD(options?: AxiosRequestConfig) {
return HealthChecksApiFp(this.configuration).healthChecksApiHealthHEAD(options).then((request) => request(this.axios, this.basePath));
}
}

0 comments on commit f55bbe5

Please sign in to comment.