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

namespace Grafeas\V1\DeploymentOccurrence;

use UnexpectedValueException;

/**
 * Types of platforms.
 *
 * Protobuf type <code>grafeas.v1.DeploymentOccurrence.Platform</code>
 */
class Platform
{
    /**
     * Unknown.
     *
     * Generated from protobuf enum <code>PLATFORM_UNSPECIFIED = 0;</code>
     */
    const PLATFORM_UNSPECIFIED = 0;
    /**
     * Google Container Engine.
     *
     * Generated from protobuf enum <code>GKE = 1;</code>
     */
    const GKE = 1;
    /**
     * Google App Engine: Flexible Environment.
     *
     * Generated from protobuf enum <code>FLEX = 2;</code>
     */
    const FLEX = 2;
    /**
     * Custom user-defined platform.
     *
     * Generated from protobuf enum <code>CUSTOM = 3;</code>
     */
    const CUSTOM = 3;

    private static $valueToName = [
        self::PLATFORM_UNSPECIFIED => 'PLATFORM_UNSPECIFIED',
        self::GKE => 'GKE',
        self::FLEX => 'FLEX',
        self::CUSTOM => 'CUSTOM',
    ];

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


