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

namespace Google\Cloud\AutoMl\V1beta1;

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.v1beta1.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 \Google\Cloud\AutoMl\V1beta1\InputConfig $input_config
     *           An input config specifying the content of the image.
     *     @type string $thumbnail_uri
     *           Output only. HTTP URI to the thumbnail image.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\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);
    }

    public function hasImageBytes()
    {
        return $this->hasOneof(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;
    }

    /**
     * An input config specifying the content of the image.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.InputConfig input_config = 6;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\InputConfig|null
     */
    public function getInputConfig()
    {
        return $this->readOneof(6);
    }

    public function hasInputConfig()
    {
        return $this->hasOneof(6);
    }

    /**
     * An input config specifying the content of the image.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.InputConfig input_config = 6;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\InputConfig $var
     * @return $this
     */
    public function setInputConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\InputConfig::class);
        $this->writeOneof(6, $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");
    }

}

