xref: /aosp_15_r20/external/grpc-grpc/src/php/tests/interop/Grpc/Testing/LoadBalancerStatsResponse.php (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: src/proto/grpc/testing/messages.proto
4
5namespace Grpc\Testing;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\RepeatedField;
9use Google\Protobuf\Internal\GPBUtil;
10
11/**
12 * Generated from protobuf message <code>grpc.testing.LoadBalancerStatsResponse</code>
13 */
14class LoadBalancerStatsResponse extends \Google\Protobuf\Internal\Message
15{
16    /**
17     * The number of completed RPCs for each peer.
18     *
19     * Generated from protobuf field <code>map<string, int32> rpcs_by_peer = 1;</code>
20     */
21    private $rpcs_by_peer;
22    /**
23     * The number of RPCs that failed to record a remote peer.
24     *
25     * Generated from protobuf field <code>int32 num_failures = 2;</code>
26     */
27    protected $num_failures = 0;
28    /**
29     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.RpcsByPeer> rpcs_by_method = 3;</code>
30     */
31    private $rpcs_by_method;
32    /**
33     * All the metadata of all RPCs for each peer.
34     *
35     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.MetadataByPeer> metadatas_by_peer = 4;</code>
36     */
37    private $metadatas_by_peer;
38
39    /**
40     * Constructor.
41     *
42     * @param array $data {
43     *     Optional. Data for populating the Message object.
44     *
45     *     @type array|\Google\Protobuf\Internal\MapField $rpcs_by_peer
46     *           The number of completed RPCs for each peer.
47     *     @type int $num_failures
48     *           The number of RPCs that failed to record a remote peer.
49     *     @type array|\Google\Protobuf\Internal\MapField $rpcs_by_method
50     *     @type array|\Google\Protobuf\Internal\MapField $metadatas_by_peer
51     *           All the metadata of all RPCs for each peer.
52     * }
53     */
54    public function __construct($data = NULL) {
55        \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
56        parent::__construct($data);
57    }
58
59    /**
60     * The number of completed RPCs for each peer.
61     *
62     * Generated from protobuf field <code>map<string, int32> rpcs_by_peer = 1;</code>
63     * @return \Google\Protobuf\Internal\MapField
64     */
65    public function getRpcsByPeer()
66    {
67        return $this->rpcs_by_peer;
68    }
69
70    /**
71     * The number of completed RPCs for each peer.
72     *
73     * Generated from protobuf field <code>map<string, int32> rpcs_by_peer = 1;</code>
74     * @param array|\Google\Protobuf\Internal\MapField $var
75     * @return $this
76     */
77    public function setRpcsByPeer($var)
78    {
79        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT32);
80        $this->rpcs_by_peer = $arr;
81
82        return $this;
83    }
84
85    /**
86     * The number of RPCs that failed to record a remote peer.
87     *
88     * Generated from protobuf field <code>int32 num_failures = 2;</code>
89     * @return int
90     */
91    public function getNumFailures()
92    {
93        return $this->num_failures;
94    }
95
96    /**
97     * The number of RPCs that failed to record a remote peer.
98     *
99     * Generated from protobuf field <code>int32 num_failures = 2;</code>
100     * @param int $var
101     * @return $this
102     */
103    public function setNumFailures($var)
104    {
105        GPBUtil::checkInt32($var);
106        $this->num_failures = $var;
107
108        return $this;
109    }
110
111    /**
112     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.RpcsByPeer> rpcs_by_method = 3;</code>
113     * @return \Google\Protobuf\Internal\MapField
114     */
115    public function getRpcsByMethod()
116    {
117        return $this->rpcs_by_method;
118    }
119
120    /**
121     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.RpcsByPeer> rpcs_by_method = 3;</code>
122     * @param array|\Google\Protobuf\Internal\MapField $var
123     * @return $this
124     */
125    public function setRpcsByMethod($var)
126    {
127        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\LoadBalancerStatsResponse\RpcsByPeer::class);
128        $this->rpcs_by_method = $arr;
129
130        return $this;
131    }
132
133    /**
134     * All the metadata of all RPCs for each peer.
135     *
136     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.MetadataByPeer> metadatas_by_peer = 4;</code>
137     * @return \Google\Protobuf\Internal\MapField
138     */
139    public function getMetadatasByPeer()
140    {
141        return $this->metadatas_by_peer;
142    }
143
144    /**
145     * All the metadata of all RPCs for each peer.
146     *
147     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.MetadataByPeer> metadatas_by_peer = 4;</code>
148     * @param array|\Google\Protobuf\Internal\MapField $var
149     * @return $this
150     */
151    public function setMetadatasByPeer($var)
152    {
153        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\LoadBalancerStatsResponse\MetadataByPeer::class);
154        $this->metadatas_by_peer = $arr;
155
156        return $this;
157    }
158
159}
160
161