Home | History | Annotate | Download | only in Testing
      1 <?php
      2 // GENERATED CODE -- DO NOT EDIT!
      3 
      4 // Original file comments:
      5 // Copyright 2015-2016 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 // An integration test service that covers all the method signature permutations
     20 // of unary/streaming requests/responses.
     21 //
     22 namespace Grpc\Testing;
     23 
     24 /**
     25  * A simple service to test the various types of RPCs and experiment with
     26  * performance with various types of payload.
     27  */
     28 class TestServiceClient extends \Grpc\BaseStub {
     29 
     30     /**
     31      * @param string $hostname hostname
     32      * @param array $opts channel options
     33      * @param \Grpc\Channel $channel (optional) re-use channel object
     34      */
     35     public function __construct($hostname, $opts, $channel = null) {
     36         parent::__construct($hostname, $opts, $channel);
     37     }
     38 
     39     /**
     40      * One empty request followed by one empty response.
     41      * @param \Grpc\Testing\PBEmpty $argument input argument
     42      * @param array $metadata metadata
     43      * @param array $options call options
     44      */
     45     public function EmptyCall(\Grpc\Testing\PBEmpty $argument,
     46       $metadata = [], $options = []) {
     47         return $this->_simpleRequest('/grpc.testing.TestService/EmptyCall',
     48         $argument,
     49         ['\Grpc\Testing\PBEmpty', 'decode'],
     50         $metadata, $options);
     51     }
     52 
     53     /**
     54      * One request followed by one response.
     55      * @param \Grpc\Testing\SimpleRequest $argument input argument
     56      * @param array $metadata metadata
     57      * @param array $options call options
     58      */
     59     public function UnaryCall(\Grpc\Testing\SimpleRequest $argument,
     60       $metadata = [], $options = []) {
     61         return $this->_simpleRequest('/grpc.testing.TestService/UnaryCall',
     62         $argument,
     63         ['\Grpc\Testing\SimpleResponse', 'decode'],
     64         $metadata, $options);
     65     }
     66 
     67     /**
     68      * One request followed by one response. Response has cache control
     69      * headers set such that a caching HTTP proxy (such as GFE) can
     70      * satisfy subsequent requests.
     71      * @param \Grpc\Testing\SimpleRequest $argument input argument
     72      * @param array $metadata metadata
     73      * @param array $options call options
     74      */
     75     public function CacheableUnaryCall(\Grpc\Testing\SimpleRequest $argument,
     76       $metadata = [], $options = []) {
     77         return $this->_simpleRequest('/grpc.testing.TestService/CacheableUnaryCall',
     78         $argument,
     79         ['\Grpc\Testing\SimpleResponse', 'decode'],
     80         $metadata, $options);
     81     }
     82 
     83     /**
     84      * One request followed by a sequence of responses (streamed download).
     85      * The server returns the payload with client desired type and sizes.
     86      * @param \Grpc\Testing\StreamingOutputCallRequest $argument input argument
     87      * @param array $metadata metadata
     88      * @param array $options call options
     89      */
     90     public function StreamingOutputCall(\Grpc\Testing\StreamingOutputCallRequest $argument,
     91       $metadata = [], $options = []) {
     92         return $this->_serverStreamRequest('/grpc.testing.TestService/StreamingOutputCall',
     93         $argument,
     94         ['\Grpc\Testing\StreamingOutputCallResponse', 'decode'],
     95         $metadata, $options);
     96     }
     97 
     98     /**
     99      * A sequence of requests followed by one response (streamed upload).
    100      * The server returns the aggregated size of client payload as the result.
    101      * @param array $metadata metadata
    102      * @param array $options call options
    103      */
    104     public function StreamingInputCall($metadata = [], $options = []) {
    105         return $this->_clientStreamRequest('/grpc.testing.TestService/StreamingInputCall',
    106         ['\Grpc\Testing\StreamingInputCallResponse','decode'],
    107         $metadata, $options);
    108     }
    109 
    110     /**
    111      * A sequence of requests with each request served by the server immediately.
    112      * As one request could lead to multiple responses, this interface
    113      * demonstrates the idea of full duplexing.
    114      * @param array $metadata metadata
    115      * @param array $options call options
    116      */
    117     public function FullDuplexCall($metadata = [], $options = []) {
    118         return $this->_bidiRequest('/grpc.testing.TestService/FullDuplexCall',
    119         ['\Grpc\Testing\StreamingOutputCallResponse','decode'],
    120         $metadata, $options);
    121     }
    122 
    123     /**
    124      * A sequence of requests followed by a sequence of responses.
    125      * The server buffers all the client requests and then serves them in order. A
    126      * stream of responses are returned to the client when the server starts with
    127      * first request.
    128      * @param array $metadata metadata
    129      * @param array $options call options
    130      */
    131     public function HalfDuplexCall($metadata = [], $options = []) {
    132         return $this->_bidiRequest('/grpc.testing.TestService/HalfDuplexCall',
    133         ['\Grpc\Testing\StreamingOutputCallResponse','decode'],
    134         $metadata, $options);
    135     }
    136 
    137     /**
    138      * The test server will not implement this method. It will be used
    139      * to test the behavior when clients call unimplemented methods.
    140      * @param \Grpc\Testing\PBEmpty $argument input argument
    141      * @param array $metadata metadata
    142      * @param array $options call options
    143      */
    144     public function UnimplementedCall(\Grpc\Testing\PBEmpty $argument,
    145       $metadata = [], $options = []) {
    146         return $this->_simpleRequest('/grpc.testing.TestService/UnimplementedCall',
    147         $argument,
    148         ['\Grpc\Testing\PBEmpty', 'decode'],
    149         $metadata, $options);
    150     }
    151 
    152 }
    153