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

namespace Google\Cloud\AutoMl\V1beta1\TimestampStats;

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

/**
 * Stats split by a defined in context granularity.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.TimestampStats.GranularStats</code>
 */
class GranularStats extends \Google\Protobuf\Internal\Message
{
    /**
     * A map from granularity key to example count for that key.
     * E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May).
     *
     * Generated from protobuf field <code>map<int32, int64> buckets = 1;</code>
     */
    private $buckets;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $buckets
     *           A map from granularity key to example count for that key.
     *           E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\DataStats::initOnce();
        parent::__construct($data);
    }

    /**
     * A map from granularity key to example count for that key.
     * E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May).
     *
     * Generated from protobuf field <code>map<int32, int64> buckets = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getBuckets()
    {
        return $this->buckets;
    }

    /**
     * A map from granularity key to example count for that key.
     * E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May).
     *
     * Generated from protobuf field <code>map<int32, int64> buckets = 1;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setBuckets($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::INT64);
        $this->buckets = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GranularStats::class, \Google\Cloud\AutoMl\V1beta1\TimestampStats_GranularStats::class);

