/* 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 { LoginResponseFromJSON, TotpSecretFromJSON, TotpSecretActivationRequestToJSON, TwoFactorAuthDisableRequestToJSON, TwoFactorAuthLoginRequestToJSON, TwoFactorAuthRecoveryCodesFromJSON, TwoFactorAuthResetRequestToJSON, TwoFactorAuthStatusFromJSON, } from '../models/index';
/**
 *
 */
export class AuthenticationServices2FAApi extends runtime.BaseAPI {
    /**
     */
    async deleteAuthV12faRaw(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 = `/auth/v1/2fa`;
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteAuthV12fa(initOverrides) {
        await this.deleteAuthV12faRaw(initOverrides);
    }
    /**
     */
    async getAuthV12faRaw(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 = `/auth/v1/2fa`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TwoFactorAuthStatusFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV12fa(initOverrides) {
        const response = await this.getAuthV12faRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV12faRaw(requestParameters, initOverrides) {
        if (requestParameters['totpSecretActivationRequest'] == null) {
            throw new runtime.RequiredError('totpSecretActivationRequest', 'Required parameter "totpSecretActivationRequest" was null or undefined when calling postAuthV12fa().');
        }
        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 = `/auth/v1/2fa`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TotpSecretActivationRequestToJSON(requestParameters['totpSecretActivationRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TwoFactorAuthStatusFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV12fa(requestParameters, initOverrides) {
        const response = await this.postAuthV12faRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV12faDisableRaw(requestParameters, initOverrides) {
        if (requestParameters['twoFactorAuthDisableRequest'] == null) {
            throw new runtime.RequiredError('twoFactorAuthDisableRequest', 'Required parameter "twoFactorAuthDisableRequest" was null or undefined when calling postAuthV12faDisable().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/auth/v1/2fa/disable`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TwoFactorAuthDisableRequestToJSON(requestParameters['twoFactorAuthDisableRequest']),
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async postAuthV12faDisable(requestParameters, initOverrides) {
        await this.postAuthV12faDisableRaw(requestParameters, initOverrides);
    }
    /**
     */
    async postAuthV12faEnrollRaw(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 = `/auth/v1/2fa/enroll`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TotpSecretFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV12faEnroll(initOverrides) {
        const response = await this.postAuthV12faEnrollRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV12faRecoveryCodesRaw(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 = `/auth/v1/2fa/recoveryCodes`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TwoFactorAuthRecoveryCodesFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV12faRecoveryCodes(initOverrides) {
        const response = await this.postAuthV12faRecoveryCodesRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV12faResetRaw(requestParameters, initOverrides) {
        if (requestParameters['twoFactorAuthResetRequest'] == null) {
            throw new runtime.RequiredError('twoFactorAuthResetRequest', 'Required parameter "twoFactorAuthResetRequest" was null or undefined when calling postAuthV12faReset().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/auth/v1/2fa/reset`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TwoFactorAuthResetRequestToJSON(requestParameters['twoFactorAuthResetRequest']),
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async postAuthV12faReset(requestParameters, initOverrides) {
        await this.postAuthV12faResetRaw(requestParameters, initOverrides);
    }
    /**
     */
    async postAuthV12faTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['twoFactorAuthLoginRequest'] == null) {
            throw new runtime.RequiredError('twoFactorAuthLoginRequest', 'Required parameter "twoFactorAuthLoginRequest" was null or undefined when calling postAuthV12faToken().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/auth/v1/2fa/token`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TwoFactorAuthLoginRequestToJSON(requestParameters['twoFactorAuthLoginRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => LoginResponseFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV12faToken(requestParameters, initOverrides) {
        const response = await this.postAuthV12faTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=AuthenticationServices2FAApi.js.map