5.3.0 (latest) 5.2.0 5.1.0 5.0.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.5.0 3.4.0 3.3.0 3.2.0

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

Reference documentation and code samples for the Google Cloud Datastore v1 API class CommitRequest.

The request for \[Datastore.Commit\]\[google.datastore.v1.Datastore.Commit\].

## Inheritance

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

## Implements

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

## Assembly

Google.Cloud.Datastore.V1.dll

## Constructors

### CommitRequest()

    public CommitRequest()

### CommitRequest(CommitRequest)

    public CommitRequest(CommitRequest other)

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

## Properties

### DatabaseId

    public string DatabaseId { get; set; }

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default
database.

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

### HasTransaction

    public bool HasTransaction { get; }

Gets whether the "transaction" field is set

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

### Mode

    public CommitRequest.Types.Mode Mode { get; set; }

The type of commit to perform. Defaults to `TRANSACTIONAL`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.CommitRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.CommitRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.CommitRequest.Types.Mode` |   |

### Mutations

    public RepeatedField<Mutation> Mutations { get; }

The mutations to perform.

When mode is `TRANSACTIONAL`, mutations affecting a single entity are
applied in order. The following sequences of mutations affecting a single
entity are not permitted in a single `Commit` request:

- `insert` followed by `insert`
- `update` followed by `insert`
- `upsert` followed by `insert`
- `delete` followed by `update`

When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single
entity.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Mutation` |   |

### ProjectId

    public string ProjectId { get; set; }

Required. The ID of the project against which to make the request.

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

### RequestOptions

    public RequestOptions RequestOptions { get; set; }

Optional. The options for this request.

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

### SingleUseTransaction

    public TransactionOptions SingleUseTransaction { get; set; }

Options for beginning a new transaction for this request.
The transaction is committed when the request completes. If specified,
\[TransactionOptions.mode\]\[google.datastore.v1.TransactionOptions\] must be
\[TransactionOptions.ReadWrite\]\[google.datastore.v1.TransactionOptions.ReadWrite\].

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

### Transaction

    public ByteString Transaction { get; set; }

The identifier of the transaction associated with the commit. A
transaction identifier is returned by a call to
\[Datastore.BeginTransaction\]\[google.datastore.v1.Datastore.BeginTransaction\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |

### TransactionSelectorCase

    public CommitRequest.TransactionSelectorOneofCase TransactionSelectorCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.CommitRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.CommitRequest.TransactionSelectorOneofCase` |   |