/**
 * Gmail Node - Version 2.2
 * Discriminator: resource=thread, operation=getAll
 */


interface Credentials {
  googleApi: CredentialReference;
  gmailOAuth2: CredentialReference;
}

export type GmailV22ThreadGetAllParams = {
  resource: 'thread';
  operation: 'getAll';
  authentication?: 'oAuth2' | 'serviceAccount' | Expression<string>;
/**
 * 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>;
/**
 * Filters
 * @default {}
 */
    filters?: {
    /** Whether to include threads from SPAM and TRASH in the results
     * @default false
     */
    includeSpamTrash?: boolean | Expression<boolean>;
    /** Only return threads with labels that match all of the specified label IDs. Choose from the list, or specify IDs using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
     * @default []
     */
    labelIds?: string[];
    /** Only return messages matching the specified query
     * @hint Use the same format as in the Gmail search box. &lt;a href="https://support.google.com/mail/answer/7190?hl=en"&gt;More info&lt;/a&gt;.
     */
    q?: string | Expression<string> | PlaceholderValue;
    /** Read Status
     * @hint Filter emails by whether they have been read or not
     * @default unread
     */
    readStatus?: 'both' | 'unread' | 'read' | Expression<string>;
    /** Get all emails received after the specified date. In an expression you can set date using string in ISO format or a timestamp in miliseconds.
     */
    receivedAfter?: string | Expression<string>;
    /** Get all emails received before the specified date. In an expression you can set date using string in ISO format or a timestamp in miliseconds.
     */
    receivedBefore?: string | Expression<string>;
  };
};

export type GmailV22ThreadGetAllOutput = {
  historyId?: string;
  id?: string;
  snippet?: string;
};

export type GmailV22ThreadGetAllNode = {
  type: 'n8n-nodes-base.gmail';
  version: 2.2;
  credentials?: Credentials;
  config: NodeConfig<GmailV22ThreadGetAllParams>;
  output?: Items<GmailV22ThreadGetAllOutput>;
};