<?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;

/**
 * New media item that's created in a user's Google Photos account.
 *
 * Generated from protobuf message <code>google.photos.library.v1.NewMediaItem</code>
 */
class NewMediaItem extends \Google\Protobuf\Internal\Message
{
    /**
     * Description of the media item. This will be shown to the user in the item's
     * info section in the Google Photos app.
     * This string shouldn't be more than 1000 characters.
     *
     * Generated from protobuf field <code>string description = 1;</code>
     */
    protected $description = '';
    protected $new_media_item_type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $description
     *           Description of the media item. This will be shown to the user in the item's
     *           info section in the Google Photos app.
     *           This string shouldn't be more than 1000 characters.
     *     @type \Google\Photos\Library\V1\SimpleMediaItem $simple_media_item
     *           A new media item that has been uploaded via the included `uploadToken`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Photos\Library\V1\PhotosLibrary::initOnce();
        parent::__construct($data);
    }

    /**
     * Description of the media item. This will be shown to the user in the item's
     * info section in the Google Photos app.
     * This string shouldn't be more than 1000 characters.
     *
     * Generated from protobuf field <code>string description = 1;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Description of the media item. This will be shown to the user in the item's
     * info section in the Google Photos app.
     * This string shouldn't be more than 1000 characters.
     *
     * Generated from protobuf field <code>string description = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * A new media item that has been uploaded via the included `uploadToken`.
     *
     * Generated from protobuf field <code>.google.photos.library.v1.SimpleMediaItem simple_media_item = 2;</code>
     * @return \Google\Photos\Library\V1\SimpleMediaItem|null
     */
    public function getSimpleMediaItem()
    {
        return $this->readOneof(2);
    }

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

    /**
     * A new media item that has been uploaded via the included `uploadToken`.
     *
     * Generated from protobuf field <code>.google.photos.library.v1.SimpleMediaItem simple_media_item = 2;</code>
     * @param \Google\Photos\Library\V1\SimpleMediaItem $var
     * @return $this
     */
    public function setSimpleMediaItem($var)
    {
        GPBUtil::checkMessage($var, \Google\Photos\Library\V1\SimpleMediaItem::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

