# Google Cloud Optimization V1 Client - Class Row (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.7.0 0.6.5 0.5.1 0.4.0 0.3.4 0.2.0 0.1.9 Reference documentation and code samples for the Google Cloud Optimization V1 Client class Row.

Specifies a row of the duration and distance matrix.

Generated from protobuf message `google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix.Row`

## Namespace

Google \\ Cloud \\ Optimization \\ V1 \\ ShipmentModel \\ DurationDistanceMatrix

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ durations` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration>` Duration values for a given row. It must have as many elements as [ShipmentModel.duration_distance_matrix_dst_tags](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentModel#_Google_Cloud_Optimization_V1_ShipmentModel__getDurationDistanceMatrixDstTags__). |
| `↳ meters` | `float[]` Distance values for a given row. If no costs or constraints refer to distances in the model, this can be left empty; otherwise it must have as many elements as `durations`. |

### getDurations

Duration values for a given row. It must have as many elements as
[ShipmentModel.duration_distance_matrix_dst_tags](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentModel#_Google_Cloud_Optimization_V1_ShipmentModel__getDurationDistanceMatrixDstTags__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration>` |   |

### setDurations

Duration values for a given row. It must have as many elements as
[ShipmentModel.duration_distance_matrix_dst_tags](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentModel#_Google_Cloud_Optimization_V1_ShipmentModel__getDurationDistanceMatrixDstTags__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMeters

Distance values for a given row. If no costs or constraints refer to
distances in the model, this can be left empty; otherwise it must have
as many elements as `durations`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<float>` |   |

### setMeters

Distance values for a given row. If no costs or constraints refer to
distances in the model, this can be left empty; otherwise it must have
as many elements as `durations`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |