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

import { betaObservabilityDatasetsRecordsBulkDelete } from "../funcs/betaObservabilityDatasetsRecordsBulkDelete.js";
import { betaObservabilityDatasetsRecordsDelete } from "../funcs/betaObservabilityDatasetsRecordsDelete.js";
import { betaObservabilityDatasetsRecordsFetch } from "../funcs/betaObservabilityDatasetsRecordsFetch.js";
import { betaObservabilityDatasetsRecordsJudge } from "../funcs/betaObservabilityDatasetsRecordsJudge.js";
import { betaObservabilityDatasetsRecordsUpdatePayload } from "../funcs/betaObservabilityDatasetsRecordsUpdatePayload.js";
import { betaObservabilityDatasetsRecordsUpdateProperties } from "../funcs/betaObservabilityDatasetsRecordsUpdateProperties.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 Records extends ClientSDK {
  /**
   * Get the content of a given conversation from a dataset
   */
  async fetch(
    request:
      operations.GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIdGetRequest,
    options?: RequestOptions,
  ): Promise<components.DatasetRecord> {
    return unwrapAsync(betaObservabilityDatasetsRecordsFetch(
      this,
      request,
      options,
    ));
  }

  /**
   * Delete a record from a dataset
   */
  async delete(
    request:
      operations.DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIdDeleteRequest,
    options?: RequestOptions,
  ): Promise<void> {
    return unwrapAsync(betaObservabilityDatasetsRecordsDelete(
      this,
      request,
      options,
    ));
  }

  /**
   * Delete multiple records from datasets
   */
  async bulkDelete(
    request: components.DeleteDatasetRecordsRequest,
    options?: RequestOptions,
  ): Promise<void> {
    return unwrapAsync(betaObservabilityDatasetsRecordsBulkDelete(
      this,
      request,
      options,
    ));
  }

  /**
   * Run Judge on a dataset record based on the given options
   */
  async judge(
    request:
      operations.JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIdLiveJudgingPostRequest,
    options?: RequestOptions,
  ): Promise<components.JudgeOutput> {
    return unwrapAsync(betaObservabilityDatasetsRecordsJudge(
      this,
      request,
      options,
    ));
  }

  /**
   * Update a dataset record conversation payload
   */
  async updatePayload(
    request:
      operations.UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIdPayloadPutRequest,
    options?: RequestOptions,
  ): Promise<void> {
    return unwrapAsync(betaObservabilityDatasetsRecordsUpdatePayload(
      this,
      request,
      options,
    ));
  }

  /**
   * Update conversation properties
   */
  async updateProperties(
    request:
      operations.UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIdPropertiesPutRequest,
    options?: RequestOptions,
  ): Promise<void> {
    return unwrapAsync(betaObservabilityDatasetsRecordsUpdateProperties(
      this,
      request,
      options,
    ));
  }
}
