@@ -21,13 +21,13 @@ const (
2121
2222// Interface needed for tests
2323type APIClientInstanceInterface interface {
24- GetInstanceExecute (ctx context.Context , projectId , instanceId string ) (* sqlserverflex.GetInstanceResponse , error )
24+ GetInstanceExecute (ctx context.Context , projectId , instanceId , region string ) (* sqlserverflex.GetInstanceResponse , error )
2525}
2626
2727// CreateInstanceWaitHandler will wait for instance creation
28- func CreateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [sqlserverflex.GetInstanceResponse ] {
28+ func CreateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId , region string ) * wait.AsyncActionHandler [sqlserverflex.GetInstanceResponse ] {
2929 handler := wait .New (func () (waitFinished bool , response * sqlserverflex.GetInstanceResponse , err error ) {
30- s , err := a .GetInstanceExecute (ctx , projectId , instanceId )
30+ s , err := a .GetInstanceExecute (ctx , projectId , instanceId , region )
3131 if err != nil {
3232 return false , nil , err
3333 }
@@ -55,9 +55,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface
5555}
5656
5757// UpdateInstanceWaitHandler will wait for instance update
58- func UpdateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [sqlserverflex.GetInstanceResponse ] {
58+ func UpdateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId , region string ) * wait.AsyncActionHandler [sqlserverflex.GetInstanceResponse ] {
5959 handler := wait .New (func () (waitFinished bool , response * sqlserverflex.GetInstanceResponse , err error ) {
60- s , err := a .GetInstanceExecute (ctx , projectId , instanceId )
60+ s , err := a .GetInstanceExecute (ctx , projectId , instanceId , region )
6161 if err != nil {
6262 return false , nil , err
6363 }
@@ -85,14 +85,14 @@ func UpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface
8585}
8686
8787// PartialUpdateInstanceWaitHandler will wait for instance update
88- func PartialUpdateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [sqlserverflex.GetInstanceResponse ] {
89- return UpdateInstanceWaitHandler (ctx , a , projectId , instanceId )
88+ func PartialUpdateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId , region string ) * wait.AsyncActionHandler [sqlserverflex.GetInstanceResponse ] {
89+ return UpdateInstanceWaitHandler (ctx , a , projectId , instanceId , region )
9090}
9191
9292// DeleteInstanceWaitHandler will wait for instance deletion
93- func DeleteInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [struct {}] {
93+ func DeleteInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId , region string ) * wait.AsyncActionHandler [struct {}] {
9494 handler := wait .New (func () (waitFinished bool , response * struct {}, err error ) {
95- _ , err = a .GetInstanceExecute (ctx , projectId , instanceId )
95+ _ , err = a .GetInstanceExecute (ctx , projectId , instanceId , region )
9696 if err == nil {
9797 return false , nil , nil
9898 }
0 commit comments