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 Mutation : IMessage<Mutation>, IEquatable<Mutation>, IDeepCloneable<Mutation>, IBufferMessage, IMessage

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

A mutation to apply to an entity.

## Inheritance

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

## Implements

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

### Mutation()

    public Mutation()

### Mutation(Mutation)

    public Mutation(Mutation other)

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

## Properties

### BaseVersion

    public long BaseVersion { get; set; }

The version of the entity that this mutation is being applied
to. If this does not match the current version on the server, the
mutation conflicts.

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

### ConflictDetectionStrategyCase

    public Mutation.ConflictDetectionStrategyOneofCase ConflictDetectionStrategyCase { get; }

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

### ConflictResolutionStrategy

    public Mutation.Types.ConflictResolutionStrategy ConflictResolutionStrategy { get; set; }

The strategy to use when a conflict is detected. Defaults to
`SERVER_VALUE`.
If this is set, then `conflict_detection_strategy` must also be set.

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

### Delete

    public Key Delete { get; set; }

The key of the entity to delete. The entity may or may not already exist.
Must have a complete key path and must not be reserved/read-only.

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

### HasBaseVersion

    public bool HasBaseVersion { get; }

Gets whether the "base_version" field is set

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

### Insert

    public Entity Insert { get; set; }

The entity to insert. The entity must not already exist.
The entity key's final path element may be incomplete.

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

### OperationCase

    public Mutation.OperationOneofCase OperationCase { get; }

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

### PropertyMask

    public PropertyMask PropertyMask { get; set; }

The properties to write in this mutation.
None of the properties in the mask may have a reserved name, except for
`__key__`.
This field is ignored for `delete`.

If the entity already exists, only properties referenced in the mask are
updated, others are left untouched.
Properties referenced in the mask but not in the entity are deleted.

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

### PropertyTransforms

    public RepeatedField<PropertyTransform> PropertyTransforms { get; }

Optional. The transforms to perform on the entity.

This field can be set only when the operation is `insert`, `update`,
or `upsert`. If present, the transforms are be applied to the entity
regardless of the property mask, in order, after the operation.

| **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.PropertyTransform` |   |

### Update

    public Entity Update { get; set; }

The entity to update. The entity must already exist.
Must have a complete key path.

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

### UpdateTime

    public Timestamp UpdateTime { get; set; }

The update time of the entity that this mutation is being applied
to. If this does not match the current update time on the server, the
mutation conflicts.

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

### Upsert

    public Entity Upsert { get; set; }

The entity to upsert. The entity may or may not already exist.
The entity key's final path element may be incomplete.

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