/* 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 { PaginatedResultsOfPassingRecordFromJSON, PaginatedResultsOfQuizResponseFromJSON, PassingRecordFromJSON, QuizFromJSON, QuizResponseToJSON, } from '../models/index';
/**
 *
 */
export class CertifiedUserServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1AdminCertifiedUserTestResponseIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1AdminCertifiedUserTestResponseId().');
        }
        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/admin/certifiedUserTestResponse/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1AdminCertifiedUserTestResponseId(requestParameters, initOverrides) {
        await this.deleteRepoV1AdminCertifiedUserTestResponseIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1AdminCertifiedUserTestResponseRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['principalId'] != null) {
            queryParameters['principalId'] = requestParameters['principalId'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        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/admin/certifiedUserTestResponse`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResultsOfQuizResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AdminCertifiedUserTestResponse(requestParameters = {}, initOverrides) {
        const response = await this.getRepoV1AdminCertifiedUserTestResponseRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1CertifiedUserTestRaw(initOverrides) {
        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/certifiedUserTest`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => QuizFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1CertifiedUserTest(initOverrides) {
        const response = await this.getRepoV1CertifiedUserTestRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1UserIdCertifiedUserPassingRecordRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1UserIdCertifiedUserPassingRecord().');
        }
        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/user/{id}/certifiedUserPassingRecord`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PassingRecordFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1UserIdCertifiedUserPassingRecord(requestParameters, initOverrides) {
        const response = await this.getRepoV1UserIdCertifiedUserPassingRecordRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1UserIdCertifiedUserPassingRecordsRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1UserIdCertifiedUserPassingRecords().');
        }
        const queryParameters = {};
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        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/user/{id}/certifiedUserPassingRecords`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResultsOfPassingRecordFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1UserIdCertifiedUserPassingRecords(requestParameters, initOverrides) {
        const response = await this.getRepoV1UserIdCertifiedUserPassingRecordsRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1CertifiedUserTestResponseRaw(requestParameters, initOverrides) {
        if (requestParameters['quizResponse'] == null) {
            throw new runtime.RequiredError('quizResponse', 'Required parameter "quizResponse" was null or undefined when calling postRepoV1CertifiedUserTestResponse().');
        }
        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/certifiedUserTestResponse`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: QuizResponseToJSON(requestParameters['quizResponse']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PassingRecordFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1CertifiedUserTestResponse(requestParameters, initOverrides) {
        const response = await this.postRepoV1CertifiedUserTestResponseRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1AdminUserIdCertificationStatusRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putRepoV1AdminUserIdCertificationStatus().');
        }
        if (requestParameters['isCertified'] == null) {
            throw new runtime.RequiredError('isCertified', 'Required parameter "isCertified" was null or undefined when calling putRepoV1AdminUserIdCertificationStatus().');
        }
        const queryParameters = {};
        if (requestParameters['isCertified'] != null) {
            queryParameters['isCertified'] = requestParameters['isCertified'];
        }
        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/admin/user/{id}/certificationStatus`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async putRepoV1AdminUserIdCertificationStatus(requestParameters, initOverrides) {
        await this.putRepoV1AdminUserIdCertificationStatusRaw(requestParameters, initOverrides);
    }
    /**
     */
    async putRepoV1UserIdRevokeCertificationRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putRepoV1UserIdRevokeCertification().');
        }
        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/user/{id}/revokeCertification`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PassingRecordFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1UserIdRevokeCertification(requestParameters, initOverrides) {
        const response = await this.putRepoV1UserIdRevokeCertificationRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=CertifiedUserServicesApi.js.map