/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 98cb32f6656c
 */

import { eventsGetStreamEvents } from "../funcs/eventsGetStreamEvents.js";
import { eventsGetWorkflowEvents } from "../funcs/eventsGetWorkflowEvents.js";
import { EventStream } from "../lib/event-streams.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as components from "../models/components/index.js";
import * as operations from "../models/operations/index.js";
import { unwrapAsync } from "../types/fp.js";

export class WorkflowsEvents extends ClientSDK {
  /**
   * Get Stream Events
   */
  async getStreamEvents(
    request?:
      | operations.GetStreamEventsV1WorkflowsEventsStreamGetRequest
      | undefined,
    options?: RequestOptions,
  ): Promise<
    EventStream<
      operations.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody
    >
  > {
    return unwrapAsync(eventsGetStreamEvents(
      this,
      request,
      options,
    ));
  }

  /**
   * Get Workflow Events
   */
  async getWorkflowEvents(
    request?:
      | operations.GetWorkflowEventsV1WorkflowsEventsListGetRequest
      | undefined,
    options?: RequestOptions,
  ): Promise<components.ListWorkflowEventResponse> {
    return unwrapAsync(eventsGetWorkflowEvents(
      this,
      request,
      options,
    ));
  }
}
