<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/photos/library/v1/photos_library.proto

namespace Google\Photos\Library\V1\MediaTypeFilter;

use UnexpectedValueException;

/**
 * The set of media types that can be searched for.
 *
 * Protobuf type <code>google.photos.library.v1.MediaTypeFilter.MediaType</code>
 */
class MediaType
{
    /**
     * Treated as if no filters are applied. All media types are included.
     *
     * Generated from protobuf enum <code>ALL_MEDIA = 0;</code>
     */
    const ALL_MEDIA = 0;
    /**
     * All media items that are considered videos.
     * This also includes movies the user has created using the Google Photos
     * app.
     *
     * Generated from protobuf enum <code>VIDEO = 1;</code>
     */
    const VIDEO = 1;
    /**
     * All media items that are considered photos. This includes .bmp, .gif,
     * .ico, .jpg (and other spellings), .tiff, .webp and special photo types
     * such as iOS live photos, Android motion photos, panoramas, photospheres.
     *
     * Generated from protobuf enum <code>PHOTO = 2;</code>
     */
    const PHOTO = 2;

    private static $valueToName = [
        self::ALL_MEDIA => 'ALL_MEDIA',
        self::VIDEO => 'VIDEO',
        self::PHOTO => 'PHOTO',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(MediaType::class, \Google\Photos\Library\V1\MediaTypeFilter_MediaType::class);

