<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/maps/routeoptimization/v1/route_optimization_service.proto

namespace Google\Maps\RouteOptimization\V1\OptimizeToursRequest;

use UnexpectedValueException;

/**
 * Defines how the solver should handle the request. In all modes but
 * `VALIDATE_ONLY`, if the request is invalid, you will receive an
 * `INVALID_REQUEST` error. See
 * [max_validation_errors][google.maps.routeoptimization.v1.OptimizeToursRequest.max_validation_errors]
 * to cap the number of errors returned.
 *
 * Protobuf type <code>google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode</code>
 */
class SolvingMode
{
    /**
     * Solve the model. Warnings may be issued in
     * [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors].
     *
     * Generated from protobuf enum <code>DEFAULT_SOLVE = 0;</code>
     */
    const DEFAULT_SOLVE = 0;
    /**
     * Only validates the model without solving it: populates as many
     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
     * as possible.
     *
     * Generated from protobuf enum <code>VALIDATE_ONLY = 1;</code>
     */
    const VALIDATE_ONLY = 1;
    /**
     * Only populates
     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
     * or
     * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments],
     * and doesn't actually solve the rest of the request (`status` and `routes`
     * are unset in the response).
     * If infeasibilities in `injected_solution_constraint` routes are detected
     * they are populated in the
     * [OptimizeToursResponse.validation_errors][google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors]
     * field and
     * [OptimizeToursResponse.skipped_shipments][google.maps.routeoptimization.v1.OptimizeToursResponse.skipped_shipments]
     * is left empty.
     * *IMPORTANT*: not all infeasible shipments are returned here, but only the
     * ones that are detected as infeasible during preprocessing.
     *
     * Generated from protobuf enum <code>DETECT_SOME_INFEASIBLE_SHIPMENTS = 2;</code>
     */
    const DETECT_SOME_INFEASIBLE_SHIPMENTS = 2;

    private static $valueToName = [
        self::DEFAULT_SOLVE => 'DEFAULT_SOLVE',
        self::VALIDATE_ONLY => 'VALIDATE_ONLY',
        self::DETECT_SOME_INFEASIBLE_SHIPMENTS => 'DETECT_SOME_INFEASIBLE_SHIPMENTS',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


