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

namespace Google\Cloud\AutoMl\V1beta1;

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

/**
 * The data statistics of a series of TIMESTAMP values.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.TimestampStats</code>
 */
class TimestampStats extends \Google\Protobuf\Internal\Message
{
    /**
     * The string key is the pre-defined granularity. Currently supported:
     * hour_of_day, day_of_week, month_of_year.
     * Granularities finer that the granularity of timestamp data are not
     * populated (e.g. if timestamps are at day granularity, then hour_of_day
     * is not populated).
     *
     * Generated from protobuf field <code>map<string, .google.cloud.automl.v1beta1.TimestampStats.GranularStats> granular_stats = 1;</code>
     */
    private $granular_stats;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $granular_stats
     *           The string key is the pre-defined granularity. Currently supported:
     *           hour_of_day, day_of_week, month_of_year.
     *           Granularities finer that the granularity of timestamp data are not
     *           populated (e.g. if timestamps are at day granularity, then hour_of_day
     *           is not populated).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\DataStats::initOnce();
        parent::__construct($data);
    }

    /**
     * The string key is the pre-defined granularity. Currently supported:
     * hour_of_day, day_of_week, month_of_year.
     * Granularities finer that the granularity of timestamp data are not
     * populated (e.g. if timestamps are at day granularity, then hour_of_day
     * is not populated).
     *
     * Generated from protobuf field <code>map<string, .google.cloud.automl.v1beta1.TimestampStats.GranularStats> granular_stats = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getGranularStats()
    {
        return $this->granular_stats;
    }

    /**
     * The string key is the pre-defined granularity. Currently supported:
     * hour_of_day, day_of_week, month_of_year.
     * Granularities finer that the granularity of timestamp data are not
     * populated (e.g. if timestamps are at day granularity, then hour_of_day
     * is not populated).
     *
     * Generated from protobuf field <code>map<string, .google.cloud.automl.v1beta1.TimestampStats.GranularStats> granular_stats = 1;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setGranularStats($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1beta1\TimestampStats\GranularStats::class);
        $this->granular_stats = $arr;

        return $this;
    }

}

