/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import { analyticsRetrieve } from "../funcs/analyticsRetrieve.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "../models/operations/index.js";
import { unwrapAsync } from "../types/fp.js";

export class Analytics extends ClientSDK {
  /**
   * Retrieve analytics for a link, a domain, or the authenticated workspace.
   *
   * @remarks
   * Retrieve analytics for a link, a domain, or the authenticated workspace. The response type depends on the `event` and `type` query parameters.
   */
  async retrieve(
    request?: operations.RetrieveAnalyticsRequest | undefined,
    options?: RequestOptions,
  ): Promise<operations.RetrieveAnalyticsResponseBody> {
    return unwrapAsync(analyticsRetrieve(
      this,
      request,
      options,
    ));
  }
}
