| 1 |
<?php |
| 2 |
// GENERATED CODE -- DO NOT EDIT! |
| 3 |
|
| 4 |
// Original file comments: |
| 5 |
// Copyright 2015 gRPC authors. |
| 6 |
// |
| 7 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 |
// you may not use this file except in compliance with the License. |
| 9 |
// You may obtain a copy of the License at |
| 10 |
// |
| 11 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
// |
| 13 |
// Unless required by applicable law or agreed to in writing, software |
| 14 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
// See the License for the specific language governing permissions and |
| 17 |
// limitations under the License. |
| 18 |
// |
| 19 |
namespace Routeguide; |
| 20 |
|
| 21 |
/** |
| 22 |
* Interface exported by the server. |
| 23 |
*/ |
| 24 |
class RouteGuideStub { |
| 25 |
|
| 26 |
/** |
| 27 |
* A simple RPC. |
| 28 |
* |
| 29 |
* Obtains the feature at a given position. |
| 30 |
* |
| 31 |
* A feature with an empty name is returned if there's no feature at the given |
| 32 |
* position. |
| 33 |
* @param \Routeguide\Point $request client request |
| 34 |
* @param \Grpc\ServerContext $context server request context |
| 35 |
* @return \Routeguide\Feature for response data, null if if error occured |
| 36 |
* initial metadata (if any) and status (if not ok) should be set to $context |
| 37 |
*/ |
| 38 |
public function GetFeature( |
| 39 |
\Routeguide\Point $request, |
| 40 |
\Grpc\ServerContext $context |
| 41 |
): ?\Routeguide\Feature { |
| 42 |
$context->setStatus(\Grpc\Status::unimplemented()); |
| 43 |
return null; |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* A server-to-client streaming RPC. |
| 48 |
* |
| 49 |
* Obtains the Features available within the given Rectangle. Results are |
| 50 |
* streamed rather than returned at once (e.g. in a response message with a |
| 51 |
* repeated field), as the rectangle may cover a large area and contain a |
| 52 |
* huge number of features. |
| 53 |
* @param \Routeguide\Rectangle $request client request |
| 54 |
* @param \Grpc\ServerCallWriter $writer write response data of \Routeguide\Feature |
| 55 |
* @param \Grpc\ServerContext $context server request context |
| 56 |
* @return void |
| 57 |
*/ |
| 58 |
public function ListFeatures( |
| 59 |
\Routeguide\Rectangle $request, |
| 60 |
\Grpc\ServerCallWriter $writer, |
| 61 |
\Grpc\ServerContext $context |
| 62 |
): void { |
| 63 |
$context->setStatus(\Grpc\Status::unimplemented()); |
| 64 |
$writer->finish(); |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* A client-to-server streaming RPC. |
| 69 |
* |
| 70 |
* Accepts a stream of Points on a route being traversed, returning a |
| 71 |
* RouteSummary when traversal is completed. |
| 72 |
* @param \Grpc\ServerCallReader $reader read client request data of \Routeguide\Point |
| 73 |
* @param \Grpc\ServerContext $context server request context |
| 74 |
* @return \Routeguide\RouteSummary for response data, null if if error occured |
| 75 |
* initial metadata (if any) and status (if not ok) should be set to $context |
| 76 |
*/ |
| 77 |
public function RecordRoute( |
| 78 |
\Grpc\ServerCallReader $reader, |
| 79 |
\Grpc\ServerContext $context |
| 80 |
): ?\Routeguide\RouteSummary { |
| 81 |
$context->setStatus(\Grpc\Status::unimplemented()); |
| 82 |
return null; |
| 83 |
} |
| 84 |
|
| 85 |
/** |
| 86 |
* A Bidirectional streaming RPC. |
| 87 |
* |
| 88 |
* Accepts a stream of RouteNotes sent while a route is being traversed, |
| 89 |
* while receiving other RouteNotes (e.g. from other users). |
| 90 |
* @param \Grpc\ServerCallReader $reader read client request data of \Routeguide\RouteNote |
| 91 |
* @param \Grpc\ServerCallWriter $writer write response data of \Routeguide\RouteNote |
| 92 |
* @param \Grpc\ServerContext $context server request context |
| 93 |
* @return void |
| 94 |
*/ |
| 95 |
public function RouteChat( |
| 96 |
\Grpc\ServerCallReader $reader, |
| 97 |
\Grpc\ServerCallWriter $writer, |
| 98 |
\Grpc\ServerContext $context |
| 99 |
): void { |
| 100 |
$context->setStatus(\Grpc\Status::unimplemented()); |
| 101 |
$writer->finish(); |
| 102 |
} |
| 103 |
|
| 104 |
/** |
| 105 |
* Get the method descriptors of the service for server registration |
| 106 |
* |
| 107 |
* @return array of \Grpc\MethodDescriptor for the service methods |
| 108 |
*/ |
| 109 |
public final function getMethodDescriptors(): array |
| 110 |
{ |
| 111 |
return [ |
| 112 |
'/routeguide.RouteGuide/GetFeature' => new \Grpc\MethodDescriptor( |
| 113 |
$this, |
| 114 |
'GetFeature', |
| 115 |
'\Routeguide\Point', |
| 116 |
\Grpc\MethodDescriptor::UNARY_CALL |
| 117 |
), |
| 118 |
'/routeguide.RouteGuide/ListFeatures' => new \Grpc\MethodDescriptor( |
| 119 |
$this, |
| 120 |
'ListFeatures', |
| 121 |
'\Routeguide\Rectangle', |
| 122 |
\Grpc\MethodDescriptor::SERVER_STREAMING_CALL |
| 123 |
), |
| 124 |
'/routeguide.RouteGuide/RecordRoute' => new \Grpc\MethodDescriptor( |
| 125 |
$this, |
| 126 |
'RecordRoute', |
| 127 |
'\Routeguide\Point', |
| 128 |
\Grpc\MethodDescriptor::CLIENT_STREAMING_CALL |
| 129 |
), |
| 130 |
'/routeguide.RouteGuide/RouteChat' => new \Grpc\MethodDescriptor( |
| 131 |
$this, |
| 132 |
'RouteChat', |
| 133 |
'\Routeguide\RouteNote', |
| 134 |
\Grpc\MethodDescriptor::BIDI_STREAMING_CALL |
| 135 |
), |
| 136 |
]; |
| 137 |
} |
| 138 |
|
| 139 |
} |