<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/workflowservice/v1/request_response.proto

namespace Temporal\Api\Workflowservice\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse</code>
 */
class CountWorkflowExecutionsResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * If `query` is not grouping by any field, the count is an approximate number
     * of workflows that matches the query.
     * If `query` is grouping by a field, the count is simply the sum of the counts
     * of the groups returned in the response. This number can be smaller than the
     * total number of workflows matching the query.
     *
     * Generated from protobuf field <code>int64 count = 1;</code>
     */
    protected $count = 0;
    /**
     * `groups` contains the groups if the request is grouping by a field.
     * The list might not be complete, and the counts of each group is approximate.
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse.AggregationGroup groups = 2;</code>
     */
    private $groups;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $count
     *           If `query` is not grouping by any field, the count is an approximate number
     *           of workflows that matches the query.
     *           If `query` is grouping by a field, the count is simply the sum of the counts
     *           of the groups returned in the response. This number can be smaller than the
     *           total number of workflows matching the query.
     *     @type \Temporal\Api\Workflowservice\V1\CountWorkflowExecutionsResponse\AggregationGroup[] $groups
     *           `groups` contains the groups if the request is grouping by a field.
     *           The list might not be complete, and the counts of each group is approximate.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * If `query` is not grouping by any field, the count is an approximate number
     * of workflows that matches the query.
     * If `query` is grouping by a field, the count is simply the sum of the counts
     * of the groups returned in the response. This number can be smaller than the
     * total number of workflows matching the query.
     *
     * Generated from protobuf field <code>int64 count = 1;</code>
     * @return int|string
     */
    public function getCount()
    {
        return $this->count;
    }

    /**
     * If `query` is not grouping by any field, the count is an approximate number
     * of workflows that matches the query.
     * If `query` is grouping by a field, the count is simply the sum of the counts
     * of the groups returned in the response. This number can be smaller than the
     * total number of workflows matching the query.
     *
     * Generated from protobuf field <code>int64 count = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->count = $var;

        return $this;
    }

    /**
     * `groups` contains the groups if the request is grouping by a field.
     * The list might not be complete, and the counts of each group is approximate.
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse.AggregationGroup groups = 2;</code>
     * @return RepeatedField<\Temporal\Api\Workflowservice\V1\CountWorkflowExecutionsResponse\AggregationGroup>
     */
    public function getGroups()
    {
        return $this->groups;
    }

    /**
     * `groups` contains the groups if the request is grouping by a field.
     * The list might not be complete, and the counts of each group is approximate.
     *
     * Generated from protobuf field <code>repeated .temporal.api.workflowservice.v1.CountWorkflowExecutionsResponse.AggregationGroup groups = 2;</code>
     * @param \Temporal\Api\Workflowservice\V1\CountWorkflowExecutionsResponse\AggregationGroup[] $var
     * @return $this
     */
    public function setGroups($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Workflowservice\V1\CountWorkflowExecutionsResponse\AggregationGroup::class);
        $this->groups = $arr;

        return $this;
    }

}

