<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/sql/v1beta4/cloud_sql_resources.proto

namespace Google\Cloud\Sql\V1beta4\SqlInstancesRescheduleMaintenanceRequestBody;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType</code>
 */
class RescheduleType
{
    /**
     * Generated from protobuf enum <code>RESCHEDULE_TYPE_UNSPECIFIED = 0;</code>
     */
    const RESCHEDULE_TYPE_UNSPECIFIED = 0;
    /**
     * Reschedules maintenance to happen now (within 5 minutes).
     *
     * Generated from protobuf enum <code>IMMEDIATE = 1;</code>
     */
    const IMMEDIATE = 1;
    /**
     * Reschedules maintenance to occur within one week from the originally
     * scheduled day and time.
     *
     * Generated from protobuf enum <code>NEXT_AVAILABLE_WINDOW = 2;</code>
     */
    const NEXT_AVAILABLE_WINDOW = 2;
    /**
     * Reschedules maintenance to a specific time and day.
     *
     * Generated from protobuf enum <code>SPECIFIC_TIME = 3;</code>
     */
    const SPECIFIC_TIME = 3;

    private static $valueToName = [
        self::RESCHEDULE_TYPE_UNSPECIFIED => 'RESCHEDULE_TYPE_UNSPECIFIED',
        self::IMMEDIATE => 'IMMEDIATE',
        self::NEXT_AVAILABLE_WINDOW => 'NEXT_AVAILABLE_WINDOW',
        self::SPECIFIC_TIME => 'SPECIFIC_TIME',
    ];

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


