/**
 * Elasticsearch Node - Version 1
 * Discriminator: resource=document, operation=create
 */


interface Credentials {
  elasticsearchApi: CredentialReference;
}

/** Create a document */
export type ElasticsearchV1DocumentCreateParams = {
  resource: 'document';
  operation: 'create';
/**
 * ID of the index to add the document to
 */
    indexId?: string | Expression<string> | PlaceholderValue;
/**
 * Whether to insert the input data this node receives in the new row
 * @default defineBelow
 */
    dataToSend?: 'defineBelow' | 'autoMapInputData' | Expression<string>;
/**
 * List of input properties to avoid sending, separated by commas. Leave empty to send all properties.
 * @displayOptions.show { dataToSend: ["autoMapInputData"] }
 */
    inputsToIgnore?: string | Expression<string> | PlaceholderValue;
/**
 * Fields to Send
 * @displayOptions.show { dataToSend: ["defineBelow"] }
 * @default {}
 */
    fieldsUi?: {
        /** Field
     */
    fieldValues?: Array<{
      /** Field Name
       */
      fieldId?: string | Expression<string> | PlaceholderValue;
      /** Field Value
       */
      fieldValue?: string | Expression<string> | PlaceholderValue;
    }>;
  };
/**
 * Additional Fields
 * @default {}
 */
    additionalFields?: {
    /** ID of the document to create and add to the index
     */
    documentId?: string | Expression<string> | PlaceholderValue;
    /** Target this primary shard
     */
    routing?: string | Expression<string> | PlaceholderValue;
    /** Period to wait for active shards. Defaults to &lt;code&gt;1m&lt;/code&gt; (one minute). See the &lt;a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#time-units"&gt;Elasticsearch time units reference&lt;/a&gt;
     * @default 1m
     */
    timeout?: string | Expression<string> | PlaceholderValue;
  };
/**
 * Options
 * @default {}
 */
    options?: {
    /** Whether to use the bulk operation to create the document/s
     * @default false
     */
    bulkOperation?: boolean | Expression<boolean>;
    /** ID of the pipeline to use to preprocess incoming documents
     */
    pipeline?: string | Expression<string> | PlaceholderValue;
    /** If true, Elasticsearch refreshes the affected shards to make this operation visible to search,if wait_for then wait for a refresh to make this operation visible to search,if false do nothing with refreshes
     * @default false
     */
    refresh?: 'true' | 'wait_for' | 'false' | Expression<string>;
  };
};

export type ElasticsearchV1DocumentCreateOutput = {
  _id?: string;
  _index?: string;
  _primary_term?: number;
  _seq_no?: number;
  _shards?: {
    failed?: number;
    successful?: number;
    total?: number;
  };
  _version?: number;
  result?: string;
};

export type ElasticsearchV1DocumentCreateNode = {
  type: 'n8n-nodes-base.elasticsearch';
  version: 1;
  credentials?: Credentials;
  config: NodeConfig<ElasticsearchV1DocumentCreateParams>;
  output?: Items<ElasticsearchV1DocumentCreateOutput>;
};