@agravity/public
Version:
The Agravity GlobalDAM API which allowes API key authenticated access the Agravity GlobalDAM Backend
1,122 lines (1,028 loc) • 53.8 kB
text/typescript
/**
* Agravity OpenAPI Documentation - Public 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.pub.agravity';
// @ts-ignore
import { AssetAvailability } from '../model/assetAvailability.pub.agravity';
// @ts-ignore
import { AssetBlob } from '../model/assetBlob.pub.agravity';
// @ts-ignore
import { Collection } from '../model/collection.pub.agravity';
// @ts-ignore
import { DynamicImageOperation } from '../model/dynamicImageOperation.pub.agravity';
// @ts-ignore
import { MoveCollectionBody } from '../model/moveCollectionBody.pub.agravity';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { AgravityPublicConfiguration } from '../configuration';
export interface HttpAssetImageEditRequestParams {
/** The ID of the asset. */
id: string;
/** The width of the final image. */
width?: number;
/** The height of the final image. */
height?: number;
/** The supported modes: contain (default), cover, fill, crop, none */
mode?: string;
/** The file type which the image should be (i.e. webp, png, jpg, gif) */
target?: string;
/** The color of the background color if background is visible (crop outside, png). RGB(A) in hex code (i.e. 00FFAA or with alpha channel: 44AABB77) and color names (i.e. lightgray) supported - default: transparent */
bgcolor?: string;
/** The density (counts for X and Y) of the target image. */
dpi?: number;
/** The bit depth of the target image. */
depth?: number;
/** The quality of the target image (1-100). */
quality?: number;
/** The color space of the image (Default: sRGB). */
colorspace?: string;
/** If mode is crop: The x coordinate of the point (if image is extended (outside) it is negative) */
cropX?: number;
/** If mode is crop: The y coordinate of the point (if image is extended (outside) it is negative) */
cropY?: number;
/** If mode=crop: The width of the cropping rectangle (from original pixel) */
cropWidth?: number;
/** If mode=crop: The height of the cropping rectangle (from original pixel) */
cropHeight?: number;
/** Which filter should be applied. To get all filters available use: /api/helper/imageeditfilters */
filter?: string;
/** If set to true the internal image is used instead of the default original */
original?: boolean;
}
export interface HttpAssetResizeRequestParams {
/** The ID of the asset. */
id: string;
}
export interface HttpAssetToCollectionRequestParams {
/** The ID of the asset. */
id: string;
/** Contains information about this operation. */
moveCollectionBody: MoveCollectionBody;
}
export interface HttpGetAssetBlobRequestParams {
/** The ID of the asset. */
id: string;
/** \"t\" for thumbnail (default); \"op\" for optimized; \"os\" for original size; \"o\" for original. */
c: string;
/** If the request comes from portal this is the indicator. If used the \"key\" param becomes mandatory. */
portalId?: string;
/** The key is the MD5 hash of the original blob of the asset. */
key?: string;
}
export interface HttpGetAssetCollectionsByIdRequestParams {
/** The ID of the asset. */
id: string;
/** This limits the fields which are returned, separated by comma (\',\'). */
fields?: string;
/** 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 HttpGetAssetDownloadRequestParams {
/** The ID of the asset. */
id: string;
/** \"t\" for thumbnail (default); \"op\" for optimized; \"os\" for original size; \"o\" for original. */
c?: string;
/** (optional) provide the id of any valid download format. */
f?: string;
/** If the request comes from portal this is the indicator. It will be checked if the requested blob is valid for the portal. */
portalId?: string;
/** The key is the MD5 hash of the original blob of the asset. */
key?: string;
}
export interface HttpGetSharedAssetBlobRequestParams {
/** This share ID is like an API key. Check on validy (format, expire, collection still availabe). Otherwise StatusCode 403 (Forbidden) is returned. */
shareId: string;
/** The ID of the asset. */
id: string;
/** Which download format the blob is requested. */
format: string;
/** If shared collection has a password, this header is mandatory. Otherwise StatusCode 403 (Forbidden) is returned. */
ayPassword?: string;
}
export interface HttpImageDynamicEditRequestParams {
/** The ID of the asset. */
id: string;
/** Operations to be performed on the image directly mapped to c# imagemagick sdk */
dynamicImageOperation: Array<DynamicImageOperation>;
}
export interface HttpImageDynamicGetFromDownloadIdRequestParams {
/** The ID of the asset. */
id: string;
/** The ID of the download format. */
downloadFormatId: string;
}
export interface HttpPutAssetAvailabilityRequestParams {
/** The ID of the asset. */
id: string;
/** The values are validated and put directly on the asset. */
assetAvailability: AssetAvailability;
}
@Injectable({
providedIn: 'root'
})
export class PublicAssetOperationsService {
protected basePath = 'http://localhost:7072/api';
public defaultHeaders = new HttpHeaders();
public configuration = new AgravityPublicConfiguration();
public encoder: HttpParameterCodec;
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration: AgravityPublicConfiguration
) {
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();
}
// @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 lets you resize/modify the image asset according to the given parameter(s).
* @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 httpAssetImageEdit(
requestParameters?: HttpAssetImageEditRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Blob>;
public httpAssetImageEdit(
requestParameters?: HttpAssetImageEditRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Blob>>;
public httpAssetImageEdit(
requestParameters?: HttpAssetImageEditRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Blob>>;
public httpAssetImageEdit(
requestParameters?: HttpAssetImageEditRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'image/xyz' | '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 httpAssetImageEdit.');
}
const width = requestParameters?.width;
const height = requestParameters?.height;
const mode = requestParameters?.mode;
const target = requestParameters?.target;
const bgcolor = requestParameters?.bgcolor;
const dpi = requestParameters?.dpi;
const depth = requestParameters?.depth;
const quality = requestParameters?.quality;
const colorspace = requestParameters?.colorspace;
const cropX = requestParameters?.cropX;
const cropY = requestParameters?.cropY;
const cropWidth = requestParameters?.cropWidth;
const cropHeight = requestParameters?.cropHeight;
const filter = requestParameters?.filter;
const original = requestParameters?.original;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (width !== undefined && width !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>width, 'width');
}
if (height !== undefined && height !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>height, 'height');
}
if (mode !== undefined && mode !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>mode, 'mode');
}
if (target !== undefined && target !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>target, 'target');
}
if (bgcolor !== undefined && bgcolor !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>bgcolor, 'bgcolor');
}
if (dpi !== undefined && dpi !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>dpi, 'dpi');
}
if (depth !== undefined && depth !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>depth, 'depth');
}
if (quality !== undefined && quality !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>quality, 'quality');
}
if (colorspace !== undefined && colorspace !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>colorspace, 'colorspace');
}
if (cropX !== undefined && cropX !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>cropX, 'crop_x');
}
if (cropY !== undefined && cropY !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>cropY, 'crop_y');
}
if (cropWidth !== undefined && cropWidth !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>cropWidth, 'crop_width');
}
if (cropHeight !== undefined && cropHeight !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>cropHeight, 'crop_height');
}
if (filter !== undefined && filter !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>filter, 'filter');
}
if (original !== undefined && original !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>original, 'original');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['image/xyz', '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 localVarPath = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/imageedit`;
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: 'blob',
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint lets you resize/modify the image asset according to the given parameter(s).
* @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 httpAssetResize(
requestParameters?: HttpAssetResizeRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Blob>;
public httpAssetResize(
requestParameters?: HttpAssetResizeRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Blob>>;
public httpAssetResize(
requestParameters?: HttpAssetResizeRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Blob>>;
public httpAssetResize(
requestParameters?: HttpAssetResizeRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'image/xyz' | '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 httpAssetResize.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['image/xyz', '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 localVarPath = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/resize`;
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
responseType: 'blob',
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint allows to move/assign from/to another collection with the given operation parameter.
* @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 httpAssetToCollection(
requestParameters?: HttpAssetToCollectionRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any>;
public httpAssetToCollection(
requestParameters?: HttpAssetToCollectionRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<any>>;
public httpAssetToCollection(
requestParameters?: HttpAssetToCollectionRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<any>>;
public httpAssetToCollection(
requestParameters?: HttpAssetToCollectionRequestParams,
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 httpAssetToCollection.');
}
const moveCollectionBody = requestParameters?.moveCollectionBody;
if (moveCollectionBody === null || moveCollectionBody === undefined) {
throw new Error('Required parameter moveCollectionBody was null or undefined when calling httpAssetToCollection.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', 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/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/tocollection`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: moveCollectionBody,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint checks, if an asset exists and returns the url for the requested blob.
* @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 httpGetAssetBlob(
requestParameters?: HttpGetAssetBlobRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AssetBlob>;
public httpGetAssetBlob(
requestParameters?: HttpGetAssetBlobRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AssetBlob>>;
public httpGetAssetBlob(
requestParameters?: HttpGetAssetBlobRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AssetBlob>>;
public httpGetAssetBlob(
requestParameters?: HttpGetAssetBlobRequestParams,
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 httpGetAssetBlob.');
}
const c = requestParameters?.c;
if (c === null || c === undefined) {
throw new Error('Required parameter c was null or undefined when calling httpGetAssetBlob.');
}
const portalId = requestParameters?.portalId;
const key = requestParameters?.key;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (c !== undefined && c !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>c, 'c');
}
if (portalId !== undefined && portalId !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>portalId, 'portal_id');
}
if (key !== undefined && key !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>key, 'key');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', 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 })}/blobs`;
return this.httpClient.request<AssetBlob>('get', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* Returns all collections of a specific asset.
* @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 httpGetAssetCollectionsById(
requestParameters?: HttpGetAssetCollectionsByIdRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Array<Collection>>;
public httpGetAssetCollectionsById(
requestParameters?: HttpGetAssetCollectionsByIdRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Array<Collection>>>;
public httpGetAssetCollectionsById(
requestParameters?: HttpGetAssetCollectionsByIdRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Array<Collection>>>;
public httpGetAssetCollectionsById(
requestParameters?: HttpGetAssetCollectionsByIdRequestParams,
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 httpGetAssetCollectionsById.');
}
const fields = requestParameters?.fields;
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 (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 (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', 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 })}/collections`;
return this.httpClient.request<Array<Collection>>('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 is similar to GetAssetBlob but with ContentDistribution and filename to let browser download the content.
* @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 httpGetAssetDownload(
requestParameters?: HttpGetAssetDownloadRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AssetBlob>;
public httpGetAssetDownload(
requestParameters?: HttpGetAssetDownloadRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AssetBlob>>;
public httpGetAssetDownload(
requestParameters?: HttpGetAssetDownloadRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AssetBlob>>;
public httpGetAssetDownload(
requestParameters?: HttpGetAssetDownloadRequestParams,
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 httpGetAssetDownload.');
}
const c = requestParameters?.c;
const f = requestParameters?.f;
const portalId = requestParameters?.portalId;
const key = requestParameters?.key;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (c !== undefined && c !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>c, 'c');
}
if (f !== undefined && f !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>f, 'f');
}
if (portalId !== undefined && portalId !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>portalId, 'portal_id');
}
if (key !== undefined && key !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>key, 'key');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', 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 })}/download`;
return this.httpClient.request<AssetBlob>('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 checks, if an asset exists, is an image, has original blob, is status active, is part of the shared collection and returns the requested asset blob.
* @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 httpGetSharedAssetBlob(
requestParameters?: HttpGetSharedAssetBlobRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AssetBlob>;
public httpGetSharedAssetBlob(
requestParameters?: HttpGetSharedAssetBlobRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<AssetBlob>>;
public httpGetSharedAssetBlob(
requestParameters?: HttpGetSharedAssetBlobRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<AssetBlob>>;
public httpGetSharedAssetBlob(
requestParameters?: HttpGetSharedAssetBlobRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<any> {
const shareId = requestParameters?.shareId;
if (shareId === null || shareId === undefined) {
throw new Error('Required parameter shareId was null or undefined when calling httpGetSharedAssetBlob.');
}
const id = requestParameters?.id;
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling httpGetSharedAssetBlob.');
}
const format = requestParameters?.format;
if (format === null || format === undefined) {
throw new Error('Required parameter format was null or undefined when calling httpGetSharedAssetBlob.');
}
const ayPassword = requestParameters?.ayPassword;
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (shareId !== undefined && shareId !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>shareId, 'share_id');
}
if (format !== undefined && format !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>format, 'format');
}
let localVarHeaders = this.defaultHeaders;
if (ayPassword !== undefined && ayPassword !== null) {
localVarHeaders = localVarHeaders.set('ay-password', String(ayPassword));
}
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 })}/blob`;
return this.httpClient.request<AssetBlob>('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 lets you use the entire api of Imagemagick to edit the image.
* @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 httpImageDynamicEdit(
requestParameters?: HttpImageDynamicEditRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Blob>;
public httpImageDynamicEdit(
requestParameters?: HttpImageDynamicEditRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Blob>>;
public httpImageDynamicEdit(
requestParameters?: HttpImageDynamicEditRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Blob>>;
public httpImageDynamicEdit(
requestParameters?: HttpImageDynamicEditRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'image/xyz' | '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 httpImageDynamicEdit.');
}
const dynamicImageOperation = requestParameters?.dynamicImageOperation;
if (dynamicImageOperation === null || dynamicImageOperation === undefined) {
throw new Error('Required parameter dynamicImageOperation was null or undefined when calling httpImageDynamicEdit.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['image/xyz', '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 localVarPath = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/imageedit`;
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
body: dynamicImageOperation,
responseType: 'blob',
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint returns an image with the requested download format applied.
* @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 httpImageDynamicGetFromDownloadId(
requestParameters?: HttpImageDynamicGetFromDownloadIdRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<Blob>;
public httpImageDynamicGetFromDownloadId(
requestParameters?: HttpImageDynamicGetFromDownloadIdRequestParams,
observe?: 'response',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpResponse<Blob>>;
public httpImageDynamicGetFromDownloadId(
requestParameters?: HttpImageDynamicGetFromDownloadIdRequestParams,
observe?: 'events',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'image/xyz' | 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<HttpEvent<Blob>>;
public httpImageDynamicGetFromDownloadId(
requestParameters?: HttpImageDynamicGetFromDownloadIdRequestParams,
observe: any = 'body',
reportProgress: boolean = false,
options?: { httpHeaderAccept?: 'image/xyz' | '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 httpImageDynamicGetFromDownloadId.');
}
const downloadFormatId = requestParameters?.downloadFormatId;
if (downloadFormatId === null || downloadFormatId === undefined) {
throw new Error('Required parameter downloadFormatId was null or undefined when calling httpImageDynamicGetFromDownloadId.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (function_key) required
localVarCredential = this.configuration.lookupCredential('function_key');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('x-functions-key', localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = ['image/xyz', '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 localVarPath = `/assets/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/imageedit/${this.configuration.encodeParam({ name: 'downloadFormatId', value: downloadFormatId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
context: localVarHttpContext,
responseType: 'blob',
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
});
}
/**
* This endpoint sets the availability of the asset. All properties are put on the asset and replace previous values.To make an asset unavailable set the `availability` property to \'locked\' or set the `available_from` property below the current date. To make it available set empty string to `availability` property or `available_to` property into past.
* @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 httpPutAssetAvailability(
requestParameters?: HttpPutAssetAvailabilityRequestParams,
observe?: 'body',
reportProgress?: boolean,
options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean }
): Observable<AssetAvailability>;
public