# Google Maps Route Optimization V1 Client - Class Transition (0.6.2)

0.6.2 (latest) 0.6.1 0.5.1 0.4.1 0.3.3 0.2.0 0.1.0 Reference documentation and code samples for the Google Maps Route Optimization V1 Client class Transition.

Transition between two events on the route. See the description of
[ShipmentRoute](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute).

If the vehicle does not have a `start_location` and/or `end_location`, the
corresponding travel metrics are 0.

Generated from protobuf message `google.maps.routeoptimization.v1.ShipmentRoute.Transition`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1 \\ ShipmentRoute

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ travel_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Travel duration during this transition. |
| `↳ travel_distance_meters` | `float` Distance traveled during the transition. |
| `↳ traffic_info_unavailable` | `bool` When traffic is requested via \[OptimizeToursRequest.consider_road_traffic\] \[google.maps.routeoptimization.v1.OptimizeToursRequest.consider_road_traffic\], and the traffic info couldn't be retrieved for a `Transition`, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location). |
| `↳ delay_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Sum of the delay durations applied to this transition. If any, the delay starts exactly `delay_duration` seconds before the next event (visit or vehicle end). See [TransitionAttributes.delay](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.TransitionAttributes#_Google_Maps_RouteOptimization_V1_TransitionAttributes__getDelay__). |
| `↳ break_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Sum of the duration of the breaks occurring during this transition, if any. Details about each break's start time and duration are stored in [ShipmentRoute.breaks](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute#_Google_Maps_RouteOptimization_V1_ShipmentRoute__getBreaks__). |
| `↳ wait_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Time spent waiting during this transition. Wait duration corresponds to idle time and does not include break time. Also note that this wait time may be split into several non-contiguous intervals. |
| `↳ total_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Total duration of the transition, provided for convenience. It is equal to: \* \* next visit `start_time` (or `vehicle_end_time` if this is the last transition) - this transition's `start_time`; \* \* if `ShipmentRoute.has_traffic_infeasibilities` is false, the following additionally holds: `total_duration = travel_duration + delay_duration + break_duration + wait_duration`. |
| `↳ start_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Start time of this transition. |
| `↳ route_polyline` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute.EncodedPolyline` The encoded polyline representation of the route followed during the transition. This field is only populated if \[populate_transition_polylines\] \[google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines\] is set to true. |
| `↳ route_token` | `string` Output only. An opaque token that can be passed to [Navigation SDK](https://developers.google.com/maps/documentation/navigation) to reconstruct the route during navigation, and, in the event of rerouting, honor the original intention when the route was created. Treat this token as an opaque blob. Don't compare its value across requests as its value may change even if the service returns the exact same route. This field is only populated if \[populate_transition_polylines\] \[google.maps.routeoptimization.v1.OptimizeToursRequest.populate_transition_polylines\] is set to true. |
| `↳ vehicle_loads` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Vehicle loads during this transition, for each type that either appears in this vehicle's [Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__), or that have non-zero [Shipment.load_demands](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment#_Google_Maps_RouteOptimization_V1_Shipment__getLoadDemands__) on some shipment performed on this route. The loads during the first transition are the starting loads of the vehicle route. Then, after each visit, the visit's `load_demands` are either added or subtracted to get the next transition's loads, depending on whether the visit was a pickup or a delivery. |

### getTravelDuration

Travel duration during this transition.

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

### hasTravelDuration

### clearTravelDuration

### setTravelDuration

Travel duration during this transition.

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

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

### getTravelDistanceMeters

Distance traveled during the transition.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setTravelDistanceMeters

Distance traveled during the transition.

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

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

### getTrafficInfoUnavailable

When traffic is requested via
[OptimizeToursRequest.consider_road_traffic](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.OptimizeToursRequest#_Google_Maps_RouteOptimization_V1_OptimizeToursRequest__getConsiderRoadTraffic__),
and the traffic info couldn't be retrieved for a `Transition`, this
boolean is set to true. This may be temporary (rare hiccup in the
realtime traffic servers) or permanent (no data for this location).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setTrafficInfoUnavailable

When traffic is requested via
[OptimizeToursRequest.consider_road_traffic](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.OptimizeToursRequest#_Google_Maps_RouteOptimization_V1_OptimizeToursRequest__getConsiderRoadTraffic__),
and the traffic info couldn't be retrieved for a `Transition`, this
boolean is set to true. This may be temporary (rare hiccup in the
realtime traffic servers) or permanent (no data for this location).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

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

### getDelayDuration

Sum of the delay durations applied to this transition. If any, the delay
starts exactly `delay_duration` seconds before the next event (visit or
vehicle end). See
[TransitionAttributes.delay](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.TransitionAttributes#_Google_Maps_RouteOptimization_V1_TransitionAttributes__getDelay__).

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

### hasDelayDuration

### clearDelayDuration

### setDelayDuration

Sum of the delay durations applied to this transition. If any, the delay
starts exactly `delay_duration` seconds before the next event (visit or
vehicle end). See
[TransitionAttributes.delay](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.TransitionAttributes#_Google_Maps_RouteOptimization_V1_TransitionAttributes__getDelay__).

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

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

### getBreakDuration

Sum of the duration of the breaks occurring during this transition, if
any. Details about each break's start time and duration are stored in
[ShipmentRoute.breaks](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute#_Google_Maps_RouteOptimization_V1_ShipmentRoute__getBreaks__).

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

### hasBreakDuration

### clearBreakDuration

### setBreakDuration

Sum of the duration of the breaks occurring during this transition, if
any. Details about each break's start time and duration are stored in
[ShipmentRoute.breaks](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute#_Google_Maps_RouteOptimization_V1_ShipmentRoute__getBreaks__).

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

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

### getWaitDuration

Time spent waiting during this transition. Wait duration corresponds to
idle time and does not include break time. Also note that this wait time
may be split into several non-contiguous intervals.

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

### hasWaitDuration

### clearWaitDuration

### setWaitDuration

Time spent waiting during this transition. Wait duration corresponds to
idle time and does not include break time. Also note that this wait time
may be split into several non-contiguous intervals.

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

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

### getTotalDuration

Total duration of the transition, provided for convenience. It is equal
to:

- next visit `start_time` (or `vehicle_end_time` if this is the last transition) - this transition's `start_time`;
- if `ShipmentRoute.has_traffic_infeasibilities` is false, the following additionally holds: \`total_duration = travel_duration + delay_duration
- break_duration + wait_duration\`.

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

### hasTotalDuration

### clearTotalDuration

### setTotalDuration

Total duration of the transition, provided for convenience. It is equal
to:

- next visit `start_time` (or `vehicle_end_time` if this is the last transition) - this transition's `start_time`;
- if `ShipmentRoute.has_traffic_infeasibilities` is false, the following additionally holds: \`total_duration = travel_duration + delay_duration
- break_duration + wait_duration\`.

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

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

### getStartTime

Start time of this transition.

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

### hasStartTime

### clearStartTime

### setStartTime

Start time of this transition.

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

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

### getRoutePolyline

The encoded polyline representation of the route followed during the
transition.

This field is only populated if [populate_transition_polylines](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.OptimizeToursRequest#_Google_Maps_RouteOptimization_V1_OptimizeToursRequest__getPopulateTransitionPolylines__)
is set to true.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute.EncodedPolyline|null` |   |

### hasRoutePolyline

### clearRoutePolyline

### setRoutePolyline

The encoded polyline representation of the route followed during the
transition.

This field is only populated if [populate_transition_polylines](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.OptimizeToursRequest#_Google_Maps_RouteOptimization_V1_OptimizeToursRequest__getPopulateTransitionPolylines__)
is set to true.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentRoute.EncodedPolyline` |

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

### getRouteToken

Output only. An opaque token that can be passed to [Navigation
SDK](https://developers.google.com/maps/documentation/navigation) to
reconstruct the route during navigation, and, in the event of rerouting,
honor the original intention when the route was created. Treat this token
as an opaque blob. Don't compare its value across requests as its value
may change even if the service returns the exact same route. This field
is only populated if [populate_transition_polylines](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.OptimizeToursRequest#_Google_Maps_RouteOptimization_V1_OptimizeToursRequest__getPopulateTransitionPolylines__)
is set to true.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRouteToken

Output only. An opaque token that can be passed to [Navigation
SDK](https://developers.google.com/maps/documentation/navigation) to
reconstruct the route during navigation, and, in the event of rerouting,
honor the original intention when the route was created. Treat this token
as an opaque blob. Don't compare its value across requests as its value
may change even if the service returns the exact same route. This field
is only populated if [populate_transition_polylines](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.OptimizeToursRequest#_Google_Maps_RouteOptimization_V1_OptimizeToursRequest__getPopulateTransitionPolylines__)
is set to true.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getVehicleLoads

Vehicle loads during this transition, for each type that either appears
in this vehicle's
[Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__),
or that have non-zero
[Shipment.load_demands](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment#_Google_Maps_RouteOptimization_V1_Shipment__getLoadDemands__)
on some shipment performed on this route.

The loads during the first transition are the starting loads of the
vehicle route. Then, after each visit, the visit's `load_demands` are
either added or subtracted to get the next transition's loads, depending
on whether the visit was a pickup or a delivery.

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

### setVehicleLoads

Vehicle loads during this transition, for each type that either appears
in this vehicle's
[Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__),
or that have non-zero
[Shipment.load_demands](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment#_Google_Maps_RouteOptimization_V1_Shipment__getLoadDemands__)
on some shipment performed on this route.

The loads during the first transition are the starting loads of the
vehicle route. Then, after each visit, the visit's `load_demands` are
either added or subtracted to get the next transition's loads, depending
on whether the visit was a pickup or a delivery.

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

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