UNPKG

@agravity/public

Version:

The Agravity GlobalDAM API which allowes API key authenticated access the Agravity GlobalDAM Backend

975 lines (860 loc) 45.2 kB
/** * Agravity OpenAPI Documentation - Public Functions * * Contact: support@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, HttpContext } from '@angular/common/http'; import { Observable } from 'rxjs'; import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { AgravityErrorResponse } from '../model/agravityErrorResponse.pub.agravity'; // @ts-ignore import { AgravityInfoResponse } from '../model/agravityInfoResponse.pub.agravity'; // @ts-ignore import { Asset } from '../model/asset.pub.agravity'; // @ts-ignore import { AssetBulkUpdate } from '../model/assetBulkUpdate.pub.agravity'; // @ts-ignore import { AssetPageResult } from '../model/assetPageResult.pub.agravity'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { AgravityPublicConfiguration } from '../configuration'; import { BaseService } from '../api.base.service'; 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 { /** This endpoint updates multiple assets. The containing keywords (tags) will removed if existing. Only custom values are removed on assets which have those items. */ assetBulkUpdate: AssetBulkUpdate; } export interface HttpAssetsBulkPostUpdateRequestParams { /** This endpoint updates multiple assets. The containing keywords (tags) will be distinctly added (no removal). Only custom values are added on assets which have those items. */ assetBulkUpdate: AssetBulkUpdate; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: string; } export interface HttpAssetsBulkPutUpdateRequestParams { /** This endpoint updates multiple assets. The containing keywords (tags) will replace existing. Only custom values are replaced on assets which have those items. */ 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 \&quot;Accept-Language\&quot; header) */ translations?: boolean; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: 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 \&#39;collectiontypeid\&#39; is set.) */ collectionid?: string; /** The ID of the collection type where these assets should come from. (Is not required when \&#39;collectionid\&#39; is set.) CAUTION: The assets returned are not distinct &#x3D;&gt; 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 (\&#39;,\&#39;). Blobs can be limited with \&#39;.\&#39; on their container. (i.e. fields&#x3D;blobs.thumbnails). Only if \&#39;thumbnails\&#39; 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 \&#39;fields\&#39; 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 \&#39;:\&#39;, \&#39;!:\&#39;, \&#39;&gt;\&#39;, \&#39;&gt;&#x3D;\&#39;, \&#39;&lt;\&#39;, \&#39;&lt;&#x3D;\&#39; */ 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 \&quot;Accept-Language\&quot; 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 \&#39;thumbnail\&#39; is found. */ expose?: boolean; /** When default language should be returned and the translation dictionary is delivered. (Ignores the \&quot;Accept-Language\&quot; header) */ translations?: boolean; /** The requested language of the response. If not matching it falls back to default language. */ acceptLanguage?: string; } export interface HttpPublicAssetsUpdateByIdRequestParams { /** 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 \&quot;Accept-Language\&quot; 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 PublicAssetManagementService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: AgravityPublicConfiguration ) { super(basePath, configuration); } /** * @endpoint post /assetsupload * @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. * @param options additional options */ 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)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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; // 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`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Asset>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * @endpoint delete /assetsbulkupdate * @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. * @param options additional options */ 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; // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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; // 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`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<AgravityInfoResponse>('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: assetBulkUpdate, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * @endpoint post /assetsbulkupdate * @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. * @param options additional options */ 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)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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; // 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`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<AgravityInfoResponse>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: assetBulkUpdate, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * @endpoint put /assetsbulkupdate * @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. * @param options additional options */ 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)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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; // 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`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<AgravityInfoResponse>('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: assetBulkUpdate, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * This endpoint creates one asset entry in the database. * @endpoint post /assets * @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. * @param options additional options */ 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 OpenApiHttpParams(this.encoder); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'collectionid', <any>collectionid, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'translations', <any>translations, QueryParamStyle.Form, true); let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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; // 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`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Asset>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: asset, params: localVarQueryParameters.toHttpParams(), responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * @endpoint delete /assets/{id} * @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. * @param options additional options */ 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; // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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 = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; 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 }); } /** * This endpoint lists all the assets, which are stored in the database and not deleted (status \&quot;A\&quot;) * @endpoint get /assets * @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. * @param options additional options */ 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 OpenApiHttpParams(this.encoder); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'collectionid', <any>collectionid, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'collectiontypeid', <any>collectiontypeid, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'fields', <any>fields, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'expose', <any>expose, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'continuation_token', <any>continuationToken, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'limit', <any>limit, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'orderby', <any>orderby, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'filter', <any>filter, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'items', <any>items, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'translations', <any>translations, QueryParamStyle.Form, true); let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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 = `/assets`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<AssetPageResult>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters.toHttpParams(), responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * This endpoint returns one single asset (from ID). If the returned asset is from a special asset type (e.g. \&quot;AssetImage\&quot;) it returns the full entity. * @endpoint get /assets/{id} * @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. * @param options additional options */ 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 translations = requestParameters?.translations; const acceptLanguage = requestParameters?.acceptLanguage; let localVarQueryParameters = new OpenApiHttpParams(this.encoder); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'fields', <any>fields, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'expose', <any>expose, QueryParamStyle.Form, true); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'translations', <any>translations, QueryParamStyle.Form, true); let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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 = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Asset>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters.toHttpParams(), responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } /** * This endpoint updates one single asset (from ID) * @endpoint post /assets/{id} * @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. * @param options additional options */ public httpPublicAssetsUpdateById( requestParameters: HttpPublicAssetsUpdateByIdRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<Asset>; public httpPublicAssetsUpdateById( requestParameters: HttpPublicAssetsUpdateByIdRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<Asset>>; public httpPublicAssetsUpdateById( requestParameters: HttpPublicAssetsUpdateByIdRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<Asset>>; public httpPublicAssetsUpdateById( requestParameters: HttpPublicAssetsUpdateByIdRequestParams, 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 httpPublicAssetsUpdateById.'); } const asset = requestParameters?.asset; if (asset === null || asset === undefined) { throw new Error('Required parameter asset was null or undefined when calling httpPublicAssetsUpdateById.'); } const translations = requestParameters?.translations; const acceptLanguage = requestParameters?.acceptLanguage; let localVarQueryParameters = new OpenApiHttpParams(this.encoder); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, 'translations', <any>translations, QueryParamStyle.Form, true); let localVarHeaders = this.defaultHeaders; if (acceptLanguage !== undefined && acceptLanguage !== null) { localVarHeaders = localVarHeaders.set('Accept-Language', String(acceptLanguage)); } // authentication (function_key) required localVarHeaders = this.configuration.addCredentialToHeaders('function_key', 'x-functions-key', localVarHeaders); 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; // 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/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<Asset>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: asset, params: localVarQueryParameters.toHttpParams(), responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress }); } }