<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/databasecenter/v1beta/maintenance.proto

namespace Google\Cloud\DatabaseCenter\V1beta;

use UnexpectedValueException;

/**
 * Phase/Week of the maintenance window. This is to capture order of
 * maintenance. For example, for Cloud SQL resources -
 * https://cloud.google.com/sql/docs/mysql/maintenance.
 * This enum can be extended to support DB Center specific phases for
 * recommendation plan generation.
 *
 * Protobuf type <code>google.cloud.databasecenter.v1beta.Phase</code>
 */
class Phase
{
    /**
     * Phase is unspecified.
     *
     * Generated from protobuf enum <code>PHASE_UNSPECIFIED = 0;</code>
     */
    const PHASE_UNSPECIFIED = 0;
    /**
     * Week 1.
     *
     * Generated from protobuf enum <code>PHASE_WEEK1 = 1;</code>
     */
    const PHASE_WEEK1 = 1;
    /**
     * Week 2.
     *
     * Generated from protobuf enum <code>PHASE_WEEK2 = 2;</code>
     */
    const PHASE_WEEK2 = 2;
    /**
     * Week 5.
     *
     * Generated from protobuf enum <code>PHASE_WEEK5 = 3;</code>
     */
    const PHASE_WEEK5 = 3;
    /**
     * Any phase.
     *
     * Generated from protobuf enum <code>PHASE_ANY = 4;</code>
     */
    const PHASE_ANY = 4;

    private static $valueToName = [
        self::PHASE_UNSPECIFIED => 'PHASE_UNSPECIFIED',
        self::PHASE_WEEK1 => 'PHASE_WEEK1',
        self::PHASE_WEEK2 => 'PHASE_WEEK2',
        self::PHASE_WEEK5 => 'PHASE_WEEK5',
        self::PHASE_ANY => 'PHASE_ANY',
    ];

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

