Skip to content

Commit

Permalink
feat: update web client
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarimizu14 authored and henchiyb committed Nov 6, 2023
1 parent 945c581 commit 3adcdd4
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/generated/web/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
ExecuteScheduleRequest,
ExecuteScheduleRequestAutifyConnect,
Label,
ProjectInfo,
Scenario,
TestCaseResult,
TestCaseResultExportVariablesInner,
Expand All @@ -60,6 +61,10 @@ import {
CreditApiFp,
CreditApiFactory,
CreditApi,
ProjectApiAxiosParamCreator,
ProjectApiFp,
ProjectApiFactory,
ProjectApi,
ResultApiAxiosParamCreator,
ResultApiFp,
ResultApiFactory,
Expand Down Expand Up @@ -120,6 +125,7 @@ export class WebClient {
this.autifyConnectApi = new AutifyConnectApi(configuration);
this.capabilityApi = new CapabilityApi(configuration);
this.creditApi = new CreditApi(configuration);
this.projectApi = new ProjectApi(configuration);
this.resultApi = new ResultApi(configuration);
this.scenarioApi = new ScenarioApi(configuration);
this.scheduleApi = new ScheduleApi(configuration);
Expand Down Expand Up @@ -246,6 +252,19 @@ export class WebClient {
);
}

private readonly projectApi;

/**
* Get project information.
* @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProjectApi
*/
getProjectInfo(projectId: number, options?: AxiosRequestConfig) {
return this.projectApi.getProjectInfo(projectId, options);
}

private readonly resultApi;

/**
Expand Down
173 changes: 173 additions & 0 deletions src/generated/web/openapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,37 @@ export interface Label {
*/
updated_at?: string;
}
/**
*
* @export
* @interface ProjectInfo
*/
export interface ProjectInfo {
/**
*
* @type {number}
* @memberof ProjectInfo
*/
id?: number;
/**
*
* @type {string}
* @memberof ProjectInfo
*/
name?: string;
/**
*
* @type {number}
* @memberof ProjectInfo
*/
scenarios_count?: number;
/**
*
* @type {number}
* @memberof ProjectInfo
*/
test_plans_count?: number;
}
/**
*
* @export
Expand Down Expand Up @@ -2056,6 +2087,148 @@ export class CreditApi extends BaseAPI {
}
}

/**
* ProjectApi - axios parameter creator
* @export
*/
export const ProjectApiAxiosParamCreator = function (
configuration?: Configuration,
) {
return {
/**
* Get project information.
* @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getProjectInfo: async (
projectId: number,
options: AxiosRequestConfig = {},
): Promise<RequestArgs> => {
// verify required parameter 'projectId' is not null or undefined
assertParamExists("getProjectInfo", "projectId", projectId);
const localVarPath = `/projects/{project_id}/project_info`.replace(
`{${"project_id"}}`,
encodeURIComponent(String(projectId)),
);
// 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 bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);

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

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

/**
* ProjectApi - functional programming interface
* @export
*/
export const ProjectApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator = ProjectApiAxiosParamCreator(configuration);
return {
/**
* Get project information.
* @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getProjectInfo(
projectId: number,
options?: AxiosRequestConfig,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProjectInfo>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectInfo(
projectId,
options,
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
);
},
};
};

/**
* ProjectApi - factory interface
* @export
*/
export const ProjectApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) {
const localVarFp = ProjectApiFp(configuration);
return {
/**
* Get project information.
* @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getProjectInfo(
projectId: number,
options?: any,
): AxiosPromise<ProjectInfo> {
return localVarFp
.getProjectInfo(projectId, options)
.then((request) => request(axios, basePath));
},
};
};

/**
* ProjectApi - object-oriented interface
* @export
* @class ProjectApi
* @extends {BaseAPI}
*/
export class ProjectApi extends BaseAPI {
/**
* Get project information.
* @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProjectApi
*/
public getProjectInfo(projectId: number, options?: AxiosRequestConfig) {
return ProjectApiFp(this.configuration)
.getProjectInfo(projectId, options)
.then((request) => request(this.axios, this.basePath));
}
}

/**
* ResultApi - axios parameter creator
* @export
Expand Down
35 changes: 35 additions & 0 deletions swagger-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,31 @@ paths:
schema:
type: object
$ref: "#/components/schemas/UsedCredits"
"/projects/{project_id}/project_info":
get:
operationId: getProjectInfo
description: |
Get project information.
tags:
- project
security:
- bearerAuth: []
parameters:
- name: project_id
in: path
required: true
description: |
For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
schema:
type: integer
responses:
"200":
description: ok
content:
application/json:
schema:
type: object
$ref: "#/components/schemas/ProjectInfo"
components:
securitySchemes:
bearerAuth:
Expand Down Expand Up @@ -1107,6 +1132,16 @@ components:
type: integer
credit_consumption_event_count:
type: integer
ProjectInfo:
properties:
id:
type: integer
name:
type: string
scenarios_count:
type: integer
test_plans_count:
type: integer

tags:
- name: schedule
Expand Down

0 comments on commit 3adcdd4

Please sign in to comment.