/* 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 { VerificationPagedResultsFromJSON, VerificationStateToJSON, VerificationSubmissionFromJSON, VerificationSubmissionToJSON, } from '../models/index';
/**
 *
 */
export class VerificationServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1VerificationSubmissionIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1VerificationSubmissionId().');
        }
        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/verificationSubmission/{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 deleteRepoV1VerificationSubmissionId(requestParameters, initOverrides) {
        await this.deleteRepoV1VerificationSubmissionIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1VerificationSubmissionRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['verifiedUserId'] != null) {
            queryParameters['verifiedUserId'] = requestParameters['verifiedUserId'];
        }
        if (requestParameters['currentVerificationState'] != null) {
            queryParameters['currentVerificationState'] = requestParameters['currentVerificationState'];
        }
        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/verificationSubmission`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => VerificationPagedResultsFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1VerificationSubmission(requestParameters = {}, initOverrides) {
        const response = await this.getRepoV1VerificationSubmissionRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1VerificationSubmissionRaw(requestParameters, initOverrides) {
        if (requestParameters['verificationSubmission'] == null) {
            throw new runtime.RequiredError('verificationSubmission', 'Required parameter "verificationSubmission" was null or undefined when calling postRepoV1VerificationSubmission().');
        }
        const queryParameters = {};
        if (requestParameters['notificationUnsubscribeEndpoint'] != null) {
            queryParameters['notificationUnsubscribeEndpoint'] = requestParameters['notificationUnsubscribeEndpoint'];
        }
        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/verificationSubmission`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: VerificationSubmissionToJSON(requestParameters['verificationSubmission']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => VerificationSubmissionFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1VerificationSubmission(requestParameters, initOverrides) {
        const response = await this.postRepoV1VerificationSubmissionRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1VerificationSubmissionIdStateRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1VerificationSubmissionIdState().');
        }
        if (requestParameters['verificationState'] == null) {
            throw new runtime.RequiredError('verificationState', 'Required parameter "verificationState" was null or undefined when calling postRepoV1VerificationSubmissionIdState().');
        }
        const queryParameters = {};
        if (requestParameters['notificationUnsubscribeEndpoint'] != null) {
            queryParameters['notificationUnsubscribeEndpoint'] = requestParameters['notificationUnsubscribeEndpoint'];
        }
        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/verificationSubmission/{id}/state`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: VerificationStateToJSON(requestParameters['verificationState']),
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async postRepoV1VerificationSubmissionIdState(requestParameters, initOverrides) {
        await this.postRepoV1VerificationSubmissionIdStateRaw(requestParameters, initOverrides);
    }
}
//# sourceMappingURL=VerificationServicesApi.js.map