/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { actionsCreate } from "../funcs/actions-create.js"; import { actionsDelete } from "../funcs/actions-delete.js"; import { actionsExecute } from "../funcs/actions-execute.js"; import { actionsList } from "../funcs/actions-list.js"; import { actionsRetrieve } from "../funcs/actions-retrieve.js"; import { actionsUpdate } from "../funcs/actions-update.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class Actions extends ClientSDK { /** * List moderation actions * * @remarks * List the moderation actions of the project. The list is paginated. */ async list( queueId?: string | undefined, page?: number | undefined, pageSize?: number | undefined, projectId?: string | undefined, options?: RequestOptions, ): Promise> { return unwrapResultIterator(actionsList( this, queueId, page, pageSize, projectId, options, )); } /** * Create an action * * @remarks * Create an action. */ async create( body: operations.CreateActionRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(actionsCreate( this, body, projectId, options, )); } /** * Get an action * * @remarks * Get an action by ID. */ async retrieve( id: string, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(actionsRetrieve( this, id, projectId, options, )); } /** * Update an action * * @remarks * Update an action. */ async update( id: string, body: operations.UpdateActionRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(actionsUpdate( this, id, body, projectId, options, )); } /** * Delete an action * * @remarks * Delete an action and all of its webhooks. */ async delete( id: string, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(actionsDelete( this, id, projectId, options, )); } /** * Execute moderation action * * @remarks * Execute a moderation action on one or more content items. */ async execute( body: operations.ExecuteActionRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(actionsExecute( this, body, projectId, options, )); } }