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

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

export class Events extends ClientSDK {
  /**
   * Connect to Eventsource
   *
   * @remarks
   * Connect to the event source to get a stream of events
   */
  async getNotifications(
    request: operations.GetNotificationsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetNotificationsResponse> {
    return unwrapAsync(eventsGetNotifications(
      this,
      request,
      options,
    ));
  }

  /**
   * Connect to WebSocket
   *
   * @remarks
   * Connect to the web socket to get a stream of events
   */
  async connectWebSocket(
    request: operations.ConnectWebSocketRequest,
    options?: RequestOptions,
  ): Promise<operations.ConnectWebSocketResponse> {
    return unwrapAsync(eventsConnectWebSocket(
      this,
      request,
      options,
    ));
  }
}
