<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/data/v1alpha/data.proto

namespace Google\Analytics\Data\V1alpha\OrderBy;

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

/**
 * Sorts by dimension values.
 *
 * Generated from protobuf message <code>google.analytics.data.v1alpha.OrderBy.DimensionOrderBy</code>
 */
class DimensionOrderBy extends \Google\Protobuf\Internal\Message
{
    /**
     * A dimension name in the request to order by.
     *
     * Generated from protobuf field <code>string dimension_name = 1;</code>
     */
    protected $dimension_name = '';
    /**
     * Controls the rule for dimension value ordering.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType order_type = 2;</code>
     */
    protected $order_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $dimension_name
     *           A dimension name in the request to order by.
     *     @type int $order_type
     *           Controls the rule for dimension value ordering.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * A dimension name in the request to order by.
     *
     * Generated from protobuf field <code>string dimension_name = 1;</code>
     * @return string
     */
    public function getDimensionName()
    {
        return $this->dimension_name;
    }

    /**
     * A dimension name in the request to order by.
     *
     * Generated from protobuf field <code>string dimension_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDimensionName($var)
    {
        GPBUtil::checkString($var, True);
        $this->dimension_name = $var;

        return $this;
    }

    /**
     * Controls the rule for dimension value ordering.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType order_type = 2;</code>
     * @return int
     */
    public function getOrderType()
    {
        return $this->order_type;
    }

    /**
     * Controls the rule for dimension value ordering.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType order_type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setOrderType($var)
    {
        GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\OrderBy\DimensionOrderBy\OrderType::class);
        $this->order_type = $var;

        return $this;
    }

}


