File

src/longRunningCalls/longRunningDescriptor.ts

Description

A descriptor for long-running operations.

Implements

Descriptor

Index

Properties
Methods

Constructor

constructor(operationsClient: OperationsClient, responseDecoder: AnyDecoder, metadataDecoder: AnyDecoder)
Parameters :
Name Type Optional
operationsClient OperationsClient No
responseDecoder AnyDecoder No
metadataDecoder AnyDecoder No

Properties

metadataDecoder
Type : AnyDecoder
operationsClient
Type : OperationsClient
responseDecoder
Type : AnyDecoder

Methods

getApiCaller
getApiCaller(settings: CallSettings)
Parameters :
Name Type Optional
settings CallSettings No
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);
  }
}

result-matching ""

    No results matching ""