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

namespace Google\Photos\Library\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Specifies a position in an album.
 *
 * Generated from protobuf message <code>google.photos.library.v1.AlbumPosition</code>
 */
class AlbumPosition extends \Google\Protobuf\Internal\Message
{
    /**
     * Type of position, for a media or enrichment item.
     *
     * Generated from protobuf field <code>.google.photos.library.v1.AlbumPosition.PositionType position = 1;</code>
     */
    protected $position = 0;
    protected $relative_item;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $position
     *           Type of position, for a media or enrichment item.
     *     @type string $relative_media_item_id
     *           The media item to which the position is relative to.
     *           Only used when position type is AFTER_MEDIA_ITEM.
     *     @type string $relative_enrichment_item_id
     *           The enrichment item to which the position is relative to.
     *           Only used when position type is AFTER_ENRICHMENT_ITEM.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Photos\Library\V1\PhotosLibrary::initOnce();
        parent::__construct($data);
    }

    /**
     * Type of position, for a media or enrichment item.
     *
     * Generated from protobuf field <code>.google.photos.library.v1.AlbumPosition.PositionType position = 1;</code>
     * @return int
     */
    public function getPosition()
    {
        return $this->position;
    }

    /**
     * Type of position, for a media or enrichment item.
     *
     * Generated from protobuf field <code>.google.photos.library.v1.AlbumPosition.PositionType position = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setPosition($var)
    {
        GPBUtil::checkEnum($var, \Google\Photos\Library\V1\AlbumPosition\PositionType::class);
        $this->position = $var;

        return $this;
    }

    /**
     * The media item to which the position is relative to.
     * Only used when position type is AFTER_MEDIA_ITEM.
     *
     * Generated from protobuf field <code>string relative_media_item_id = 2;</code>
     * @return string
     */
    public function getRelativeMediaItemId()
    {
        return $this->readOneof(2);
    }

    public function hasRelativeMediaItemId()
    {
        return $this->hasOneof(2);
    }

    /**
     * The media item to which the position is relative to.
     * Only used when position type is AFTER_MEDIA_ITEM.
     *
     * Generated from protobuf field <code>string relative_media_item_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setRelativeMediaItemId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The enrichment item to which the position is relative to.
     * Only used when position type is AFTER_ENRICHMENT_ITEM.
     *
     * Generated from protobuf field <code>string relative_enrichment_item_id = 3;</code>
     * @return string
     */
    public function getRelativeEnrichmentItemId()
    {
        return $this->readOneof(3);
    }

    public function hasRelativeEnrichmentItemId()
    {
        return $this->hasOneof(3);
    }

    /**
     * The enrichment item to which the position is relative to.
     * Only used when position type is AFTER_ENRICHMENT_ITEM.
     *
     * Generated from protobuf field <code>string relative_enrichment_item_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRelativeEnrichmentItemId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getRelativeItem()
    {
        return $this->whichOneof("relative_item");
    }

}

