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

namespace Google\Cloud\DataCatalog\V1\DataSource;

use UnexpectedValueException;

/**
 * Name of a service that stores the data.
 *
 * Protobuf type <code>google.cloud.datacatalog.v1.DataSource.Service</code>
 */
class Service
{
    /**
     * Default unknown service.
     *
     * Generated from protobuf enum <code>SERVICE_UNSPECIFIED = 0;</code>
     */
    const SERVICE_UNSPECIFIED = 0;
    /**
     * Google Cloud Storage service.
     *
     * Generated from protobuf enum <code>CLOUD_STORAGE = 1;</code>
     */
    const CLOUD_STORAGE = 1;
    /**
     * BigQuery service.
     *
     * Generated from protobuf enum <code>BIGQUERY = 2;</code>
     */
    const BIGQUERY = 2;

    private static $valueToName = [
        self::SERVICE_UNSPECIFIED => 'SERVICE_UNSPECIFIED',
        self::CLOUD_STORAGE => 'CLOUD_STORAGE',
        self::BIGQUERY => 'BIGQUERY',
    ];

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

