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

/**
 * Example data used for training or prediction.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1.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\V1\TextSnippet $text_snippet
     *           Example text.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

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

}

