/**
 * X (Formerly Twitter) Node - Version 2
 * Discriminator: resource=tweet, operation=search
 */


interface Credentials {
  twitterOAuth2Api: CredentialReference;
}

/** Create, like, search, or delete a tweet */
export type TwitterV2TweetSearchParams = {
  resource: 'tweet';
  operation: 'search';
/**
 * A UTF-8, URL-encoded search query of 500 characters maximum, including operators. Queries may additionally be limited by complexity. Check the searching examples &lt;a href="https://developer.twitter.com/en/docs/tweets/search/guides/standard-operators"&gt;here&lt;/a&gt;.
 */
    searchText?: string | Expression<string> | PlaceholderValue;
/**
 * Whether to return all results or only up to a given limit
 * @default false
 */
    returnAll?: boolean | Expression<boolean>;
/**
 * Max number of results to return
 * @displayOptions.show { returnAll: [false] }
 * @default 50
 */
    limit?: number | Expression<number>;
/**
 * Options
 * @default {}
 */
    additionalFields?: {
    /** The order in which to return results
     * @default recency
     */
    sortOrder?: 'recency' | 'relevancy' | Expression<string>;
    /** Tweets before this date will not be returned. This date must be within the last 7 days if you don't have Academic Research access.
     */
    startTime?: string | Expression<string>;
    /** Tweets after this date will not be returned. This date must be within the last 7 days if you don't have Academic Research access.
     */
    endTime?: string | Expression<string>;
    /** The fields to add to each returned tweet object. Default fields are: ID, text, edit_history_tweet_ids.
     * @default []
     */
    tweetFieldsObject?: Array<'attachments' | 'author_id' | 'context_annotations' | 'conversation_id' | 'created_at' | 'edit_controls' | 'entities' | 'geo' | 'id' | 'in_reply_to_user_id' | 'lang' | 'non_public_metrics' | 'public_metrics' | 'organic_metrics' | 'promoted_metrics' | 'possibly_sensitive' | 'referenced_tweets' | 'reply_settings' | 'source' | 'text' | 'withheld'>;
  };
};

export type TwitterV2TweetSearchOutput = {
  edit_history_tweet_ids?: Array<string>;
  id?: string;
  text?: string;
};

export type TwitterV2TweetSearchNode = {
  type: 'n8n-nodes-base.twitter';
  version: 2;
  credentials?: Credentials;
  config: NodeConfig<TwitterV2TweetSearchParams>;
  output?: Items<TwitterV2TweetSearchOutput>;
};