<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/batch/v1/job.proto

namespace Google\Cloud\Batch\V1\JobStatus;

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

/**
 * Aggregated task status for a TaskGroup.
 *
 * Generated from protobuf message <code>google.cloud.batch.v1.JobStatus.TaskGroupStatus</code>
 */
class TaskGroupStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * Count of task in each state in the TaskGroup.
     * The map key is task state name.
     *
     * Generated from protobuf field <code>map<string, int64> counts = 1;</code>
     */
    private $counts;
    /**
     * Status of instances allocated for the TaskGroup.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2;</code>
     */
    private $instances;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $counts
     *           Count of task in each state in the TaskGroup.
     *           The map key is task state name.
     *     @type array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $instances
     *           Status of instances allocated for the TaskGroup.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * Count of task in each state in the TaskGroup.
     * The map key is task state name.
     *
     * Generated from protobuf field <code>map<string, int64> counts = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getCounts()
    {
        return $this->counts;
    }

    /**
     * Count of task in each state in the TaskGroup.
     * The map key is task state name.
     *
     * Generated from protobuf field <code>map<string, int64> counts = 1;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setCounts($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT64);
        $this->counts = $arr;

        return $this;
    }

    /**
     * Status of instances allocated for the TaskGroup.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getInstances()
    {
        return $this->instances;
    }

    /**
     * Status of instances allocated for the TaskGroup.
     *
     * Generated from protobuf field <code>repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2;</code>
     * @param array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setInstances($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\InstanceStatus::class);
        $this->instances = $arr;

        return $this;
    }

}


