4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.0

    public sealed class CreateDocumentRequest : IMessage<CreateDocumentRequest>, IEquatable<CreateDocumentRequest>, IDeepCloneable<CreateDocumentRequest>, IBufferMessage, IMessage

Reference documentation and code samples for the Firestore v1 API class CreateDocumentRequest.

The request for
\[Firestore.CreateDocument\]\[google.firestore.v1.Firestore.CreateDocument\].

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> CreateDocumentRequest

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CreateDocumentRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CreateDocumentRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateDocumentRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CreateDocumentRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CreateDocumentRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CreateDocumentRequest), [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)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)

## Assembly

Google.Cloud.Firestore.V1.dll

## Constructors

### CreateDocumentRequest()

    public CreateDocumentRequest()

### CreateDocumentRequest(CreateDocumentRequest)

    public CreateDocumentRequest(CreateDocumentRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CreateDocumentRequest` |

## Properties

### CollectionId

    public string CollectionId { get; set; }

Required. The collection ID, relative to `parent`, to list. For example:
`chatrooms`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Document

    public Document Document { get; set; }

Required. The document to create. `name` must not be set.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Document` |   |

### DocumentId

    public string DocumentId { get; set; }

The client-assigned document ID to use for this document.

Optional. If not specified, an ID will be assigned by the service.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Mask

    public DocumentMask Mask { get; set; }

The fields to return. If not set, returns all fields.

If the document has a field that is not present in this mask, that field
will not be returned in the response.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.DocumentMask` |   |

### Parent

    public string Parent { get; set; }

Required. The parent resource. For example:
`projects/{project_id}/databases/{database_id}/documents` or
`projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### RequestOptions

    public RequestOptions RequestOptions { get; set; }

Optional. Any additional options for the request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RequestOptions` |   |