# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference (v0.16.0)

0.16.0 (latest) 0.15.0 0.14.1 0.13.0 0.12.0 0.11.1 0.10.0 0.9.2 0.8.2 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 0.2.1 0.1.1 Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::OptimizeToursValidationError::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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #index

    def index() -> ::Integer

**Returns**

- (::Integer) --- Index of the field if repeated.

  Note: The following fields are mutually exclusive: `index`, `key`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #index=

    def index=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Index of the field if repeated.


  Note: The following fields are mutually exclusive: `index`, `key`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::Integer) --- Index of the field if repeated.

  Note: The following fields are mutually exclusive: `index`, `key`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #key

    def key() -> ::String

**Returns**

- (::String) --- Key if the field is a map.

  Note: The following fields are mutually exclusive: `key`, `index`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #key=

    def key=(value) -> ::String

**Parameter**

- **value** (::String) --- Key if the field is a map.


  Note: The following fields are mutually exclusive: `key`, `index`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- Key if the field is a map.

  Note: The following fields are mutually exclusive: `key`, `index`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Name of the field, e.g., "vehicles".

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Name of the field, e.g., "vehicles".
**Returns**

- (::String) --- Name of the field, e.g., "vehicles".

### #sub_field

    def sub_field() -> ::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference

**Returns**

- ([::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursValidationError-FieldReference)) --- Recursively nested sub-field, if needed.

### #sub_field=

    def sub_field=(value) -> ::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference

**Parameter**

- **value** ([::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursValidationError-FieldReference)) --- Recursively nested sub-field, if needed.
**Returns**

- ([::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursValidationError-FieldReference)) --- Recursively nested sub-field, if needed.