# Cloud Optimization v1 API - Class InjectedSolutionConstraint (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)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.6.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.5.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.4.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.3.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.2.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.1.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.0.0/Google.Cloud.Optimization.V1.InjectedSolutionConstraint)
- [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)

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

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

Solution injected in the request including information about which visits
must be constrained and how they must be constrained.

## Inheritance

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

## 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), [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), [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), [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

### InjectedSolutionConstraint()

    public InjectedSolutionConstraint()

### InjectedSolutionConstraint(InjectedSolutionConstraint)

    public InjectedSolutionConstraint(InjectedSolutionConstraint other)

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

## Properties

### ConstraintRelaxations

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

For zero or more groups of vehicles, specifies when and how much to relax
constraints. If this field is empty, all non-empty vehicle routes are
fully constrained.

| **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.ConstraintRelaxation` |   |

### Routes

    public RepeatedField<ShipmentRoute> Routes { get; }

Routes of the solution to inject. Some routes may be omitted from the
original solution. The routes and skipped shipments must satisfy the basic
validity assumptions listed for `injected_first_solution_routes`.

| **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.ShipmentRoute` |   |

### SkippedShipments

    public RepeatedField<SkippedShipment> SkippedShipments { get; }

Skipped shipments of the solution to inject. Some may be omitted from the
original solution. See the `routes` field.

| **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.SkippedShipment` |   |