/**
 * Pipedrive Node - Version 1
 * Discriminator: resource=organization, operation=search
 */


interface Credentials {
  pipedriveApi: CredentialReference;
  pipedriveOAuth2Api: CredentialReference;
}

/** Search a deal */
export type PipedriveV1OrganizationSearchParams = {
  resource: 'organization';
  operation: 'search';
  authentication?: 'apiToken' | '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>;
/**
 * The search term to look for. Minimum 2 characters (or 1 if using exact_match).
 */
    term?: string | Expression<string> | PlaceholderValue;
/**
 * Additional Fields
 * @default {}
 */
    additionalFields?: {
    /** Whether only full exact matches against the given term are returned. It is not case sensitive.
     * @default false
     */
    exactMatch?: boolean | Expression<boolean>;
    /** Fields to the search in. Defaults to all of them.
     * @default []
     */
    fields?: Array<'address' | 'custom_fields' | 'name' | 'notes'>;
    /** Whether to return the data exactly in the way it got received from the API
     * @default false
     */
    rawData?: boolean | Expression<boolean>;
  };
};

export type PipedriveV1OrganizationSearchOutput = {
  custom_fields?: Array<string>;
  id?: number;
  name?: string;
  notes?: Array<string>;
  owner?: {
    id?: number;
  };
  result_score?: number;
  type?: string;
  visible_to?: number;
};

export type PipedriveV1OrganizationSearchNode = {
  type: 'n8n-nodes-base.pipedrive';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<PipedriveV1OrganizationSearchParams>;
  output?: Items<PipedriveV1OrganizationSearchOutput>;
};