1031 lines
41 KiB
TypeScript
1031 lines
41 KiB
TypeScript
/**
|
|
* 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.
|
|
*/ /* tslint:disable:no-unused-variable member-ordering */
|
|
|
|
import { Inject, Injectable, Optional } from '@angular/core';
|
|
import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http';
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { AddCommentRequest } from '../model/addCommentRequest';
|
|
import { AddRedactionRequest } from '../model/addRedactionRequest';
|
|
import { ApproveRequest } from '../model/approveRequest';
|
|
import { CommentResponse } from '../model/commentResponse';
|
|
import { ManualAddResponse } from '../model/manualAddResponse';
|
|
import { ManualRedactions } from '../model/manualRedactions';
|
|
import { RemoveRedactionRequest } from '../model/removeRedactionRequest';
|
|
|
|
import { BASE_PATH } from '../variables';
|
|
import { Configuration } from '../configuration';
|
|
import { ForceRedactionRequest } from '..';
|
|
|
|
@Injectable()
|
|
export class ManualRedactionControllerService {
|
|
public defaultHeaders = new HttpHeaders();
|
|
public configuration = new Configuration();
|
|
protected basePath = '';
|
|
|
|
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
|
|
if (basePath) {
|
|
this.basePath = basePath;
|
|
}
|
|
if (configuration) {
|
|
this.configuration = configuration;
|
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Adds a comment to a redaction/redaction request
|
|
* None
|
|
* @param body addCommentRequest
|
|
* @param projectId projectId
|
|
* @param fileId fileId
|
|
* @param annotationId annotationId
|
|
* @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 addComment(
|
|
body: AddCommentRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<CommentResponse>;
|
|
|
|
public addComment(
|
|
body: AddCommentRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<CommentResponse>>;
|
|
|
|
public addComment(
|
|
body: AddCommentRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<CommentResponse>>;
|
|
|
|
public addComment(
|
|
body: AddCommentRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: 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 addComment.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling addComment.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling addComment.');
|
|
}
|
|
|
|
if (annotationId === null || annotationId === undefined) {
|
|
throw new Error('Required parameter annotationId was null or undefined when calling addComment.');
|
|
}
|
|
|
|
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<CommentResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/comment/add/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(
|
|
String(annotationId)
|
|
)}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Forces a redaction
|
|
* None
|
|
* @param body forceRedactionRequest
|
|
* @param projectId projectId
|
|
* @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 forceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<ManualAddResponse>;
|
|
public forceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<ManualAddResponse>>;
|
|
public forceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<ManualAddResponse>>;
|
|
public forceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: 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 forceRedaction.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling forceRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling forceRedaction.');
|
|
}
|
|
|
|
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<ManualAddResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/redaction/force/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Adds a request to force a redaction.
|
|
* None
|
|
* @param body forceRedactionRequest
|
|
* @param projectId projectId
|
|
* @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 requestForceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<ManualAddResponse>;
|
|
public requestForceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<ManualAddResponse>>;
|
|
public requestForceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<ManualAddResponse>>;
|
|
public requestForceRedaction(
|
|
body: ForceRedactionRequest,
|
|
projectId: string,
|
|
fileId: 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 requestForceRedaction.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling requestForceRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling requestForceRedaction.');
|
|
}
|
|
|
|
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<ManualAddResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/request/force/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Adds a manual redaction
|
|
* None
|
|
* @param body addRedactionRequest
|
|
* @param projectId projectId
|
|
* @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 addRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<ManualAddResponse>;
|
|
|
|
public addRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<ManualAddResponse>>;
|
|
|
|
public addRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<ManualAddResponse>>;
|
|
|
|
public addRedaction(body: AddRedactionRequest, projectId: string, fileId: 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 addRedaction.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling addRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling addRedaction.');
|
|
}
|
|
|
|
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<ManualAddResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/redaction/add/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Approves a redaction request/ remove redaction request
|
|
* None
|
|
* @param body approveRequest
|
|
* @param projectId projectId
|
|
* @param fileId fileId
|
|
* @param annotationId annotationId
|
|
* @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 approveRequest(
|
|
body: ApproveRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<any>;
|
|
|
|
public approveRequest(
|
|
body: ApproveRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<any>>;
|
|
|
|
public approveRequest(
|
|
body: ApproveRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<any>>;
|
|
|
|
public approveRequest(
|
|
body: ApproveRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: 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 approveRequest.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling approveRequest.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling approveRequest.');
|
|
}
|
|
|
|
if (annotationId === null || annotationId === undefined) {
|
|
throw new Error('Required parameter annotationId was null or undefined when calling approveRequest.');
|
|
}
|
|
|
|
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}/manualRedaction/approve/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(
|
|
String(annotationId)
|
|
)}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Declines a redaction request/ remove redaction request
|
|
* None
|
|
* @param projectId projectId
|
|
* @param fileId fileId
|
|
* @param annotationId annotationId
|
|
* @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 declineRequest(projectId: string, fileId: string, annotationId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
|
|
|
public declineRequest(
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<any>>;
|
|
|
|
public declineRequest(projectId: string, fileId: string, annotationId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
|
|
|
public declineRequest(projectId: string, fileId: string, annotationId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling declineRequest.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling declineRequest.');
|
|
}
|
|
|
|
if (annotationId === null || annotationId === undefined) {
|
|
throw new Error('Required parameter annotationId was null or undefined when calling declineRequest.');
|
|
}
|
|
|
|
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[] = [];
|
|
|
|
return this.httpClient.request<any>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/decline/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(
|
|
String(annotationId)
|
|
)}`,
|
|
{
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Returns the manual redactions
|
|
* None
|
|
* @param projectId projectId
|
|
* @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 getManualRedaction(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable<ManualRedactions>;
|
|
|
|
public getManualRedaction(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<ManualRedactions>>;
|
|
|
|
public getManualRedaction(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<ManualRedactions>>;
|
|
|
|
public getManualRedaction(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling getManualRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling getManualRedaction.');
|
|
}
|
|
|
|
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[] = [];
|
|
|
|
return this.httpClient.request<ManualRedactions>(
|
|
'get',
|
|
`${this.basePath}/manualRedaction/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Removes a redaction
|
|
* None
|
|
* @param body removeRedactionRequest
|
|
* @param projectId projectId
|
|
* @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 removeRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<ManualAddResponse>;
|
|
|
|
public removeRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<ManualAddResponse>>;
|
|
|
|
public removeRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<ManualAddResponse>>;
|
|
|
|
public removeRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: 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 removeRedaction.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling removeRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling removeRedaction.');
|
|
}
|
|
|
|
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<ManualAddResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/redaction/remove/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Adds a request for a redaction.
|
|
* None
|
|
* @param body addRedactionRequest
|
|
* @param projectId projectId
|
|
* @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 requestAddRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<ManualAddResponse>;
|
|
|
|
public requestAddRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<ManualAddResponse>>;
|
|
|
|
public requestAddRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<ManualAddResponse>>;
|
|
|
|
public requestAddRedaction(
|
|
body: AddRedactionRequest,
|
|
projectId: string,
|
|
fileId: 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 requestAddRedaction.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling requestAddRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling requestAddRedaction.');
|
|
}
|
|
|
|
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<ManualAddResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/request/add/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Adds a request to remove a redaction.
|
|
* None
|
|
* @param body removeRedactionRequest
|
|
* @param projectId projectId
|
|
* @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 requestRemoveRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<ManualAddResponse>;
|
|
|
|
public requestRemoveRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<ManualAddResponse>>;
|
|
|
|
public requestRemoveRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<ManualAddResponse>>;
|
|
|
|
public requestRemoveRedaction(
|
|
body: RemoveRedactionRequest,
|
|
projectId: string,
|
|
fileId: 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 requestRemoveRedaction.');
|
|
}
|
|
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling requestRemoveRedaction.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling requestRemoveRedaction.');
|
|
}
|
|
|
|
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<ManualAddResponse>(
|
|
'post',
|
|
`${this.basePath}/manualRedaction/request/remove/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
|
{
|
|
body: body,
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Undo a manual request or redaction
|
|
* Can only be done be the user who added the request/redaction.
|
|
* @param projectId projectId
|
|
* @param fileId fileId
|
|
* @param annotationId annotationId
|
|
* @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 undo(projectId: string, fileId: string, annotationId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
|
|
|
public undo(projectId: string, fileId: string, annotationId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
|
|
|
public undo(projectId: string, fileId: string, annotationId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
|
|
|
public undo(projectId: string, fileId: string, annotationId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling undo.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling undo.');
|
|
}
|
|
|
|
if (annotationId === null || annotationId === undefined) {
|
|
throw new Error('Required parameter annotationId was null or undefined when calling undo.');
|
|
}
|
|
|
|
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[] = [];
|
|
|
|
return this.httpClient.request<any>(
|
|
'delete',
|
|
`${this.basePath}/manualRedaction/undo/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(
|
|
String(annotationId)
|
|
)}`,
|
|
{
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Undo a comment
|
|
* Can only be done be the user who added the comment.
|
|
* @param projectId projectId
|
|
* @param fileId fileId
|
|
* @param annotationId annotationId
|
|
* @param commentId commentId
|
|
* @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 undoComment(projectId: string, fileId: string, annotationId: string, commentId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
|
|
|
public undoComment(
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
commentId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<any>>;
|
|
|
|
public undoComment(
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
commentId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<any>>;
|
|
|
|
public undoComment(
|
|
projectId: string,
|
|
fileId: string,
|
|
annotationId: string,
|
|
commentId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
if (projectId === null || projectId === undefined) {
|
|
throw new Error('Required parameter projectId was null or undefined when calling undoComment.');
|
|
}
|
|
|
|
if (fileId === null || fileId === undefined) {
|
|
throw new Error('Required parameter fileId was null or undefined when calling undoComment.');
|
|
}
|
|
|
|
if (annotationId === null || annotationId === undefined) {
|
|
throw new Error('Required parameter annotationId was null or undefined when calling undoComment.');
|
|
}
|
|
|
|
if (commentId === null || commentId === undefined) {
|
|
throw new Error('Required parameter commentId was null or undefined when calling undoComment.');
|
|
}
|
|
|
|
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[] = [];
|
|
|
|
return this.httpClient.request<any>(
|
|
'delete',
|
|
`${this.basePath}/manualRedaction/comment/undo/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(
|
|
String(annotationId)
|
|
)}/${encodeURIComponent(String(commentId))}`,
|
|
{
|
|
withCredentials: this.configuration.withCredentials,
|
|
headers: headers,
|
|
observe: observe,
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @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;
|
|
}
|
|
}
|