How to use the google-gax.createApiCall 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-logging / src / v2 / metrics_service_v2_client.js View on Github external
var metricsServiceV2Stub = gaxGrpc.createStub(
      protos.google.logging.v2.MetricsServiceV2,
      opts
    );

    // Iterate over each of the methods that the service provides
    // and create an API call method for each.
    var metricsServiceV2StubMethods = [
      'listLogMetrics',
      'getLogMetric',
      'createLogMetric',
      'updateLogMetric',
      'deleteLogMetric',
    ];
    for (let methodName of metricsServiceV2StubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        metricsServiceV2Stub.then(
          stub =>
            function() {
              var args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            }
        ),
        defaults[methodName],
        this._descriptors.page[methodName]
      );
    }
  }
github googleapis / nodejs-logging / src / v2 / logging_service_v2_client.js View on Github external
var loggingServiceV2Stub = gaxGrpc.createStub(
      protos.google.logging.v2.LoggingServiceV2,
      opts
    );

    // Iterate over each of the methods that the service provides
    // and create an API call method for each.
    var loggingServiceV2StubMethods = [
      'deleteLog',
      'writeLogEntries',
      'listLogEntries',
      'listMonitoredResourceDescriptors',
      'listLogs',
    ];
    for (let methodName of loggingServiceV2StubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        loggingServiceV2Stub.then(
          stub =>
            function() {
              var args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            }
        ),
        defaults[methodName],
        this._descriptors.page[methodName] ||
          this._descriptors.batching[methodName]
      );
    }
  }
github googleapis / nodejs-dlp / src / v2beta1 / dlp_service_client.js View on Github external
);

    // Iterate over each of the methods that the service provides
    // and create an API call method for each.
    var dlpServiceStubMethods = [
      'inspectContent',
      'redactContent',
      'deidentifyContent',
      'analyzeDataSourceRisk',
      'createInspectOperation',
      'listInspectFindings',
      'listInfoTypes',
      'listRootCategories',
    ];
    for (let methodName of dlpServiceStubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        dlpServiceStub.then(
          stub =>
            function() {
              var args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            }
        ),
        defaults[methodName],
        this._descriptors.longrunning[methodName]
      );
    }
  }
github googleapis / nodejs-logging / src / v2 / config_service_v2_client.js View on Github external
// Iterate over each of the methods that the service provides
    // and create an API call method for each.
    var configServiceV2StubMethods = [
      'listSinks',
      'getSink',
      'createSink',
      'updateSink',
      'deleteSink',
      'listExclusions',
      'getExclusion',
      'createExclusion',
      'updateExclusion',
      'deleteExclusion',
    ];
    for (let methodName of configServiceV2StubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        configServiceV2Stub.then(
          stub =>
            function() {
              var args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            }
        ),
        defaults[methodName],
        this._descriptors.page[methodName]
      );
    }
  }
github googleapis / nodejs-logging / src / v2 / metrics_service_v2_client.js View on Github external
const metricsServiceV2Stub = gaxGrpc.createStub(
      protos.google.logging.v2.MetricsServiceV2,
      opts
    );

    // Iterate over each of the methods that the service provides
    // and create an API call method for each.
    const metricsServiceV2StubMethods = [
      'listLogMetrics',
      'getLogMetric',
      'createLogMetric',
      'updateLogMetric',
      'deleteLogMetric',
    ];
    for (const methodName of metricsServiceV2StubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        metricsServiceV2Stub.then(
          stub =>
            function() {
              const args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            },
          err =>
            function() {
              throw err;
            }
        ),
        defaults[methodName],
        this._descriptors.page[methodName]
      );
    }
  }
github googleapis / nodejs-talent / src / v4beta1 / resume_service_client.js View on Github external
// 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.cloud.talent.v4beta1.ResumeService.
    const resumeServiceStub = gaxGrpc.createStub(
      protos.google.cloud.talent.v4beta1.ResumeService,
      opts
    );

    // Iterate over each of the methods that the service provides
    // and create an API call method for each.
    const resumeServiceStubMethods = ['parseResume'];
    for (const methodName of resumeServiceStubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        resumeServiceStub.then(
          stub =>
            function() {
              const args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            },
          err =>
            function() {
              throw err;
            }
        ),
        defaults[methodName],
        null
      );
    }
  }
github googleapis / google-cloud-node / packages / spanner / src / admin / database / v1 / database_admin_client.js View on Github external
databaseAdminStubMethods.forEach(function(methodName) {
    self['_' + methodName] = gax.createApiCall(
      databaseAdminStub.then(function(databaseAdminStub) {
        return function() {
          var args = Array.prototype.slice.call(arguments, 0);
          return databaseAdminStub[methodName].apply(databaseAdminStub, args);
        };
      }),
      defaults[methodName],
      PAGE_DESCRIPTORS[methodName] || self.longrunningDescriptors[methodName]);
  });
}
github googleapis / google-cloud-node / packages / language / src / v1 / language_service_client.js View on Github external
languageServiceStubMethods.forEach(function(methodName) {
    self['_' + methodName] = gax.createApiCall(
      languageServiceStub.then(function(languageServiceStub) {
        return function() {
          var args = Array.prototype.slice.call(arguments, 0);
          return languageServiceStub[methodName].apply(languageServiceStub, args);
        };
      }),
      defaults[methodName],
      null);
  });
}
github firebase / user-privacy / functions / node_modules / @google-cloud / firestore / src / v1beta1 / firestore_client.js View on Github external
firestoreStubMethods.forEach(function(methodName) {
    self['_' + methodName] = gax.createApiCall(
      firestoreStub.then(function(firestoreStub) {
        return function() {
          var args = Array.prototype.slice.call(arguments, 0);
          return firestoreStub[methodName].apply(firestoreStub, args);
        };
      }),
      defaults[methodName],
      PAGE_DESCRIPTORS[methodName] || STREAM_DESCRIPTORS[methodName]
    );
  });
}
github googleapis / nodejs-dlp / src / v2 / dlp_service_client.js View on Github external
'getDlpJob',
      'deleteDlpJob',
      'cancelDlpJob',
      'listJobTriggers',
      'getJobTrigger',
      'deleteJobTrigger',
      'updateJobTrigger',
      'createJobTrigger',
      'createStoredInfoType',
      'updateStoredInfoType',
      'getStoredInfoType',
      'listStoredInfoTypes',
      'deleteStoredInfoType',
    ];
    for (const methodName of dlpServiceStubMethods) {
      this._innerApiCalls[methodName] = gax.createApiCall(
        dlpServiceStub.then(
          stub =>
            function() {
              const args = Array.prototype.slice.call(arguments, 0);
              return stub[methodName].apply(stub, args);
            },
          err =>
            function() {
              throw err;
            }
        ),
        defaults[methodName],
        this._descriptors.page[methodName]
      );
    }
  }