# Interface CreateDocumentRequestOrBuilder (3.43.1)

3.43.1 (latest) 3.41.0 3.38.0 3.37.0 3.36.0 3.35.1 3.33.4 3.32.2 3.31.9 3.30.11 3.28.0 3.27.2 3.26.5 3.25.1 3.24.3 3.22.0 3.21.4 3.20.0 3.17.0 3.16.3 3.15.7 3.14.4 3.13.2 3.12.1 3.11.0 3.10.0 3.9.6 3.8.2 3.7.10 3.6.0 3.5.0 3.4.2 3.3.0 3.2.0 3.1.0 3.0.21

    public interface CreateDocumentRequestOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getCollectionId()

    public abstract String getCollectionId()

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

`string collection_id = 2 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The collectionId. |

### getCollectionIdBytes()

    public abstract ByteString getCollectionIdBytes()

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

`string collection_id = 2 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for collectionId. |

### getDocument()

    public abstract Document getDocument()

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

`.google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Document` | The document. |

### getDocumentId()

    public abstract String getDocumentId()

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

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

`string document_id = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The documentId. |

### getDocumentIdBytes()

    public abstract ByteString getDocumentIdBytes()

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

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

`string document_id = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for documentId. |

### getDocumentOrBuilder()

    public abstract DocumentOrBuilder getDocumentOrBuilder()

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

`.google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.DocumentOrBuilder` |   |

### getMask()

    public abstract DocumentMask getMask()

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.

`.google.firestore.v1.DocumentMask mask = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.DocumentMask` | The mask. |

### getMaskOrBuilder()

    public abstract DocumentMaskOrBuilder getMaskOrBuilder()

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.

`.google.firestore.v1.DocumentMask mask = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.DocumentMaskOrBuilder` |   |

### getParent()

    public abstract String getParent()

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

`string parent = 1 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The parent. |

### getParentBytes()

    public abstract ByteString getParentBytes()

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

`string parent = 1 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for parent. |

### hasDocument()

    public abstract boolean hasDocument()

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

`.google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the document field is set. |

### hasMask()

    public abstract boolean hasMask()

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.

`.google.firestore.v1.DocumentMask mask = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the mask field is set. |