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

namespace Google\Cloud\OracleDatabase\V1\DatabaseConnectionStringProfile;

use UnexpectedValueException;

/**
 * The host name format being used in the connection string.
 *
 * Protobuf type <code>google.cloud.oracledatabase.v1.DatabaseConnectionStringProfile.HostFormat</code>
 */
class HostFormat
{
    /**
     * Default unspecified value.
     *
     * Generated from protobuf enum <code>HOST_FORMAT_UNSPECIFIED = 0;</code>
     */
    const HOST_FORMAT_UNSPECIFIED = 0;
    /**
     * FQDN
     *
     * Generated from protobuf enum <code>FQDN = 1;</code>
     */
    const FQDN = 1;
    /**
     * IP
     *
     * Generated from protobuf enum <code>IP = 2;</code>
     */
    const IP = 2;

    private static $valueToName = [
        self::HOST_FORMAT_UNSPECIFIED => 'HOST_FORMAT_UNSPECIFIED',
        self::FQDN => 'FQDN',
        self::IP => 'IP',
    ];

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


