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

namespace Google\Cloud\Compute\V1\SslCertificate;

use UnexpectedValueException;

/**
 * (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used.
 *
 * Protobuf type <code>google.cloud.compute.v1.SslCertificate.Type</code>
 */
class Type
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_TYPE = 0;</code>
     */
    const UNDEFINED_TYPE = 0;
    /**
     * Generated from protobuf enum <code>MANAGED = 211065727;</code>
     */
    const MANAGED = 211065727;
    /**
     * Generated from protobuf enum <code>SELF_MANAGED = 166002060;</code>
     */
    const SELF_MANAGED = 166002060;
    /**
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 169278866;</code>
     */
    const TYPE_UNSPECIFIED = 169278866;

    private static $valueToName = [
        self::UNDEFINED_TYPE => 'UNDEFINED_TYPE',
        self::MANAGED => 'MANAGED',
        self::SELF_MANAGED => 'SELF_MANAGED',
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
    ];

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


