public sealed class ImportDocumentsRequest : IMessage<ImportDocumentsRequest>, IEquatable<ImportDocumentsRequest>, IDeepCloneable<ImportDocumentsRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1beta API class ImportDocumentsRequest.
Whether to automatically generate IDs for the documents if absent.
If set to true,
[Document.id][google.cloud.discoveryengine.v1beta.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.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
is highly recommended to avoid duplicate contents. If unset or set to
false, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
have to be specified using
[id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
otherwise, documents without IDs fail to be imported.
Supported data sources:
[GcsSource][google.cloud.discoveryengine.v1beta.GcsSource].
[GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
must be custom or csv. Otherwise, an INVALID_ARGUMENT error is thrown.
[BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource].
[BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.GcsSource].
[GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
must be custom or csv. Otherwise, an INVALID_ARGUMENT error is thrown.
[BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource].
[BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.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.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eImportDocumentsRequest\u003c/code\u003e class is used for importing documents into the Discovery Engine v1beta API, supporting various data sources like GcsSource, BigQuerySource, and more.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides functionality to specify the source of the documents, such as AlloyDB, BigQuery, Bigtable, Cloud SQL, FhirStore, Firestore, GCS, Spanner, or an inline source, as well as to set various configurations.\u003c/p\u003e\n"],["\u003cp\u003eUsers can choose whether to automatically generate IDs for documents using the \u003ccode\u003eAutoGenerateIds\u003c/code\u003e property, or specify the field to be used as the unique ID field via the \u003ccode\u003eIdField\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReconciliationMode\u003c/code\u003e property determines how imported documents reconcile with existing ones, and defaults to incremental.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUpdateMask\u003c/code\u003e property allows for the specification of which fields in the imported documents to update, otherwise it will default to updating all fields.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1beta API - Class ImportDocumentsRequest (1.0.0-beta19)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta19 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportDocumentsRequest)\n- [1.0.0-beta18](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/1.0.0-beta18/Google.Cloud.DiscoveryEngine.V1Beta.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 v1beta 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.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportDocumentsRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ImportDocumentsRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportDocumentsRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ImportDocumentsRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.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.V1Beta](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1Beta.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.v1beta.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.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL\\]\nis highly recommended to avoid duplicate contents. If unset or set to\n`false`, \\[Document.id\\]\\[google.cloud.discoveryengine.v1beta.Document.id\\]s\nhave to be specified using\n\\[id_field\\]\\[google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field\\],\notherwise, documents without IDs fail to be imported.\n\nSupported data sources:\n\n- \\[GcsSource\\]\\[google.cloud.discoveryengine.v1beta.GcsSource\\]. \\[GcsSource.data_schema\\]\\[google.cloud.discoveryengine.v1beta.GcsSource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[BigQuerySource\\]\\[google.cloud.discoveryengine.v1beta.BigQuerySource\\]. \\[BigQuerySource.data_schema\\]\\[google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[SpannerSource\\]\\[google.cloud.discoveryengine.v1beta.SpannerSource\\].\n- \\[CloudSqlSource\\]\\[google.cloud.discoveryengine.v1beta.CloudSqlSource\\].\n- \\[FirestoreSource\\]\\[google.cloud.discoveryengine.v1beta.FirestoreSource\\].\n- \\[BigtableSource\\]\\[google.cloud.discoveryengine.v1beta.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### 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.v1beta.GcsSource\\] it is the\nkey of the JSON field. For instance, `my_id` for JSON `{\"my_id\":\n\"some_uuid\"}`. For others, it may be the column name of the table where the\nunique ids are stored.\n\nThe values of the JSON field or the table column are used as the\n\\[Document.id\\]\\[google.cloud.discoveryengine.v1beta.Document.id\\]s. The JSON\nfield or the table column must be of string type, and the values must be\nset as valid strings conform to\n[RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.\nOtherwise, documents without valid IDs fail to be imported.\n\nOnly set this field when\n\\[auto_generate_ids\\]\\[google.cloud.discoveryengine.v1beta.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.v1beta.GcsSource\\]. \\[GcsSource.data_schema\\]\\[google.cloud.discoveryengine.v1beta.GcsSource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[BigQuerySource\\]\\[google.cloud.discoveryengine.v1beta.BigQuerySource\\]. \\[BigQuerySource.data_schema\\]\\[google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema\\] must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.\n- \\[SpannerSource\\]\\[google.cloud.discoveryengine.v1beta.SpannerSource\\].\n- \\[CloudSqlSource\\]\\[google.cloud.discoveryengine.v1beta.CloudSqlSource\\].\n- \\[FirestoreSource\\]\\[google.cloud.discoveryengine.v1beta.FirestoreSource\\].\n- \\[BigtableSource\\]\\[google.cloud.discoveryengine.v1beta.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.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.BranchName)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.ImportDocumentsRequest#Google_Cloud_DiscoveryEngine_V1Beta_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.v1beta.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."]]