How to use the google-gax.StreamType function in google-gax

To help you get started, we’ve selected a few google-gax examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-firestore / dev / src / v1beta1 / firestore_client.js View on Github external
'pageToken',
        'nextPageToken',
        'documents'
      ),
      listCollectionIds: new gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'collectionIds'
      ),
    };

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      batchGetDocuments: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
      runQuery: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
      write: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
      listen: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.firestore.v1beta1.Firestore',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
github maierj / fastlane-action / .github / actions / statistics-chart-action / node_modules / @google-cloud / firestore / build / src / v1 / firestore_client.js View on Github external
// Load the applicable protos.
        // For Node.js, pass the path to JSON proto file.
        // For browsers, pass the JSON content.
        const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json');
        const protos = gaxGrpc.loadProto(opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath);
        // Some of the methods on this service return "paged" results,
        // (e.g. 50 results at a time, with tokens to get subsequent
        // pages). Denote the keys used for pagination and results.
        this._descriptors.page = {
            listDocuments: new gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documents'),
            listCollectionIds: new gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'collectionIds'),
        };
        // Some of the methods on this service provide streaming responses.
        // Provide descriptors for these.
        this._descriptors.stream = {
            batchGetDocuments: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
            runQuery: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
            write: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
            listen: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
        };
        // Put together the default options sent with requests.
        const defaults = gaxGrpc.constructSettings('google.firestore.v1.Firestore', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
        // Set up a dictionary of "inner API calls"; the core implementation
        // of calling the API is handled in `google-gax`, with this code
        // merely providing the destination and request information.
        this._innerApiCalls = {};
        // Put together the "service stub" for
        // google.firestore.v1.Firestore.
        this.firestoreStub = gaxGrpc.createStub(opts.fallback
            ? protos.lookupService('google.firestore.v1.Firestore')
            : // tslint:disable-next-line no-any
                protos.google.firestore.v1.Firestore, opts);
github googleapis / nodejs-speech / src / v1 / speech_client.js View on Github external
const nodejsProtoPath = path.join(
      __dirname,
      '..',
      '..',
      'protos',
      'protos.json'
    );
    const protos = gaxGrpc.loadProto(
      opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
    );

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      streamingRecognize: new gaxModule.StreamDescriptor(
        gax.StreamType.BIDI_STREAMING
      ),
    };

    const protoFilesRoot = opts.fallback
      ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json'))
      : gaxModule.protobuf.loadSync(nodejsProtoPath);

    // This API contains "long-running operations", which return a
    // an Operation object that allows for tracking of the operation,
    // rather than holding a request open.
    this.operationsClient = new gaxModule.lro({
      auth: gaxGrpc.auth,
      grpc: gaxGrpc.grpc,
    }).operationsClient(opts);

    const longRunningRecognizeResponse = protoFilesRoot.lookup(
github googleapis / nodejs-firestore / dev / src / v1beta1 / firestore_client.js View on Github external
),
      listCollectionIds: new gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'collectionIds'
      ),
    };

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      batchGetDocuments: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
      runQuery: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
      write: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
      listen: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.firestore.v1beta1.Firestore',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
    // merely providing the destination and request information.
    this._innerApiCalls = {};
github googleapis / nodejs-spanner / src / v1 / spanner_client.js View on Github external
// Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listSessions: new gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'sessions'
      ),
    };

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      executeStreamingSql: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
      streamingRead: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.spanner.v1.Spanner',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
github googleapis / nodejs-dialogflow / src / v2beta1 / sessions_client.js View on Github external
// identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      environmentSessionPathTemplate: new gaxModule.PathTemplate(
        'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}'
      ),
      sessionPathTemplate: new gaxModule.PathTemplate(
        'projects/{project}/agent/sessions/{session}'
      ),
    };

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      streamingDetectIntent: new gaxModule.StreamDescriptor(
        gax.StreamType.BIDI_STREAMING
      ),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.cloud.dialogflow.v2beta1.Sessions',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
    // merely providing the destination and request information.
    this._innerApiCalls = {};
github googleapis / nodejs-bigtable / src / v2 / bigtable_client.js View on Github external
// Create useful helper objects for these.
    this._pathTemplates = {
      tablePathTemplate: new gaxModule.PathTemplate(
        'projects/{project}/instances/{instance}/tables/{table}'
      ),
    };

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      readRows: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
      sampleRowKeys: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
      mutateRows: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.bigtable.v2.Bigtable',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
    // merely providing the destination and request information.
    this._innerApiCalls = {};
github googleapis / nodejs-speech / src / v1p1beta1 / speech_client.js View on Github external
const nodejsProtoPath = path.join(
      __dirname,
      '..',
      '..',
      'protos',
      'protos.json'
    );
    const protos = gaxGrpc.loadProto(
      opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
    );

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      streamingRecognize: new gaxModule.StreamDescriptor(
        gax.StreamType.BIDI_STREAMING
      ),
    };

    const protoFilesRoot = opts.fallback
      ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json'))
      : gaxModule.protobuf.loadSync(nodejsProtoPath);

    // This API contains "long-running operations", which return a
    // an Operation object that allows for tracking of the operation,
    // rather than holding a request open.
    this.operationsClient = new gaxModule.lro({
      auth: gaxGrpc.auth,
      grpc: gaxGrpc.grpc,
    }).operationsClient(opts);

    const longRunningRecognizeResponse = protoFilesRoot.lookup(
github googleapis / nodejs-firestore / dev / src / v1 / firestore_client.js View on Github external
'pageToken',
        'nextPageToken',
        'documents'
      ),
      listCollectionIds: new gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'collectionIds'
      ),
    };

    // Some of the methods on this service provide streaming responses.
    // Provide descriptors for these.
    this._descriptors.stream = {
      batchGetDocuments: new gaxModule.StreamDescriptor(
        gax.StreamType.SERVER_STREAMING
      ),
      runQuery: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
      write: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
      listen: new gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.firestore.v1.Firestore',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code