UNPKG

@agravity/private

Version:

The Agravity GlobalDAM API which allowes authenticated user to access the Agravity GlobalDAM Backend

273 lines (246 loc) 12.1 kB
/** * Agravity OpenAPI Documentation - Private 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, 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 { Asset } from '../model/asset.agravity'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { AgravityConfiguration } from '../configuration'; import { BaseService } from '../api.base.service'; export interface HttpWordpressPageRequestParams { /** The title of the wordpress post. */ pageTitle: string; /** The excerpt of the wordpress page as well as the first part of the page. */ pageContentBefore: string; /** The URL where the image can be publically retrieved. */ pageImage: string; /** The content of the wordpress page, which is shown below the image. */ pageContentAfter: string; /** This endpoint creates a Wordpress Page */ asset: Asset; } export interface HttpWordpressPostRequestParams { /** The title of the wordpress post. */ postTitle: string; /** The excerpt of the wordpress post as well as the first part of the post. */ postContentBefore: string; /** The URL where the image can be publically retrieved. */ postImage: string; /** The content of the wordpress post, which is shown below the image. */ postContentAfter: string; /** This endpoint creates a Wordpress Post */ asset: Asset; } @Injectable({ providedIn: 'root' }) export class WordpressManagementService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: AgravityConfiguration ) { super(basePath, configuration); } /** * This endpoint creates a Wordpress Page * @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 httpWordpressPage( requestParameters: HttpWordpressPageRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<number>; public httpWordpressPage( requestParameters: HttpWordpressPageRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<number>>; public httpWordpressPage( requestParameters: HttpWordpressPageRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<number>>; public httpWordpressPage( requestParameters: HttpWordpressPageRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const pageTitle = requestParameters?.pageTitle; if (pageTitle === null || pageTitle === undefined) { throw new Error('Required parameter pageTitle was null or undefined when calling httpWordpressPage.'); } const pageContentBefore = requestParameters?.pageContentBefore; if (pageContentBefore === null || pageContentBefore === undefined) { throw new Error('Required parameter pageContentBefore was null or undefined when calling httpWordpressPage.'); } const pageImage = requestParameters?.pageImage; if (pageImage === null || pageImage === undefined) { throw new Error('Required parameter pageImage was null or undefined when calling httpWordpressPage.'); } const pageContentAfter = requestParameters?.pageContentAfter; if (pageContentAfter === null || pageContentAfter === undefined) { throw new Error('Required parameter pageContentAfter was null or undefined when calling httpWordpressPage.'); } const asset = requestParameters?.asset; if (asset === null || asset === undefined) { throw new Error('Required parameter asset was null or undefined when calling httpWordpressPage.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>pageTitle, 'page_title'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>pageContentBefore, 'page_content_before'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>pageImage, 'page_image'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>pageContentAfter, 'page_content_after'); let localVarHeaders = this.defaultHeaders; // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; // 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 = `/wordpresspage`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<number>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: asset, params: localVarQueryParameters, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } /** * This endpoint creates a Wordpress Post * @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 httpWordpressPost( requestParameters: HttpWordpressPostRequestParams, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<number>; public httpWordpressPost( requestParameters: HttpWordpressPostRequestParams, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpResponse<number>>; public httpWordpressPost( requestParameters: HttpWordpressPostRequestParams, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<HttpEvent<number>>; public httpWordpressPost( requestParameters: HttpWordpressPostRequestParams, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json'; context?: HttpContext; transferCache?: boolean } ): Observable<any> { const postTitle = requestParameters?.postTitle; if (postTitle === null || postTitle === undefined) { throw new Error('Required parameter postTitle was null or undefined when calling httpWordpressPost.'); } const postContentBefore = requestParameters?.postContentBefore; if (postContentBefore === null || postContentBefore === undefined) { throw new Error('Required parameter postContentBefore was null or undefined when calling httpWordpressPost.'); } const postImage = requestParameters?.postImage; if (postImage === null || postImage === undefined) { throw new Error('Required parameter postImage was null or undefined when calling httpWordpressPost.'); } const postContentAfter = requestParameters?.postContentAfter; if (postContentAfter === null || postContentAfter === undefined) { throw new Error('Required parameter postContentAfter was null or undefined when calling httpWordpressPost.'); } const asset = requestParameters?.asset; if (asset === null || asset === undefined) { throw new Error('Required parameter asset was null or undefined when calling httpWordpressPost.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>postTitle, 'post_title'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>postContentBefore, 'post_content_before'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>postImage, 'post_image'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, <any>postContentAfter, 'post_content_after'); let localVarHeaders = this.defaultHeaders; // authentication (msal_auth) required localVarHeaders = this.configuration.addCredentialToHeaders('msal_auth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); const localVarTransferCache: boolean = options?.transferCache ?? true; // 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 = `/wordpresspost`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request<number>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: asset, params: localVarQueryParameters, responseType: <any>responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } }