/**
 * Splunk Node - Version 2
 * Discriminator: resource=search, operation=create
 */


interface Credentials {
  splunkApi: CredentialReference;
}

/** Create a search report from a search job */
export type SplunkV2SearchCreateParams = {
  resource: 'search';
  operation: 'create';
/**
 * Search language string to execute, in Splunk's &lt;a href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/WhatsInThisManual"&gt;Search Processing Language&lt;/a&gt;
 */
    search?: string | Expression<string> | PlaceholderValue;
/**
 * Additional Fields
 * @default {}
 */
    additionalFields?: {
    /** Ad Hoc Search Level
     * @default verbose
     */
    adhoc_search_level?: 'fast' | 'smart' | 'verbose' | Expression<string>;
    /** Seconds after which the search job automatically cancels
     * @default 0
     */
    auto_cancel?: number | Expression<number>;
    /** Auto-finalize the search after at least this many events are processed
     * @default 0
     */
    auto_finalize_ec?: number | Expression<number>;
    /** Seconds of inactivity after which the search job automatically pauses
     * @default 0
     */
    auto_pause?: number | Expression<number>;
    /** The earliest index time for the search (inclusive)
     */
    index_earliest?: string | Expression<string>;
    /** The earliest cut-off for the search (inclusive)
     */
    earliest_time?: string | Expression<string>;
    /** Exec Mode
     * @default blocking
     */
    exec_mode?: 'blocking' | 'normal' | 'oneshot' | Expression<string>;
    /** Seconds of disk sync delay for indexed real-time search
     * @default 0
     */
    indexedRealtimeOffset?: number | Expression<number>;
    /** The latest index time for the search (inclusive)
     */
    index_latest?: string | Expression<string>;
    /** The latest cut-off for the search (inclusive)
     */
    latest_time?: string | Expression<string>;
    /** Number of seconds to run this search before finalizing. Enter &lt;code&gt;0&lt;/code&gt; to never finalize.
     * @default 0
     */
    max_time?: number | Expression<number>;
    /** Application namespace in which to restrict searches
     */
    namespace?: string | Expression<string> | PlaceholderValue;
    /** How frequently to run the MapReduce reduce phase on accumulated map values
     * @default 0
     */
    reduce_freq?: number | Expression<number>;
    /** Comma-separated list of (possibly wildcarded) servers from which raw events should be pulled. This same server list is to be used in subsearches.
     */
    remote_server_list?: string | Expression<string> | PlaceholderValue;
    /** Number of seconds ago to check when an identical search is started and return the job’s search ID instead of starting a new job
     * @default 0
     */
    reuse_max_seconds_ago?: number | Expression<number>;
    /** Name of a required field to add to the search. Even if not referenced or used directly by the search, a required field is still included in events and summary endpoints.
     */
    rf?: string | Expression<string> | PlaceholderValue;
    /** Search Mode
     * @default normal
     */
    search_mode?: 'normal' | 'realtime' | Expression<string>;
    /** The most status buckets to generate. Set &lt;code&gt;0&lt;/code&gt; generate no timeline information.
     * @default 0
     */
    status_buckets?: number | Expression<number>;
    /** Number of seconds to keep this search after processing has stopped
     * @default 86400
     */
    timeout?: number | Expression<number>;
    /** New workload pool where the existing running search should be placed
     */
    workload_pool?: string | Expression<string> | PlaceholderValue;
  };
};

export type SplunkV2SearchCreateOutput = {
  acl?: {
    app?: string;
    can_write?: boolean;
    modifiable?: boolean;
    owner?: string;
    perms?: {
      read?: Array<string>;
      write?: Array<string>;
    };
    sharing?: string;
    ttl?: string;
  };
  author?: string;
  bundleVersion?: string;
  cursorTime?: string;
  defaultSaveTTL?: string;
  defaultTTL?: string;
  delegate?: string;
  diskUsage?: number;
  dispatchState?: string;
  doneProgress?: number;
  earliestTime?: string;
  entryUrl?: string;
  id?: string;
  isDone?: boolean;
  isEventsPreviewEnabled?: boolean;
  isFailed?: boolean;
  isFinalized?: boolean;
  isPaused?: boolean;
  isPreviewEnabled?: boolean;
  isSaved?: boolean;
  isSavedSearch?: boolean;
  isZombie?: boolean;
  label?: string;
  links?: {
    alternate?: string;
    control?: string;
    events?: string;
    results?: string;
    results_preview?: string;
    'search.log'?: string;
    summary?: string;
    timeline?: string;
  };
  messages?: Array<{
    help?: string;
    text?: string;
    type?: string;
  }>;
  name?: string;
  numPreviews?: number;
  performance?: {
    'startup.configuration'?: {
      duration_secs?: number;
      invocations?: number;
    };
    'startup.handoff'?: {
      duration_secs?: number;
      invocations?: number;
    };
  };
  pid?: string;
  priority?: number;
  provenance?: string;
  published?: string;
  request?: {
    search?: string;
  };
  resultPreviewCount?: number;
  runtime?: {
    auto_cancel?: string;
    auto_pause?: string;
  };
  sampleRatio?: string;
  sampleSeed?: string;
  search?: string;
  searchProviders?: Array<string>;
  sid?: string;
  statusBuckets?: number;
  ttl?: number;
  updated?: string;
};

export type SplunkV2SearchCreateNode = {
  type: 'n8n-nodes-base.splunk';
  version: 2;
  credentials?: Credentials;
  config: NodeConfig<SplunkV2SearchCreateParams>;
  output?: Items<SplunkV2SearchCreateOutput>;
};