//---------------------- // // Generated using the NSwag toolchain v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- /* eslint-disable */ // ReSharper disable InconsistentNaming export class ApiClient { private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; private baseUrl: string; protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; this.baseUrl = baseUrl ?? ""; } /** * @return OK */ health(): Promise { let url_ = this.baseUrl + "/health"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processHealth(_response); }); } protected processHealth(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { return; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ ready(): Promise { let url_ = this.baseUrl + "/health/ready"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processReady(_response); }); } protected processReady(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { return; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ dashboardView(): Promise { let url_ = this.baseUrl + "/api/v1/dashboard-view"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processDashboardView(_response); }); } protected processDashboardView(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as DashboardViewDto; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ notes(): Promise { let url_ = this.baseUrl + "/api/v1/notes"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processNotes(_response); }); } protected processNotes(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as AantekeningDto[]; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ address(): Promise { let url_ = this.baseUrl + "/api/v1/brp/address"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processAddress(_response); }); } protected processAddress(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as BrpAddressDto; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ diplomas(): Promise { let url_ = this.baseUrl + "/api/v1/duo/diplomas"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processDiplomas(_response); }); } protected processDiplomas(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as DuoLookupDto; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ policy(): Promise { let url_ = this.baseUrl + "/api/v1/intake/policy"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processPolicy(_response); }); } protected processPolicy(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as IntakePolicyDto; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ registrations(body: RegistratieRequest): Promise { let url_ = this.baseUrl + "/api/v1/registrations"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: RequestInit = { body: content_, method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processRegistrations(_response); }); } protected processRegistrations(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ReferentieResponse; return result200; }); } else if (status === 422) { return response.text().then((_responseText) => { let result422: any = null; result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; return throwException("Unprocessable Content", status, _responseText, _headers, result422); }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ herregistraties(body: HerregistratieRequest): Promise { let url_ = this.baseUrl + "/api/v1/herregistraties"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: RequestInit = { body: content_, method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processHerregistraties(_response); }); } protected processHerregistraties(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ReferentieResponse; return result200; }); } else if (status === 422) { return response.text().then((_responseText) => { let result422: any = null; result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; return throwException("Unprocessable Content", status, _responseText, _headers, result422); }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ intakes(body: IntakeRequest): Promise { let url_ = this.baseUrl + "/api/v1/intakes"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: RequestInit = { body: content_, method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processIntakes(_response); }); } protected processIntakes(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ReferentieResponse; return result200; }); } else if (status === 422) { return response.text().then((_responseText) => { let result422: any = null; result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; return throwException("Unprocessable Content", status, _responseText, _headers, result422); }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ changeRequests(body: ChangeRequestRequest): Promise { let url_ = this.baseUrl + "/api/v1/change-requests"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: RequestInit = { body: content_, method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processChangeRequests(_response); }); } protected processChangeRequests(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ReferentieResponse; return result200; }); } else if (status === 422) { return response.text().then((_responseText) => { let result422: any = null; result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; return throwException("Unprocessable Content", status, _responseText, _headers, result422); }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return OK */ categories(wizardId: string): Promise { let url_ = this.baseUrl + "/api/v1/uploads/categories?"; if (wizardId === undefined || wizardId === null) throw new globalThis.Error("The parameter 'wizardId' must be defined and cannot be null."); else url_ += "wizardId=" + encodeURIComponent("" + wizardId) + "&"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processCategories(_response); }); } protected processCategories(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as UploadCategoriesDto; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @param localIds (optional) * @return OK */ status(localIds?: string | undefined): Promise { let url_ = this.baseUrl + "/api/v1/uploads/status?"; if (localIds === null) throw new globalThis.Error("The parameter 'localIds' cannot be null."); else if (localIds !== undefined) url_ += "localIds=" + encodeURIComponent("" + localIds) + "&"; url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "GET", headers: { "Accept": "application/json" } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processStatus(_response); }); } protected processStatus(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 200) { return response.text().then((_responseText) => { let result200: any = null; result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as UploadStatusDto; return result200; }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return No Content */ uploads(documentId: string): Promise { let url_ = this.baseUrl + "/api/v1/uploads/{documentId}"; if (documentId === undefined || documentId === null) throw new globalThis.Error("The parameter 'documentId' must be defined."); url_ = url_.replace("{documentId}", encodeURIComponent("" + documentId)); url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "DELETE", headers: { } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processUploads(_response); }); } protected processUploads(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 204) { return response.text().then((_responseText) => { return; }); } else if (status === 404) { return response.text().then((_responseText) => { return throwException("Not Found", status, _responseText, _headers); }); } else if (status === 409) { return response.text().then((_responseText) => { let result409: any = null; result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; return throwException("Conflict", status, _responseText, _headers, result409); }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } /** * @return No Content */ uploads2(documentId: string): Promise { let url_ = this.baseUrl + "/api/v1/admin/uploads/{documentId}"; if (documentId === undefined || documentId === null) throw new globalThis.Error("The parameter 'documentId' must be defined."); url_ = url_.replace("{documentId}", encodeURIComponent("" + documentId)); url_ = url_.replace(/[?&]$/, ""); let options_: RequestInit = { method: "DELETE", headers: { } }; return this.http.fetch(url_, options_).then((_response: Response) => { return this.processUploads2(_response); }); } protected processUploads2(response: Response): Promise { const status = response.status; let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; if (status === 204) { return response.text().then((_responseText) => { return; }); } else if (status === 403) { return response.text().then((_responseText) => { return throwException("Forbidden", status, _responseText, _headers); }); } else if (status === 404) { return response.text().then((_responseText) => { return throwException("Not Found", status, _responseText, _headers); }); } else if (status !== 200 && status !== 204) { return response.text().then((_responseText) => { return throwException("An unexpected server error occurred.", status, _responseText, _headers); }); } return Promise.resolve(null as any); } } export interface AantekeningDto { type?: string | undefined; omschrijving?: string | undefined; datum?: string | undefined; } export interface AdresDto { straat?: string | undefined; postcode?: string | undefined; woonplaats?: string | undefined; } export interface BrpAddressDto { gevonden?: boolean; adres?: AdresDto; } export interface ChangeRequestRequest { straat?: string | undefined; postcode?: string | undefined; woonplaats?: string | undefined; } export interface DashboardViewDto { registration?: RegistrationDto; person?: PersonDto; decisions?: HerregistratieDecisionsDto; } export interface DocumentCategoryDto { categoryId?: string | undefined; label?: string | undefined; description?: string | undefined; required?: boolean; acceptedTypes?: string[] | undefined; maxSizeMb?: number; multiple?: boolean; allowPostDelivery?: boolean; } export interface DocumentRefDto { categoryId?: string | undefined; channel?: string | undefined; documentId?: string | undefined; } export interface DuoDiplomaDto { id?: string | undefined; naam?: string | undefined; instelling?: string | undefined; jaar?: number; beroep?: string | undefined; policyQuestions?: PolicyQuestionDto[] | undefined; } export interface DuoLookupDto { diplomas?: DuoDiplomaDto[] | undefined; handmatig?: ManualDiplomaPolicyDto; } export interface HerregistratieDecisionsDto { eligibleForHerregistratie?: boolean; herregistratieReason?: string | undefined; } export interface HerregistratieRequest { uren?: number; documents?: DocumentRefDto[] | undefined; } export interface IntakePolicyDto { scholingThreshold?: number; } export interface IntakeRequest { uren?: number; } export interface ManualDiplomaPolicyDto { beroepen?: string[] | undefined; policyQuestions?: PolicyQuestionDto[] | undefined; } export interface PersonDto { naam?: string | undefined; geboortedatum?: string | undefined; adres?: AdresDto; } export interface PolicyQuestionDto { id?: string | undefined; vraag?: string | undefined; type?: string | undefined; } export interface ProblemDetails { type?: string | undefined; title?: string | undefined; status?: number | undefined; detail?: string | undefined; instance?: string | undefined; [key: string]: any; } export interface ReferentieResponse { referentie?: string | undefined; } export interface RegistratieRequest { diplomaHerkomst?: string | undefined; documents?: DocumentRefDto[] | undefined; } export interface RegistrationDto { bigNummer?: string | undefined; naam?: string | undefined; beroep?: string | undefined; registratiedatum?: string | undefined; geboortedatum?: string | undefined; status?: RegistrationStatusDto; } export interface RegistrationStatusDto { tag?: string | undefined; herregistratieDatum?: string | undefined; geschorstTot?: string | undefined; reden?: string | undefined; doorgehaaldOp?: string | undefined; } export interface UploadCategoriesDto { categories?: DocumentCategoryDto[] | undefined; } export interface UploadStatusDto { results?: UploadStatusItemDto[] | undefined; } export interface UploadStatusItemDto { localId?: string | undefined; status?: string | undefined; documentId?: string | undefined; } export class SwaggerException extends Error { override message: string; status: number; response: string; headers: { [key: string]: any; }; result: any; constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { super(); this.message = message; this.status = status; this.response = response; this.headers = headers; this.result = result; } protected isSwaggerException = true; static isSwaggerException(obj: any): obj is SwaggerException { return obj.isSwaggerException === true; } } function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { if (result !== null && result !== undefined) throw result; else throw new SwaggerException(message, status, response, headers, null); }