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

namespace Google\Cloud\DataLabeling\V1beta1;

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

/**
 * A polyline for the image annotation.
 *
 * Generated from protobuf message <code>google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation</code>
 */
class ImagePolylineAnnotation extends \Google\Protobuf\Internal\Message
{
    /**
     * Label of this polyline.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code>
     */
    private $annotation_spec = null;
    protected $poly;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DataLabeling\V1beta1\Polyline $polyline
     *     @type \Google\Cloud\DataLabeling\V1beta1\NormalizedPolyline $normalized_polyline
     *     @type \Google\Cloud\DataLabeling\V1beta1\AnnotationSpec $annotation_spec
     *           Label of this polyline.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datalabeling\V1Beta1\Annotation::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.Polyline polyline = 2;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\Polyline|null
     */
    public function getPolyline()
    {
        return $this->readOneof(2);
    }

    public function hasPolyline()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.Polyline polyline = 2;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\Polyline $var
     * @return $this
     */
    public function setPolyline($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\Polyline::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.NormalizedPolyline normalized_polyline = 3;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\NormalizedPolyline|null
     */
    public function getNormalizedPolyline()
    {
        return $this->readOneof(3);
    }

    public function hasNormalizedPolyline()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.NormalizedPolyline normalized_polyline = 3;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\NormalizedPolyline $var
     * @return $this
     */
    public function setNormalizedPolyline($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\NormalizedPolyline::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Label of this polyline.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code>
     * @return \Google\Cloud\DataLabeling\V1beta1\AnnotationSpec|null
     */
    public function getAnnotationSpec()
    {
        return $this->annotation_spec;
    }

    public function hasAnnotationSpec()
    {
        return isset($this->annotation_spec);
    }

    public function clearAnnotationSpec()
    {
        unset($this->annotation_spec);
    }

    /**
     * Label of this polyline.
     *
     * Generated from protobuf field <code>.google.cloud.datalabeling.v1beta1.AnnotationSpec annotation_spec = 1;</code>
     * @param \Google\Cloud\DataLabeling\V1beta1\AnnotationSpec $var
     * @return $this
     */
    public function setAnnotationSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataLabeling\V1beta1\AnnotationSpec::class);
        $this->annotation_spec = $var;

        return $this;
    }

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

}

