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

/**
 * Example data used for training or prediction.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.ExamplePayload</code>
 */
class ExamplePayload extends \Google\Protobuf\Internal\Message
{
    protected $payload;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AutoMl\V1beta1\Image $image
     *           An example image.
     *     @type \Google\Cloud\AutoMl\V1beta1\TextSnippet $text_snippet
     *           Example text.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\DataItems::initOnce();
        parent::__construct($data);
    }

    /**
     * An example image.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.Image image = 1;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\Image
     */
    public function getImage()
    {
        return $this->readOneof(1);
    }

    /**
     * An example image.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.Image image = 1;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\Image $var
     * @return $this
     */
    public function setImage($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\Image::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Example text.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.TextSnippet text_snippet = 2;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\TextSnippet
     */
    public function getTextSnippet()
    {
        return $this->readOneof(2);
    }

    /**
     * Example text.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.TextSnippet text_snippet = 2;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\TextSnippet $var
     * @return $this
     */
    public function setTextSnippet($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\TextSnippet::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

