<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/testing/messages.proto

namespace Grpc\Testing\LoadBalancerAccumulatedStatsResponse;

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

/**
 * Generated from protobuf message <code>grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats</code>
 */
class MethodStats extends \Google\Protobuf\Internal\Message
{
    /**
     * The number of RPCs that were started for this method.
     *
     * Generated from protobuf field <code>int32 rpcs_started = 1;</code>
     */
    protected $rpcs_started = 0;
    /**
     * The number of RPCs that completed with each status for this method.  The
     * key is the integral value of a google.rpc.Code; the value is the count.
     *
     * Generated from protobuf field <code>map<int32, int32> result = 2;</code>
     */
    private $result;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $rpcs_started
     *           The number of RPCs that were started for this method.
     *     @type array|\Google\Protobuf\Internal\MapField $result
     *           The number of RPCs that completed with each status for this method.  The
     *           key is the integral value of a google.rpc.Code; the value is the count.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
        parent::__construct($data);
    }

    /**
     * The number of RPCs that were started for this method.
     *
     * Generated from protobuf field <code>int32 rpcs_started = 1;</code>
     * @return int
     */
    public function getRpcsStarted()
    {
        return $this->rpcs_started;
    }

    /**
     * The number of RPCs that were started for this method.
     *
     * Generated from protobuf field <code>int32 rpcs_started = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setRpcsStarted($var)
    {
        GPBUtil::checkInt32($var);
        $this->rpcs_started = $var;

        return $this;
    }

    /**
     * The number of RPCs that completed with each status for this method.  The
     * key is the integral value of a google.rpc.Code; the value is the count.
     *
     * Generated from protobuf field <code>map<int32, int32> result = 2;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * The number of RPCs that completed with each status for this method.  The
     * key is the integral value of a google.rpc.Code; the value is the count.
     *
     * Generated from protobuf field <code>map<int32, int32> result = 2;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setResult($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::INT32);
        $this->result = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(MethodStats::class, \Grpc\Testing\LoadBalancerAccumulatedStatsResponse_MethodStats::class);

