# Cloud Optimization v1 API - Class InjectedSolutionConstraint.Types.ConstraintRelaxation (2.7.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.7.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.6.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.5.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.4.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.3.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.2.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.1.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.0.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)
- [1.0.0-beta01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/1.0.0-beta01/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation)

    public sealed class InjectedSolutionConstraint.Types.ConstraintRelaxation : IMessage<InjectedSolutionConstraint.Types.ConstraintRelaxation>, IEquatable<InjectedSolutionConstraint.Types.ConstraintRelaxation>, IDeepCloneable<InjectedSolutionConstraint.Types.ConstraintRelaxation>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Optimization v1 API class InjectedSolutionConstraint.Types.ConstraintRelaxation.

For a group of vehicles, specifies at what threshold(s) constraints on
visits will be relaxed and to which level. Shipments listed in
the `skipped_shipment` field are constrained to be skipped; i.e., they
cannot be performed.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> InjectedSolutionConstraint.Types.ConstraintRelaxation

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[InjectedSolutionConstraint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types)[ConstraintRelaxation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[InjectedSolutionConstraint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types)[ConstraintRelaxation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[InjectedSolutionConstraint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types)[ConstraintRelaxation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Optimization.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1)

## Assembly

Google.Cloud.Optimization.V1.dll

## Constructors

### ConstraintRelaxation()

    public ConstraintRelaxation()

### ConstraintRelaxation(ConstraintRelaxation)

    public ConstraintRelaxation(InjectedSolutionConstraint.Types.ConstraintRelaxation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation` |

## Properties

### Relaxations

    public RepeatedField<InjectedSolutionConstraint.Types.ConstraintRelaxation.Types.Relaxation> Relaxations { get; }

All the visit constraint relaxations that will apply to visits on
routes with vehicles in `vehicle_indices`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.InjectedSolutionConstraint.Types.ConstraintRelaxation.Types.Relaxation` |   |

### VehicleIndices

    public RepeatedField<int> VehicleIndices { get; }

Specifies the vehicle indices to which the visit constraint
`relaxations` apply. If empty, this is considered the default and the
`relaxations` apply to all vehicles that are not specified in other
`constraint_relaxations`. There can be at most one default, i.e., at
most one constraint relaxation field is allowed empty
`vehicle_indices`. A vehicle index can only be listed once, even within
several `constraint_relaxations`.

A vehicle index is mapped the same as
\[ShipmentRoute.vehicle_index\]\[google.cloud.optimization.v1.ShipmentRoute.vehicle_index\],
if `interpret_injected_solutions_using_labels` is true (see `fields`
comment).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.int32` |   |