<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/deploy/v1/cloud_deploy.proto

namespace Google\Cloud\Deploy\V1;

use UnexpectedValueException;

/**
 * Valid state of a repair attempt.
 *
 * Protobuf type <code>google.cloud.deploy.v1.RepairState</code>
 */
class RepairState
{
    /**
     * The `repair` has an unspecified state.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_UNSPECIFIED = 0;</code>
     */
    const REPAIR_STATE_UNSPECIFIED = 0;
    /**
     * The `repair` action has succeeded.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_SUCCEEDED = 1;</code>
     */
    const REPAIR_STATE_SUCCEEDED = 1;
    /**
     * The `repair` action was cancelled.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_CANCELLED = 2;</code>
     */
    const REPAIR_STATE_CANCELLED = 2;
    /**
     * The `repair` action has failed.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_FAILED = 3;</code>
     */
    const REPAIR_STATE_FAILED = 3;
    /**
     * The `repair` action is in progress.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_IN_PROGRESS = 4;</code>
     */
    const REPAIR_STATE_IN_PROGRESS = 4;
    /**
     * The `repair` action is pending.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_PENDING = 5;</code>
     */
    const REPAIR_STATE_PENDING = 5;
    /**
     * The `repair` action was skipped.
     *
     * Generated from protobuf enum <code>REPAIR_STATE_SKIPPED = 6;</code>
     */
    const REPAIR_STATE_SKIPPED = 6;

    private static $valueToName = [
        self::REPAIR_STATE_UNSPECIFIED => 'REPAIR_STATE_UNSPECIFIED',
        self::REPAIR_STATE_SUCCEEDED => 'REPAIR_STATE_SUCCEEDED',
        self::REPAIR_STATE_CANCELLED => 'REPAIR_STATE_CANCELLED',
        self::REPAIR_STATE_FAILED => 'REPAIR_STATE_FAILED',
        self::REPAIR_STATE_IN_PROGRESS => 'REPAIR_STATE_IN_PROGRESS',
        self::REPAIR_STATE_PENDING => 'REPAIR_STATE_PENDING',
        self::REPAIR_STATE_SKIPPED => 'REPAIR_STATE_SKIPPED',
    ];

    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);
    }
}

