mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-07 03:01:06 +00:00
63216b0c90
Signed-off-by: Modular Magician <magic-modules@google.com>
47 lines
1.4 KiB
Go
47 lines
1.4 KiB
Go
// ----------------------------------------------------------------------------
|
|
//
|
|
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
|
|
//
|
|
// ----------------------------------------------------------------------------
|
|
//
|
|
// This file is automatically generated by Magic Modules and manual
|
|
// changes will be clobbered when the file is regenerated.
|
|
//
|
|
// Please read more about how to change this file in
|
|
// .github/CONTRIBUTING.md.
|
|
//
|
|
// ----------------------------------------------------------------------------
|
|
package google
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type FilestoreOperationWaiter struct {
|
|
Config *Config
|
|
CommonOperationWaiter
|
|
}
|
|
|
|
func (w *FilestoreOperationWaiter) QueryOp() (interface{}, error) {
|
|
if w == nil {
|
|
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
|
|
}
|
|
// Returns the proper get.
|
|
url := fmt.Sprintf("https://file.googleapis.com/v1/%s", w.CommonOperationWaiter.Op.Name)
|
|
return sendRequest(w.Config, "GET", url, nil)
|
|
}
|
|
|
|
func filestoreOperationWaitTime(config *Config, op map[string]interface{}, project, activity string, timeoutMinutes int) error {
|
|
if val, ok := op["name"]; !ok || val == "" {
|
|
// This was a synchronous call - there is no operation to wait for.
|
|
return nil
|
|
}
|
|
w := &FilestoreOperationWaiter{
|
|
Config: config,
|
|
}
|
|
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
|
|
return err
|
|
}
|
|
return OperationWait(w, activity, timeoutMinutes)
|
|
}
|