# Google Maps Route Optimization V1 Client - Class ShipmentTypeRequirement (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 ShipmentTypeRequirement.

Specifies requirements between shipments based on their shipment_type.

The specifics of the requirement are defined by the requirement mode.

Generated from protobuf message `google.maps.routeoptimization.v1.ShipmentTypeRequirement`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ required_shipment_type_alternatives` | `string[]` List of alternative shipment types required by the `dependent_shipment_types`. |
| `↳ dependent_shipment_types` | `string[]` All shipments with a type in the `dependent_shipment_types` field require at least one shipment of type `required_shipment_type_alternatives` to be visited on the same route. NOTE: Chains of requirements such that a `shipment_type` depends on itself are not allowed. |
| `↳ requirement_mode` | `int` Mode applied to the requirement. |

### getRequiredShipmentTypeAlternatives

List of alternative shipment types required by the
`dependent_shipment_types`.

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

### setRequiredShipmentTypeAlternatives

List of alternative shipment types required by the
`dependent_shipment_types`.

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

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

### getDependentShipmentTypes

All shipments with a type in the `dependent_shipment_types` field require
at least one shipment of type `required_shipment_type_alternatives` to be
visited on the same route.

NOTE: Chains of requirements such that a `shipment_type` depends on itself
are not allowed.

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

### setDependentShipmentTypes

All shipments with a type in the `dependent_shipment_types` field require
at least one shipment of type `required_shipment_type_alternatives` to be
visited on the same route.

NOTE: Chains of requirements such that a `shipment_type` depends on itself
are not allowed.

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

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

### getRequirementMode

Mode applied to the requirement.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [RequirementMode](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentTypeRequirement.RequirementMode). |

### setRequirementMode

Mode applied to the requirement.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [RequirementMode](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentTypeRequirement.RequirementMode). |

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