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

namespace Google\Cloud\CloudDms\V1\SslConfig;

use UnexpectedValueException;

/**
 * Specifies The kind of ssl configuration used.
 *
 * Protobuf type <code>google.cloud.clouddms.v1.SslConfig.SslType</code>
 */
class SslType
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>SSL_TYPE_UNSPECIFIED = 0;</code>
     */
    const SSL_TYPE_UNSPECIFIED = 0;
    /**
     * Only 'ca_certificate' specified.
     *
     * Generated from protobuf enum <code>SERVER_ONLY = 1;</code>
     */
    const SERVER_ONLY = 1;
    /**
     * Both server ('ca_certificate'), and client ('client_key',
     * 'client_certificate') specified.
     *
     * Generated from protobuf enum <code>SERVER_CLIENT = 2;</code>
     */
    const SERVER_CLIENT = 2;

    private static $valueToName = [
        self::SSL_TYPE_UNSPECIFIED => 'SSL_TYPE_UNSPECIFIED',
        self::SERVER_ONLY => 'SERVER_ONLY',
        self::SERVER_CLIENT => 'SERVER_CLIENT',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SslType::class, \Google\Cloud\CloudDms\V1\SslConfig_SslType::class);

