/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { tweetsActionsBookmark } from "../funcs/tweets-actions-bookmark.js"; import { tweetsActionsCreateThread } from "../funcs/tweets-actions-create-thread.js"; import { tweetsActionsCreateWithoutCookie } from "../funcs/tweets-actions-create-without-cookie.js"; import { tweetsActionsCreate } from "../funcs/tweets-actions-create.js"; import { tweetsActionsDeleteBatch } from "../funcs/tweets-actions-delete-batch.js"; import { tweetsActionsLike } from "../funcs/tweets-actions-like.js"; import { tweetsActionsQuote } from "../funcs/tweets-actions-quote.js"; import { tweetsActionsRetweet } from "../funcs/tweets-actions-retweet.js"; import { tweetsActionsUnbookmark } from "../funcs/tweets-actions-unbookmark.js"; import { tweetsActionsUnlike } from "../funcs/tweets-actions-unlike.js"; import { tweetsActionsUnretweet } from "../funcs/tweets-actions-unretweet.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"; export class Actions extends ClientSDK { /** * Like a Tweet * * @remarks * Likes a specific tweet on behalf of the user associated with the provided cookie,$0.001 per call. */ async like( request: operations.TweetsActionsLikeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsLike( this, request, options, )); } /** * Unlike a Tweet * * @remarks * Unlike a tweet, $0.001 per call. */ async unlike( request: operations.TweetsActionsUnlikeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsUnlike( this, request, options, )); } /** * Retweet a Tweet * * @remarks * Retweets a specific tweet on behalf of the user associated with the provided cookie,$0.001 per call. */ async retweet( request: operations.TweetsActionsRetweetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsRetweet( this, request, options, )); } /** * Delete Retweet * * @remarks * Delete a retweet, $0.001 per call. */ async unretweet( request: operations.TweetsActionsUnretweetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsUnretweet( this, request, options, )); } /** * Create a Tweet Thread * * @remarks * Create a tweet thread from an ordered list of texts, $0.001 per call. */ async createThread( request: models.CreateThreadQuery, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsCreateThread( this, request, options, )); } /** * Create a Tweet or Reply * * @remarks * Posts a new tweet. To create a reply, provide the `reply_tweet_id`. This endpoint does not handle quote tweets,$0.001 per call. */ async create( request: models.PostTweetQuery, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsCreate( this, request, options, )); } /** * Create a Quote Tweet * * @remarks * Posts a new tweet that quotes an existing tweet. Requires the URL of the tweet to be quoted and the new content,$0.001 per call. */ async quote( request: models.QuoteTweetQuery, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsQuote( this, request, options, )); } /** * Post Tweet (Auto Cookie) * * @remarks * Post a tweet using a random cookie from the pool, [cookie management](https://twitterxapi.com/cookies/management) * $0.001 per call. */ async createWithoutCookie( request: models.PostTweetWithoutCookieQuery, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsCreateWithoutCookie( this, request, options, )); } /** * Bookmark a Tweet * * @remarks * Adds a specific tweet to the bookmarks of the user associated with the provided cookie,$0.001 per call. */ async bookmark( request: operations.TweetsActionsBookmarkRequest, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsBookmark( this, request, options, )); } /** * Delete Bookmark * * @remarks * Delete a bookmark, $0.001 per call. */ async unbookmark( request: operations.TweetsActionsUnbookmarkRequest, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsUnbookmark( this, request, options, )); } /** * Delete One or More Tweets * * @remarks * Deletes one or more tweets from a specified user account. This endpoint supports two modes: * * 1. **Single Tweet Deletion**: Provide a `target_id` to delete a specific tweet. * 2. **Bulk Deletion**: Omit the `target_id` to delete **all** tweets from the user's account. * * **Warning**: The bulk deletion mode is irreversible and will permanently remove all tweets from the account. Use with extreme caution. */ async deleteBatch( request: models.DeleteTweetQuery, options?: RequestOptions, ): Promise { return unwrapAsync(tweetsActionsDeleteBatch( this, request, options, )); } }