public sealed class ImportDocumentsRequest : IMessage<ImportDocumentsRequest>, IEquatable<ImportDocumentsRequest>, IDeepCloneable<ImportDocumentsRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1 API class ImportDocumentsRequest.
Whether to automatically generate IDs for the documents if absent.
If set to true,
[Document.id][google.cloud.discoveryengine.v1.Document.id]s are
automatically generated based on the hash of the payload, where IDs may not
be consistent during multiple imports. In which case
[ReconciliationMode.FULL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL]
is highly recommended to avoid duplicate contents. If unset or set to
false, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have
to be specified using
[id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field],
otherwise, documents without IDs fail to be imported.
Supported data sources:
[GcsSource][google.cloud.discoveryengine.v1.GcsSource].
[GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
must be custom or csv. Otherwise, an INVALID_ARGUMENT error is thrown.
[BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource].
[BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
must be custom or csv. Otherwise, an INVALID_ARGUMENT error is thrown.
The field indicates the ID field or column to be used as unique IDs of
the documents.
For [GcsSource][google.cloud.discoveryengine.v1.GcsSource] it is the key of
the JSON field. For instance, my_id for JSON {"my_id": "some_uuid"}.
For others, it may be the column name of the table where the unique ids are
stored.
The values of the JSON field or the table column are used as the
[Document.id][google.cloud.discoveryengine.v1.Document.id]s. The JSON field
or the table column must be of string type, and the values must be set as
valid strings conform to RFC-1034
with 1-63 characters. Otherwise, documents without valid IDs fail to be
imported.
Only set this field when
[auto_generate_ids][google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids]
is unset or set as false. Otherwise, an INVALID_ARGUMENT error is thrown.
If it is unset, a default value _id is used when importing from the
allowed data sources.
Supported data sources:
[GcsSource][google.cloud.discoveryengine.v1.GcsSource].
[GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
must be custom or csv. Otherwise, an INVALID_ARGUMENT error is thrown.
[BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource].
[BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
must be custom or csv. Otherwise, an INVALID_ARGUMENT error is thrown.
Required. The parent branch resource name, such as
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}.
Requires create/update permission.
public ImportDocumentsRequest.Types.ReconciliationMode ReconciliationMode { get; set; }
The mode of reconciliation between existing documents and the documents to
be imported. Defaults to
[ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eImportDocumentsRequest\u003c/code\u003e class is used for importing documents into the Discovery Engine v1 API, offering methods for handling various data sources and managing document updates and IDs.\u003c/p\u003e\n"],["\u003cp\u003eIt supports multiple data sources like Cloud Storage, BigQuery, Cloud SQL, Firestore, Bigtable, AlloyDB, Spanner, and FHIR stores for document import, and also allows for inline content import.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes options for automatically generating document IDs or specifying a custom ID field, and can manage the reconciliation mode between existing and imported documents, providing flexibility for managing updates and duplicates.\u003c/p\u003e\n"],["\u003cp\u003eError handling during import is configurable through \u003ccode\u003eErrorConfig\u003c/code\u003e, allowing you to specify where errors should be logged, while the \u003ccode\u003eUpdateMask\u003c/code\u003e property can control which fields of the documents are updated.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eImportDocumentsRequest\u003c/code\u003e class includes a \u003ccode\u003eParent\u003c/code\u003e property, that allows you to specify the parent branch resource name, requiring appropriate permissions.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class ImportDocumentsRequest (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest) \n\n public sealed class ImportDocumentsRequest : IMessage\u003cImportDocumentsRequest\u003e, IEquatable\u003cImportDocumentsRequest\u003e, IDeepCloneable\u003cImportDocumentsRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1 API class ImportDocumentsRequest.\n\nRequest message for Import methods. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ImportDocumentsRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ImportDocumentsRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ImportDocumentsRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ImportDocumentsRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.dll\n\nConstructors\n------------\n\n### ImportDocumentsRequest()\n\n public ImportDocumentsRequest()\n\n### ImportDocumentsRequest(ImportDocumentsRequest)\n\n public ImportDocumentsRequest(ImportDocumentsRequest other)\n\nProperties\n----------\n\n### AlloyDbSource\n\n public AlloyDbSource AlloyDbSource { get; set; }\n\nAlloyDB input source.\n\n### AutoGenerateIds\n\n public bool AutoGenerateIds { get; set; }\n\nWhether to automatically generate IDs for the documents if absent.\n\nIf set to `true`,\n\\[Document.id\\]\\[google.cloud.discoveryengine.v1.Document.id\\]s are\nautomatically generated based on the hash of the payload, where IDs may not\nbe consistent during multiple imports. In which case\n\\[ReconciliationMode.FULL\\]\\[google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL\\]\nis highly recommended to avoid duplicate contents. If unset or set to\n`false`, \\[Document.id\\]\\[google.cloud.discoveryengine.v1.Document.id\\]s have\nto be specified using\n\\[id_field\\]\\[google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field\\],\notherwise, documents without IDs fail to be imported.\n\nSupported data sources:\n\n- \\[GcsSource\\]\\[google.cloud.discoveryengine.v1.GcsSource\\]. \\[GcsSource.data_schema\\]\\[google.cloud.discoveryengine.v1.GcsSource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[BigQuerySource\\]\\[google.cloud.discoveryengine.v1.BigQuerySource\\]. \\[BigQuerySource.data_schema\\]\\[google.cloud.discoveryengine.v1.BigQuerySource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[SpannerSource\\]\\[google.cloud.discoveryengine.v1.SpannerSource\\].\n- \\[CloudSqlSource\\]\\[google.cloud.discoveryengine.v1.CloudSqlSource\\].\n- \\[FirestoreSource\\]\\[google.cloud.discoveryengine.v1.FirestoreSource\\].\n- \\[BigtableSource\\]\\[google.cloud.discoveryengine.v1.BigtableSource\\].\n\n### BigquerySource\n\n public BigQuerySource BigquerySource { get; set; }\n\nBigQuery input source.\n\n### BigtableSource\n\n public BigtableSource BigtableSource { get; set; }\n\nCloud Bigtable input source.\n\n### CloudSqlSource\n\n public CloudSqlSource CloudSqlSource { get; set; }\n\nCloud SQL input source.\n\n### ErrorConfig\n\n public ImportErrorConfig ErrorConfig { get; set; }\n\nThe desired location of errors incurred during the Import.\n\n### FhirStoreSource\n\n public FhirStoreSource FhirStoreSource { get; set; }\n\nFhirStore input source.\n\n### FirestoreSource\n\n public FirestoreSource FirestoreSource { get; set; }\n\nFirestore input source.\n\n### ForceRefreshContent\n\n public bool ForceRefreshContent { get; set; }\n\nOptional. Whether to force refresh the unstructured content of the\ndocuments.\n\nIf set to `true`, the content part of the documents will be refreshed\nregardless of the update status of the referencing content.\n\n### GcsSource\n\n public GcsSource GcsSource { get; set; }\n\nCloud Storage location for the input content.\n\n### IdField\n\n public string IdField { get; set; }\n\nThe field indicates the ID field or column to be used as unique IDs of\nthe documents.\n\nFor \\[GcsSource\\]\\[google.cloud.discoveryengine.v1.GcsSource\\] it is the key of\nthe JSON field. For instance, `my_id` for JSON `{\"my_id\": \"some_uuid\"}`.\nFor others, it may be the column name of the table where the unique ids are\nstored.\n\nThe values of the JSON field or the table column are used as the\n\\[Document.id\\]\\[google.cloud.discoveryengine.v1.Document.id\\]s. The JSON field\nor the table column must be of string type, and the values must be set as\nvalid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)\nwith 1-63 characters. Otherwise, documents without valid IDs fail to be\nimported.\n\nOnly set this field when\n\\[auto_generate_ids\\]\\[google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids\\]\nis unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.\n\nIf it is unset, a default value `_id` is used when importing from the\nallowed data sources.\n\nSupported data sources:\n\n- \\[GcsSource\\]\\[google.cloud.discoveryengine.v1.GcsSource\\]. \\[GcsSource.data_schema\\]\\[google.cloud.discoveryengine.v1.GcsSource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[BigQuerySource\\]\\[google.cloud.discoveryengine.v1.BigQuerySource\\]. \\[BigQuerySource.data_schema\\]\\[google.cloud.discoveryengine.v1.BigQuerySource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[SpannerSource\\]\\[google.cloud.discoveryengine.v1.SpannerSource\\].\n- \\[CloudSqlSource\\]\\[google.cloud.discoveryengine.v1.CloudSqlSource\\].\n- \\[FirestoreSource\\]\\[google.cloud.discoveryengine.v1.FirestoreSource\\].\n- \\[BigtableSource\\]\\[google.cloud.discoveryengine.v1.BigtableSource\\].\n\n### InlineSource\n\n public ImportDocumentsRequest.Types.InlineSource InlineSource { get; set; }\n\nThe Inline source for the input content for documents.\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. The parent branch resource name, such as\n`projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.\nRequires create/update permission.\n\n### ParentAsBranchName\n\n public BranchName ParentAsBranchName { get; set; }\n\n[BranchName](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.BranchName)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.ImportDocumentsRequest#Google_Cloud_DiscoveryEngine_V1_ImportDocumentsRequest_Parent) resource name property.\n\n### ReconciliationMode\n\n public ImportDocumentsRequest.Types.ReconciliationMode ReconciliationMode { get; set; }\n\nThe mode of reconciliation between existing documents and the documents to\nbe imported. Defaults to\n\\[ReconciliationMode.INCREMENTAL\\]\\[google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL\\].\n\n### SourceCase\n\n public ImportDocumentsRequest.SourceOneofCase SourceCase { get; }\n\n### SpannerSource\n\n public SpannerSource SpannerSource { get; set; }\n\nSpanner input source.\n\n### UpdateMask\n\n public FieldMask UpdateMask { get; set; }\n\nIndicates which fields in the provided imported documents to update. If\nnot set, the default is to update all fields."]]