import * as Models from "./models";


/**
 * API endpoints for TOTP Verification.
 */
export class TotpVerification {
  private client: any;

  constructor(client: any) {
    this.client = client;
  }

  /**
   * Verify TOTP code for 2FA session. Completes authentication and returns
   * JWT tokens on success.
   */
  async totpVerifyCreate(data: Models.VerifyRequest): Promise<Models.VerifyResponse> {
    const response = await this.client.request('POST', "/cfg/totp/verify/", { body: data });
    return response;
  }

  /**
   * Verify backup recovery code for 2FA session. Alternative verification
   * method when TOTP device unavailable.
   */
  async totpVerifyBackupCreate(data: Models.VerifyBackupRequest): Promise<Models.VerifyResponse> {
    const response = await this.client.request('POST', "/cfg/totp/verify/backup/", { body: data });
    return response;
  }

}