/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { dmConversations } from "../funcs/dm-conversations.js"; import { dmHistory } from "../funcs/dm-history.js"; import { dmMedia } from "../funcs/dm-media.js"; import { dmSend } from "../funcs/dm-send.js"; import { dmStatus } from "../funcs/dm-status.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Dm extends ClientSDK { /** * Check DM Permissions * * @remarks * Retrieves the Direct Message (DM) availability status for a list of users. This endpoint checks if the specified accounts can receive messages based on their privacy settings, follow status, or verified permissions. */ async status( request: Array, options?: RequestOptions, ): Promise { return unwrapAsync(dmStatus( this, request, options, )); } /** * Send DM * * @remarks * Send DM via XChat encrypted chat API (1:1 or existing group g...), optional image via media_urls (max 1) or video via video_url (mutually exclusive). $0.001 per call. */ async send( request: models.SendDmV3Query, options?: RequestOptions, ): Promise { return unwrapAsync(dmSend( this, request, options, )); } /** * Get DM History * * @remarks * Get DM history via XChat encrypted chat API. Use count for page size (10–200). Set all=true to follow has_more and return every page. Or paginate manually: when has_more is true, pass the oldest message's sequence_id as before. */ async history( request: models.GetDmHistoryV3Query, options?: RequestOptions, ): Promise { return unwrapAsync(dmHistory( this, request, options, )); } /** * Get DM Media * * @remarks * Fetch one XChat media attachment and return a playable URL. Use conversation_id, media_hash_key, and optional key_version from /v3/twitter/dm-history attachments. */ async media( request: models.GetDmMediaV3Query, options?: RequestOptions, ): Promise { return unwrapAsync(dmMedia( this, request, options, )); } /** * Get Conversations * * @remarks * Get XChat conversation list. Use count for page size (10–200). Set all=true to follow the inbox cursor and return every conversation. */ async conversations( request: models.GetConversationsV3Query, options?: RequestOptions, ): Promise { return unwrapAsync(dmConversations( this, request, options, )); } }