<?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 CATEGORY values.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.CategoryStats</code>
 */
class CategoryStats extends \Google\Protobuf\Internal\Message
{
    /**
     * The statistics of the top 20 CATEGORY values, ordered by
     * [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count].
     *
     * Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats top_category_stats = 1;</code>
     */
    private $top_category_stats;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\AutoMl\V1beta1\CategoryStats\SingleCategoryStats>|\Google\Protobuf\Internal\RepeatedField $top_category_stats
     *           The statistics of the top 20 CATEGORY values, ordered by
     *           [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\DataStats::initOnce();
        parent::__construct($data);
    }

    /**
     * The statistics of the top 20 CATEGORY values, ordered by
     * [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count].
     *
     * Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats top_category_stats = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTopCategoryStats()
    {
        return $this->top_category_stats;
    }

    /**
     * The statistics of the top 20 CATEGORY values, ordered by
     * [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count].
     *
     * Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats top_category_stats = 1;</code>
     * @param array<\Google\Cloud\AutoMl\V1beta1\CategoryStats\SingleCategoryStats>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTopCategoryStats($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1beta1\CategoryStats\SingleCategoryStats::class);
        $this->top_category_stats = $arr;

        return $this;
    }

}

