@@ -16,17 +16,15 @@ const (
1616)
1717
1818func GetCredentialsDisplayName (ctx context.Context , apiClient loadbalancer.DefaultAPI , projectId , region , credentialsRef string ) (string , error ) {
19- req := apiClient .GetCredentials (ctx , projectId , region , credentialsRef )
20- resp , err := apiClient .GetCredentialsExecute (req )
19+ resp , err := apiClient .GetCredentials (ctx , projectId , region , credentialsRef ).Execute ()
2120 if err != nil {
2221 return "" , fmt .Errorf ("get Load Balancer credentials: %w" , err )
2322 }
2423 return * resp .Credential .DisplayName , nil
2524}
2625
2726func GetLoadBalancerTargetPool (ctx context.Context , apiClient loadbalancer.DefaultAPI , projectId , region , loadBalancerName , targetPoolName string ) (* loadbalancer.TargetPool , error ) {
28- req := apiClient .GetLoadBalancer (ctx , projectId , region , loadBalancerName )
29- resp , err := apiClient .GetLoadBalancerExecute (req )
27+ resp , err := apiClient .GetLoadBalancer (ctx , projectId , region , loadBalancerName ).Execute ()
3028 if err != nil {
3129 return nil , fmt .Errorf ("get load balancer: %w" , err )
3230 }
@@ -139,8 +137,7 @@ func GetTargetName(ctx context.Context, apiClient loadbalancer.DefaultAPI, proje
139137// It goes through all load balancers and checks what observability credentials are being used, then returns a list of those credentials.
140138func GetUsedObsCredentials (ctx context.Context , apiClient loadbalancer.DefaultAPI , allCredentials []loadbalancer.CredentialsResponse , projectId , region string ) ([]loadbalancer.CredentialsResponse , error ) {
141139 var usedCredentialsSlice []loadbalancer.CredentialsResponse
142- req := apiClient .ListLoadBalancers (ctx , projectId , region )
143- loadBalancers , err := apiClient .ListLoadBalancersExecute (req )
140+ loadBalancers , err := apiClient .ListLoadBalancers (ctx , projectId , region ).Execute ()
144141 if err != nil {
145142 return nil , fmt .Errorf ("list load balancers: %w" , err )
146143 }
0 commit comments