src/longRunningCalls/longRunningDescriptor.ts
A descriptor for long-running operations.
Properties |
Methods |
constructor(operationsClient: OperationsClient, responseDecoder: AnyDecoder, metadataDecoder: AnyDecoder)
|
||||||||||||
Parameters :
|
metadataDecoder |
Type : AnyDecoder
|
operationsClient |
Type : OperationsClient
|
responseDecoder |
Type : AnyDecoder
|
getApiCaller | ||||||
getApiCaller(settings: CallSettings)
|
||||||
Parameters :
Returns :
any
|
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);
}
}