/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as runtime from '../runtime';
import { FileHandleResultsFromJSON, PaginatedResultsOfWikiHeaderFromJSON, WikiPageFromJSON, WikiPageToJSON, WikiPageKeyFromJSON, } from '../models/index';
/**
 *
 */
export class WikiPageServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1EntityOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling deleteRepoV1EntityOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling deleteRepoV1EntityOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1EntityOwnerIdWikiWikiId(requestParameters, initOverrides) {
        await this.deleteRepoV1EntityOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async deleteRepoV1EvaluationOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling deleteRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling deleteRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1EvaluationOwnerIdWikiWikiId(requestParameters, initOverrides) {
        await this.deleteRepoV1EvaluationOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1AccessRequirementOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1AccessRequirementOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1AccessRequirementOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        if (requestParameters['wikiVersion'] != null) {
            queryParameters['wikiVersion'] = requestParameters['wikiVersion'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/access_requirement/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AccessRequirementOwnerIdWikiWikiId(requestParameters, initOverrides) {
        const response = await this.getRepoV1AccessRequirementOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1AccessRequirementOwnerIdWikikeyRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1AccessRequirementOwnerIdWikikey().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/access_requirement/{ownerId}/wikikey`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageKeyFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AccessRequirementOwnerIdWikikey(requestParameters, initOverrides) {
        const response = await this.getRepoV1AccessRequirementOwnerIdWikikeyRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWiki().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityOwnerIdWiki(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikiRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        if (requestParameters['wikiVersion'] != null) {
            queryParameters['wikiVersion'] = requestParameters['wikiVersion'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiId(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdAttachmentRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachment().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachment().');
        }
        if (requestParameters['fileName'] == null) {
            throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachment().');
        }
        const queryParameters = {};
        if (requestParameters['fileName'] != null) {
            queryParameters['fileName'] = requestParameters['fileName'];
        }
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki/{wikiId}/attachment`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdAttachment(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikiWikiIdAttachmentRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdAttachmenthandlesRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachmenthandles().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachmenthandles().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki/{wikiId}/attachmenthandles`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => FileHandleResultsFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdAttachmenthandles(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikiWikiIdAttachmenthandlesRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdAttachmentpreviewRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachmentpreview().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachmentpreview().');
        }
        if (requestParameters['fileName'] == null) {
            throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling getRepoV1EntityOwnerIdWikiWikiIdAttachmentpreview().');
        }
        const queryParameters = {};
        if (requestParameters['fileName'] != null) {
            queryParameters['fileName'] = requestParameters['fileName'];
        }
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki/{wikiId}/attachmentpreview`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiWikiIdAttachmentpreview(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikiWikiIdAttachmentpreviewRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiheadertreeRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWikiheadertree().');
        }
        const queryParameters = {};
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wikiheadertree`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResultsOfWikiHeaderFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikiheadertree(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikiheadertreeRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikikeyRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EntityOwnerIdWikikey().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wikikey`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageKeyFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityOwnerIdWikikey(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityOwnerIdWikikeyRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWiki().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWiki(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikiRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        if (requestParameters['wikiVersion'] != null) {
            queryParameters['wikiVersion'] = requestParameters['wikiVersion'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiId(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachment().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachment().');
        }
        if (requestParameters['fileName'] == null) {
            throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachment().');
        }
        const queryParameters = {};
        if (requestParameters['fileName'] != null) {
            queryParameters['fileName'] = requestParameters['fileName'];
        }
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki/{wikiId}/attachment`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdAttachment(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdAttachmenthandlesRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachmenthandles().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachmenthandles().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki/{wikiId}/attachmenthandles`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => FileHandleResultsFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdAttachmenthandles(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikiWikiIdAttachmenthandlesRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentpreviewRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentpreview().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentpreview().');
        }
        if (requestParameters['fileName'] == null) {
            throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentpreview().');
        }
        const queryParameters = {};
        if (requestParameters['fileName'] != null) {
            queryParameters['fileName'] = requestParameters['fileName'];
        }
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki/{wikiId}/attachmentpreview`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentpreview(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikiWikiIdAttachmentpreviewRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiheadertreeRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikiheadertree().');
        }
        const queryParameters = {};
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wikiheadertree`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResultsOfWikiHeaderFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikiheadertree(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikiheadertreeRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikikeyRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling getRepoV1EvaluationOwnerIdWikikey().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wikikey`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageKeyFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EvaluationOwnerIdWikikey(requestParameters, initOverrides) {
        const response = await this.getRepoV1EvaluationOwnerIdWikikeyRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1AccessRequirementOwnerIdWikiRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling postRepoV1AccessRequirementOwnerIdWiki().');
        }
        if (requestParameters['wikiPage'] == null) {
            throw new runtime.RequiredError('wikiPage', 'Required parameter "wikiPage" was null or undefined when calling postRepoV1AccessRequirementOwnerIdWiki().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/access_requirement/{ownerId}/wiki`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: WikiPageToJSON(requestParameters['wikiPage']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1AccessRequirementOwnerIdWiki(requestParameters, initOverrides) {
        const response = await this.postRepoV1AccessRequirementOwnerIdWikiRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityOwnerIdWikiRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling postRepoV1EntityOwnerIdWiki().');
        }
        if (requestParameters['wikiPage'] == null) {
            throw new runtime.RequiredError('wikiPage', 'Required parameter "wikiPage" was null or undefined when calling postRepoV1EntityOwnerIdWiki().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: WikiPageToJSON(requestParameters['wikiPage']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityOwnerIdWiki(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityOwnerIdWikiRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EvaluationOwnerIdWikiRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling postRepoV1EvaluationOwnerIdWiki().');
        }
        if (requestParameters['wikiPage'] == null) {
            throw new runtime.RequiredError('wikiPage', 'Required parameter "wikiPage" was null or undefined when calling postRepoV1EvaluationOwnerIdWiki().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: WikiPageToJSON(requestParameters['wikiPage']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EvaluationOwnerIdWiki(requestParameters, initOverrides) {
        const response = await this.postRepoV1EvaluationOwnerIdWikiRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1AccessRequirementOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling putRepoV1AccessRequirementOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling putRepoV1AccessRequirementOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiPage'] == null) {
            throw new runtime.RequiredError('wikiPage', 'Required parameter "wikiPage" was null or undefined when calling putRepoV1AccessRequirementOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/access_requirement/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: WikiPageToJSON(requestParameters['wikiPage']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1AccessRequirementOwnerIdWikiWikiId(requestParameters, initOverrides) {
        const response = await this.putRepoV1AccessRequirementOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1EntityOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling putRepoV1EntityOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling putRepoV1EntityOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiPage'] == null) {
            throw new runtime.RequiredError('wikiPage', 'Required parameter "wikiPage" was null or undefined when calling putRepoV1EntityOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/entity/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: WikiPageToJSON(requestParameters['wikiPage']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1EntityOwnerIdWikiWikiId(requestParameters, initOverrides) {
        const response = await this.putRepoV1EntityOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1EvaluationOwnerIdWikiWikiIdRaw(requestParameters, initOverrides) {
        if (requestParameters['ownerId'] == null) {
            throw new runtime.RequiredError('ownerId', 'Required parameter "ownerId" was null or undefined when calling putRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiId'] == null) {
            throw new runtime.RequiredError('wikiId', 'Required parameter "wikiId" was null or undefined when calling putRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        if (requestParameters['wikiPage'] == null) {
            throw new runtime.RequiredError('wikiPage', 'Required parameter "wikiPage" was null or undefined when calling putRepoV1EvaluationOwnerIdWikiWikiId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/evaluation/{ownerId}/wiki/{wikiId}`;
        urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
        urlPath = urlPath.replace(`{${"wikiId"}}`, encodeURIComponent(String(requestParameters['wikiId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: WikiPageToJSON(requestParameters['wikiPage']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => WikiPageFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1EvaluationOwnerIdWikiWikiId(requestParameters, initOverrides) {
        const response = await this.putRepoV1EvaluationOwnerIdWikiWikiIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=WikiPageServicesApi.js.map