diff --git a/src/php/tests/generated_code/GPBMetadata/Math.php b/src/php/tests/generated_code/GPBMetadata/Math.php index c96131a02e6..10f043607ac 100644 Binary files a/src/php/tests/generated_code/GPBMetadata/Math.php and b/src/php/tests/generated_code/GPBMetadata/Math.php differ diff --git a/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Messages.php b/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Messages.php index 6ba468ef541..b0302806f77 100644 Binary files a/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Messages.php and b/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Messages.php differ diff --git a/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/PBEmpty.php b/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/PBEmpty.php index 542c18b23e5..f103e2e3ed2 100644 --- a/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/PBEmpty.php +++ b/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/PBEmpty.php @@ -14,12 +14,9 @@ class PBEmpty if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile( - ' -J -"src/proto/grpc/testing/empty.proto grpc.testing" - EmptyMessagebproto3' - , true); + $pool->internalAddGeneratedFile(hex2bin( + "0a4a0a227372632f70726f746f2f677270632f74657374696e672f656d7074792e70726f746f120c677270632e74657374696e67220e0a0c456d7074794d657373616765620670726f746f33" + ), true); static::$is_initialized = true; } diff --git a/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Test.php b/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Test.php index 00b82e5f664..f8a22f6ea54 100644 Binary files a/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Test.php and b/src/php/tests/interop/GPBMetadata/Src/Proto/Grpc/Testing/Test.php differ diff --git a/src/php/tests/interop/Grpc/Testing/ClientConfigureRequest.php b/src/php/tests/interop/Grpc/Testing/ClientConfigureRequest.php index bb2b1cadb4d..f3c8ecf5f80 100644 --- a/src/php/tests/interop/Grpc/Testing/ClientConfigureRequest.php +++ b/src/php/tests/interop/Grpc/Testing/ClientConfigureRequest.php @@ -27,6 +27,13 @@ class ClientConfigureRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .grpc.testing.ClientConfigureRequest.Metadata metadata = 2; */ private $metadata; + /** + * The deadline to use, in seconds, for all RPCs. If unset or zero, the + * client will use the default from the command-line. + * + * Generated from protobuf field int32 timeout_sec = 3; + */ + protected $timeout_sec = 0; /** * Constructor. @@ -38,6 +45,9 @@ class ClientConfigureRequest extends \Google\Protobuf\Internal\Message * The types of RPCs the client sends. * @type \Grpc\Testing\ClientConfigureRequest\Metadata[]|\Google\Protobuf\Internal\RepeatedField $metadata * The collection of custom metadata to be attached to RPCs sent by the client. + * @type int $timeout_sec + * The deadline to use, in seconds, for all RPCs. If unset or zero, the + * client will use the default from the command-line. * } */ public function __construct($data = NULL) { @@ -97,5 +107,33 @@ class ClientConfigureRequest extends \Google\Protobuf\Internal\Message return $this; } + /** + * The deadline to use, in seconds, for all RPCs. If unset or zero, the + * client will use the default from the command-line. + * + * Generated from protobuf field int32 timeout_sec = 3; + * @return int + */ + public function getTimeoutSec() + { + return $this->timeout_sec; + } + + /** + * The deadline to use, in seconds, for all RPCs. If unset or zero, the + * client will use the default from the command-line. + * + * Generated from protobuf field int32 timeout_sec = 3; + * @param int $var + * @return $this + */ + public function setTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->timeout_sec = $var; + + return $this; + } + } diff --git a/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse.php b/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse.php index ddd2c4323ac..0ec3f82ec0e 100644 --- a/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse.php +++ b/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse.php @@ -17,22 +17,32 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes { /** * The total number of RPCs have ever issued for each type. + * Deprecated: use stats_per_method.rpcs_started instead. * - * Generated from protobuf field map num_rpcs_started_by_method = 1; + * Generated from protobuf field map num_rpcs_started_by_method = 1 [deprecated = true]; */ private $num_rpcs_started_by_method; /** * The total number of RPCs have ever completed successfully for each type. + * Deprecated: use stats_per_method.result instead. * - * Generated from protobuf field map num_rpcs_succeeded_by_method = 2; + * Generated from protobuf field map num_rpcs_succeeded_by_method = 2 [deprecated = true]; */ private $num_rpcs_succeeded_by_method; /** * The total number of RPCs have ever failed for each type. + * Deprecated: use stats_per_method.result instead. * - * Generated from protobuf field map num_rpcs_failed_by_method = 3; + * Generated from protobuf field map num_rpcs_failed_by_method = 3 [deprecated = true]; */ private $num_rpcs_failed_by_method; + /** + * Per-method RPC statistics. The key is the full method path; i.e. + * "/proto.package.ServiceName/MethodName". + * + * Generated from protobuf field map stats_per_method = 4; + */ + private $stats_per_method; /** * Constructor. @@ -42,10 +52,16 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes * * @type array|\Google\Protobuf\Internal\MapField $num_rpcs_started_by_method * The total number of RPCs have ever issued for each type. + * Deprecated: use stats_per_method.rpcs_started instead. * @type array|\Google\Protobuf\Internal\MapField $num_rpcs_succeeded_by_method * The total number of RPCs have ever completed successfully for each type. + * Deprecated: use stats_per_method.result instead. * @type array|\Google\Protobuf\Internal\MapField $num_rpcs_failed_by_method * The total number of RPCs have ever failed for each type. + * Deprecated: use stats_per_method.result instead. + * @type array|\Google\Protobuf\Internal\MapField $stats_per_method + * Per-method RPC statistics. The key is the full method path; i.e. + * "/proto.package.ServiceName/MethodName". * } */ public function __construct($data = NULL) { @@ -55,8 +71,9 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes /** * The total number of RPCs have ever issued for each type. + * Deprecated: use stats_per_method.rpcs_started instead. * - * Generated from protobuf field map num_rpcs_started_by_method = 1; + * Generated from protobuf field map num_rpcs_started_by_method = 1 [deprecated = true]; * @return \Google\Protobuf\Internal\MapField */ public function getNumRpcsStartedByMethod() @@ -66,8 +83,9 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes /** * The total number of RPCs have ever issued for each type. + * Deprecated: use stats_per_method.rpcs_started instead. * - * Generated from protobuf field map num_rpcs_started_by_method = 1; + * Generated from protobuf field map num_rpcs_started_by_method = 1 [deprecated = true]; * @param array|\Google\Protobuf\Internal\MapField $var * @return $this */ @@ -81,8 +99,9 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes /** * The total number of RPCs have ever completed successfully for each type. + * Deprecated: use stats_per_method.result instead. * - * Generated from protobuf field map num_rpcs_succeeded_by_method = 2; + * Generated from protobuf field map num_rpcs_succeeded_by_method = 2 [deprecated = true]; * @return \Google\Protobuf\Internal\MapField */ public function getNumRpcsSucceededByMethod() @@ -92,8 +111,9 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes /** * The total number of RPCs have ever completed successfully for each type. + * Deprecated: use stats_per_method.result instead. * - * Generated from protobuf field map num_rpcs_succeeded_by_method = 2; + * Generated from protobuf field map num_rpcs_succeeded_by_method = 2 [deprecated = true]; * @param array|\Google\Protobuf\Internal\MapField $var * @return $this */ @@ -107,8 +127,9 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes /** * The total number of RPCs have ever failed for each type. + * Deprecated: use stats_per_method.result instead. * - * Generated from protobuf field map num_rpcs_failed_by_method = 3; + * Generated from protobuf field map num_rpcs_failed_by_method = 3 [deprecated = true]; * @return \Google\Protobuf\Internal\MapField */ public function getNumRpcsFailedByMethod() @@ -118,8 +139,9 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes /** * The total number of RPCs have ever failed for each type. + * Deprecated: use stats_per_method.result instead. * - * Generated from protobuf field map num_rpcs_failed_by_method = 3; + * Generated from protobuf field map num_rpcs_failed_by_method = 3 [deprecated = true]; * @param array|\Google\Protobuf\Internal\MapField $var * @return $this */ @@ -131,5 +153,33 @@ class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Mes return $this; } + /** + * Per-method RPC statistics. The key is the full method path; i.e. + * "/proto.package.ServiceName/MethodName". + * + * Generated from protobuf field map stats_per_method = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getStatsPerMethod() + { + return $this->stats_per_method; + } + + /** + * Per-method RPC statistics. The key is the full method path; i.e. + * "/proto.package.ServiceName/MethodName". + * + * Generated from protobuf field map stats_per_method = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setStatsPerMethod($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\LoadBalancerAccumulatedStatsResponse\MethodStats::class); + $this->stats_per_method = $arr; + + return $this; + } + } diff --git a/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse/MethodStats.php b/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse/MethodStats.php new file mode 100644 index 00000000000..aaf42f40bfc --- /dev/null +++ b/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse/MethodStats.php @@ -0,0 +1,106 @@ +grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats + */ +class MethodStats extends \Google\Protobuf\Internal\Message +{ + /** + * The number of RPCs that were started for this method. + * + * Generated from protobuf field int32 rpcs_started = 1; + */ + 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 map result = 2; + */ + 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 int32 rpcs_started = 1; + * @return int + */ + public function getRpcsStarted() + { + return $this->rpcs_started; + } + + /** + * The number of RPCs that were started for this method. + * + * Generated from protobuf field int32 rpcs_started = 1; + * @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 map result = 2; + * @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 map result = 2; + * @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); + diff --git a/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse_MethodStats.php b/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse_MethodStats.php new file mode 100644 index 00000000000..6fe02460c70 --- /dev/null +++ b/src/php/tests/interop/Grpc/Testing/LoadBalancerAccumulatedStatsResponse_MethodStats.php @@ -0,0 +1,16 @@ +