The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

790 lines
16 KiB

10 years ago
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
// Source: route_guide.proto
// Date: 2015-09-24 21:21:51
10 years ago
namespace routeguide {
10 years ago
class Point extends \DrSlump\Protobuf\Message
{
/** @var int */
10 years ago
public $latitude = 0;
10 years ago
/** @var int */
public $longitude = 0;
/** @var \Closure[] */
protected static $__extensions = array();
public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Point');
10 years ago
// OPTIONAL INT32 latitude = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = 'latitude';
$f->type = \DrSlump\Protobuf::TYPE_INT32;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = 0;
$descriptor->addField($f);
10 years ago
// OPTIONAL INT32 longitude = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = 'longitude';
$f->type = \DrSlump\Protobuf::TYPE_INT32;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = 0;
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}
return $descriptor;
10 years ago
}
/**
* Check if <latitude> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasLatitude()
{
return $this->_has(1);
10 years ago
}
10 years ago
/**
* Clear <latitude> value.
10 years ago
*
* @return \routeguide\Point
10 years ago
*/
public function clearLatitude()
{
return $this->_clear(1);
10 years ago
}
10 years ago
/**
* Get <latitude> value.
10 years ago
*
* @return int
*/
public function getLatitude()
{
return $this->_get(1);
10 years ago
}
10 years ago
/**
* Set <latitude> value.
10 years ago
*
* @param int $value
*
* @return \routeguide\Point
10 years ago
*/
public function setLatitude($value)
{
return $this->_set(1, $value);
10 years ago
}
10 years ago
/**
* Check if <longitude> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasLongitude()
{
return $this->_has(2);
10 years ago
}
10 years ago
/**
* Clear <longitude> value.
10 years ago
*
* @return \routeguide\Point
10 years ago
*/
public function clearLongitude()
{
return $this->_clear(2);
10 years ago
}
10 years ago
/**
* Get <longitude> value.
10 years ago
*
* @return int
*/
public function getLongitude()
{
return $this->_get(2);
10 years ago
}
10 years ago
/**
* Set <longitude> value.
10 years ago
*
* @param int $value
*
* @return \routeguide\Point
10 years ago
*/
public function setLongitude($value)
{
return $this->_set(2, $value);
10 years ago
}
}
}
namespace routeguide {
10 years ago
class Rectangle extends \DrSlump\Protobuf\Message
{
/** @var \routeguide\Point */
10 years ago
public $lo = null;
/** @var \routeguide\Point */
10 years ago
public $hi = null;
/** @var \Closure[] */
protected static $__extensions = array();
public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Rectangle');
10 years ago
// OPTIONAL MESSAGE lo = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = 'lo';
$f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\routeguide\Point';
$descriptor->addField($f);
10 years ago
// OPTIONAL MESSAGE hi = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = 'hi';
$f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\routeguide\Point';
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}
return $descriptor;
10 years ago
}
/**
* Check if <lo> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasLo()
{
return $this->_has(1);
10 years ago
}
10 years ago
/**
* Clear <lo> value.
10 years ago
*
* @return \routeguide\Rectangle
10 years ago
*/
public function clearLo()
{
return $this->_clear(1);
10 years ago
}
10 years ago
/**
* Get <lo> value.
10 years ago
*
* @return \routeguide\Point
10 years ago
*/
public function getLo()
{
return $this->_get(1);
10 years ago
}
10 years ago
/**
* Set <lo> value.
10 years ago
*
* @param \routeguide\Point $value
*
* @return \routeguide\Rectangle
10 years ago
*/
public function setLo(\routeguide\Point $value)
{
return $this->_set(1, $value);
10 years ago
}
10 years ago
/**
* Check if <hi> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasHi()
{
return $this->_has(2);
10 years ago
}
10 years ago
/**
* Clear <hi> value.
10 years ago
*
* @return \routeguide\Rectangle
10 years ago
*/
public function clearHi()
{
return $this->_clear(2);
10 years ago
}
10 years ago
/**
* Get <hi> value.
10 years ago
*
* @return \routeguide\Point
10 years ago
*/
public function getHi()
{
return $this->_get(2);
10 years ago
}
10 years ago
/**
* Set <hi> value.
10 years ago
*
* @param \routeguide\Point $value
*
* @return \routeguide\Rectangle
10 years ago
*/
public function setHi(\routeguide\Point $value)
{
return $this->_set(2, $value);
10 years ago
}
}
}
namespace routeguide {
10 years ago
class Feature extends \DrSlump\Protobuf\Message
{
/** @var string */
10 years ago
public $name = null;
/** @var \routeguide\Point */
10 years ago
public $location = null;
/** @var \Closure[] */
protected static $__extensions = array();
public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Feature');
10 years ago
// OPTIONAL STRING name = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = 'name';
$f->type = \DrSlump\Protobuf::TYPE_STRING;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
10 years ago
// OPTIONAL MESSAGE location = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = 'location';
$f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\routeguide\Point';
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}
return $descriptor;
10 years ago
}
/**
* Check if <name> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasName()
{
return $this->_has(1);
10 years ago
}
10 years ago
/**
* Clear <name> value.
10 years ago
*
* @return \routeguide\Feature
10 years ago
*/
public function clearName()
{
return $this->_clear(1);
10 years ago
}
10 years ago
/**
* Get <name> value.
10 years ago
*
* @return string
*/
public function getName()
{
return $this->_get(1);
10 years ago
}
10 years ago
/**
* Set <name> value.
10 years ago
*
* @param string $value
*
* @return \routeguide\Feature
10 years ago
*/
public function setName($value)
{
return $this->_set(1, $value);
10 years ago
}
10 years ago
/**
* Check if <location> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasLocation()
{
return $this->_has(2);
10 years ago
}
10 years ago
/**
* Clear <location> value.
10 years ago
*
* @return \routeguide\Feature
10 years ago
*/
public function clearLocation()
{
return $this->_clear(2);
10 years ago
}
10 years ago
/**
* Get <location> value.
10 years ago
*
* @return \routeguide\Point
10 years ago
*/
public function getLocation()
{
return $this->_get(2);
10 years ago
}
10 years ago
/**
* Set <location> value.
10 years ago
*
* @param \routeguide\Point $value
*
* @return \routeguide\Feature
10 years ago
*/
public function setLocation(\routeguide\Point $value)
{
return $this->_set(2, $value);
10 years ago
}
}
}
namespace routeguide {
10 years ago
class RouteNote extends \DrSlump\Protobuf\Message
{
/** @var \routeguide\Point */
10 years ago
public $location = null;
10 years ago
/** @var string */
public $message = null;
/** @var \Closure[] */
protected static $__extensions = array();
public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.RouteNote');
10 years ago
// OPTIONAL MESSAGE location = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = 'location';
$f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\routeguide\Point';
$descriptor->addField($f);
10 years ago
// OPTIONAL STRING message = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = 'message';
$f->type = \DrSlump\Protobuf::TYPE_STRING;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
10 years ago
foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}
return $descriptor;
}
10 years ago
/**
* Check if <location> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasLocation()
{
return $this->_has(1);
10 years ago
}
10 years ago
/**
* Clear <location> value.
10 years ago
*
* @return \routeguide\RouteNote
10 years ago
*/
public function clearLocation()
{
return $this->_clear(1);
10 years ago
}
10 years ago
/**
* Get <location> value.
10 years ago
*
* @return \routeguide\Point
10 years ago
*/
public function getLocation()
{
return $this->_get(1);
10 years ago
}
10 years ago
/**
* Set <location> value.
10 years ago
*
* @param \routeguide\Point $value
*
* @return \routeguide\RouteNote
10 years ago
*/
public function setLocation(\routeguide\Point $value)
{
return $this->_set(1, $value);
10 years ago
}
10 years ago
/**
* Check if <message> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasMessage()
{
return $this->_has(2);
10 years ago
}
10 years ago
/**
* Clear <message> value.
10 years ago
*
* @return \routeguide\RouteNote
10 years ago
*/
public function clearMessage()
{
return $this->_clear(2);
10 years ago
}
10 years ago
/**
* Get <message> value.
10 years ago
*
* @return string
*/
public function getMessage()
{
return $this->_get(2);
10 years ago
}
10 years ago
/**
* Set <message> value.
10 years ago
*
* @param string $value
*
* @return \routeguide\RouteNote
10 years ago
*/
public function setMessage($value)
{
return $this->_set(2, $value);
10 years ago
}
}
}
namespace routeguide {
10 years ago
class RouteSummary extends \DrSlump\Protobuf\Message
{
/** @var int */
10 years ago
public $point_count = 0;
10 years ago
/** @var int */
public $feature_count = 0;
10 years ago
/** @var int */
public $distance = 0;
10 years ago
/** @var int */
public $elapsed_time = 0;
/** @var \Closure[] */
protected static $__extensions = array();
public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.RouteSummary');
10 years ago
// OPTIONAL INT32 point_count = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = 'point_count';
$f->type = \DrSlump\Protobuf::TYPE_INT32;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = 0;
$descriptor->addField($f);
10 years ago
// OPTIONAL INT32 feature_count = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = 'feature_count';
$f->type = \DrSlump\Protobuf::TYPE_INT32;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = 0;
$descriptor->addField($f);
10 years ago
// OPTIONAL INT32 distance = 3
$f = new \DrSlump\Protobuf\Field();
$f->number = 3;
$f->name = 'distance';
$f->type = \DrSlump\Protobuf::TYPE_INT32;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = 0;
$descriptor->addField($f);
10 years ago
// OPTIONAL INT32 elapsed_time = 4
$f = new \DrSlump\Protobuf\Field();
$f->number = 4;
$f->name = 'elapsed_time';
$f->type = \DrSlump\Protobuf::TYPE_INT32;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = 0;
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}
return $descriptor;
10 years ago
}
/**
* Check if <point_count> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasPointCount()
{
return $this->_has(1);
10 years ago
}
10 years ago
/**
* Clear <point_count> value.
10 years ago
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function clearPointCount()
{
return $this->_clear(1);
10 years ago
}
10 years ago
/**
* Get <point_count> value.
10 years ago
*
* @return int
*/
public function getPointCount()
{
return $this->_get(1);
10 years ago
}
10 years ago
/**
* Set <point_count> value.
10 years ago
*
* @param int $value
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function setPointCount($value)
{
return $this->_set(1, $value);
10 years ago
}
10 years ago
/**
* Check if <feature_count> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasFeatureCount()
{
return $this->_has(2);
10 years ago
}
10 years ago
/**
* Clear <feature_count> value.
10 years ago
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function clearFeatureCount()
{
return $this->_clear(2);
10 years ago
}
10 years ago
/**
* Get <feature_count> value.
10 years ago
*
* @return int
*/
public function getFeatureCount()
{
return $this->_get(2);
10 years ago
}
10 years ago
/**
* Set <feature_count> value.
10 years ago
*
* @param int $value
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function setFeatureCount($value)
{
return $this->_set(2, $value);
10 years ago
}
10 years ago
/**
* Check if <distance> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasDistance()
{
return $this->_has(3);
10 years ago
}
10 years ago
/**
* Clear <distance> value.
10 years ago
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function clearDistance()
{
return $this->_clear(3);
10 years ago
}
10 years ago
/**
* Get <distance> value.
10 years ago
*
* @return int
*/
public function getDistance()
{
return $this->_get(3);
10 years ago
}
10 years ago
/**
* Set <distance> value.
10 years ago
*
* @param int $value
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function setDistance($value)
{
return $this->_set(3, $value);
10 years ago
}
10 years ago
/**
* Check if <elapsed_time> has a value.
10 years ago
*
* @return bool
10 years ago
*/
public function hasElapsedTime()
{
return $this->_has(4);
10 years ago
}
10 years ago
/**
* Clear <elapsed_time> value.
10 years ago
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function clearElapsedTime()
{
return $this->_clear(4);
10 years ago
}
10 years ago
/**
* Get <elapsed_time> value.
10 years ago
*
* @return int
*/
public function getElapsedTime()
{
return $this->_get(4);
10 years ago
}
10 years ago
/**
* Set <elapsed_time> value.
10 years ago
*
* @param int $value
*
* @return \routeguide\RouteSummary
10 years ago
*/
public function setElapsedTime($value)
{
return $this->_set(4, $value);
10 years ago
}
}
}
namespace routeguide {
10 years ago
class RouteGuideClient extends \Grpc\BaseStub
{
public function __construct($hostname, $opts)
{
parent::__construct($hostname, $opts);
}
10 years ago
/**
* @param routeguide\Point $input
10 years ago
*/
public function GetFeature(\routeguide\Point $argument, $metadata = array(), $options = array())
{
return $this->_simpleRequest('/routeguide.RouteGuide/GetFeature', $argument, '\routeguide\Feature::deserialize', $metadata, $options);
10 years ago
}
/**
* @param routeguide\Rectangle $input
10 years ago
*/
public function ListFeatures($argument, $metadata = array(), $options = array())
{
return $this->_serverStreamRequest('/routeguide.RouteGuide/ListFeatures', $argument, '\routeguide\Feature::deserialize', $metadata, $options);
10 years ago
}
/**
* @param routeguide\Point $input
10 years ago
*/
public function RecordRoute($metadata = array())
{
return $this->_clientStreamRequest('/routeguide.RouteGuide/RecordRoute', '\routeguide\RouteSummary::deserialize', $metadata);
10 years ago
}
/**
* @param routeguide\RouteNote $input
10 years ago
*/
public function RouteChat($metadata = array())
{
return $this->_bidiRequest('/routeguide.RouteGuide/RouteChat', '\routeguide\RouteNote::deserialize', $metadata);
10 years ago
}
}
}