# Cloud Firestore V1 API - Class Google::Cloud::Firestore::V1::CreateDocumentRequest (v2.4.0)

2.4.0 (latest) 2.3.0 2.2.1 2.1.1 2.0.1 1.3.0 1.2.0 1.1.1 1.0.0 0.14.0 0.13.0 0.12.0 0.11.1 0.10.0 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.8 Reference documentation and code samples for the Cloud Firestore V1 API class Google::Cloud::Firestore::V1::CreateDocumentRequest.

The request for
[Firestore.CreateDocument](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client#Google__Cloud__Firestore__V1__Firestore__Client_create_document_instance_ "Google::Cloud::Firestore::V1::Firestore::Client#create_document (method)").

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #collection_id

    def collection_id() -> ::String

**Returns**

- (::String) --- Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.

### #collection_id=

    def collection_id=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.
**Returns**

- (::String) --- Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.

### #document

    def document() -> ::Google::Cloud::Firestore::V1::Document

**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)) --- Required. The document to create. `name` must not be set.

### #document=

    def document=(value) -> ::Google::Cloud::Firestore::V1::Document

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)) --- Required. The document to create. `name` must not be set.
**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)) --- Required. The document to create. `name` must not be set.

### #document_id

    def document_id() -> ::String

**Returns**

- (::String) --- The client-assigned document ID to use for this document.

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

### #document_id=

    def document_id=(value) -> ::String

**Parameter**

- **value** (::String) --- The client-assigned document ID to use for this document.


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

- (::String) --- The client-assigned document ID to use for this document.

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

### #mask

    def mask() -> ::Google::Cloud::Firestore::V1::DocumentMask

**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- 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.

### #mask=

    def mask=(value) -> ::Google::Cloud::Firestore::V1::DocumentMask

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- 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.
**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- 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.

### #parent

    def parent() -> ::String

**Returns**

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

### #parent=

    def parent=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
**Returns**

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