func (c *TestClient) InstanceStopped(project, zone, name string) (bool, error) {
	if c.InstanceStoppedFn != nil {
		return c.InstanceStoppedFn(project, zone, name)
	}
	return c.client.InstanceStopped(project, zone, name)
}
InstanceStopped uses the override method InstanceStoppedFn or the real implementation.
package compute
import (
	"context"
	"net/http"
	"net/http/httptest"
	computeAlpha "google.golang.org/api/compute/v0.alpha"
	computeBeta "google.golang.org/api/compute/v0.beta"
	compute "google.golang.org/api/compute/v1"
	"google.golang.org/api/googleapi"
	"google.golang.org/api/option"
)
func NewTestClient(handleFunc http.HandlerFunc) (*httptest.Server, *TestClient, error) {
	ts := httptest.NewServer(handleFunc)
	opts := []option.ClientOption{
		option.WithEndpoint(ts.URL),
		option.WithHTTPClient(http.DefaultClient),
	}
	c, err := NewClient(context.Background(), opts...)
	if err != nil {
		return nil, nil, err
	}
	tc := &TestClient{}
	tc.client = *c.(*client)
	tc.client.i = tc
	return ts, tc, nil
}
type TestClient struct {
	client
	AttachDiskFn                func(project, zone, instance string, d *compute.AttachedDisk) error
	DetachDiskFn                func(project, zone, instance, disk string) error
	CreateDiskFn                func(project, zone string, d *compute.Disk) error
	CreateForwardingRuleFn      func(project, region string, fr *compute.ForwardingRule) error
	CreateFirewallRuleFn        func(project string, i *compute.Firewall) error
	CreateImageFn               func(project string, i *compute.Image) error
	CreateInstanceFn            func(project, zone string, i *compute.Instance) error
	CreateNetworkFn             func(project string, n *compute.Network) error
	CreateSnapshotFn            func(project, zone, disk string, s *compute.Snapshot) error
	CreateSubnetworkFn          func(project, region string, n *compute.Subnetwork) error
	CreateTargetInstanceFn      func(project, zone string, ti *compute.TargetInstance) error
	StartInstanceFn             func(project, zone, name string) error
	StopInstanceFn              func(project, zone, name string) error
	DeleteDiskFn                func(project, zone, name string) error
	DeleteForwardingRuleFn      func(project, region, name string) error
	DeleteFirewallRuleFn        func(project, name string) error
	DeleteImageFn               func(project, name string) error
	DeleteInstanceFn            func(project, zone, name string) error
	DeleteNetworkFn             func(project, name string) error
	DeleteSubnetworkFn          func(project, region, name string) error
	DeleteTargetInstanceFn      func(project, zone, name string) error
	DeprecateImageFn            func(project, name string, deprecationstatus *compute.DeprecationStatus) error
	GetMachineTypeFn            func(project, zone, machineType string) (*compute.MachineType, error)
	ListMachineTypesFn          func(project, zone string, opts ...ListCallOption) ([]*compute.MachineType, error)
	GetProjectFn                func(project string) (*compute.Project, error)
	GetSerialPortOutputFn       func(project, zone, name string, port, start int64) (*compute.SerialPortOutput, error)
	GetGuestAttributesFn        func(project, zone, name, queryPath, variableKey string) (*compute.GuestAttributes, error)
	GetZoneFn                   func(project, zone string) (*compute.Zone, error)
	ListZonesFn                 func(project string, opts ...ListCallOption) ([]*compute.Zone, error)
	GetInstanceFn               func(project, zone, name string) (*compute.Instance, error)
	AggregatedListInstancesFn   func(project string, opts ...ListCallOption) ([]*compute.Instance, error)
	ListInstancesFn             func(project, zone string, opts ...ListCallOption) ([]*compute.Instance, error)
	ListSnapshotsFn             func(project string, opts ...ListCallOption) ([]*compute.Snapshot, error)
	GetSnapshotFn               func(project, name string) (*compute.Snapshot, error)
	DeleteSnapshotFn            func(project, name string) error
	GetDiskFn                   func(project, zone, name string) (*compute.Disk, error)
	AggregatedListDisksFn       func(project string, opts ...ListCallOption) ([]*compute.Disk, error)
	ListDisksFn                 func(project, zone string, opts ...ListCallOption) ([]*compute.Disk, error)
	GetForwardingRuleFn         func(project, region, name string) (*compute.ForwardingRule, error)
	ListForwardingRulesFn       func(project, region string, opts ...ListCallOption) ([]*compute.ForwardingRule, error)
	GetFirewallRuleFn           func(project, name string) (*compute.Firewall, error)
	ListFirewallRulesFn         func(project string, opts ...ListCallOption) ([]*compute.Firewall, error)
	GetImageFn                  func(project, name string) (*compute.Image, error)
	GetImageFromFamilyFn        func(project, family string) (*compute.Image, error)
	ListImagesFn                func(project string, opts ...ListCallOption) ([]*compute.Image, error)
	GetLicenseFn                func(project, name string) (*compute.License, error)
	ListLicensesFn              func(project string, opts ...ListCallOption) ([]*compute.License, error)
	GetNetworkFn                func(project, name string) (*compute.Network, error)
	AggregatedListSubnetworksFn func(project string, opts ...ListCallOption) ([]*compute.Subnetwork, error)
	ListNetworksFn              func(project string, opts ...ListCallOption) ([]*compute.Network, error)
	GetSubnetworkFn             func(project, region, name string) (*compute.Subnetwork, error)
	ListSubnetworksFn           func(project, region string, opts ...ListCallOption) ([]*compute.Subnetwork, error)
	GetTargetInstanceFn         func(project, zone, name string) (*compute.TargetInstance, error)
	ListTargetInstancesFn       func(project, zone string, opts ...ListCallOption) ([]*compute.TargetInstance, error)
	InstanceStatusFn            func(project, zone, name string) (string, error)
	InstanceStoppedFn           func(project, zone, name string) (bool, error)
	ResizeDiskFn                func(project, zone, disk string, drr *compute.DisksResizeRequest) error
	SetInstanceMetadataFn       func(project, zone, name string, md *compute.Metadata) error
	SetCommonInstanceMetadataFn func(project string, md *compute.Metadata) error
	RetryFn                     func(f func(opts ...googleapi.CallOption) (*compute.Operation, error), opts ...googleapi.CallOption) (op *compute.Operation, err error)
	CreateInstanceAlphaFn func(project, zone string, i *computeAlpha.Instance) error
	ListMachineImagesFn  func(project string, opts ...ListCallOption) ([]*computeBeta.MachineImage, error)
	DeleteMachineImageFn func(project, name string) error
	CreateMachineImageFn func(project string, i *computeBeta.MachineImage) error
	GetMachineImageFn    func(project, name string) (*computeBeta.MachineImage, error)
	CreateInstanceBetaFn func(project, zone string, i *computeBeta.Instance) error
	zoneOperationsWaitFn   func(project, zone, name string) error
	regionOperationsWaitFn func(project, region, name string) error
	globalOperationsWaitFn func(project, name string) error
}
func (c *TestClient) Retry(f func(opts ...googleapi.CallOption) (*compute.Operation, error), opts ...googleapi.CallOption) (op *compute.Operation, err error) {
	if c.RetryFn != nil {
		return c.RetryFn(f, opts...)
	}
	return c.client.Retry(f, opts...)
}
func (c *TestClient) AttachDisk(project, zone, instance string, ad *compute.AttachedDisk) error {
	if c.AttachDiskFn != nil {
		return c.AttachDiskFn(project, zone, instance, ad)
	}
	return c.client.AttachDisk(project, zone, instance, ad)
}
func (c *TestClient) DetachDisk(project, zone, instance, disk string) error {
	if c.DetachDiskFn != nil {
		return c.DetachDiskFn(project, zone, instance, disk)
	}
	return c.client.DetachDisk(project, zone, instance, disk)
}
func (c *TestClient) CreateDisk(project, zone string, d *compute.Disk) error {
	if c.CreateDiskFn != nil {
		return c.CreateDiskFn(project, zone, d)
	}
	return c.client.CreateDisk(project, zone, d)
}
func (c *TestClient) CreateForwardingRule(project, region string, fr *compute.ForwardingRule) error {
	if c.CreateForwardingRuleFn != nil {
		return c.CreateForwardingRuleFn(project, region, fr)
	}
	return c.client.CreateForwardingRule(project, region, fr)
}
func (c *TestClient) CreateFirewallRule(project string, i *compute.Firewall) error {
	if c.CreateFirewallRuleFn != nil {
		return c.CreateFirewallRuleFn(project, i)
	}
	return c.client.CreateFirewallRule(project, i)
}
func (c *TestClient) CreateImage(project string, i *compute.Image) error {
	if c.CreateImageFn != nil {
		return c.CreateImageFn(project, i)
	}
	return c.client.CreateImage(project, i)
}
func (c *TestClient) CreateInstance(project, zone string, i *compute.Instance) error {
	if c.CreateInstanceFn != nil {
		return c.CreateInstanceFn(project, zone, i)
	}
	return c.client.CreateInstance(project, zone, i)
}
func (c *TestClient) CreateNetwork(project string, n *compute.Network) error {
	if c.CreateNetworkFn != nil {
		return c.CreateNetworkFn(project, n)
	}
	return c.client.CreateNetwork(project, n)
}
func (c *TestClient) CreateSubnetwork(project, region string, n *compute.Subnetwork) error {
	if c.CreateSubnetworkFn != nil {
		return c.CreateSubnetworkFn(project, region, n)
	}
	return c.client.CreateSubnetwork(project, region, n)
}
func (c *TestClient) CreateTargetInstance(project, zone string, ti *compute.TargetInstance) error {
	if c.CreateTargetInstanceFn != nil {
		return c.CreateTargetInstanceFn(project, zone, ti)
	}
	return c.client.CreateTargetInstance(project, zone, ti)
}
func (c *TestClient) StartInstance(project, zone, name string) error {
	if c.StartInstanceFn != nil {
		return c.StartInstanceFn(project, zone, name)
	}
	return c.client.StartInstance(project, zone, name)
}
func (c *TestClient) StopInstance(project, zone, name string) error {
	if c.StopInstanceFn != nil {
		return c.StopInstanceFn(project, zone, name)
	}
	return c.client.StopInstance(project, zone, name)
}
func (c *TestClient) DeleteDisk(project, zone, name string) error {
	if c.DeleteDiskFn != nil {
		return c.DeleteDiskFn(project, zone, name)
	}
	return c.client.DeleteDisk(project, zone, name)
}
func (c *TestClient) DeleteForwardingRule(project, region, name string) error {
	if c.DeleteForwardingRuleFn != nil {
		return c.DeleteForwardingRuleFn(project, region, name)
	}
	return c.client.DeleteForwardingRule(project, region, name)
}
func (c *TestClient) DeleteFirewallRule(project, name string) error {
	if c.DeleteFirewallRuleFn != nil {
		return c.DeleteFirewallRuleFn(project, name)
	}
	return c.client.DeleteFirewallRule(project, name)
}
func (c *TestClient) DeleteImage(project, name string) error {
	if c.DeleteImageFn != nil {
		return c.DeleteImageFn(project, name)
	}
	return c.client.DeleteImage(project, name)
}
func (c *TestClient) DeleteInstance(project, zone, name string) error {
	if c.DeleteInstanceFn != nil {
		return c.DeleteInstanceFn(project, zone, name)
	}
	return c.client.DeleteInstance(project, zone, name)
}
func (c *TestClient) DeleteNetwork(project, name string) error {
	if c.DeleteNetworkFn != nil {
		return c.DeleteNetworkFn(project, name)
	}
	return c.client.DeleteNetwork(project, name)
}
func (c *TestClient) DeleteSubnetwork(project, region, name string) error {
	if c.DeleteSubnetworkFn != nil {
		return c.DeleteSubnetworkFn(project, region, name)
	}
	return c.client.DeleteSubnetwork(project, region, name)
}
func (c *TestClient) DeleteTargetInstance(project, zone, name string) error {
	if c.DeleteTargetInstanceFn != nil {
		return c.DeleteTargetInstanceFn(project, zone, name)
	}
	return c.client.DeleteTargetInstance(project, zone, name)
}
func (c *TestClient) DeprecateImage(project, name string, deprecationstatus *compute.DeprecationStatus) error {
	if c.DeprecateImageFn != nil {
		return c.DeprecateImageFn(project, name, deprecationstatus)
	}
	return c.client.DeprecateImage(project, name, deprecationstatus)
}
func (c *TestClient) GetProject(project string) (*compute.Project, error) {
	if c.GetProjectFn != nil {
		return c.GetProjectFn(project)
	}
	return c.client.GetProject(project)
}
func (c *TestClient) GetMachineType(project, zone, machineType string) (*compute.MachineType, error) {
	if c.GetMachineTypeFn != nil {
		return c.GetMachineTypeFn(project, zone, machineType)
	}
	return c.client.GetMachineType(project, zone, machineType)
}
func (c *TestClient) ListMachineTypes(project, zone string, opts ...ListCallOption) ([]*compute.MachineType, error) {
	if c.ListMachineTypesFn != nil {
		return c.ListMachineTypesFn(project, zone, opts...)
	}
	return c.client.ListMachineTypes(project, zone, opts...)
}
func (c *TestClient) GetZone(project, zone string) (*compute.Zone, error) {
	if c.GetZoneFn != nil {
		return c.GetZoneFn(project, zone)
	}
	return c.client.GetZone(project, zone)
}
func (c *TestClient) ListZones(project string, opts ...ListCallOption) ([]*compute.Zone, error) {
	if c.ListZonesFn != nil {
		return c.ListZonesFn(project, opts...)
	}
	return c.client.ListZones(project, opts...)
}
func (c *TestClient) CreateSnapshot(project, zone, disk string, s *compute.Snapshot) error {
	if c.CreateSnapshotFn != nil {
		return c.CreateSnapshotFn(project, zone, disk, s)
	}
	return c.client.CreateSnapshot(project, zone, disk, s)
}
func (c *TestClient) GetSnapshot(project, name string) (*compute.Snapshot, error) {
	if c.GetSnapshotFn != nil {
		return c.GetSnapshotFn(project, name)
	}
	return c.client.GetSnapshot(project, name)
}
func (c *TestClient) ListSnapshots(project string, opts ...ListCallOption) ([]*compute.Snapshot, error) {
	if c.ListSnapshotsFn != nil {
		return c.ListSnapshotsFn(project, opts...)
	}
	return c.client.ListSnapshots(project, opts...)
}
func (c *TestClient) DeleteSnapshot(project, name string) error {
	if c.DeleteSnapshotFn != nil {
		return c.DeleteSnapshotFn(project, name)
	}
	return c.client.DeleteSnapshot(project, name)
}
func (c *TestClient) GetInstance(project, zone, name string) (*compute.Instance, error) {
	if c.GetInstanceFn != nil {
		return c.GetInstanceFn(project, zone, name)
	}
	return c.client.GetInstance(project, zone, name)
}
func (c *TestClient) ListInstances(project, zone string, opts ...ListCallOption) ([]*compute.Instance, error) {
	if c.ListInstancesFn != nil {
		return c.ListInstancesFn(project, zone, opts...)
	}
	return c.client.ListInstances(project, zone, opts...)
}
func (c *TestClient) AggregatedListInstances(project string, opts ...ListCallOption) ([]*compute.Instance, error) {
	if c.AggregatedListInstancesFn != nil {
		return c.AggregatedListInstancesFn(project, opts...)
	}
	return c.client.AggregatedListInstances(project, opts...)
}
func (c *TestClient) GetDisk(project, zone, name string) (*compute.Disk, error) {
	if c.GetDiskFn != nil {
		return c.GetDiskFn(project, zone, name)
	}
	return c.client.GetDisk(project, zone, name)
}
func (c *TestClient) AggregatedListDisks(project string, opts ...ListCallOption) ([]*compute.Disk, error) {
	if c.AggregatedListDisksFn != nil {
		return c.AggregatedListDisksFn(project, opts...)
	}
	return c.client.AggregatedListDisks(project, opts...)
}
func (c *TestClient) ListDisks(project, zone string, opts ...ListCallOption) ([]*compute.Disk, error) {
	if c.ListDisksFn != nil {
		return c.ListDisksFn(project, zone, opts...)
	}
	return c.client.ListDisks(project, zone, opts...)
}
func (c *TestClient) GetForwardingRule(project, region, name string) (*compute.ForwardingRule, error) {
	if c.GetForwardingRuleFn != nil {
		return c.GetForwardingRuleFn(project, region, name)
	}
	return c.client.GetForwardingRule(project, region, name)
}
func (c *TestClient) ListForwardingRules(project, region string, opts ...ListCallOption) ([]*compute.ForwardingRule, error) {
	if c.ListForwardingRulesFn != nil {
		return c.ListForwardingRulesFn(project, region, opts...)
	}
	return c.client.ListForwardingRules(project, region, opts...)
}
func (c *TestClient) GetFirewallRule(project, name string) (*compute.Firewall, error) {
	if c.GetFirewallRuleFn != nil {
		return c.GetFirewallRuleFn(project, name)
	}
	return c.client.GetFirewallRule(project, name)
}
func (c *TestClient) ListFirewallRules(project string, opts ...ListCallOption) ([]*compute.Firewall, error) {
	if c.ListFirewallRulesFn != nil {
		return c.ListFirewallRulesFn(project, opts...)
	}
	return c.client.ListFirewallRules(project, opts...)
}
func (c *TestClient) GetImage(project, name string) (*compute.Image, error) {
	if c.GetImageFn != nil {
		return c.GetImageFn(project, name)
	}
	return c.client.GetImage(project, name)
}
func (c *TestClient) GetImageFromFamily(project, family string) (*compute.Image, error) {
	if c.GetImageFromFamilyFn != nil {
		return c.GetImageFromFamilyFn(project, family)
	}
	return c.client.GetImageFromFamily(project, family)
}
func (c *TestClient) ListImages(project string, opts ...ListCallOption) ([]*compute.Image, error) {
	if c.ListImagesFn != nil {
		return c.ListImagesFn(project, opts...)
	}
	return c.client.ListImages(project, opts...)
}
func (c *TestClient) GetLicense(project, name string) (*compute.License, error) {
	if c.GetLicenseFn != nil {
		return c.GetLicenseFn(project, name)
	}
	return c.client.GetLicense(project, name)
}
func (c *TestClient) ListLicenses(project string, opts ...ListCallOption) ([]*compute.License, error) {
	if c.ListLicensesFn != nil {
		return c.ListLicensesFn(project)
	}
	return c.client.ListLicenses(project)
}
func (c *TestClient) GetNetwork(project, name string) (*compute.Network, error) {
	if c.GetNetworkFn != nil {
		return c.GetNetworkFn(project, name)
	}
	return c.client.GetNetwork(project, name)
}
func (c *TestClient) ListNetworks(project string, opts ...ListCallOption) ([]*compute.Network, error) {
	if c.ListNetworksFn != nil {
		return c.ListNetworksFn(project, opts...)
	}
	return c.client.ListNetworks(project, opts...)
}
func (c *TestClient) GetSubnetwork(project, region, name string) (*compute.Subnetwork, error) {
	if c.GetSubnetworkFn != nil {
		return c.GetSubnetworkFn(project, region, name)
	}
	return c.client.GetSubnetwork(project, region, name)
}
func (c *TestClient) AggregatedListSubnetworks(project string, opts ...ListCallOption) ([]*compute.Subnetwork, error) {
	if c.AggregatedListSubnetworksFn != nil {
		return c.AggregatedListSubnetworksFn(project, opts...)
	}
	return c.client.AggregatedListSubnetworks(project, opts...)
}
func (c *TestClient) ListSubnetworks(project, region string, opts ...ListCallOption) ([]*compute.Subnetwork, error) {
	if c.ListSubnetworksFn != nil {
		return c.ListSubnetworksFn(project, region, opts...)
	}
	return c.client.ListSubnetworks(project, region, opts...)
}
func (c *TestClient) GetTargetInstance(project, zone, name string) (*compute.TargetInstance, error) {
	if c.GetTargetInstanceFn != nil {
		return c.GetTargetInstanceFn(project, zone, name)
	}
	return c.client.GetTargetInstance(project, zone, name)
}
func (c *TestClient) ListTargetInstances(project, zone string, opts ...ListCallOption) ([]*compute.TargetInstance, error) {
	if c.ListTargetInstancesFn != nil {
		return c.ListTargetInstancesFn(project, zone, opts...)
	}
	return c.client.ListTargetInstances(project, zone, opts...)
}
func (c *TestClient) GetSerialPortOutput(project, zone, name string, port, start int64) (*compute.SerialPortOutput, error) {
	if c.GetSerialPortOutputFn != nil {
		return c.GetSerialPortOutputFn(project, zone, name, port, start)
	}
	return c.client.GetSerialPortOutput(project, zone, name, port, start)
}
func (c *TestClient) GetGuestAttributes(project, zone, name, queryPath, variableKey string) (*compute.GuestAttributes, error) {
	if c.GetGuestAttributesFn != nil {
		return c.GetGuestAttributesFn(project, zone, name, queryPath, variableKey)
	}
	return c.client.GetGuestAttributes(project, zone, name, queryPath, variableKey)
}
func (c *TestClient) InstanceStatus(project, zone, name string) (string, error) {
	if c.InstanceStatusFn != nil {
		return c.InstanceStatusFn(project, zone, name)
	}
	return c.client.InstanceStatus(project, zone, name)
}