mirror of https://github.com/grpc/grpc.git
Merge pull request #24880 from stanley-cheung/php-regenerate-protos
Re-generate protos for PHPpull/24883/head
commit
b1737f23b9
12 changed files with 574 additions and 2 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,101 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Configurations for a test client. |
||||
* |
||||
* Generated from protobuf message <code>grpc.testing.ClientConfigureRequest</code> |
||||
*/ |
||||
class ClientConfigureRequest extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* The types of RPCs the client sends. |
||||
* |
||||
* Generated from protobuf field <code>repeated .grpc.testing.ClientConfigureRequest.RpcType types = 1;</code> |
||||
*/ |
||||
private $types; |
||||
/** |
||||
* The collection of custom metadata to be attached to RPCs sent by the client. |
||||
* |
||||
* Generated from protobuf field <code>repeated .grpc.testing.ClientConfigureRequest.Metadata metadata = 2;</code> |
||||
*/ |
||||
private $metadata; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int[]|\Google\Protobuf\Internal\RepeatedField $types |
||||
* 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. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* The types of RPCs the client sends. |
||||
* |
||||
* Generated from protobuf field <code>repeated .grpc.testing.ClientConfigureRequest.RpcType types = 1;</code> |
||||
* @return \Google\Protobuf\Internal\RepeatedField |
||||
*/ |
||||
public function getTypes() |
||||
{ |
||||
return $this->types; |
||||
} |
||||
|
||||
/** |
||||
* The types of RPCs the client sends. |
||||
* |
||||
* Generated from protobuf field <code>repeated .grpc.testing.ClientConfigureRequest.RpcType types = 1;</code> |
||||
* @param int[]|\Google\Protobuf\Internal\RepeatedField $var |
||||
* @return $this |
||||
*/ |
||||
public function setTypes($var) |
||||
{ |
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Grpc\Testing\ClientConfigureRequest\RpcType::class); |
||||
$this->types = $arr; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The collection of custom metadata to be attached to RPCs sent by the client. |
||||
* |
||||
* Generated from protobuf field <code>repeated .grpc.testing.ClientConfigureRequest.Metadata metadata = 2;</code> |
||||
* @return \Google\Protobuf\Internal\RepeatedField |
||||
*/ |
||||
public function getMetadata() |
||||
{ |
||||
return $this->metadata; |
||||
} |
||||
|
||||
/** |
||||
* The collection of custom metadata to be attached to RPCs sent by the client. |
||||
* |
||||
* Generated from protobuf field <code>repeated .grpc.testing.ClientConfigureRequest.Metadata metadata = 2;</code> |
||||
* @param \Grpc\Testing\ClientConfigureRequest\Metadata[]|\Google\Protobuf\Internal\RepeatedField $var |
||||
* @return $this |
||||
*/ |
||||
public function setMetadata($var) |
||||
{ |
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\ClientConfigureRequest\Metadata::class); |
||||
$this->metadata = $arr; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,117 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing\ClientConfigureRequest; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Metadata to be attached for the given type of RPCs. |
||||
* |
||||
* Generated from protobuf message <code>grpc.testing.ClientConfigureRequest.Metadata</code> |
||||
*/ |
||||
class Metadata extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* Generated from protobuf field <code>.grpc.testing.ClientConfigureRequest.RpcType type = 1;</code> |
||||
*/ |
||||
protected $type = 0; |
||||
/** |
||||
* Generated from protobuf field <code>string key = 2;</code> |
||||
*/ |
||||
protected $key = ''; |
||||
/** |
||||
* Generated from protobuf field <code>string value = 3;</code> |
||||
*/ |
||||
protected $value = ''; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int $type |
||||
* @type string $key |
||||
* @type string $value |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>.grpc.testing.ClientConfigureRequest.RpcType type = 1;</code> |
||||
* @return int |
||||
*/ |
||||
public function getType() |
||||
{ |
||||
return $this->type; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>.grpc.testing.ClientConfigureRequest.RpcType type = 1;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setType($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Grpc\Testing\ClientConfigureRequest\RpcType::class); |
||||
$this->type = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>string key = 2;</code> |
||||
* @return string |
||||
*/ |
||||
public function getKey() |
||||
{ |
||||
return $this->key; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>string key = 2;</code> |
||||
* @param string $var |
||||
* @return $this |
||||
*/ |
||||
public function setKey($var) |
||||
{ |
||||
GPBUtil::checkString($var, True); |
||||
$this->key = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>string value = 3;</code> |
||||
* @return string |
||||
*/ |
||||
public function getValue() |
||||
{ |
||||
return $this->value; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>string value = 3;</code> |
||||
* @param string $var |
||||
* @return $this |
||||
*/ |
||||
public function setValue($var) |
||||
{ |
||||
GPBUtil::checkString($var, True); |
||||
$this->value = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
||||
// Adding a class alias for backwards compatibility with the previous class name. |
||||
class_alias(Metadata::class, \Grpc\Testing\ClientConfigureRequest_Metadata::class); |
||||
|
@ -0,0 +1,53 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing\ClientConfigureRequest; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Type of RPCs to send. |
||||
* |
||||
* Protobuf type <code>grpc.testing.ClientConfigureRequest.RpcType</code> |
||||
*/ |
||||
class RpcType |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>EMPTY_CALL = 0;</code> |
||||
*/ |
||||
const EMPTY_CALL = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>UNARY_CALL = 1;</code> |
||||
*/ |
||||
const UNARY_CALL = 1; |
||||
|
||||
private static $valueToName = [ |
||||
self::EMPTY_CALL => 'EMPTY_CALL', |
||||
self::UNARY_CALL => 'UNARY_CALL', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
||||
// Adding a class alias for backwards compatibility with the previous class name. |
||||
class_alias(RpcType::class, \Grpc\Testing\ClientConfigureRequest_RpcType::class); |
||||
|
@ -0,0 +1,16 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing; |
||||
|
||||
if (false) { |
||||
/** |
||||
* This class is deprecated. Use Grpc\Testing\ClientConfigureRequest\Metadata instead. |
||||
* @deprecated |
||||
*/ |
||||
class ClientConfigureRequest_Metadata {} |
||||
} |
||||
class_exists(ClientConfigureRequest\Metadata::class); |
||||
@trigger_error('Grpc\Testing\ClientConfigureRequest_Metadata is deprecated and will be removed in the next major release. Use Grpc\Testing\ClientConfigureRequest\Metadata instead', E_USER_DEPRECATED); |
||||
|
@ -0,0 +1,16 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing; |
||||
|
||||
if (false) { |
||||
/** |
||||
* This class is deprecated. Use Grpc\Testing\ClientConfigureRequest\RpcType instead. |
||||
* @deprecated |
||||
*/ |
||||
class ClientConfigureRequest_RpcType {} |
||||
} |
||||
class_exists(ClientConfigureRequest\RpcType::class); |
||||
@trigger_error('Grpc\Testing\ClientConfigureRequest_RpcType is deprecated and will be removed in the next major release. Use Grpc\Testing\ClientConfigureRequest\RpcType instead', E_USER_DEPRECATED); |
||||
|
@ -0,0 +1,33 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Response for updating a test client's configuration. |
||||
* |
||||
* Generated from protobuf message <code>grpc.testing.ClientConfigureResponse</code> |
||||
*/ |
||||
class ClientConfigureResponse extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,33 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Request for retrieving a test client's accumulated stats. |
||||
* |
||||
* Generated from protobuf message <code>grpc.testing.LoadBalancerAccumulatedStatsRequest</code> |
||||
*/ |
||||
class LoadBalancerAccumulatedStatsRequest extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,135 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: src/proto/grpc/testing/messages.proto |
||||
|
||||
namespace Grpc\Testing; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Accumulated stats for RPCs sent by a test client. |
||||
* |
||||
* Generated from protobuf message <code>grpc.testing.LoadBalancerAccumulatedStatsResponse</code> |
||||
*/ |
||||
class LoadBalancerAccumulatedStatsResponse extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* The total number of RPCs have ever issued for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_started_by_method = 1;</code> |
||||
*/ |
||||
private $num_rpcs_started_by_method; |
||||
/** |
||||
* The total number of RPCs have ever completed successfully for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_succeeded_by_method = 2;</code> |
||||
*/ |
||||
private $num_rpcs_succeeded_by_method; |
||||
/** |
||||
* The total number of RPCs have ever failed for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_failed_by_method = 3;</code> |
||||
*/ |
||||
private $num_rpcs_failed_by_method; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type array|\Google\Protobuf\Internal\MapField $num_rpcs_started_by_method |
||||
* The total number of RPCs have ever issued for each type. |
||||
* @type array|\Google\Protobuf\Internal\MapField $num_rpcs_succeeded_by_method |
||||
* The total number of RPCs have ever completed successfully for each type. |
||||
* @type array|\Google\Protobuf\Internal\MapField $num_rpcs_failed_by_method |
||||
* The total number of RPCs have ever failed for each type. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* The total number of RPCs have ever issued for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_started_by_method = 1;</code> |
||||
* @return \Google\Protobuf\Internal\MapField |
||||
*/ |
||||
public function getNumRpcsStartedByMethod() |
||||
{ |
||||
return $this->num_rpcs_started_by_method; |
||||
} |
||||
|
||||
/** |
||||
* The total number of RPCs have ever issued for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_started_by_method = 1;</code> |
||||
* @param array|\Google\Protobuf\Internal\MapField $var |
||||
* @return $this |
||||
*/ |
||||
public function setNumRpcsStartedByMethod($var) |
||||
{ |
||||
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT32); |
||||
$this->num_rpcs_started_by_method = $arr; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The total number of RPCs have ever completed successfully for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_succeeded_by_method = 2;</code> |
||||
* @return \Google\Protobuf\Internal\MapField |
||||
*/ |
||||
public function getNumRpcsSucceededByMethod() |
||||
{ |
||||
return $this->num_rpcs_succeeded_by_method; |
||||
} |
||||
|
||||
/** |
||||
* The total number of RPCs have ever completed successfully for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_succeeded_by_method = 2;</code> |
||||
* @param array|\Google\Protobuf\Internal\MapField $var |
||||
* @return $this |
||||
*/ |
||||
public function setNumRpcsSucceededByMethod($var) |
||||
{ |
||||
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT32); |
||||
$this->num_rpcs_succeeded_by_method = $arr; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The total number of RPCs have ever failed for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_failed_by_method = 3;</code> |
||||
* @return \Google\Protobuf\Internal\MapField |
||||
*/ |
||||
public function getNumRpcsFailedByMethod() |
||||
{ |
||||
return $this->num_rpcs_failed_by_method; |
||||
} |
||||
|
||||
/** |
||||
* The total number of RPCs have ever failed for each type. |
||||
* |
||||
* Generated from protobuf field <code>map<string, int32> num_rpcs_failed_by_method = 3;</code> |
||||
* @param array|\Google\Protobuf\Internal\MapField $var |
||||
* @return $this |
||||
*/ |
||||
public function setNumRpcsFailedByMethod($var) |
||||
{ |
||||
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT32); |
||||
$this->num_rpcs_failed_by_method = $arr; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,53 @@ |
||||
<?php |
||||
// GENERATED CODE -- DO NOT EDIT! |
||||
|
||||
// Original file comments: |
||||
// Copyright 2015-2016 gRPC authors. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
// |
||||
// An integration test service that covers all the method signature permutations |
||||
// of unary/streaming requests/responses. |
||||
// |
||||
namespace Grpc\Testing; |
||||
|
||||
/** |
||||
* A service to dynamically update the configuration of an xDS test client. |
||||
*/ |
||||
class XdsUpdateClientConfigureServiceClient extends \Grpc\BaseStub { |
||||
|
||||
/** |
||||
* @param string $hostname hostname |
||||
* @param array $opts channel options |
||||
* @param \Grpc\Channel $channel (optional) re-use channel object |
||||
*/ |
||||
public function __construct($hostname, $opts, $channel = null) { |
||||
parent::__construct($hostname, $opts, $channel); |
||||
} |
||||
|
||||
/** |
||||
* Update the tes client's configuration. |
||||
* @param \Grpc\Testing\ClientConfigureRequest $argument input argument |
||||
* @param array $metadata metadata |
||||
* @param array $options call options |
||||
* @return \Grpc\UnaryCall |
||||
*/ |
||||
public function Configure(\Grpc\Testing\ClientConfigureRequest $argument, |
||||
$metadata = [], $options = []) { |
||||
return $this->_simpleRequest('/grpc.testing.XdsUpdateClientConfigureService/Configure', |
||||
$argument, |
||||
['\Grpc\Testing\ClientConfigureResponse', 'decode'], |
||||
$metadata, $options); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue