diff --git a/README.md b/README.md index 28ce2da2a..49fa5d365 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ To re-generate http rune swagger YOu need swagger-codegen installed `brew install swagger-codegen` ``` -BASE=https://red-staging.iqser.cloud/ +BASE=https://dev-06.iqser.cloud/ URL="$BASE"redaction-gateway-v1/v2/api-docs?group=redaction-gateway-v1 rm -Rf /tmp/swagger mkdir -p /tmp/swagger diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 34c5726d3..6be64a7b2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -540,7 +540,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach, this.dossierId, this.fileId, true, - this.fileData.fileStatus.lastUploaded, + this.fileData.fileStatus.cacheIdentifier, 'response' ) .subscribe(data => { diff --git a/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts b/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts index d9aa1af5e..d3cdb52e2 100644 --- a/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts +++ b/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts @@ -11,7 +11,8 @@ */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -21,14 +22,14 @@ import { DossierAttributesConfig } from '../model/dossierAttributesConfig'; import { DossierAttributesReq } from '../model/dossierAttributesReq'; import { DossierAttributesRes } from '../model/dossierAttributesRes'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class DossierAttributesControllerService { + protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -44,6 +45,20 @@ export class DossierAttributesControllerService { } } + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + /** * Add or update a dossier attribute in existing dossier. * None @@ -58,21 +73,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public addOrUpdateDossierAttributes( body: DossierAttributeReq, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public addOrUpdateDossierAttributes( body: DossierAttributeReq, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public addOrUpdateDossierAttributes( body: DossierAttributeReq, dossierId: string, @@ -120,7 +132,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dossierAttributes/update/${encodeURIComponent(String(dossierId))}`, + `${this.basePath}/dossier-attributes/update/${encodeURIComponent(String(dossierId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -145,21 +157,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: string, @@ -207,7 +216,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dossierAttributes/config/${encodeURIComponent( + `${this.basePath}/dossier-attributes/config/${encodeURIComponent( String(dossierTemplateId) )}`, { @@ -234,21 +243,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public deleteDossierAttribute( dossierAttributeId: string, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteDossierAttribute( dossierAttributeId: string, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public deleteDossierAttribute( dossierAttributeId: string, dossierId: string, @@ -288,7 +294,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'delete', - `${this.basePath}/dossierAttributes/set/${encodeURIComponent( + `${this.basePath}/dossier-attributes/set/${encodeURIComponent( String(dossierId) )}/${encodeURIComponent(String(dossierAttributeId))}`, { @@ -314,21 +320,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, @@ -368,7 +371,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'delete', - `${this.basePath}/dossierAttributes/config/${encodeURIComponent( + `${this.basePath}/dossier-attributes/config/${encodeURIComponent( String(dossierTemplateId) )}/${encodeURIComponent(String(dossierAttributeId))}`, { @@ -383,7 +386,7 @@ export class DossierAttributesControllerService { /** * Bulk delete dossier attributes. * None - * @param body dossierAttributeIds + * @param body dossierId * @param dossierTemplateId dossierTemplateId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -394,21 +397,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public deleteDossierAttributesConfig( body: Array, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteDossierAttributesConfig( body: Array, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public deleteDossierAttributesConfig( body: Array, dossierTemplateId: string, @@ -456,7 +456,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dossierAttributes/config/delete/${encodeURIComponent( + `${this.basePath}/dossier-attributes/config/delete/${encodeURIComponent( String(dossierTemplateId) )}`, { @@ -481,19 +481,16 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public getDossierAttributes( dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public getDossierAttributes( dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public getDossierAttributes( dossierId: string, observe: any = 'body', @@ -526,7 +523,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'get', - `${this.basePath}/dossierAttributes/${encodeURIComponent(String(dossierId))}`, + `${this.basePath}/dossier-attributes/${encodeURIComponent(String(dossierId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -548,19 +545,16 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public getDossierAttributesConfig( dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public getDossierAttributesConfig( dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public getDossierAttributesConfig( dossierTemplateId: string, observe: any = 'body', @@ -593,7 +587,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'get', - `${this.basePath}/dossierAttributes/config/${encodeURIComponent( + `${this.basePath}/dossier-attributes/config/${encodeURIComponent( String(dossierTemplateId) )}`, { @@ -619,21 +613,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public setDossierAttributes( body: DossierAttributesReq, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public setDossierAttributes( body: DossierAttributesReq, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public setDossierAttributes( body: DossierAttributesReq, dossierId: string, @@ -681,7 +672,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dossierAttributes/set/${encodeURIComponent(String(dossierId))}`, + `${this.basePath}/dossier-attributes/set/${encodeURIComponent(String(dossierId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -706,21 +697,18 @@ export class DossierAttributesControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: string, @@ -768,7 +756,7 @@ export class DossierAttributesControllerService { return this.httpClient.request( 'put', - `${this.basePath}/dossierAttributes/config/${encodeURIComponent( + `${this.basePath}/dossier-attributes/config/${encodeURIComponent( String(dossierTemplateId) )}`, { diff --git a/libs/red-ui-http/src/lib/api/dossierController.service.ts b/libs/red-ui-http/src/lib/api/dossierController.service.ts index 1e5a59344..c6d07a5fb 100644 --- a/libs/red-ui-http/src/lib/api/dossierController.service.ts +++ b/libs/red-ui-http/src/lib/api/dossierController.service.ts @@ -11,21 +11,22 @@ */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs'; import { Dossier } from '../model/dossier'; import { DossierRequest } from '../model/dossierRequest'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class DossierControllerService { + protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -41,6 +42,20 @@ export class DossierControllerService { } } + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + /** * Creates or updates a dossier. * None @@ -53,19 +68,16 @@ export class DossierControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public createOrUpdateDossier( body: DossierRequest, observe?: 'response', reportProgress?: boolean ): Observable>; - public createOrUpdateDossier( body: DossierRequest, observe?: 'events', reportProgress?: boolean ): Observable>; - public createOrUpdateDossier( body: DossierRequest, observe: any = 'body', @@ -125,19 +137,16 @@ export class DossierControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public deleteDossier( dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteDossier( dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public deleteDossier( dossierId: string, observe: any = 'body', @@ -180,6 +189,55 @@ export class DossierControllerService { ); } + /** + * Gets all deleted dossiers. + * None + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDeletedDossiers( + observe?: 'body', + reportProgress?: boolean + ): Observable>; + public getDeletedDossiers( + observe?: 'response', + reportProgress?: boolean + ): Observable>>; + public getDeletedDossiers( + observe?: 'events', + reportProgress?: boolean + ): Observable>>; + public getDeletedDossiers( + observe: any = 'body', + reportProgress: boolean = false + ): Observable { + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = ['application/json']; + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + return this.httpClient.request>('get', `${this.basePath}/deleted-dossiers`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + /** * Gets an existing dossier. * None @@ -192,19 +250,16 @@ export class DossierControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public getDossier( dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public getDossier( dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public getDossier( dossierId: string, observe: any = 'body', @@ -254,17 +309,14 @@ export class DossierControllerService { * @param reportProgress flag to report request and response progress. */ public getDossiers(observe?: 'body', reportProgress?: boolean): Observable>; - public getDossiers( observe?: 'response', reportProgress?: boolean ): Observable>>; - public getDossiers( observe?: 'events', reportProgress?: boolean ): Observable>>; - public getDossiers(observe: any = 'body', reportProgress: boolean = false): Observable { let headers = this.defaultHeaders; @@ -292,4 +344,146 @@ export class DossierControllerService { reportProgress: reportProgress }); } + + /** + * Hard deletes existing dossiers. + * None + * @param body dossierId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public hardDeleteDossiers( + body: Array, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public hardDeleteDossiers( + body: Array, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public hardDeleteDossiers( + body: Array, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public hardDeleteDossiers( + body: Array, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { + if (body === null || body === undefined) { + throw new Error( + 'Required parameter body was null or undefined when calling hardDeleteDossiers.' + ); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['*/*']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request( + 'delete', + `${this.basePath}/deleted-dossiers/hard-delete`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Restores dossiers. + * None + * @param body dossierId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public restoreDossiers( + body: Array, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public restoreDossiers( + body: Array, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public restoreDossiers( + body: Array, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public restoreDossiers( + body: Array, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { + if (body === null || body === undefined) { + throw new Error( + 'Required parameter body was null or undefined when calling restoreDossiers.' + ); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request('post', `${this.basePath}/deleted-dossiers/restore`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } } diff --git a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts index b3230bcc3..353616ea0 100644 --- a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts @@ -11,19 +11,19 @@ */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; +import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class FileManagementControllerService { + protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -39,6 +39,20 @@ export class FileManagementControllerService { } } + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + /** * Deletes a file for a given dossierId and FileId * None @@ -53,21 +67,18 @@ export class FileManagementControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public deleteFile( dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteFile( dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public deleteFile( dossierId: string, fileId: string, @@ -133,21 +144,18 @@ export class FileManagementControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public deleteFiles( body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteFiles( body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public deleteFiles( body: Array, dossierId: string, @@ -222,7 +230,6 @@ export class FileManagementControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public downloadAnnotatedFile( dossierId: string, fileId: string, @@ -230,7 +237,6 @@ export class FileManagementControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public downloadAnnotatedFile( dossierId: string, fileId: string, @@ -238,7 +244,6 @@ export class FileManagementControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public downloadAnnotatedFile( dossierId: string, fileId: string, @@ -395,4 +400,172 @@ export class FileManagementControllerService { } ); } + + /** + * Hard deletes an uploaded file. + * None + * @param body fileId + * @param dossierId dossierId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public hardDeleteFile( + body: Array, + dossierId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public hardDeleteFile( + body: Array, + dossierId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public hardDeleteFile( + body: Array, + dossierId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public hardDeleteFile( + body: Array, + dossierId: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { + if (body === null || body === undefined) { + throw new Error( + 'Required parameter body was null or undefined when calling hardDeleteFile.' + ); + } + + if (dossierId === null || dossierId === undefined) { + throw new Error( + 'Required parameter dossierId was null or undefined when calling hardDeleteFile.' + ); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['*/*']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request( + 'delete', + `${this.basePath}/delete/hard-delete/${encodeURIComponent(String(dossierId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Restores an deleted file. + * None + * @param body fileIds + * @param dossierId dossierId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public restoreFiles( + body: Array, + dossierId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public restoreFiles( + body: Array, + dossierId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public restoreFiles( + body: Array, + dossierId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public restoreFiles( + body: Array, + dossierId: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { + if (body === null || body === undefined) { + throw new Error( + 'Required parameter body was null or undefined when calling restoreFiles.' + ); + } + + if (dossierId === null || dossierId === undefined) { + throw new Error( + 'Required parameter dossierId was null or undefined when calling restoreFiles.' + ); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request( + 'post', + `${this.basePath}/delete/restore/${encodeURIComponent(String(dossierId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } }