terraform-provider-google/google/cloudfunctions_operation.go

25 lines
574 B
Go
Raw Normal View History

package google
import (
"google.golang.org/api/cloudfunctions/v1"
)
type CloudFunctionsOperationWaiter struct {
Service *cloudfunctions.Service
2018-12-27 01:42:37 +00:00
CommonOperationWaiter
}
2018-12-27 01:42:37 +00:00
func (w *CloudFunctionsOperationWaiter) QueryOp() (interface{}, error) {
return w.Service.Operations.Get(w.Op.Name).Do()
}
2018-12-27 01:42:37 +00:00
func cloudFunctionsOperationWait(service *cloudfunctions.Service, op *cloudfunctions.Operation, activity string) error {
w := &CloudFunctionsOperationWaiter{
2018-12-27 01:42:37 +00:00
Service: service,
}
2018-12-27 01:42:37 +00:00
if err := w.SetOp(op); err != nil {
return err
}
2018-12-27 01:42:37 +00:00
return OperationWait(w, activity, 4)
}