/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { authorsCreate } from "../funcs/authors-create.js"; import { authorsDelete } from "../funcs/authors-delete.js"; import { authorsList } from "../funcs/authors-list.js"; import { authorsRetrieve } from "../funcs/authors-retrieve.js"; import { authorsUpdate } from "../funcs/authors-update.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class Authors extends ClientSDK { /** * List authors * * @remarks * List authors with their activity metrics and reputation. The list is paginated. */ async list( request?: operations.ListAuthorsRequest | undefined, options?: RequestOptions, ): Promise> { return unwrapResultIterator(authorsList( this, request, options, )); } /** * Create a new author * * @remarks * Create a new author. Typically not needed as authors are created automatically when content is moderated. */ async create( body: operations.CreateAuthorRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(authorsCreate( this, body, projectId, options, )); } /** * Get author details * * @remarks * Get detailed information about a specific author including historical data and analysis */ async retrieve( id: string, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(authorsRetrieve( this, id, projectId, options, )); } /** * Update author details * * @remarks * Update the details of a specific author */ async update( id: string, body: operations.UpdateAuthorRequestBody, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(authorsUpdate( this, id, body, projectId, options, )); } /** * Delete an author * * @remarks * Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. */ async delete( id: string, projectId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(authorsDelete( this, id, projectId, options, )); } }