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

namespace Google\Cloud\Channel\V1;

use UnexpectedValueException;

/**
 * Type of media used.
 *
 * Protobuf type <code>google.cloud.channel.v1.MediaType</code>
 */
class MediaType
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>MEDIA_TYPE_UNSPECIFIED = 0;</code>
     */
    const MEDIA_TYPE_UNSPECIFIED = 0;
    /**
     * Type of image.
     *
     * Generated from protobuf enum <code>MEDIA_TYPE_IMAGE = 1;</code>
     */
    const MEDIA_TYPE_IMAGE = 1;

    private static $valueToName = [
        self::MEDIA_TYPE_UNSPECIFIED => 'MEDIA_TYPE_UNSPECIFIED',
        self::MEDIA_TYPE_IMAGE => 'MEDIA_TYPE_IMAGE',
    ];

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

