/**
 * HubSpot Node - Version 2.1
 * Discriminator: resource=contact, operation=getAll
 */


interface Credentials {
  hubspotApi: CredentialReference;
  hubspotAppToken: CredentialReference;
  hubspotOAuth2Api: CredentialReference;
}

/** Get many contacts */
export type HubspotV21ContactGetAllParams = {
  resource: 'contact';
  operation: 'getAll';
  authentication?: 'apiKey' | 'appToken' | 'oAuth2' | 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 100
 */
    limit?: number | Expression<number>;
/**
 * Options
 * @default {}
 */
    additionalFields?: {
    /** Specify which form submissions should be fetched
     * @default all
     */
    formSubmissionMode?: 'all' | 'none' | 'newest' | 'oldest' | Expression<string>;
    /** Whether current list memberships should be fetched for the contact
     * @default true
     */
    listMemberships?: boolean | Expression<boolean>;
    /** &lt;p&gt;Used to include specific contact properties in the results. By default, the results will only include Contact ID and will not include the values for any properties for your Contact.&lt;/p&gt;&lt;p&gt;Including this parameter will include the data for the specified property in the results. You can include this parameter multiple times to request multiple properties separated by a comma: &lt;code&gt;,&lt;/code&gt;.&lt;/p&gt;. Choose from the list, or specify IDs using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
     * @default {}
     */
    propertiesCollection?: {
        /** Contact Properties to Include
     */
    propertiesValues?: {
      /** Whether to include specific Contact properties in the returned results. Choose from a list, or specify IDs using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;. Choose from the list, or specify IDs using an &lt;a href="https://docs.n8n.io/code/expressions/"&gt;expression&lt;/a&gt;.
       * @default []
       */
      properties?: string[];
      /** Specify if the current value for a property should be fetched, or the value and all the historical values for that property
       * @default valueAndHistory
       */
      propertyMode?: 'valueAndHistory' | 'valueOnly' | Expression<string>;
    };
  };
  };
};

export type HubspotV21ContactGetAllOutput = {
  addedAt?: number;
  'canonical-vid'?: number;
  'form-submissions'?: Array<{
    'contact-associated-by'?: Array<string>;
    'conversion-id'?: string;
    'form-id'?: string;
    'form-type'?: string;
    'page-title'?: string;
    'page-url'?: string;
    'portal-id'?: number;
    timestamp?: number;
    title?: string;
  }>;
  'identity-profiles'?: Array<{
    'deleted-changed-timestamp'?: number;
    identities?: Array<{
      'is-primary'?: boolean;
      timestamp?: number;
      type?: string;
      value?: string;
    }>;
    'saved-at-timestamp'?: number;
    vid?: number;
  }>;
  'is-contact'?: boolean;
  'merge-audits'?: Array<{
    'canonical-vid'?: number;
    'entity-id'?: string;
    'first-name'?: string;
    'is-reverted'?: boolean;
    'last-name'?: string;
    merged_from_email?: {
      'data-sensitivity'?: null;
      'is-encrypted'?: null;
      selected?: boolean;
      'source-id'?: string;
      'source-label'?: null;
      'source-type'?: string;
      timestamp?: number;
      value?: string;
    };
    merged_to_email?: {
      'data-sensitivity'?: null;
      'is-encrypted'?: null;
      selected?: boolean;
      'source-id'?: string;
      'source-label'?: null;
      'source-type'?: string;
      timestamp?: number;
      'updated-by-user-id'?: null;
      value?: string;
    };
    'num-properties-moved'?: number;
    'primary-vid-to-merge'?: number;
    timestamp?: number;
    'user-id'?: number;
    'vid-to-merge'?: number;
  }>;
  'merged-vids'?: Array<number>;
  'portal-id'?: number;
  properties?: {
    firstname?: {
      value?: string;
    };
    lastmodifieddate?: {
      value?: string;
    };
    lastname?: {
      value?: string;
    };
  };
  vid?: number;
};

export type HubspotV21ContactGetAllNode = {
  type: 'n8n-nodes-base.hubspot';
  version: 2.1;
  credentials?: Credentials;
  config: NodeConfig<HubspotV21ContactGetAllParams>;
  output?: Items<HubspotV21ContactGetAllOutput>;
};