Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc-gcp / build / src / index.d.ts
1 /**
2  * @license
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 import * as grpc from 'grpc';
19 import { GcpChannelFactory } from './gcp_channel_factory';
20 import * as protoRoot from './generated/grpc_gcp';
21 import ApiConfig = protoRoot.grpc.gcp.ApiConfig;
22 /**
23  * Create ApiConfig proto message from config object.
24  * @param apiDefinition Api object that specifies channel pool configuation.
25  * @return A protobuf message type.
26  */
27 export declare function createGcpApiConfig(apiDefinition: {}): ApiConfig;
28 /**
29  * Function for creating a gcp channel factory.
30  * @memberof grpc-gcp
31  * @param address The address of the server to connect to.
32  * @param credentials Channel credentials to use when connecting
33  * @param options A map of channel options that will be passed to the core.
34  * @return {GcpChannelFactory} A GcpChannelFactory instance.
35  */
36 export declare function gcpChannelFactoryOverride(address: string, credentials: grpc.ChannelCredentials, options: {}): GcpChannelFactory;
37 export interface MethodDefinition<RequestType, ResponseType> {
38     path: string;
39     requestStream: boolean;
40     responseStream: boolean;
41     requestSerialize: grpc.serialize<RequestType>;
42     responseDeserialize: grpc.deserialize<ResponseType>;
43 }
44 export interface InputCallProperties<RequestType, ResponseType> {
45     argument?: any;
46     metadata: grpc.Metadata;
47     call: grpc.ClientUnaryCall | grpc.ClientReadableStream<RequestType> | grpc.ClientDuplexStream<RequestType, ResponseType> | grpc.ClientWritableStream<RequestType>;
48     channel: GcpChannelFactory;
49     methodDefinition: MethodDefinition<RequestType, ResponseType>;
50     callOptions: grpc.CallOptions;
51     callback?: Function;
52 }
53 export interface OutputCallProperties<RequestType, ResponseType> {
54     argument?: any;
55     metadata: grpc.Metadata;
56     call: grpc.ClientUnaryCall | grpc.ClientReadableStream<RequestType> | grpc.ClientDuplexStream<RequestType, ResponseType> | grpc.ClientWritableStream<RequestType>;
57     channel: grpc.Channel;
58     methodDefinition: MethodDefinition<RequestType, ResponseType>;
59     callOptions: grpc.CallOptions;
60     callback?: Function;
61 }
62 /**
63  * Pass in call properties and return a new object with modified values.
64  * This function will be used together with gcpChannelFactoryOverride
65  * when constructing a grpc Client.
66  * @memberof grpc-gcp
67  * @param callProperties Call properties with channel factory object.
68  * @return Modified call properties with selected grpc channel object.
69  */
70 export declare function gcpCallInvocationTransformer<RequestType, ResponseType>(callProperties: InputCallProperties<RequestType, ResponseType>): OutputCallProperties<RequestType, ResponseType>;
71 export { GcpChannelFactory };