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

namespace Google\Analytics\Data\V1beta;

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

/**
 * The response pivot report table corresponding to a pivot request.
 *
 * Generated from protobuf message <code>google.analytics.data.v1beta.RunPivotReportResponse</code>
 */
class RunPivotReportResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Summarizes the columns and rows created by a pivot. Each pivot in the
     * request produces one header in the response. If we have a request like
     * this:
     *     "pivots": [{
     *       "fieldNames": ["country",
     *         "city"]
     *     },
     *     {
     *       "fieldNames": "eventName"
     *     }]
     * We will have the following `pivotHeaders` in the response:
     *     "pivotHeaders" : [{
     *       "dimensionHeaders": [{
     *         "dimensionValues": [
     *            { "value": "United Kingdom" },
     *            { "value": "London" }
     *          ]
     *       },
     *       {
     *         "dimensionValues": [
     *         { "value": "Japan" },
     *         { "value": "Osaka" }
     *         ]
     *       }]
     *     },
     *     {
     *       "dimensionHeaders": [{
     *         "dimensionValues": [{ "value": "session_start" }]
     *       },
     *       {
     *         "dimensionValues": [{ "value": "scroll" }]
     *       }]
     *     }]
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.PivotHeader pivot_headers = 1;</code>
     */
    private $pivot_headers;
    /**
     * Describes dimension columns. The number of DimensionHeaders and ordering of
     * DimensionHeaders matches the dimensions present in rows.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.DimensionHeader dimension_headers = 2;</code>
     */
    private $dimension_headers;
    /**
     * Describes metric columns. The number of MetricHeaders and ordering of
     * MetricHeaders matches the metrics present in rows.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.MetricHeader metric_headers = 3;</code>
     */
    private $metric_headers;
    /**
     * Rows of dimension value combinations and metric values in the report.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.Row rows = 4;</code>
     */
    private $rows;
    /**
     * Aggregation of metric values. Can be totals, minimums, or maximums. The
     * returned aggregations are controlled by the metric_aggregations in the
     * pivot. The type of aggregation returned in each row is shown by the
     * dimension_values which are set to "RESERVED_<MetricAggregation>".
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.Row aggregates = 5;</code>
     */
    private $aggregates;
    /**
     * Metadata for the report.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1beta.ResponseMetaData metadata = 6;</code>
     */
    protected $metadata = null;
    /**
     * This Google Analytics property's quota state including this request.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1beta.PropertyQuota property_quota = 7;</code>
     */
    protected $property_quota = null;
    /**
     * Identifies what kind of resource this message is. This `kind` is always the
     * fixed string "analyticsData#runPivotReport". Useful to distinguish between
     * response types in JSON.
     *
     * Generated from protobuf field <code>string kind = 8;</code>
     */
    protected $kind = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Analytics\Data\V1beta\PivotHeader[] $pivot_headers
     *           Summarizes the columns and rows created by a pivot. Each pivot in the
     *           request produces one header in the response. If we have a request like
     *           this:
     *               "pivots": [{
     *                 "fieldNames": ["country",
     *                   "city"]
     *               },
     *               {
     *                 "fieldNames": "eventName"
     *               }]
     *           We will have the following `pivotHeaders` in the response:
     *               "pivotHeaders" : [{
     *                 "dimensionHeaders": [{
     *                   "dimensionValues": [
     *                      { "value": "United Kingdom" },
     *                      { "value": "London" }
     *                    ]
     *                 },
     *                 {
     *                   "dimensionValues": [
     *                   { "value": "Japan" },
     *                   { "value": "Osaka" }
     *                   ]
     *                 }]
     *               },
     *               {
     *                 "dimensionHeaders": [{
     *                   "dimensionValues": [{ "value": "session_start" }]
     *                 },
     *                 {
     *                   "dimensionValues": [{ "value": "scroll" }]
     *                 }]
     *               }]
     *     @type \Google\Analytics\Data\V1beta\DimensionHeader[] $dimension_headers
     *           Describes dimension columns. The number of DimensionHeaders and ordering of
     *           DimensionHeaders matches the dimensions present in rows.
     *     @type \Google\Analytics\Data\V1beta\MetricHeader[] $metric_headers
     *           Describes metric columns. The number of MetricHeaders and ordering of
     *           MetricHeaders matches the metrics present in rows.
     *     @type \Google\Analytics\Data\V1beta\Row[] $rows
     *           Rows of dimension value combinations and metric values in the report.
     *     @type \Google\Analytics\Data\V1beta\Row[] $aggregates
     *           Aggregation of metric values. Can be totals, minimums, or maximums. The
     *           returned aggregations are controlled by the metric_aggregations in the
     *           pivot. The type of aggregation returned in each row is shown by the
     *           dimension_values which are set to "RESERVED_<MetricAggregation>".
     *     @type \Google\Analytics\Data\V1beta\ResponseMetaData $metadata
     *           Metadata for the report.
     *     @type \Google\Analytics\Data\V1beta\PropertyQuota $property_quota
     *           This Google Analytics property's quota state including this request.
     *     @type string $kind
     *           Identifies what kind of resource this message is. This `kind` is always the
     *           fixed string "analyticsData#runPivotReport". Useful to distinguish between
     *           response types in JSON.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Data\V1Beta\AnalyticsDataApi::initOnce();
        parent::__construct($data);
    }

    /**
     * Summarizes the columns and rows created by a pivot. Each pivot in the
     * request produces one header in the response. If we have a request like
     * this:
     *     "pivots": [{
     *       "fieldNames": ["country",
     *         "city"]
     *     },
     *     {
     *       "fieldNames": "eventName"
     *     }]
     * We will have the following `pivotHeaders` in the response:
     *     "pivotHeaders" : [{
     *       "dimensionHeaders": [{
     *         "dimensionValues": [
     *            { "value": "United Kingdom" },
     *            { "value": "London" }
     *          ]
     *       },
     *       {
     *         "dimensionValues": [
     *         { "value": "Japan" },
     *         { "value": "Osaka" }
     *         ]
     *       }]
     *     },
     *     {
     *       "dimensionHeaders": [{
     *         "dimensionValues": [{ "value": "session_start" }]
     *       },
     *       {
     *         "dimensionValues": [{ "value": "scroll" }]
     *       }]
     *     }]
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.PivotHeader pivot_headers = 1;</code>
     * @return RepeatedField<\Google\Analytics\Data\V1beta\PivotHeader>
     */
    public function getPivotHeaders()
    {
        return $this->pivot_headers;
    }

    /**
     * Summarizes the columns and rows created by a pivot. Each pivot in the
     * request produces one header in the response. If we have a request like
     * this:
     *     "pivots": [{
     *       "fieldNames": ["country",
     *         "city"]
     *     },
     *     {
     *       "fieldNames": "eventName"
     *     }]
     * We will have the following `pivotHeaders` in the response:
     *     "pivotHeaders" : [{
     *       "dimensionHeaders": [{
     *         "dimensionValues": [
     *            { "value": "United Kingdom" },
     *            { "value": "London" }
     *          ]
     *       },
     *       {
     *         "dimensionValues": [
     *         { "value": "Japan" },
     *         { "value": "Osaka" }
     *         ]
     *       }]
     *     },
     *     {
     *       "dimensionHeaders": [{
     *         "dimensionValues": [{ "value": "session_start" }]
     *       },
     *       {
     *         "dimensionValues": [{ "value": "scroll" }]
     *       }]
     *     }]
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.PivotHeader pivot_headers = 1;</code>
     * @param \Google\Analytics\Data\V1beta\PivotHeader[] $var
     * @return $this
     */
    public function setPivotHeaders($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\PivotHeader::class);
        $this->pivot_headers = $arr;

        return $this;
    }

    /**
     * Describes dimension columns. The number of DimensionHeaders and ordering of
     * DimensionHeaders matches the dimensions present in rows.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.DimensionHeader dimension_headers = 2;</code>
     * @return RepeatedField<\Google\Analytics\Data\V1beta\DimensionHeader>
     */
    public function getDimensionHeaders()
    {
        return $this->dimension_headers;
    }

    /**
     * Describes dimension columns. The number of DimensionHeaders and ordering of
     * DimensionHeaders matches the dimensions present in rows.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.DimensionHeader dimension_headers = 2;</code>
     * @param \Google\Analytics\Data\V1beta\DimensionHeader[] $var
     * @return $this
     */
    public function setDimensionHeaders($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\DimensionHeader::class);
        $this->dimension_headers = $arr;

        return $this;
    }

    /**
     * Describes metric columns. The number of MetricHeaders and ordering of
     * MetricHeaders matches the metrics present in rows.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.MetricHeader metric_headers = 3;</code>
     * @return RepeatedField<\Google\Analytics\Data\V1beta\MetricHeader>
     */
    public function getMetricHeaders()
    {
        return $this->metric_headers;
    }

    /**
     * Describes metric columns. The number of MetricHeaders and ordering of
     * MetricHeaders matches the metrics present in rows.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.MetricHeader metric_headers = 3;</code>
     * @param \Google\Analytics\Data\V1beta\MetricHeader[] $var
     * @return $this
     */
    public function setMetricHeaders($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\MetricHeader::class);
        $this->metric_headers = $arr;

        return $this;
    }

    /**
     * Rows of dimension value combinations and metric values in the report.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.Row rows = 4;</code>
     * @return RepeatedField<\Google\Analytics\Data\V1beta\Row>
     */
    public function getRows()
    {
        return $this->rows;
    }

    /**
     * Rows of dimension value combinations and metric values in the report.
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.Row rows = 4;</code>
     * @param \Google\Analytics\Data\V1beta\Row[] $var
     * @return $this
     */
    public function setRows($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\Row::class);
        $this->rows = $arr;

        return $this;
    }

    /**
     * Aggregation of metric values. Can be totals, minimums, or maximums. The
     * returned aggregations are controlled by the metric_aggregations in the
     * pivot. The type of aggregation returned in each row is shown by the
     * dimension_values which are set to "RESERVED_<MetricAggregation>".
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.Row aggregates = 5;</code>
     * @return RepeatedField<\Google\Analytics\Data\V1beta\Row>
     */
    public function getAggregates()
    {
        return $this->aggregates;
    }

    /**
     * Aggregation of metric values. Can be totals, minimums, or maximums. The
     * returned aggregations are controlled by the metric_aggregations in the
     * pivot. The type of aggregation returned in each row is shown by the
     * dimension_values which are set to "RESERVED_<MetricAggregation>".
     *
     * Generated from protobuf field <code>repeated .google.analytics.data.v1beta.Row aggregates = 5;</code>
     * @param \Google\Analytics\Data\V1beta\Row[] $var
     * @return $this
     */
    public function setAggregates($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\Row::class);
        $this->aggregates = $arr;

        return $this;
    }

    /**
     * Metadata for the report.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1beta.ResponseMetaData metadata = 6;</code>
     * @return \Google\Analytics\Data\V1beta\ResponseMetaData|null
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

    /**
     * Metadata for the report.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1beta.ResponseMetaData metadata = 6;</code>
     * @param \Google\Analytics\Data\V1beta\ResponseMetaData $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Data\V1beta\ResponseMetaData::class);
        $this->metadata = $var;

        return $this;
    }

    /**
     * This Google Analytics property's quota state including this request.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1beta.PropertyQuota property_quota = 7;</code>
     * @return \Google\Analytics\Data\V1beta\PropertyQuota|null
     */
    public function getPropertyQuota()
    {
        return $this->property_quota;
    }

    public function hasPropertyQuota()
    {
        return isset($this->property_quota);
    }

    public function clearPropertyQuota()
    {
        unset($this->property_quota);
    }

    /**
     * This Google Analytics property's quota state including this request.
     *
     * Generated from protobuf field <code>.google.analytics.data.v1beta.PropertyQuota property_quota = 7;</code>
     * @param \Google\Analytics\Data\V1beta\PropertyQuota $var
     * @return $this
     */
    public function setPropertyQuota($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Data\V1beta\PropertyQuota::class);
        $this->property_quota = $var;

        return $this;
    }

    /**
     * Identifies what kind of resource this message is. This `kind` is always the
     * fixed string "analyticsData#runPivotReport". Useful to distinguish between
     * response types in JSON.
     *
     * Generated from protobuf field <code>string kind = 8;</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * Identifies what kind of resource this message is. This `kind` is always the
     * fixed string "analyticsData#runPivotReport". Useful to distinguish between
     * response types in JSON.
     *
     * Generated from protobuf field <code>string kind = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

}

