import * as Models from "./models";


/**
 * API endpoints for Accounts.
 */
export class Accounts {
  private client: any;

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

  /**
   * Request OTP code to email or phone.
   */
  async otpRequestCreate(data: Models.OTPRequestRequest): Promise<Models.OTPRequestResponse> {
    const response = await this.client.request('POST', "/cfg/accounts/otp/request/", { body: data });
    return response;
  }

  /**
   * Verify OTP code and return JWT tokens or 2FA session. If user has 2FA
   * enabled: - Returns requires_2fa=True with session_id - Client must
   * complete 2FA verification at /cfg/totp/verify/ If user has no 2FA: -
   * Returns JWT tokens and user data directly
   */
  async otpVerifyCreate(data: Models.OTPVerifyRequest): Promise<Models.OTPVerifyResponse> {
    const response = await this.client.request('POST', "/cfg/accounts/otp/verify/", { body: data });
    return response;
  }

}