From 4a9a7440e80e21a3b9dc49feddc98eb47e1088b0 Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 28 Jun 2021 21:06:16 +0300 Subject: [PATCH] excluded pages addition to api and legal basis change api --- .../api/manualRedactionController.service.ts | 245 ++++++++++++++---- libs/red-ui-http/src/lib/model/fileStatus.ts | 4 + .../src/lib/model/legalBasisChangeRequest.ts | 17 ++ libs/red-ui-http/src/lib/model/models.ts | 1 + 4 files changed, 222 insertions(+), 45 deletions(-) create mode 100644 libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts diff --git a/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts b/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts index af7bfccbd..6297cebef 100644 --- a/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts +++ b/libs/red-ui-http/src/lib/api/manualRedactionController.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,18 +22,19 @@ import { ApproveRequest } from '../model/approveRequest'; import { CommentResponse } from '../model/commentResponse'; import { ForceRedactionRequest } from '../model/forceRedactionRequest'; import { ImageRecategorizationRequest } from '../model/imageRecategorizationRequest'; +import { LegalBasisChangeRequest } from '../model/legalBasisChangeRequest'; import { ManualAddResponse } from '../model/manualAddResponse'; import { ManualRedactions } from '../model/manualRedactions'; import { RemoveRedactionRequest } from '../model/removeRedactionRequest'; -import { BASE_PATH } from '../variables'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class ManualRedactionControllerService { + protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -66,7 +68,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public addComment( body: AddCommentRequest, annotationId: string, @@ -75,7 +76,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public addComment( body: AddCommentRequest, annotationId: string, @@ -84,7 +84,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public addComment( body: AddCommentRequest, annotationId: string, @@ -175,7 +174,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public addRedaction( body: AddRedactionRequest, dossierId: string, @@ -183,7 +181,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public addRedaction( body: AddRedactionRequest, dossierId: string, @@ -191,7 +188,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public addRedaction( body: AddRedactionRequest, dossierId: string, @@ -277,7 +273,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public approveRequest( body: ApproveRequest, annotationId: string, @@ -286,7 +281,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public approveRequest( body: ApproveRequest, annotationId: string, @@ -295,7 +289,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public approveRequest( body: ApproveRequest, annotationId: string, @@ -386,7 +379,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public declineRequest( annotationId: string, dossierId: string, @@ -394,7 +386,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public declineRequest( annotationId: string, dossierId: string, @@ -402,7 +393,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public declineRequest( annotationId: string, dossierId: string, @@ -477,7 +467,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public forceRedaction( body: ForceRedactionRequest, dossierId: string, @@ -485,7 +474,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public forceRedaction( body: ForceRedactionRequest, dossierId: string, @@ -493,7 +481,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public forceRedaction( body: ForceRedactionRequest, dossierId: string, @@ -575,21 +562,18 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public getManualRedaction( dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public getManualRedaction( dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public getManualRedaction( dossierId: string, fileId: string, @@ -641,6 +625,103 @@ export class ManualRedactionControllerService { ); } + /** + * Changes a legal basis reason + * None + * @param body legalBasisChangeRequest + * @param dossierId dossierId + * @param fileId fileId + * @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 legalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public legalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public legalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public legalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: 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 legalBasisChange.' + ); + } + + if (dossierId === null || dossierId === undefined) { + throw new Error( + 'Required parameter dossierId was null or undefined when calling legalBasisChange.' + ); + } + + if (fileId === null || fileId === undefined) { + throw new Error( + 'Required parameter fileId was null or undefined when calling legalBasisChange.' + ); + } + + 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); + } + + // 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}/manualRedaction/redaction/legalBasisChange/${encodeURIComponent( + String(dossierId) + )}/${encodeURIComponent(String(fileId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + /** * Recategorizes an image * None @@ -657,7 +738,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public recategorizeImage( body: ImageRecategorizationRequest, dossierId: string, @@ -665,7 +745,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public recategorizeImage( body: ImageRecategorizationRequest, dossierId: string, @@ -673,7 +752,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public recategorizeImage( body: ImageRecategorizationRequest, dossierId: string, @@ -757,7 +835,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public removeRedaction( body: RemoveRedactionRequest, dossierId: string, @@ -765,7 +842,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public removeRedaction( body: RemoveRedactionRequest, dossierId: string, @@ -773,7 +849,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public removeRedaction( body: RemoveRedactionRequest, dossierId: string, @@ -857,7 +932,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public requestAddRedaction( body: AddRedactionRequest, dossierId: string, @@ -865,7 +939,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public requestAddRedaction( body: AddRedactionRequest, dossierId: string, @@ -873,7 +946,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public requestAddRedaction( body: AddRedactionRequest, dossierId: string, @@ -957,7 +1029,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public requestForceRedaction( body: ForceRedactionRequest, dossierId: string, @@ -965,7 +1036,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public requestForceRedaction( body: ForceRedactionRequest, dossierId: string, @@ -973,7 +1043,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public requestForceRedaction( body: ForceRedactionRequest, dossierId: string, @@ -1057,7 +1126,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public requestImageRecategorization( body: ImageRecategorizationRequest, dossierId: string, @@ -1065,7 +1133,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public requestImageRecategorization( body: ImageRecategorizationRequest, dossierId: string, @@ -1073,7 +1140,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public requestImageRecategorization( body: ImageRecategorizationRequest, dossierId: string, @@ -1141,6 +1207,103 @@ export class ManualRedactionControllerService { ); } + /** + * Adds a request to change the legal basis reason. + * None + * @param body legalBasisChangeRequest + * @param dossierId dossierId + * @param fileId fileId + * @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 requestLegalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public requestLegalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public requestLegalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public requestLegalBasisChange( + body: LegalBasisChangeRequest, + dossierId: string, + fileId: 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 requestLegalBasisChange.' + ); + } + + if (dossierId === null || dossierId === undefined) { + throw new Error( + 'Required parameter dossierId was null or undefined when calling requestLegalBasisChange.' + ); + } + + if (fileId === null || fileId === undefined) { + throw new Error( + 'Required parameter fileId was null or undefined when calling requestLegalBasisChange.' + ); + } + + 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); + } + + // 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}/manualRedaction/request/legalBasis/${encodeURIComponent( + String(dossierId) + )}/${encodeURIComponent(String(fileId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + /** * Adds a request to remove a redaction. * None @@ -1157,7 +1320,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public requestRemoveRedaction( body: RemoveRedactionRequest, dossierId: string, @@ -1165,7 +1327,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public requestRemoveRedaction( body: RemoveRedactionRequest, dossierId: string, @@ -1173,7 +1334,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public requestRemoveRedaction( body: RemoveRedactionRequest, dossierId: string, @@ -1257,7 +1417,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public undo( annotationId: string, dossierId: string, @@ -1265,7 +1424,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public undo( annotationId: string, dossierId: string, @@ -1273,7 +1431,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public undo( annotationId: string, dossierId: string, @@ -1348,7 +1505,6 @@ export class ManualRedactionControllerService { observe?: 'body', reportProgress?: boolean ): Observable; - public undoComment( annotationId: string, commentId: string, @@ -1357,7 +1513,6 @@ export class ManualRedactionControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; - public undoComment( annotationId: string, commentId: string, @@ -1366,7 +1521,6 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public undoComment( annotationId: string, commentId: string, @@ -1418,6 +1572,7 @@ export class ManualRedactionControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header return this.httpClient.request( 'delete', `${this.basePath}/manualRedaction/comment/undo/${encodeURIComponent( diff --git a/libs/red-ui-http/src/lib/model/fileStatus.ts b/libs/red-ui-http/src/lib/model/fileStatus.ts index be3c909a6..fbefcfb9c 100644 --- a/libs/red-ui-http/src/lib/model/fileStatus.ts +++ b/libs/red-ui-http/src/lib/model/fileStatus.ts @@ -136,6 +136,10 @@ export interface FileStatus { * The ID of the user who uploaded the file. */ uploader?: string; + /** + * The list of excluded pages. + */ + excludedPages?: number[]; } export namespace FileStatus { diff --git a/libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts b/libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts new file mode 100644 index 000000000..19b12d1f4 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/legalBasisChangeRequest.ts @@ -0,0 +1,17 @@ +/** + * API Documentation for Redaction Gateway + * Description for redaction + * + * OpenAPI spec version: 1.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export interface LegalBasisChangeRequest { + annotationId?: string; + comment?: string; + legalBasis?: string; +} diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index 50ce4cb3b..84f194d26 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -74,3 +74,4 @@ export * from './viewedPages'; export * from './viewedPagesRequest'; export * from './watermarkModelReq'; export * from './watermarkModelRes'; +export * from './legalBasisChangeRequest';