func (c *ComputeStub) ListDisks(ctx context.Context, _, _ string) (*compute.DiskList, error) {
	return c.StubbedListDisks, nil
}
ListDisks returns a list of disks.
package stubs
import (
	"context"
	"fmt"
	"github.com/pkg/errors"
	compute "google.golang.org/api/compute/v1"
)
var ErrNonexistentVM = fmt.Errorf("googleapi: Error 404: The resource 'projects/test/zones/us-central1-a/instances/nonexistent' was not found, notFound")
type ComputeStub struct {
	SavedFirewallRule            *compute.Firewall
	SavedCreateSnapshots         map[string]compute.Snapshot
	DeletedAccessConfigs         []NetworkAccessConfigStub
	DeleteAccessConfigShouldFail bool
	GetInstanceShouldFail        bool
	StubbedListProjectSnapshots  []*compute.SnapshotList
	StubbedListDisks             *compute.DiskList
	StubbedFirewall              *compute.Firewall
	StubbedStopInstance          *compute.Operation
	StubbedStartInstance         *compute.Operation
	StubbedInstance              *compute.Instance
	SavedDiskInsertDst           string
	DiskInsertCalled             bool
}
func (c *ComputeStub) DiskInsert(ctx context.Context, projectID, zone string, disk *compute.Disk) (*compute.Operation, error) {
	c.SavedDiskInsertDst = projectID
	c.DiskInsertCalled = true
	return nil, nil
}
type NetworkAccessConfigStub struct {
	NetworkInterfaceName string
	AccessConfigName     string
}
func (c *ComputeStub) InsertFirewallRule(ctx context.Context, projectID string, fw *compute.Firewall) (*compute.Operation, error) {
	c.SavedFirewallRule = fw
	return nil, nil
}
func (c *ComputeStub) PatchFirewallRule(ctx context.Context, projectID string, rule string, rb *compute.Firewall) (*compute.Operation, error) {
	c.SavedFirewallRule = rb
	return nil, nil
}
func (c *ComputeStub) DeleteFirewallRule(ctx context.Context, projectID string, rule string) (*compute.Operation, error) {
	return nil, nil
}
func (c *ComputeStub) FirewallRule(ctx context.Context, projectID string, ruleID string) (*compute.Firewall, error) {
	return c.StubbedFirewall, nil
}
func (c *ComputeStub) GetInstance(ctx context.Context, project, zone, instance string) (*compute.Instance, error) {
	if c.GetInstanceShouldFail {
		return nil, errors.New("api call failed")
	}
	return c.StubbedInstance, nil
}
func (c *ComputeStub) DeleteAccessConfig(ctx context.Context, project, zone, instance, accessConfig, networkInterface string) (*compute.Operation, error) {
	if c.DeleteAccessConfigShouldFail {
		return nil, errors.New("api call failed")
	}
	c.DeletedAccessConfigs = append(c.DeletedAccessConfigs, NetworkAccessConfigStub{
		NetworkInterfaceName: networkInterface,
		AccessConfigName:     accessConfig,
	})
	return nil, nil
}
func (c *ComputeStub) CreateSnapshot(ctx context.Context, _, _, disk string, snapshot *compute.Snapshot) (*compute.Operation, error) {
	c.SavedCreateSnapshots[disk] = *snapshot
	return nil, nil
}
func (c *ComputeStub) DeleteDiskSnapshot(_ context.Context, _, _ string) (*compute.Operation, error) {
	return nil, nil
}
func (c *ComputeStub) ListProjectSnapshots(context.Context, string) (*compute.SnapshotList, error) {
	if len(c.StubbedListProjectSnapshots) == 0 {
		return nil, nil
	}
	pop := c.StubbedListProjectSnapshots[len(c.StubbedListProjectSnapshots)-1 : len(c.StubbedListProjectSnapshots)][0]
	c.StubbedListProjectSnapshots = c.StubbedListProjectSnapshots[0 : len(c.StubbedListProjectSnapshots)-1]
	if pop == nil {
		return &compute.SnapshotList{Items: []*compute.Snapshot{}}, nil
	}
	return pop, nil
}