# Class FieldReference (1.15.0)

1.15.0 (latest) 1.14.0 1.13.0 1.12.0 1.11.2 1.10.0 1.9.1 1.8.5 1.7.0 1.6.0 1.5.0 1.4.3 1.3.2 1.2.0 1.1.3 1.0.1 0.1.1

    FieldReference(mapping=None, *, ignore_unknown_fields=False, **kwargs)

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.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: <https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields>

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `name` | `str` Name of the field, e.g., "vehicles". |
| `index` | `int` Index of the field if repeated. This field is a member of `oneof`_ `index_or_key`. |
| `key` | `str` Key if the field is a map. This field is a member of `oneof`_ `index_or_key`. |
| `sub_field` | `google.cloud.optimization_v1.types.OptimizeToursValidationError.FieldReference` Recursively nested sub-field, if needed. |