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

namespace Google\Photos\Library\V1\AlbumPosition;

use UnexpectedValueException;

/**
 * Possible positions in an album.
 *
 * Protobuf type <code>google.photos.library.v1.AlbumPosition.PositionType</code>
 */
class PositionType
{
    /**
     * Default value if this enum isn't set.
     *
     * Generated from protobuf enum <code>POSITION_TYPE_UNSPECIFIED = 0;</code>
     */
    const POSITION_TYPE_UNSPECIFIED = 0;
    /**
     * At the beginning of the album.
     *
     * Generated from protobuf enum <code>FIRST_IN_ALBUM = 1;</code>
     */
    const FIRST_IN_ALBUM = 1;
    /**
     * At the end of the album.
     *
     * Generated from protobuf enum <code>LAST_IN_ALBUM = 2;</code>
     */
    const LAST_IN_ALBUM = 2;
    /**
     * After a media item.
     *
     * Generated from protobuf enum <code>AFTER_MEDIA_ITEM = 3;</code>
     */
    const AFTER_MEDIA_ITEM = 3;
    /**
     * After an enrichment item.
     *
     * Generated from protobuf enum <code>AFTER_ENRICHMENT_ITEM = 4;</code>
     */
    const AFTER_ENRICHMENT_ITEM = 4;

    private static $valueToName = [
        self::POSITION_TYPE_UNSPECIFIED => 'POSITION_TYPE_UNSPECIFIED',
        self::FIRST_IN_ALBUM => 'FIRST_IN_ALBUM',
        self::LAST_IN_ALBUM => 'LAST_IN_ALBUM',
        self::AFTER_MEDIA_ITEM => 'AFTER_MEDIA_ITEM',
        self::AFTER_ENRICHMENT_ITEM => 'AFTER_ENRICHMENT_ITEM',
    ];

    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(PositionType::class, \Google\Photos\Library\V1\AlbumPosition_PositionType::class);

