<?php

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/access_report.proto
namespace Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha;

use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\GPBType;
use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\RepeatedField;
use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\GPBUtil;
/**
 * Order bys define how rows will be sorted in the response. For example,
 * ordering rows by descending access count is one ordering, and ordering rows
 * by the country string is a different ordering.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.AccessOrderBy</code>
 */
class AccessOrderBy extends \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\Message
{
    /**
     * If true, sorts by descending order. If false or unspecified, sorts in
     * ascending order.
     *
     * Generated from protobuf field <code>bool desc = 3;</code>
     */
    private $desc = \false;
    protected $one_order_by;
    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Analytics\Admin\V1alpha\AccessOrderBy\MetricOrderBy $metric
     *           Sorts results by a metric's values.
     *     @type \Google\Analytics\Admin\V1alpha\AccessOrderBy\DimensionOrderBy $dimension
     *           Sorts results by a dimension's values.
     *     @type bool $desc
     *           If true, sorts by descending order. If false or unspecified, sorts in
     *           ascending order.
     * }
     */
    public function __construct($data = NULL)
    {
        \Matomo\Dependencies\GoogleAnalyticsImporter\GPBMetadata\Google\Analytics\Admin\V1Alpha\AccessReport::initOnce();
        parent::__construct($data);
    }
    /**
     * Sorts results by a metric's values.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AccessOrderBy.MetricOrderBy metric = 1;</code>
     * @return \Google\Analytics\Admin\V1alpha\AccessOrderBy\MetricOrderBy|null
     */
    public function getMetric()
    {
        return $this->readOneof(1);
    }
    public function hasMetric()
    {
        return $this->hasOneof(1);
    }
    /**
     * Sorts results by a metric's values.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AccessOrderBy.MetricOrderBy metric = 1;</code>
     * @param \Google\Analytics\Admin\V1alpha\AccessOrderBy\MetricOrderBy $var
     * @return $this
     */
    public function setMetric($var)
    {
        GPBUtil::checkMessage($var, \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha\AccessOrderBy\MetricOrderBy::class);
        $this->writeOneof(1, $var);
        return $this;
    }
    /**
     * Sorts results by a dimension's values.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AccessOrderBy.DimensionOrderBy dimension = 2;</code>
     * @return \Google\Analytics\Admin\V1alpha\AccessOrderBy\DimensionOrderBy|null
     */
    public function getDimension()
    {
        return $this->readOneof(2);
    }
    public function hasDimension()
    {
        return $this->hasOneof(2);
    }
    /**
     * Sorts results by a dimension's values.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.AccessOrderBy.DimensionOrderBy dimension = 2;</code>
     * @param \Google\Analytics\Admin\V1alpha\AccessOrderBy\DimensionOrderBy $var
     * @return $this
     */
    public function setDimension($var)
    {
        GPBUtil::checkMessage($var, \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha\AccessOrderBy\DimensionOrderBy::class);
        $this->writeOneof(2, $var);
        return $this;
    }
    /**
     * If true, sorts by descending order. If false or unspecified, sorts in
     * ascending order.
     *
     * Generated from protobuf field <code>bool desc = 3;</code>
     * @return bool
     */
    public function getDesc()
    {
        return $this->desc;
    }
    /**
     * If true, sorts by descending order. If false or unspecified, sorts in
     * ascending order.
     *
     * Generated from protobuf field <code>bool desc = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setDesc($var)
    {
        GPBUtil::checkBool($var);
        $this->desc = $var;
        return $this;
    }
    /**
     * @return string
     */
    public function getOneOrderBy()
    {
        return $this->whichOneof("one_order_by");
    }
}
