# Google Maps FleetEngine Delivery V1 Client - Class VehicleJourneySegment (0.5.3)

0.5.3 (latest) 0.5.2 0.4.1 0.3.1 0.2.0 0.1.8 Reference documentation and code samples for the Google Maps FleetEngine Delivery V1 Client class VehicleJourneySegment.

Represents a Vehicle's travel segment - from its previous stop to the
current stop. If it is the first active stop, then it is from the
Vehicle's current location to this stop.

Generated from protobuf message `maps.fleetengine.delivery.v1.VehicleJourneySegment`

## Namespace

Google \\ Maps \\ FleetEngine \\ Delivery \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ stop` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.VehicleStop` Specifies the stop location, along with the `Task`s associated with the stop. Some fields of the VehicleStop might not be present if this journey segment is part of `JourneySharingInfo`. |
| `↳ driving_distance_meters` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` Output only. The travel distance from the previous stop to this stop. If the current stop is the first stop in the list of journey segments, then the starting point is the vehicle's location recorded at the time that this stop was added to the list. This field might not be present if this journey segment is part of `JourneySharingInfo`. |
| `↳ driving_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Output only. The travel time from the previous stop to this stop. If the current stop is the first stop in the list of journey segments, then the starting point is the Vehicle's location recorded at the time that this stop was added to the list. If this field is defined in the path `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST), then it may be populated with the value from `DeliveryVehicle.remaining_duration` (gRPC) or `DeliveryVehicle.remainingDuration` (REST). This provides the remaining driving duration from the driver app's latest known location rather than the driving time from the previous stop. |
| `↳ path` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.LatLng.html>` Output only. The path from the previous stop to this stop. If the current stop is the first stop in the list of journey segments, then this is the path from the vehicle's current location to this stop at the time that the stop was added to the list. This field might not be present if this journey segment is part of `JourneySharingInfo`. If this field is defined in the path `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path` (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path` (REST), then it may be populated with the `LatLng`s decoded from `DeliveryVehicle.current_route_segment` (gRPC) or `DeliveryVehicle.currentRouteSegment` (REST). This provides the driving path from the driver app's latest known location rather than the path from the previous stop. |

### getStop

Specifies the stop location, along with the `Task`s associated with
the stop. Some fields of the VehicleStop might not be present if this
journey segment is part of `JourneySharingInfo`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.VehicleStop|null` |   |

### hasStop

### clearStop

### setStop

Specifies the stop location, along with the `Task`s associated with
the stop. Some fields of the VehicleStop might not be present if this
journey segment is part of `JourneySharingInfo`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.VehicleStop` |

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

### getDrivingDistanceMeters

Output only. The travel distance from the previous stop to this stop.

If the current stop is the first stop in the list of journey
segments, then the starting point is the vehicle's location recorded
at the time that this stop was added to the list. This field might not be
present if this journey segment is part of `JourneySharingInfo`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value|null` |   |

### hasDrivingDistanceMeters

### clearDrivingDistanceMeters

### getDrivingDistanceMetersUnwrapped

Returns the unboxed value from `getDrivingDistanceMeters()`

Output only. The travel distance from the previous stop to this stop.
If the current stop is the first stop in the list of journey
segments, then the starting point is the vehicle's location recorded
at the time that this stop was added to the list. This field might not be
present if this journey segment is part of `JourneySharingInfo`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|null` |   |

### setDrivingDistanceMeters

Output only. The travel distance from the previous stop to this stop.

If the current stop is the first stop in the list of journey
segments, then the starting point is the vehicle's location recorded
at the time that this stop was added to the list. This field might not be
present if this journey segment is part of `JourneySharingInfo`.

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

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

### setDrivingDistanceMetersUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int32Value object.

Output only. The travel distance from the previous stop to this stop.
If the current stop is the first stop in the list of journey
segments, then the starting point is the vehicle's location recorded
at the time that this stop was added to the list. This field might not be
present if this journey segment is part of `JourneySharingInfo`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|null` |

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

### getDrivingDuration

Output only. The travel time from the previous stop to this stop.

If the current stop is the first stop in the list of journey
segments, then the starting point is the Vehicle's location recorded
at the time that this stop was added to the list.
If this field is defined in the path
`Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or
`Task.remainingVehicleJourneySegments[0].drivingDuration` (REST),
then it may be populated with the value from
`DeliveryVehicle.remaining_duration` (gRPC) or
`DeliveryVehicle.remainingDuration` (REST).
This provides the remaining driving duration from the driver app's latest
known location rather than the driving time from the previous stop.

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

### hasDrivingDuration

### clearDrivingDuration

### setDrivingDuration

Output only. The travel time from the previous stop to this stop.

If the current stop is the first stop in the list of journey
segments, then the starting point is the Vehicle's location recorded
at the time that this stop was added to the list.
If this field is defined in the path
`Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or
`Task.remainingVehicleJourneySegments[0].drivingDuration` (REST),
then it may be populated with the value from
`DeliveryVehicle.remaining_duration` (gRPC) or
`DeliveryVehicle.remainingDuration` (REST).
This provides the remaining driving duration from the driver app's latest
known location rather than the driving time from the previous stop.

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

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

### getPath

Output only. The path from the previous stop to this stop. If the current
stop is the first stop in the list of journey segments, then this is the
path from the vehicle's current location to this stop at the time that the
stop was added to the list. This field might not be present if this journey
segment is part of `JourneySharingInfo`.

If this field is defined in the path
`Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path`
(gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path`
(REST), then it may be populated with the `LatLng`s decoded from
`DeliveryVehicle.current_route_segment` (gRPC) or
`DeliveryVehicle.currentRouteSegment` (REST). This provides the driving
path from the driver app's latest known location rather than the path from
the previous stop.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.LatLng.html>` |   |

### setPath

Output only. The path from the previous stop to this stop. If the current
stop is the first stop in the list of journey segments, then this is the
path from the vehicle's current location to this stop at the time that the
stop was added to the list. This field might not be present if this journey
segment is part of `JourneySharingInfo`.

If this field is defined in the path
`Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path`
(gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path`
(REST), then it may be populated with the `LatLng`s decoded from
`DeliveryVehicle.current_route_segment` (gRPC) or
`DeliveryVehicle.currentRouteSegment` (REST). This provides the driving
path from the driver app's latest known location rather than the path from
the previous stop.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.LatLng.html>` |

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