# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::InjectedSolutionConstraint (v0.16.0)

0.16.0 (latest) 0.15.0 0.14.1 0.13.0 0.12.0 0.11.1 0.10.0 0.9.2 0.8.2 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 0.2.1 0.1.1 Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::InjectedSolutionConstraint.

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

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #constraint_relaxations

    def constraint_relaxations() -> ::Array<::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-InjectedSolutionConstraint-ConstraintRelaxation)\>) --- 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.

### #constraint_relaxations=

    def constraint_relaxations=(value) -> ::Array<::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-InjectedSolutionConstraint-ConstraintRelaxation)\>) --- 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.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-InjectedSolutionConstraint-ConstraintRelaxation)\>) --- 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.

### #routes

    def routes() -> ::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentRoute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute)\>) --- 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`.

### #routes=

    def routes=(value) -> ::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::ShipmentRoute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute)\>) --- 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`.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::ShipmentRoute](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute)\>) --- 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`.

### #skipped_shipments

    def skipped_shipments() -> ::Array<::Google::Cloud::Optimization::V1::SkippedShipment>

**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::SkippedShipment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-SkippedShipment)\>) --- Skipped shipments of the solution to inject. Some may be omitted from the original solution. See the `routes` field.

### #skipped_shipments=

    def skipped_shipments=(value) -> ::Array<::Google::Cloud::Optimization::V1::SkippedShipment>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Optimization::V1::SkippedShipment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-SkippedShipment)\>) --- Skipped shipments of the solution to inject. Some may be omitted from the original solution. See the `routes` field.
**Returns**

- (::Array\<[::Google::Cloud::Optimization::V1::SkippedShipment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-SkippedShipment)\>) --- Skipped shipments of the solution to inject. Some may be omitted from the original solution. See the `routes` field.