red-ui/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts
2021-09-29 09:25:32 +03:00

301 lines
13 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 {BASE_PATH} from '../variables';
import {Configuration} from '../configuration';
import {IDossierTemplate} from "../model/dossierTemplate";
@Injectable()
export class DossierTemplateControllerService {
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;
}
}
/**
* Creates a new DossierTemplates or updates an existing one.
* None
* @param body dossierTemplateModel
* @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 createOrUpdateDossierTemplate(body: IDossierTemplate, observe?: 'body', reportProgress?: boolean): Observable<IDossierTemplate>;
public createOrUpdateDossierTemplate(
body: IDossierTemplate,
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<IDossierTemplate>>;
public createOrUpdateDossierTemplate(
body: IDossierTemplate,
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<IDossierTemplate>>;
public createOrUpdateDossierTemplate(body: IDossierTemplate, 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 createOrUpdateDossierTemplate.');
}
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<IDossierTemplate>('post', `${this.basePath}/dossier-template`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* Delete a specific DossierTemplate by its ID
* None
* @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.
*/
public deleteDossierTemplate(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public deleteDossierTemplate(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deleteDossierTemplate(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deleteDossierTemplate(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (dossierTemplateId === null || dossierTemplateId === undefined) {
throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierTemplate.');
}
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);
}
return this.httpClient.request<any>(
'delete',
`${this.basePath}/dossier-template/${encodeURIComponent(String(dossierTemplateId))}`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
}
/**
* Delete multiple DossierTemplates by their IDs
* None
* @param body dossierTemplateIds
* @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 deleteDossierTemplates(body: Array<string>, observe?: 'body', reportProgress?: boolean): Observable<any>;
public deleteDossierTemplates(body: Array<string>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deleteDossierTemplates(body: Array<string>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deleteDossierTemplates(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 deleteDossierTemplates.');
}
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}/dossier-template/delete`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* Lists all existing DossierTemplates.
* 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 getAllDossierTemplates(observe?: 'body', reportProgress?: boolean): Observable<Array<IDossierTemplate>>;
public getAllDossierTemplates(observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<IDossierTemplate>>>;
public getAllDossierTemplates(observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<IDossierTemplate>>>;
public getAllDossierTemplates(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<IDossierTemplate>>('get', `${this.basePath}/dossier-template`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* Get a specific DossierTemplate by its ID
* None
* @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.
*/
public getDossierTemplate(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable<IDossierTemplate>;
public getDossierTemplate(
dossierTemplateId: string,
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<IDossierTemplate>>;
public getDossierTemplate(
dossierTemplateId: string,
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<IDossierTemplate>>;
public getDossierTemplate(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (dossierTemplateId === null || dossierTemplateId === undefined) {
throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierTemplate.');
}
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<IDossierTemplate>(
'get',
`${this.basePath}/dossier-template/${encodeURIComponent(String(dossierTemplateId))}`,
{
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;
}
}