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

namespace Google\Cloud\Sql\V1\PasswordValidationPolicy;

use UnexpectedValueException;

/**
 * The complexity choices of the password.
 *
 * Protobuf type <code>google.cloud.sql.v1.PasswordValidationPolicy.Complexity</code>
 */
class Complexity
{
    /**
     * Complexity check is not specified.
     *
     * Generated from protobuf enum <code>COMPLEXITY_UNSPECIFIED = 0;</code>
     */
    const COMPLEXITY_UNSPECIFIED = 0;
    /**
     * A combination of lowercase, uppercase, numeric, and non-alphanumeric
     * characters.
     *
     * Generated from protobuf enum <code>COMPLEXITY_DEFAULT = 1;</code>
     */
    const COMPLEXITY_DEFAULT = 1;

    private static $valueToName = [
        self::COMPLEXITY_UNSPECIFIED => 'COMPLEXITY_UNSPECIFIED',
        self::COMPLEXITY_DEFAULT => 'COMPLEXITY_DEFAULT',
    ];

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


