api for dossier deletion and dossier attributes
This commit is contained in:
parent
a66eeeca34
commit
fcaf97cfb1
@ -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
|
||||
|
||||
@ -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 => {
|
||||
|
||||
@ -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<DossierAttributesRes>;
|
||||
|
||||
public addOrUpdateDossierAttributes(
|
||||
body: DossierAttributeReq,
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<DossierAttributesRes>>;
|
||||
|
||||
public addOrUpdateDossierAttributes(
|
||||
body: DossierAttributeReq,
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<DossierAttributesRes>>;
|
||||
|
||||
public addOrUpdateDossierAttributes(
|
||||
body: DossierAttributeReq,
|
||||
dossierId: string,
|
||||
@ -120,7 +132,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<DossierAttributesRes>(
|
||||
'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<DossierAttributeConfig>;
|
||||
|
||||
public addOrUpdateDossierAttributesConfig(
|
||||
body: DossierAttributeConfig,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<DossierAttributeConfig>>;
|
||||
|
||||
public addOrUpdateDossierAttributesConfig(
|
||||
body: DossierAttributeConfig,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<DossierAttributeConfig>>;
|
||||
|
||||
public addOrUpdateDossierAttributesConfig(
|
||||
body: DossierAttributeConfig,
|
||||
dossierTemplateId: string,
|
||||
@ -207,7 +216,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<DossierAttributeConfig>(
|
||||
'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<any>;
|
||||
|
||||
public deleteDossierAttribute(
|
||||
dossierAttributeId: string,
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteDossierAttribute(
|
||||
dossierAttributeId: string,
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteDossierAttribute(
|
||||
dossierAttributeId: string,
|
||||
dossierId: string,
|
||||
@ -288,7 +294,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'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<any>;
|
||||
|
||||
public deleteDossierAttributeConfig(
|
||||
dossierAttributeId: string,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteDossierAttributeConfig(
|
||||
dossierAttributeId: string,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteDossierAttributeConfig(
|
||||
dossierAttributeId: string,
|
||||
dossierTemplateId: string,
|
||||
@ -368,7 +371,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'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<any>;
|
||||
|
||||
public deleteDossierAttributesConfig(
|
||||
body: Array<string>,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteDossierAttributesConfig(
|
||||
body: Array<string>,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteDossierAttributesConfig(
|
||||
body: Array<string>,
|
||||
dossierTemplateId: string,
|
||||
@ -456,7 +456,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'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<DossierAttributesRes>;
|
||||
|
||||
public getDossierAttributes(
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<DossierAttributesRes>>;
|
||||
|
||||
public getDossierAttributes(
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<DossierAttributesRes>>;
|
||||
|
||||
public getDossierAttributes(
|
||||
dossierId: string,
|
||||
observe: any = 'body',
|
||||
@ -526,7 +523,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<DossierAttributesRes>(
|
||||
'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<DossierAttributesConfig>;
|
||||
|
||||
public getDossierAttributesConfig(
|
||||
dossierTemplateId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<DossierAttributesConfig>>;
|
||||
|
||||
public getDossierAttributesConfig(
|
||||
dossierTemplateId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<DossierAttributesConfig>>;
|
||||
|
||||
public getDossierAttributesConfig(
|
||||
dossierTemplateId: string,
|
||||
observe: any = 'body',
|
||||
@ -593,7 +587,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<DossierAttributesConfig>(
|
||||
'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<DossierAttributesRes>;
|
||||
|
||||
public setDossierAttributes(
|
||||
body: DossierAttributesReq,
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<DossierAttributesRes>>;
|
||||
|
||||
public setDossierAttributes(
|
||||
body: DossierAttributesReq,
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<DossierAttributesRes>>;
|
||||
|
||||
public setDossierAttributes(
|
||||
body: DossierAttributesReq,
|
||||
dossierId: string,
|
||||
@ -681,7 +672,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<DossierAttributesRes>(
|
||||
'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<DossierAttributesConfig>;
|
||||
|
||||
public setDossierAttributesConfig(
|
||||
body: DossierAttributesConfig,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<DossierAttributesConfig>>;
|
||||
|
||||
public setDossierAttributesConfig(
|
||||
body: DossierAttributesConfig,
|
||||
dossierTemplateId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<DossierAttributesConfig>>;
|
||||
|
||||
public setDossierAttributesConfig(
|
||||
body: DossierAttributesConfig,
|
||||
dossierTemplateId: string,
|
||||
@ -768,7 +756,7 @@ export class DossierAttributesControllerService {
|
||||
|
||||
return this.httpClient.request<DossierAttributesConfig>(
|
||||
'put',
|
||||
`${this.basePath}/dossierAttributes/config/${encodeURIComponent(
|
||||
`${this.basePath}/dossier-attributes/config/${encodeURIComponent(
|
||||
String(dossierTemplateId)
|
||||
)}`,
|
||||
{
|
||||
|
||||
@ -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<Dossier>;
|
||||
|
||||
public createOrUpdateDossier(
|
||||
body: DossierRequest,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<Dossier>>;
|
||||
|
||||
public createOrUpdateDossier(
|
||||
body: DossierRequest,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<Dossier>>;
|
||||
|
||||
public createOrUpdateDossier(
|
||||
body: DossierRequest,
|
||||
observe: any = 'body',
|
||||
@ -125,19 +137,16 @@ export class DossierControllerService {
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
|
||||
public deleteDossier(
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteDossier(
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
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<Array<Dossier>>;
|
||||
public getDeletedDossiers(
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<Array<Dossier>>>;
|
||||
public getDeletedDossiers(
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<Array<Dossier>>>;
|
||||
public getDeletedDossiers(
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
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<Array<Dossier>>('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<Dossier>;
|
||||
|
||||
public getDossier(
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<Dossier>>;
|
||||
|
||||
public getDossier(
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<Dossier>>;
|
||||
|
||||
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<Array<Dossier>>;
|
||||
|
||||
public getDossiers(
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<Array<Dossier>>>;
|
||||
|
||||
public getDossiers(
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<Array<Dossier>>>;
|
||||
|
||||
public getDossiers(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
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<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public hardDeleteDossiers(
|
||||
body: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public hardDeleteDossiers(
|
||||
body: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public hardDeleteDossiers(
|
||||
body: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
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<any>(
|
||||
'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<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public restoreDossiers(
|
||||
body: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public restoreDossiers(
|
||||
body: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public restoreDossiers(
|
||||
body: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
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<any>('post', `${this.basePath}/deleted-dossiers/restore`, {
|
||||
body: body,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<any>;
|
||||
|
||||
public deleteFile(
|
||||
dossierId: string,
|
||||
fileId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteFile(
|
||||
dossierId: string,
|
||||
fileId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteFile(
|
||||
dossierId: string,
|
||||
fileId: string,
|
||||
@ -133,21 +144,18 @@ export class FileManagementControllerService {
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
|
||||
public deleteFiles(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteFiles(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteFiles(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
@ -222,7 +230,6 @@ export class FileManagementControllerService {
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
|
||||
public downloadAnnotatedFile(
|
||||
dossierId: string,
|
||||
fileId: string,
|
||||
@ -230,7 +237,6 @@ export class FileManagementControllerService {
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public downloadAnnotatedFile(
|
||||
dossierId: string,
|
||||
fileId: string,
|
||||
@ -238,7 +244,6 @@ export class FileManagementControllerService {
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
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<string>,
|
||||
dossierId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public hardDeleteFile(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public hardDeleteFile(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public hardDeleteFile(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
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<any>(
|
||||
'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<string>,
|
||||
dossierId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public restoreFiles(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public restoreFiles(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public restoreFiles(
|
||||
body: Array<string>,
|
||||
dossierId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
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<any>(
|
||||
'post',
|
||||
`${this.basePath}/delete/restore/${encodeURIComponent(String(dossierId))}`,
|
||||
{
|
||||
body: body,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user