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

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

export class Activities extends ClientSDK {
  /**
   * Get all activities
   *
   * @remarks
   * List all activities on the server.  Admins can see all activities but other users can only see their own
   */
  async listActivities(
    options?: RequestOptions,
  ): Promise<operations.ListActivitiesResponse> {
    return unwrapAsync(activitiesListActivities(
      this,
      options,
    ));
  }

  /**
   * Cancel a running activity
   *
   * @remarks
   * Cancel a running activity.  Admins can cancel all activities but other users can only cancel their own
   */
  async cancelActivity(
    request: operations.CancelActivityRequest,
    options?: RequestOptions,
  ): Promise<operations.CancelActivityResponse> {
    return unwrapAsync(activitiesCancelActivity(
      this,
      request,
      options,
    ));
  }
}
