32 lines
841 B
TypeScript
32 lines
841 B
TypeScript
|
// AUTOGENERATED BY private/apigen
|
||
|
// DO NOT EDIT.
|
||
|
|
||
|
import { HttpClient } from '@/utils/httpClient';
|
||
|
import { Time, UUID } from '@/types/common';
|
||
|
|
||
|
export class {
|
||
|
content: string;
|
||
|
}
|
||
|
|
||
|
export class {
|
||
|
id: UUID;
|
||
|
date: Time;
|
||
|
pathParam: string;
|
||
|
body: string;
|
||
|
}
|
||
|
|
||
|
export class testapiHttpApiV0 {
|
||
|
private readonly http: HttpClient = new HttpClient();
|
||
|
private readonly ROOT_PATH: string = '/api/v0/testapi';
|
||
|
|
||
|
public async (request: , path: string, id: UUID, date: Time): Promise<> {
|
||
|
const path = `${this.ROOT_PATH}/${path}?id=${id}&date=${date}`;
|
||
|
const response = await this.http.post(path, JSON.stringify(request));
|
||
|
if (response.ok) {
|
||
|
return response.json().then((body) => body as );
|
||
|
}
|
||
|
const err = await response.json();
|
||
|
throw new Error(err.error);
|
||
|
}
|
||
|
}
|