diff --git a/go.mod b/go.mod index b4eda8ea3d43..be776d4d8f5a 100644 --- a/go.mod +++ b/go.mod @@ -17,8 +17,8 @@ require ( github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.4.0 github.com/hashicorp/go-azure-helpers v0.66.2 - github.com/hashicorp/go-azure-sdk/resource-manager v0.20240320.1144505 - github.com/hashicorp/go-azure-sdk/sdk v0.20240320.1144505 + github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953 + github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953 github.com/hashicorp/go-hclog v1.5.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 diff --git a/go.sum b/go.sum index ba3092805494..75dfc710b924 100644 --- a/go.sum +++ b/go.sum @@ -95,10 +95,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2nAvHq4WgSjx8= github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4= -github.com/hashicorp/go-azure-sdk/resource-manager v0.20240320.1144505 h1:xMXHJE32HA1y+m/psMLP2dEMOwCKP7mTA9epS/NiiXc= -github.com/hashicorp/go-azure-sdk/resource-manager v0.20240320.1144505/go.mod h1:Gm1OmXNjcjCKRh3p0styx5RSB1w1HveT4nC1bA04RNE= -github.com/hashicorp/go-azure-sdk/sdk v0.20240320.1144505 h1:xyf0CAil4xoYGThviNOr4z+/I0GpqLaePMCd13n3Qps= -github.com/hashicorp/go-azure-sdk/sdk v0.20240320.1144505/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w= +github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953 h1:eoU9iMmWgufB441trZJ45TsZ+0vJ79vGKdBuVVYUXwI= +github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953/go.mod h1:zvsDltRIRr58vA0EpSmY+a6NcgGirQE/u02Ag+D8jmM= +github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953 h1:WAcSZL5+H9Z/DjUZ0x0sluNoEno/mD4b+NWpY04vJrw= +github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_managedidentitycredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_managedidentitycredential.go index 24486269af1b..40046682a18d 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_managedidentitycredential.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_managedidentitycredential.go @@ -11,6 +11,7 @@ import ( var _ Credential = ManagedIdentityCredential{} type ManagedIdentityCredential struct { + TypeProperties ManagedIdentityTypeProperties `json:"typeProperties"` // Fields inherited from Credential Annotations *[]interface{} `json:"annotations,omitempty"` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_systemassignedmanagedidentitycredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_systemassignedmanagedidentitycredential.go deleted file mode 100644 index 42c79e69195f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_systemassignedmanagedidentitycredential.go +++ /dev/null @@ -1,11 +0,0 @@ -package credentials - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SystemAssignedManagedIdentityCredential struct { - Annotations *[]interface{} `json:"annotations,omitempty"` - Description *string `json:"description,omitempty"` - Type string `json:"type"` - TypeProperties *ManagedIdentityTypeProperties `json:"typeProperties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_userassignedmanagedidentitycredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_userassignedmanagedidentitycredential.go deleted file mode 100644 index c47db874f29b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/datafactory/2018-06-01/credentials/model_userassignedmanagedidentitycredential.go +++ /dev/null @@ -1,11 +0,0 @@ -package credentials - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserAssignedManagedIdentityCredential struct { - Annotations *[]interface{} `json:"annotations,omitempty"` - Description *string `json:"description,omitempty"` - Type string `json:"type"` - TypeProperties ManagedIdentityTypeProperties `json:"typeProperties"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/README.md index 93ed14342a44..0ede8797bafb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/README.md @@ -111,11 +111,7 @@ payload := clusters.ClusterPatch{ } -read, err := client.Update(ctx, id, payload) -if err != nil { +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { // handle the error } -if model := read.Model; model != nil { - // do something with the model/response object -} ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/method_update.go index 80edce4b64fb..55fe35076020 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/method_update.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2020-08-01/clusters/method_update.go @@ -2,9 +2,12 @@ package clusters import ( "context" + "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" "github.com/hashicorp/go-azure-sdk/sdk/odata" ) @@ -12,6 +15,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type UpdateOperationResponse struct { + Poller pollers.Poller HttpResponse *http.Response OData *odata.OData Model *Cluster @@ -22,6 +26,7 @@ func (c ClustersClient) Update(ctx context.Context, id ClusterId, input ClusterP opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ + http.StatusAccepted, http.StatusOK, }, HttpMethod: http.MethodPatch, @@ -47,12 +52,24 @@ func (c ClustersClient) Update(ctx context.Context, id ClusterId, input ClusterP return } - var model Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { return } return } + +// UpdateThenPoll performs Update then polls until it's completed +func (c ClustersClient) UpdateThenPoll(ctx context.Context, id ClusterId, input ClusterPatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index ddb5fca48d9a..999dadf38339 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -153,7 +153,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/tags github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk/resource-manager v0.20240320.1144505 +# github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953 ## explicit; go 1.21 github.com/hashicorp/go-azure-sdk/resource-manager/aad/2021-05-01/domainservices github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview @@ -1071,7 +1071,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/saplands github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/saprecommendations github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/sapsupportedsku github.com/hashicorp/go-azure-sdk/resource-manager/workloads/2023-04-01/sapvirtualinstances -# github.com/hashicorp/go-azure-sdk/sdk v0.20240320.1144505 +# github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953 ## explicit; go 1.21 github.com/hashicorp/go-azure-sdk/sdk/auth github.com/hashicorp/go-azure-sdk/sdk/auth/autorest