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

namespace Google\Cloud\ApiHub\V1\DiscoveredApiObservation;

use UnexpectedValueException;

/**
 * DiscoveredApiObservation protocol style
 *
 * Protobuf type <code>google.cloud.apihub.v1.DiscoveredApiObservation.Style</code>
 */
class Style
{
    /**
     * Unknown style
     *
     * Generated from protobuf enum <code>STYLE_UNSPECIFIED = 0;</code>
     */
    const STYLE_UNSPECIFIED = 0;
    /**
     * Style is Rest API
     *
     * Generated from protobuf enum <code>REST = 1;</code>
     */
    const REST = 1;
    /**
     * Style is Grpc API
     *
     * Generated from protobuf enum <code>GRPC = 2;</code>
     */
    const GRPC = 2;
    /**
     * Style is GraphQL API
     *
     * Generated from protobuf enum <code>GRAPHQL = 3;</code>
     */
    const GRAPHQL = 3;

    private static $valueToName = [
        self::STYLE_UNSPECIFIED => 'STYLE_UNSPECIFIED',
        self::REST => 'REST',
        self::GRPC => 'GRPC',
        self::GRAPHQL => 'GRAPHQL',
    ];

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


