Skip to content

Commit

Permalink
chore(deps): use @google-cloud/paginator (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Oct 3, 2018
1 parent 8e61c8a commit 197e6e0
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 137 deletions.
1 change: 1 addition & 0 deletions packages/google-cloud-compute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
},
"dependencies": {
"@google-cloud/common": "^0.17.0",
"@google-cloud/paginator": "^0.1.1",
"@google-cloud/promisify": "^0.3.1",
"arrify": "^1.0.1",
"async": "^2.6.1",
Expand Down
49 changes: 19 additions & 30 deletions packages/google-cloud-compute/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const format = require('string-format-obj');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');
const {paginator} = require('@google-cloud/paginator');

const Firewall = require('./firewall.js');
const HealthCheck = require('./health-check.js');
Expand Down Expand Up @@ -809,9 +810,7 @@ Compute.prototype.getAddresses = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getAddressesStream = common.paginator.streamify(
'getAddresses'
);
Compute.prototype.getAddressesStream = paginator.streamify('getAddresses');

/**
* Get a list of autoscalers. For a detailed description of this method's
Expand Down Expand Up @@ -948,9 +947,7 @@ Compute.prototype.getAutoscalers = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getAutoscalersStream = common.paginator.streamify(
'getAutoscalers'
);
Compute.prototype.getAutoscalersStream = paginator.streamify('getAutoscalers');

/**
* Get a list of disks.
Expand Down Expand Up @@ -1082,7 +1079,7 @@ Compute.prototype.getDisks = function(options, callback) {
* });
*/

Compute.prototype.getDisksStream = common.paginator.streamify('getDisks');
Compute.prototype.getDisksStream = paginator.streamify('getDisks');

/**
* Get a list of instance groups.
Expand Down Expand Up @@ -1216,7 +1213,7 @@ Compute.prototype.getInstanceGroups = function(options, callback) {
* });
*/

Compute.prototype.getInstanceGroupsStream = common.paginator.streamify(
Compute.prototype.getInstanceGroupsStream = paginator.streamify(
'getInstanceGroups'
);

Expand Down Expand Up @@ -1337,9 +1334,7 @@ Compute.prototype.getFirewalls = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getFirewallsStream = common.paginator.streamify(
'getFirewalls'
);
Compute.prototype.getFirewallsStream = paginator.streamify('getFirewalls');

/**
* Get a list of health checks.
Expand Down Expand Up @@ -1467,7 +1462,7 @@ Compute.prototype.getHealthChecks = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getHealthChecksStream = common.paginator.streamify(
Compute.prototype.getHealthChecksStream = paginator.streamify(
'getHealthChecks'
);

Expand Down Expand Up @@ -1587,7 +1582,7 @@ Compute.prototype.getImages = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getImagesStream = common.paginator.streamify('getImages');
Compute.prototype.getImagesStream = paginator.streamify('getImages');

/**
* Get a list of machine types in this project.
Expand Down Expand Up @@ -1721,7 +1716,7 @@ Compute.prototype.getMachineTypes = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getMachineTypesStream = common.paginator.streamify(
Compute.prototype.getMachineTypesStream = paginator.streamify(
'getMachineTypes'
);

Expand Down Expand Up @@ -1845,7 +1840,7 @@ Compute.prototype.getNetworks = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getNetworksStream = common.paginator.streamify('getNetworks');
Compute.prototype.getNetworksStream = paginator.streamify('getNetworks');

/**
* Get a list of global operations.
Expand Down Expand Up @@ -1968,9 +1963,7 @@ Compute.prototype.getOperations = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getOperationsStream = common.paginator.streamify(
'getOperations'
);
Compute.prototype.getOperationsStream = paginator.streamify('getOperations');

/**
* Return the regions available to your project.
Expand Down Expand Up @@ -2091,7 +2084,7 @@ Compute.prototype.getRegions = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getRegionsStream = common.paginator.streamify('getRegions');
Compute.prototype.getRegionsStream = paginator.streamify('getRegions');

/**
* Get a list of forwarding rules.
Expand Down Expand Up @@ -2212,7 +2205,7 @@ Compute.prototype.getRules = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getRulesStream = common.paginator.streamify('getRules');
Compute.prototype.getRulesStream = paginator.streamify('getRules');

/**
* Get a list of backend services.
Expand Down Expand Up @@ -2334,7 +2327,7 @@ Compute.prototype.getServices = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getServicesStream = common.paginator.streamify('getServices');
Compute.prototype.getServicesStream = paginator.streamify('getServices');

/**
* Get a list of snapshots.
Expand Down Expand Up @@ -2456,9 +2449,7 @@ Compute.prototype.getSnapshots = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getSnapshotsStream = common.paginator.streamify(
'getSnapshots'
);
Compute.prototype.getSnapshotsStream = paginator.streamify('getSnapshots');

/**
* Get a list of subnetworks in this project.
Expand Down Expand Up @@ -2594,9 +2585,7 @@ Compute.prototype.getSubnetworks = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getSubnetworksStream = common.paginator.streamify(
'getSubnetworks'
);
Compute.prototype.getSubnetworksStream = paginator.streamify('getSubnetworks');

/**
* Get a list of virtual machine instances.
Expand Down Expand Up @@ -2726,7 +2715,7 @@ Compute.prototype.getVMs = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getVMsStream = common.paginator.streamify('getVMs');
Compute.prototype.getVMsStream = paginator.streamify('getVMs');

/**
* Return the zones available to your project.
Expand Down Expand Up @@ -2847,7 +2836,7 @@ Compute.prototype.getZones = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getZonesStream = common.paginator.streamify('getZones');
Compute.prototype.getZonesStream = paginator.streamify('getZones');

/**
* Get a reference to a Google Compute Engine health check.
Expand Down Expand Up @@ -3035,7 +3024,7 @@ Compute.prototype.execAfterOperation_ = function(callback) {
*
* These methods can be auto-paginated.
*/
common.paginator.extend(Compute, [
paginator.extend(Compute, [
'getAddresses',
'getAutoscalers',
'getDisks',
Expand Down
5 changes: 3 additions & 2 deletions packages/google-cloud-compute/src/instance-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const extend = require('extend');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');
const {paginator} = require('@google-cloud/paginator');

/**
* You can create and manage groups of virtual machine instances so that you
Expand Down Expand Up @@ -466,7 +467,7 @@ InstanceGroup.prototype.getVMs = function(options, callback) {
* this.end();
* });
*/
InstanceGroup.prototype.getVMsStream = common.paginator.streamify('getVMs');
InstanceGroup.prototype.getVMsStream = paginator.streamify('getVMs');

/**
* Remove one or more VMs from this instance group.
Expand Down Expand Up @@ -602,7 +603,7 @@ InstanceGroup.prototype.setPorts = function(ports, callback) {
*
* These methods can be auto-paginated.
*/
common.paginator.extend(InstanceGroup, ['getVMs']);
paginator.extend(InstanceGroup, ['getVMs']);

/*! Developer Documentation
*
Expand Down
17 changes: 6 additions & 11 deletions packages/google-cloud-compute/src/region.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const extend = require('extend');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');
const {paginator} = require('@google-cloud/paginator');

const Address = require('./address.js');
const Network = require('./network.js');
Expand Down Expand Up @@ -529,9 +530,7 @@ Region.prototype.getAddresses = function(options, callback) {
* this.end();
* });
*/
Region.prototype.getAddressesStream = common.paginator.streamify(
'getAddresses'
);
Region.prototype.getAddressesStream = paginator.streamify('getAddresses');

/**
* Get a list of operations for this region.
Expand Down Expand Up @@ -661,9 +660,7 @@ Region.prototype.getOperations = function(options, callback) {
* this.end();
* });
*/
Region.prototype.getOperationsStream = common.paginator.streamify(
'getOperations'
);
Region.prototype.getOperationsStream = paginator.streamify('getOperations');

/**
* Get a list of forwading rules in this region.
Expand Down Expand Up @@ -792,7 +789,7 @@ Region.prototype.getRules = function(options, callback) {
* this.end();
* });
*/
Region.prototype.getRulesStream = common.paginator.streamify('getRules');
Region.prototype.getRulesStream = paginator.streamify('getRules');

/**
* Get a list of subnetworks in this region.
Expand Down Expand Up @@ -922,9 +919,7 @@ Region.prototype.getSubnetworks = function(options, callback) {
* this.end();
* });
*/
Region.prototype.getSubnetworksStream = common.paginator.streamify(
'getSubnetworks'
);
Region.prototype.getSubnetworksStream = paginator.streamify('getSubnetworks');

/**
* Get a reference to a Google Compute Engine region operation.
Expand Down Expand Up @@ -985,7 +980,7 @@ Region.prototype.subnetwork = function(name) {
*
* These methods can be auto-paginated.
*/
common.paginator.extend(Region, [
paginator.extend(Region, [
'getAddresses',
'getOperations',
'getRules',
Expand Down
21 changes: 8 additions & 13 deletions packages/google-cloud-compute/src/zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const gceImages = require('gce-images');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');
const {paginator} = require('@google-cloud/paginator');

const Autoscaler = require('./autoscaler.js');
const Disk = require('./disk.js');
Expand Down Expand Up @@ -889,9 +890,7 @@ Zone.prototype.getAutoscalers = function(options, callback) {
* this.end();
* });
*/
Zone.prototype.getAutoscalersStream = common.paginator.streamify(
'getAutoscalers'
);
Zone.prototype.getAutoscalersStream = paginator.streamify('getAutoscalers');

/**
* Get a list of disks in this zone.
Expand Down Expand Up @@ -1020,7 +1019,7 @@ Zone.prototype.getDisks = function(options, callback) {
* this.end();
* });
*/
Zone.prototype.getDisksStream = common.paginator.streamify('getDisks');
Zone.prototype.getDisksStream = paginator.streamify('getDisks');

/**
* Get a list of instance groups for this zone.
Expand Down Expand Up @@ -1151,7 +1150,7 @@ Zone.prototype.getInstanceGroups = function(options, callback) {
* this.end();
* });
*/
Zone.prototype.getInstanceGroupsStream = common.paginator.streamify(
Zone.prototype.getInstanceGroupsStream = paginator.streamify(
'getInstanceGroups'
);

Expand Down Expand Up @@ -1251,9 +1250,7 @@ Zone.prototype.getMachineTypes = function(options, callback) {
* this.end();
* });
*/
Zone.prototype.getMachineTypesStream = common.paginator.streamify(
'getMachineTypes'
);
Zone.prototype.getMachineTypesStream = paginator.streamify('getMachineTypes');

/**
* Get a list of operations for this zone.
Expand Down Expand Up @@ -1383,9 +1380,7 @@ Zone.prototype.getOperations = function(options, callback) {
* this.end();
* });
*/
Zone.prototype.getOperationsStream = common.paginator.streamify(
'getOperations'
);
Zone.prototype.getOperationsStream = paginator.streamify('getOperations');

/**
* Get a list of VM instances in this zone.
Expand Down Expand Up @@ -1512,7 +1507,7 @@ Zone.prototype.getVMs = function(options, callback) {
* this.end();
* });
*/
Zone.prototype.getVMsStream = common.paginator.streamify('getVMs');
Zone.prototype.getVMsStream = paginator.streamify('getVMs');

/**
* Get a reference to a Google Compute Engine instance group.
Expand Down Expand Up @@ -1647,7 +1642,7 @@ Zone.prototype.createHttpsServerFirewall_ = function(callback) {
*
* These methods can be auto-paginated.
*/
common.paginator.extend(Zone, [
paginator.extend(Zone, [
'getAutoscalers',
'getDisks',
'getInstanceGroups',
Expand Down
Loading

0 comments on commit 197e6e0

Please sign in to comment.