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

namespace Google\Cloud\AutoMl\V1;

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

/**
 * Contains annotation information that is relevant to AutoML.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1.AnnotationPayload</code>
 */
class AnnotationPayload extends \Google\Protobuf\Internal\Message
{
    protected $detail;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AutoMl\V1\TranslationAnnotation $translation
     *           Annotation details for translation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1\AnnotationPayload::initOnce();
        parent::__construct($data);
    }

    /**
     * Annotation details for translation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
     * @return \Google\Cloud\AutoMl\V1\TranslationAnnotation
     */
    public function getTranslation()
    {
        return $this->readOneof(2);
    }

    /**
     * Annotation details for translation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.TranslationAnnotation translation = 2;</code>
     * @param \Google\Cloud\AutoMl\V1\TranslationAnnotation $var
     * @return $this
     */
    public function setTranslation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationAnnotation::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

