<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/admanager/v1/report_service.proto

namespace Google\Ads\AdManager\V1\Report;

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

/**
 * A dimension or a metric in a report.
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.Report.Field</code>
 */
class Field extends \Google\Protobuf\Internal\Message
{
    protected $field;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $dimension
     *           The dimension this field represents.
     *     @type int $metric
     *           The metric this field represents.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce();
        parent::__construct($data);
    }

    /**
     * The dimension this field represents.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Report.Dimension dimension = 1;</code>
     * @return int
     */
    public function getDimension()
    {
        return $this->readOneof(1);
    }

    public function hasDimension()
    {
        return $this->hasOneof(1);
    }

    /**
     * The dimension this field represents.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Report.Dimension dimension = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setDimension($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Dimension::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The metric this field represents.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Report.Metric metric = 2;</code>
     * @return int
     */
    public function getMetric()
    {
        return $this->readOneof(2);
    }

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

    /**
     * The metric this field represents.
     *
     * Generated from protobuf field <code>.google.ads.admanager.v1.Report.Metric metric = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setMetric($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Metric::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}


