src/longRunningCalls/longRunningDescriptor.ts
A callback to upack a google.protobuf.Any message.
Properties |
Signature :
[message: literal type]
|
Returns : Metadata
|
import {Descriptor} from '../descriptor';
import {CallSettings} from '../gax';
import {Metadata} from '../grpc';
import {OperationsClient} from '../operationsClient';
import {LongrunningApiCaller} from './longRunningApiCaller';
/**
* A callback to upack a google.protobuf.Any message.
*/
export interface AnyDecoder {
(message: {}): Metadata;
}
/**
* A descriptor for long-running operations.
*/
export class LongRunningDescriptor implements Descriptor {
operationsClient: OperationsClient;
responseDecoder: AnyDecoder;
metadataDecoder: AnyDecoder;
constructor(
operationsClient: OperationsClient,
responseDecoder: AnyDecoder,
metadataDecoder: AnyDecoder
) {
this.operationsClient = operationsClient;
this.responseDecoder = responseDecoder;
this.metadataDecoder = metadataDecoder;
}
getApiCaller(settings: CallSettings) {
return new LongrunningApiCaller(this);
}
}