@agravity/private
Version:
The Agravity GlobalDAM API which allowes authenticated user to access the Agravity GlobalDAM Backend
1,136 lines (1,034 loc) • 55.1 kB
text/typescript
/**
* Agravity OpenAPI Documentation - Private Functions
*
* Contact: office@agravity.io
*
* 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, HttpParameterCodec, HttpContext } from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { AgravityErrorResponse } from '../model/agravityErrorResponse.agravity';
// @ts-ignore
import { AgravityInfoResponse } from '../model/agravityInfoResponse.agravity';
// @ts-ignore
import { Asset } from '../model/asset.agravity';
// @ts-ignore
import { AssetBulkUpdate } from '../model/assetBulkUpdate.agravity';
// @ts-ignore
import { AssetPageResult } from '../model/assetPageResult.agravity';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { AgravityConfiguration } from '../configuration';
export interface HttpAssetUploadFileRequestParams {
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
name?: string;
collectionid?: string;
file?: Blob;
filename?: string;
previewof?: string;
}
export interface HttpAssetsBulkDeleteUpdateRequestParams {
/** The body has to be valid json which contains the reference asset, which for which collection (reference for collection type items) and which assets are to update. The containing keywords (tags) will be removed. Only custom values are replaces if they are part of the given collection id. */
assetBulkUpdate: AssetBulkUpdate;
}
export interface HttpAssetsBulkPostUpdateRequestParams {
/** The body has to be valid json which contains the reference asset, which for which collection (reference for collection type items) and which assets are to update. The containing keywords (tags) will be distinctly added (no removal). Only custom values are replaces if they are part of the given collection id. */
assetBulkUpdate: AssetBulkUpdate;
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
}
export interface HttpAssetsBulkPutUpdateRequestParams {
/** The body has to be valid json which contains the reference asset, a collection (used as reference for collection type items) and which asset ids are to update. The containing keywords (tags) will be fully replaced. ONLY custom items are replaced which are in body (others in same collection will be ignored)!Only custom values are replaces if they are part of the given collection id. */
assetBulkUpdate: AssetBulkUpdate;
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
}
export interface HttpAssetsCreateRequestParams {
/** The ID of the collection where this assets should be assigned. */
collectionid: string;
/** This endpoint creates an unique asset ID and adds the information to the database. */
asset: Asset;
/** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
translations?: boolean;
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
}
export interface HttpAssetsDeleteAllRequestParams {
/** The filter of assets */
filter?: string;
/** The ID of the collection. */
collectionId?: string;
}
export interface HttpAssetsDeleteByIdRequestParams {
/** The ID of the asset. */
id: string;
}
export interface HttpAssetsGetRequestParams {
/** The ID of the collection where these assets should come from. (Is not required when \'collectiontypeid\' is set.) */
collectionid?: string;
/** The ID of the collection type where these assets should come from. (Is not required when \'collectionid\' is set.) CAUTION: The assets returned are not distinct => Duplicates are possible if assets are in multiple collections in this collection type! */
collectiontypeid?: string;
/** This limits the fields which are returned, separated by comma (\',\'). Blobs can be limited with \'.\' on their container. (i.e. fields=blobs.thumbnails). Only if \'thumbnails\' is set, the placeholder of this asset type are returned if no thumbnail blob is found. */
fields?: string;
/** This indicates if the given blobs should have URLs where these can be requested. (If not limited through \'fields\' parameter it will expose all URLs of all blobs.) */
expose?: boolean;
/** Each result returns the continous token if more results are available than requested. With this token, the next page could be fetched. (URL encoded!) */
continuationToken?: string;
/** This number limits the page result of assets. */
limit?: number;
/** How the return assets are sorted. Default is property: modified_date (newest first). */
orderby?: string;
/** This will limit the output on specific parameters which are separated by \':\', \'!:\', \'>\', \'>=\', \'<\', \'<=\' */
filter?: string;
/** The items can be extended to fully filled items. */
items?: boolean;
/** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
translations?: boolean;
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
}
export interface HttpAssetsGetByIdRequestParams {
/** The ID of the asset. */
id: string;
/** Which fields are need to be filled out with comma separated. If one is set all non mandatory fields are left out. No validation if field exist. */
fields?: string;
/** This indicates if the given blobs should have URLs where these can be requested. It will expose placeholder blobs if no \'thumbnail\' is found.) */
expose?: boolean;
/** The items can be extended to fully filled items. */
items?: boolean;
/** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
translations?: boolean;
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
}
export interface HttpAssetsUpdateByIdRequestParams {
/** The ID of the asset. */
id: string;
/** The body has to contain one of the mentioned elements and a valid json. Not fitting properties are ignored. */
asset: Asset;
/** When default language should be returned and the translation dictionary is delivered. (Ignores the \"Accept-Language\" header) */
translations?: boolean;
/** The requested language of the response. If not matching it falls back to default language. */
acceptLanguage?: string;
}
@Injectable({
providedIn: 'root'
})
export class AssetManagementService {
protected basePath = 'http://localhost:7071/api';
public defaultHeaders = new HttpHeaders();
public configuration = new AgravityConfiguration();
public encoder: HttpParameterCodec;
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration: AgravityConfiguration
) {
if (configuration) {
this.configuration = configuration;
}
if (typeof this.configuration.basePath !== 'string') {
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
if (firstBasePath != undefined) {
basePath = firstBasePath;
}
if (typeof basePath !== 'string') {
basePath = this.basePath;
}
this.configuration.basePath = basePath;
}
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}
/**
* @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;
}
// @ts-ignore
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === 'object' && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
} else {
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
}
return httpParams;
}
private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if (value == null) {
return httpParams;
}
if (typeof value === 'object') {
if (Array.isArray(value)) {
(value as any[]).forEach((elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)));
} else if (value instanceof Date) {
if (key != null) {
httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10));
} else {
throw Error('key may not be null if value is Date');
}
} else {
Object.keys(value).forEach((k) => (httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)));
}
} else if (key != null) {
httpParams = httpParams.append(key, value);
} else {
throw Error('key may not be null if value is not object or array');
}
return httpParams;
}
/**
* This endpoint allows to upload one asset which is put onto the storage (INBOX). Collection ID is mandatory on asset upload. Previewof can be used alone.
* @param requestParameters
* @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 httpAssetUploadFile(
requestParameters?: HttpAssetUploadFileRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Asset>;
public httpAssetUploadFile(
requestParameters?: HttpAssetUploadFileRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Asset>>;
public httpAssetUploadFile(
requestParameters?: HttpAssetUploadFileRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Asset>>;
public httpAssetUploadFile(
requestParameters?: HttpAssetUploadFileRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const acceptLanguage = requestParameters?.acceptLanguage;
const name = requestParameters?.name;
const collectionid = requestParameters?.collectionid;
const file = requestParameters?.file;
const filename = requestParameters?.filename;
const previewof = requestParameters?.previewof;
let localVarHeaders = this.defaultHeaders;
if (acceptLanguage !== undefined && acceptLanguage !== null) {
localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}
// to determine the Content-Type header
const consumes: string[] = ['multipart/form-data'];
const canConsumeForm = this.canConsumeForm(consumes);
let localVarFormParams: { append(param: string, value: any): any };
let localVarUseForm = false;
let localVarConvertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
localVarUseForm = canConsumeForm;
if (localVarUseForm) {
localVarFormParams = new FormData();
} else {
localVarFormParams = new HttpParams({ encoder: this.encoder });
}
if (name !== undefined) {
localVarFormParams = (localVarFormParams.append('name', <any>name) as any) || localVarFormParams;
}
if (collectionid !== undefined) {
localVarFormParams = (localVarFormParams.append('collectionid', <any>collectionid) as any) || localVarFormParams;
}
if (file !== undefined) {
localVarFormParams = (localVarFormParams.append('file', <any>file) as any) || localVarFormParams;
}
if (filename !== undefined) {
localVarFormParams = (localVarFormParams.append('filename', <any>filename) as any) || localVarFormParams;
}
if (previewof !== undefined) {
localVarFormParams = (localVarFormParams.append('previewof', <any>previewof) as any) || localVarFormParams;
}
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 = `/assetsupload`;
return this.httpClient.request<Asset>('post', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* @param requestParameters
* @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 httpAssetsBulkDeleteUpdate(
requestParameters?: HttpAssetsBulkDeleteUpdateRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AgravityInfoResponse>;
public httpAssetsBulkDeleteUpdate(
requestParameters?: HttpAssetsBulkDeleteUpdateRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AgravityInfoResponse>>;
public httpAssetsBulkDeleteUpdate(
requestParameters?: HttpAssetsBulkDeleteUpdateRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AgravityInfoResponse>>;
public httpAssetsBulkDeleteUpdate(
requestParameters?: HttpAssetsBulkDeleteUpdateRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const assetBulkUpdate = requestParameters?.assetBulkUpdate;
if (assetBulkUpdate === null || assetBulkUpdate === undefined) {
throw new Error('Required parameter assetBulkUpdate was null or undefined when calling httpAssetsBulkDeleteUpdate.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
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 = `/assetsbulkupdate`;
return this.httpClient.request<AgravityInfoResponse>('delete', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: assetBulkUpdate,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* @param requestParameters
* @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 httpAssetsBulkPostUpdate(
requestParameters?: HttpAssetsBulkPostUpdateRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AgravityInfoResponse>;
public httpAssetsBulkPostUpdate(
requestParameters?: HttpAssetsBulkPostUpdateRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AgravityInfoResponse>>;
public httpAssetsBulkPostUpdate(
requestParameters?: HttpAssetsBulkPostUpdateRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AgravityInfoResponse>>;
public httpAssetsBulkPostUpdate(
requestParameters?: HttpAssetsBulkPostUpdateRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const assetBulkUpdate = requestParameters?.assetBulkUpdate;
if (assetBulkUpdate === null || assetBulkUpdate === undefined) {
throw new Error('Required parameter assetBulkUpdate was null or undefined when calling httpAssetsBulkPostUpdate.');
}
const acceptLanguage = requestParameters?.acceptLanguage;
let localVarHeaders = this.defaultHeaders;
if (acceptLanguage !== undefined && acceptLanguage !== null) {
localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
}
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
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 = `/assetsbulkupdate`;
return this.httpClient.request<AgravityInfoResponse>('post', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: assetBulkUpdate,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* @param requestParameters
* @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 httpAssetsBulkPutUpdate(
requestParameters?: HttpAssetsBulkPutUpdateRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AgravityInfoResponse>;
public httpAssetsBulkPutUpdate(
requestParameters?: HttpAssetsBulkPutUpdateRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AgravityInfoResponse>>;
public httpAssetsBulkPutUpdate(
requestParameters?: HttpAssetsBulkPutUpdateRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AgravityInfoResponse>>;
public httpAssetsBulkPutUpdate(
requestParameters?: HttpAssetsBulkPutUpdateRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const assetBulkUpdate = requestParameters?.assetBulkUpdate;
if (assetBulkUpdate === null || assetBulkUpdate === undefined) {
throw new Error('Required parameter assetBulkUpdate was null or undefined when calling httpAssetsBulkPutUpdate.');
}
const acceptLanguage = requestParameters?.acceptLanguage;
let localVarHeaders = this.defaultHeaders;
if (acceptLanguage !== undefined && acceptLanguage !== null) {
localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
}
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
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 = `/assetsbulkupdate`;
return this.httpClient.request<AgravityInfoResponse>('put', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: assetBulkUpdate,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint creates one asset entry in the database.
* @param requestParameters
* @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 httpAssetsCreate(
requestParameters?: HttpAssetsCreateRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Asset>;
public httpAssetsCreate(
requestParameters?: HttpAssetsCreateRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Asset>>;
public httpAssetsCreate(
requestParameters?: HttpAssetsCreateRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Asset>>;
public httpAssetsCreate(
requestParameters?: HttpAssetsCreateRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const collectionid = requestParameters?.collectionid;
if (collectionid === null || collectionid === undefined) {
throw new Error('Required parameter collectionid was null or undefined when calling httpAssetsCreate.');
}
const asset = requestParameters?.asset;
if (asset === null || asset === undefined) {
throw new Error('Required parameter asset was null or undefined when calling httpAssetsCreate.');
}
const translations = requestParameters?.translations;
const acceptLanguage = requestParameters?.acceptLanguage;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (collectionid !== undefined && collectionid !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>collectionid, 'collectionid');
}
if (translations !== undefined && translations !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
}
let localVarHeaders = this.defaultHeaders;
if (acceptLanguage !== undefined && acceptLanguage !== null) {
localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
}
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
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 = `/assets`;
return this.httpClient.request<Asset>('post', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: asset,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* @param requestParameters
* @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 httpAssetsDeleteAll(
requestParameters?: HttpAssetsDeleteAllRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any>;
public httpAssetsDeleteAll(
requestParameters?: HttpAssetsDeleteAllRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<any>>;
public httpAssetsDeleteAll(
requestParameters?: HttpAssetsDeleteAllRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<any>>;
public httpAssetsDeleteAll(
requestParameters?: HttpAssetsDeleteAllRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const filter = requestParameters?.filter;
const collectionId = requestParameters?.collectionId;
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = 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 = `/assets`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* @param requestParameters
* @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 httpAssetsDeleteById(
requestParameters?: HttpAssetsDeleteByIdRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any>;
public httpAssetsDeleteById(
requestParameters?: HttpAssetsDeleteByIdRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<any>>;
public httpAssetsDeleteById(
requestParameters?: HttpAssetsDeleteByIdRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<any>>;
public httpAssetsDeleteById(
requestParameters?: HttpAssetsDeleteByIdRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const id = requestParameters?.id;
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling httpAssetsDeleteById.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = 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 = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* @param requestParameters
* @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 httpAssetsGet(
requestParameters?: HttpAssetsGetRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AssetPageResult>;
public httpAssetsGet(
requestParameters?: HttpAssetsGetRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AssetPageResult>>;
public httpAssetsGet(
requestParameters?: HttpAssetsGetRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AssetPageResult>>;
public httpAssetsGet(
requestParameters?: HttpAssetsGetRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const collectionid = requestParameters?.collectionid;
const collectiontypeid = requestParameters?.collectiontypeid;
const fields = requestParameters?.fields;
const expose = requestParameters?.expose;
const continuationToken = requestParameters?.continuationToken;
const limit = requestParameters?.limit;
const orderby = requestParameters?.orderby;
const filter = requestParameters?.filter;
const items = requestParameters?.items;
const translations = requestParameters?.translations;
const acceptLanguage = requestParameters?.acceptLanguage;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (collectionid !== undefined && collectionid !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>collectionid, 'collectionid');
}
if (collectiontypeid !== undefined && collectiontypeid !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>collectiontypeid, 'collectiontypeid');
}
if (fields !== undefined && fields !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>fields, 'fields');
}
if (expose !== undefined && expose !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>expose, 'expose');
}
if (continuationToken !== undefined && continuationToken !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>continuationToken, 'continuation_token');
}
if (limit !== undefined && limit !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>limit, 'limit');
}
if (orderby !== undefined && orderby !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>orderby, 'orderby');
}
if (filter !== undefined && filter !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>filter, 'filter');
}
if (items !== undefined && items !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>items, 'items');
}
if (translations !== undefined && translations !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
}
let localVarHeaders = this.defaultHeaders;
if (acceptLanguage !== undefined && acceptLanguage !== null) {
localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
}
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = 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 = `/assets`;
return this.httpClient.request<AssetPageResult>('get', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint returns one single asset (from ID). If the returned asset is from a special asset type (e.g. \"AssetImage\") it returns the full entity.
* @param requestParameters
* @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 httpAssetsGetById(
requestParameters?: HttpAssetsGetByIdRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Asset>;
public httpAssetsGetById(
requestParameters?: HttpAssetsGetByIdRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Asset>>;
public httpAssetsGetById(
requestParameters?: HttpAssetsGetByIdRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Asset>>;
public httpAssetsGetById(
requestParameters?: HttpAssetsGetByIdRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const id = requestParameters?.id;
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling httpAssetsGetById.');
}
const fields = requestParameters?.fields;
const expose = requestParameters?.expose;
const items = requestParameters?.items;
const translations = requestParameters?.translations;
const acceptLanguage = requestParameters?.acceptLanguage;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (fields !== undefined && fields !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>fields, 'fields');
}
if (expose !== undefined && expose !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>expose, 'expose');
}
if (items !== undefined && items !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>items, 'items');
}
if (translations !== undefined && translations !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>translations, 'translations');
}
let localVarHeaders = this.defaultHeaders;
if (acceptLanguage !== undefined && acceptLanguage !== null) {
localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage));
}
let localVarCredential: string | undefined;
// authentication (msal_auth) required
localVarCredential = this.configuration.lookupCredential('msal_auth');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = 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 = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
return this.httpClient.request<Asset>('get', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
params: lo