# Cloud Optimization v1 API - Class OptimizeToursValidationError.Types.FieldReference (2.7.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.7.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.6.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.5.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.4.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.3.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.2.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.1.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.0.0/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)
- [1.0.0-beta01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/1.0.0-beta01/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference)

    public sealed class OptimizeToursValidationError.Types.FieldReference : IMessage<OptimizeToursValidationError.Types.FieldReference>, IEquatable<OptimizeToursValidationError.Types.FieldReference>, IDeepCloneable<OptimizeToursValidationError.Types.FieldReference>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Optimization v1 API class OptimizeToursValidationError.Types.FieldReference.

Specifies a context for the validation error. A `FieldReference` always
refers to a given field in this file and follows the same hierarchical
structure. For example, we may specify element #2 of `start_time_windows`
of vehicle #5 using:

    name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 }

We however omit top-level entities such as `OptimizeToursRequest` or
`ShipmentModel` to avoid crowding the message.

## Inheritance

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

## Implements

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

## Assembly

Google.Cloud.Optimization.V1.dll

## Constructors

### FieldReference()

    public FieldReference()

### FieldReference(FieldReference)

    public FieldReference(OptimizeToursValidationError.Types.FieldReference other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationErrorhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference` |

## Properties

### HasIndex

    public bool HasIndex { get; }

Gets whether the "index" field is set

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

### HasKey

    public bool HasKey { get; }

Gets whether the "key" field is set

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

### Index

    public int Index { get; set; }

Index of the field if repeated.

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

### IndexOrKeyCase

    public OptimizeToursValidationError.Types.FieldReference.IndexOrKeyOneofCase IndexOrKeyCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationErrorhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReferencehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference.IndexOrKeyOneofCase` |   |

### Key

    public string Key { get; set; }

Key if the field is a map.

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

### Name

    public string Name { get; set; }

Name of the field, e.g., "vehicles".

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

### SubField

    public OptimizeToursValidationError.Types.FieldReference SubField { get; set; }

Recursively nested sub-field, if needed.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationErrorhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.OptimizeToursValidationError.Types.FieldReference` |   |