377 lines
20 KiB
TypeScript
377 lines
20 KiB
TypeScript
/**
|
|
* BeReadyBackend
|
|
*
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
/* tslint:disable:no-unused-variable member-ordering */
|
|
|
|
import { Inject, Injectable, Optional } from '@angular/core';
|
|
import { HttpClient, HttpHeaders, HttpParams,
|
|
HttpResponse, HttpEvent, HttpContext
|
|
} from '@angular/common/http';
|
|
import { Observable } from 'rxjs';
|
|
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
|
|
|
|
// @ts-ignore
|
|
import { GetFriendDto } from '../model/get-friend-dto';
|
|
// @ts-ignore
|
|
import { GetFriendRequestDto } from '../model/get-friend-request-dto';
|
|
|
|
// @ts-ignore
|
|
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
|
import { Configuration } from '../configuration';
|
|
import { BaseService } from '../api.base.service';
|
|
|
|
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class FriendsService extends BaseService {
|
|
|
|
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
|
|
super(basePath, configuration);
|
|
}
|
|
|
|
/**
|
|
* @endpoint put /API/Friends/{friendId}/Request
|
|
* @param friendId
|
|
* @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.
|
|
* @param options additional options
|
|
*/
|
|
public acceptFriendRequestEndpoint(friendId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
|
|
public acceptFriendRequestEndpoint(friendId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
|
|
public acceptFriendRequestEndpoint(friendId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
|
|
public acceptFriendRequestEndpoint(friendId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (friendId === null || friendId === undefined) {
|
|
throw new Error('Required parameter friendId was null or undefined when calling acceptFriendRequestEndpoint.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (JWTBearerAuth) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
|
|
|
|
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
|
]);
|
|
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
}
|
|
|
|
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
|
|
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
|
|
|
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
|
if (localVarHttpHeaderAcceptSelected) {
|
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
responseType_ = 'text';
|
|
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
responseType_ = 'json';
|
|
} else {
|
|
responseType_ = 'blob';
|
|
}
|
|
}
|
|
|
|
let localVarPath = `/API/Friends/${this.configuration.encodeParam({name: "friendId", value: friendId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Request`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @endpoint delete /API/Friends/{friendId}
|
|
* @param friendId
|
|
* @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.
|
|
* @param options additional options
|
|
*/
|
|
public deleteFriendEndpoint(friendId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
|
|
public deleteFriendEndpoint(friendId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
|
|
public deleteFriendEndpoint(friendId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
|
|
public deleteFriendEndpoint(friendId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (friendId === null || friendId === undefined) {
|
|
throw new Error('Required parameter friendId was null or undefined when calling deleteFriendEndpoint.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (JWTBearerAuth) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
|
|
|
|
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
|
]);
|
|
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
}
|
|
|
|
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
|
|
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
|
|
|
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
|
if (localVarHttpHeaderAcceptSelected) {
|
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
responseType_ = 'text';
|
|
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
responseType_ = 'json';
|
|
} else {
|
|
responseType_ = 'blob';
|
|
}
|
|
}
|
|
|
|
let localVarPath = `/API/Friends/${this.configuration.encodeParam({name: "friendId", value: friendId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @endpoint get /API/Friends/Requests
|
|
* @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.
|
|
* @param options additional options
|
|
*/
|
|
public getAllFriendRequestsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetFriendRequestDto>>;
|
|
public getAllFriendRequestsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetFriendRequestDto>>>;
|
|
public getAllFriendRequestsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetFriendRequestDto>>>;
|
|
public getAllFriendRequestsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (JWTBearerAuth) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
|
|
|
|
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
|
'application/json'
|
|
]);
|
|
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
}
|
|
|
|
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
|
|
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
|
|
|
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
|
if (localVarHttpHeaderAcceptSelected) {
|
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
responseType_ = 'text';
|
|
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
responseType_ = 'json';
|
|
} else {
|
|
responseType_ = 'blob';
|
|
}
|
|
}
|
|
|
|
let localVarPath = `/API/Friends/Requests`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<Array<GetFriendRequestDto>>('get', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @endpoint get /API/Friends
|
|
* @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.
|
|
* @param options additional options
|
|
*/
|
|
public getAllFriendsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetFriendDto>>;
|
|
public getAllFriendsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetFriendDto>>>;
|
|
public getAllFriendsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetFriendDto>>>;
|
|
public getAllFriendsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (JWTBearerAuth) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
|
|
|
|
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
|
'application/json'
|
|
]);
|
|
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
}
|
|
|
|
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
|
|
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
|
|
|
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
|
if (localVarHttpHeaderAcceptSelected) {
|
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
responseType_ = 'text';
|
|
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
responseType_ = 'json';
|
|
} else {
|
|
responseType_ = 'blob';
|
|
}
|
|
}
|
|
|
|
let localVarPath = `/API/Friends`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<Array<GetFriendDto>>('get', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @endpoint delete /API/Friends/{friendId}/Request
|
|
* @param friendId
|
|
* @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.
|
|
* @param options additional options
|
|
*/
|
|
public rejectFriendRequestEndpoint(friendId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
|
|
public rejectFriendRequestEndpoint(friendId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
|
|
public rejectFriendRequestEndpoint(friendId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
|
|
public rejectFriendRequestEndpoint(friendId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (friendId === null || friendId === undefined) {
|
|
throw new Error('Required parameter friendId was null or undefined when calling rejectFriendRequestEndpoint.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (JWTBearerAuth) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
|
|
|
|
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
|
]);
|
|
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
}
|
|
|
|
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
|
|
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
|
|
|
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
|
if (localVarHttpHeaderAcceptSelected) {
|
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
responseType_ = 'text';
|
|
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
responseType_ = 'json';
|
|
} else {
|
|
responseType_ = 'blob';
|
|
}
|
|
}
|
|
|
|
let localVarPath = `/API/Friends/${this.configuration.encodeParam({name: "friendId", value: friendId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Request`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @endpoint post /API/Friends/{friendId}
|
|
* @param friendId
|
|
* @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.
|
|
* @param options additional options
|
|
*/
|
|
public sendFriendRequestEndpoint(friendId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
|
|
public sendFriendRequestEndpoint(friendId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
|
|
public sendFriendRequestEndpoint(friendId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
|
|
public sendFriendRequestEndpoint(friendId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
|
if (friendId === null || friendId === undefined) {
|
|
throw new Error('Required parameter friendId was null or undefined when calling sendFriendRequestEndpoint.');
|
|
}
|
|
|
|
let localVarHeaders = this.defaultHeaders;
|
|
|
|
// authentication (JWTBearerAuth) required
|
|
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
|
|
|
|
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
|
|
]);
|
|
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
}
|
|
|
|
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
|
|
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
|
|
|
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
|
if (localVarHttpHeaderAcceptSelected) {
|
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
responseType_ = 'text';
|
|
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
responseType_ = 'json';
|
|
} else {
|
|
responseType_ = 'blob';
|
|
}
|
|
}
|
|
|
|
let localVarPath = `/API/Friends/${this.configuration.encodeParam({name: "friendId", value: friendId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
|
|
const { basePath, withCredentials } = this.configuration;
|
|
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
|
|
{
|
|
context: localVarHttpContext,
|
|
responseType: <any>responseType_,
|
|
...(withCredentials ? { withCredentials } : {}),
|
|
headers: localVarHeaders,
|
|
observe: observe,
|
|
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
|
reportProgress: reportProgress
|
|
}
|
|
);
|
|
}
|
|
|
|
}
|