terraform-provider-google/google/compute_shared_operation.go
Riley Karson 232cb87c7a Add versioned Beta support to google_compute_instance_group_manager (#234)
* Vendor GCP Compute Beta client library.

* Refactor resource_compute_instance_group_manager for multi version support (#129)

* Refactor resource_compute_instance_group_manager for multi version support.
* Minor changes based on review.
* Removed type-specific API version conversion functions.

* Add support for Beta operations.

* Add v0beta support to google_compute_instance_group_manager.

* Renamed Key to Feature, added comments & updated some parameter names.

* Fix code and tests for version finder to match fields that don't have a change.

* Store non-v1 resources' self links as v1 so that dependent single-version resources don't see diffs.

* Fix weird change to vendor.json from merge.

* Add a note that Convert loses ForceSendFields, fix failing test.

* Moved nil type to a switch case in compute_shared_operation.go.

* Move base api version declaration above schema.
2017-07-26 13:37:59 -07:00

24 lines
898 B
Go

package google
import (
computeBeta "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/compute/v1"
)
func computeSharedOperationWaitZone(config *Config, op interface{}, project string, zone, activity string) error {
return computeSharedOperationWaitZoneTime(config, op, project, zone, 4, activity)
}
func computeSharedOperationWaitZoneTime(config *Config, op interface{}, project string, zone string, minutes int, activity string) error {
switch op.(type) {
case *compute.Operation:
return computeOperationWaitZoneTime(config, op.(*compute.Operation), project, zone, minutes, activity)
case *computeBeta.Operation:
return computeBetaOperationWaitZoneTime(config, op.(*computeBeta.Operation), project, zone, minutes, activity)
case nil:
panic("Attempted to wait on an Operation that was nil.")
default:
panic("Attempted to wait on an Operation of unknown type.")
}
}