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

namespace Google\Cloud\AutoMl\V1;

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

/**
 * A representation of an image.
 * Only images up to 30MB in size are supported.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1.Image</code>
 */
class Image extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. HTTP URI to the thumbnail image.
     *
     * Generated from protobuf field <code>string thumbnail_uri = 4;</code>
     */
    private $thumbnail_uri = '';
    protected $data;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $image_bytes
     *           Image content represented as a stream of bytes.
     *           Note: As with all `bytes` fields, protobuffers use a pure binary
     *           representation, whereas JSON representations use base64.
     *     @type string $thumbnail_uri
     *           Output only. HTTP URI to the thumbnail image.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce();
        parent::__construct($data);
    }

    /**
     * Image content represented as a stream of bytes.
     * Note: As with all `bytes` fields, protobuffers use a pure binary
     * representation, whereas JSON representations use base64.
     *
     * Generated from protobuf field <code>bytes image_bytes = 1;</code>
     * @return string
     */
    public function getImageBytes()
    {
        return $this->readOneof(1);
    }

    /**
     * Image content represented as a stream of bytes.
     * Note: As with all `bytes` fields, protobuffers use a pure binary
     * representation, whereas JSON representations use base64.
     *
     * Generated from protobuf field <code>bytes image_bytes = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setImageBytes($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Output only. HTTP URI to the thumbnail image.
     *
     * Generated from protobuf field <code>string thumbnail_uri = 4;</code>
     * @return string
     */
    public function getThumbnailUri()
    {
        return $this->thumbnail_uri;
    }

    /**
     * Output only. HTTP URI to the thumbnail image.
     *
     * Generated from protobuf field <code>string thumbnail_uri = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setThumbnailUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->thumbnail_uri = $var;

        return $this;
    }

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

}

