diff --git a/sdk/resourcemanager/resources/armlocks/CHANGELOG.md b/sdk/resourcemanager/resources/armlocks/CHANGELOG.md index fd6b487fc17b..238148162d06 100644 --- a/sdk/resourcemanager/resources/armlocks/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armlocks/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 1.0.0 (2022-05-16) +### Breaking Changes + +- Function `OperationListResult.MarshalJSON` has been removed +- Function `ErrorDetail.MarshalJSON` has been removed +- Function `ManagementLockListResult.MarshalJSON` has been removed + + ## 0.4.0 (2022-04-18) ### Breaking Changes diff --git a/sdk/resourcemanager/resources/armlocks/autorest.md b/sdk/resourcemanager/resources/armlocks/autorest.md index 4c591be67ebf..5712ce226195 100644 --- a/sdk/resourcemanager/resources/armlocks/autorest.md +++ b/sdk/resourcemanager/resources/armlocks/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/resources/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 1.0.0 package-locks: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armlocks/go.mod b/sdk/resourcemanager/resources/armlocks/go.mod index 26cbc1fdcea7..9d97bb19c067 100644 --- a/sdk/resourcemanager/resources/armlocks/go.mod +++ b/sdk/resourcemanager/resources/armlocks/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armlocks go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/golang-jwt/jwt v3.2.1+incompatible // indirect github.com/google/uuid v1.1.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/resources/armlocks/go.sum b/sdk/resourcemanager/resources/armlocks/go.sum index 56d1c32628ae..ed5b814680ee 100644 --- a/sdk/resourcemanager/resources/armlocks/go.sum +++ b/sdk/resourcemanager/resources/armlocks/go.sum @@ -1,15 +1,13 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= @@ -17,37 +15,19 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/resources/armlocks/ze_generated_example_authorizationoperations_client_test.go b/sdk/resourcemanager/resources/armlocks/ze_generated_example_authorizationoperations_client_test.go index 95010dad97ce..65c8038c9e32 100644 --- a/sdk/resourcemanager/resources/armlocks/ze_generated_example_authorizationoperations_client_test.go +++ b/sdk/resourcemanager/resources/armlocks/ze_generated_example_authorizationoperations_client_test.go @@ -32,7 +32,6 @@ func ExampleAuthorizationOperationsClient_NewListPager() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item diff --git a/sdk/resourcemanager/resources/armlocks/ze_generated_example_managementlocks_client_test.go b/sdk/resourcemanager/resources/armlocks/ze_generated_example_managementlocks_client_test.go index 590058f677bc..06d8c99bd1b0 100644 --- a/sdk/resourcemanager/resources/armlocks/ze_generated_example_managementlocks_client_test.go +++ b/sdk/resourcemanager/resources/armlocks/ze_generated_example_managementlocks_client_test.go @@ -24,13 +24,13 @@ func ExampleManagementLocksClient_CreateOrUpdateAtResourceGroupLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.CreateOrUpdateAtResourceGroupLevel(ctx, - "", - "", + "resourcegroupname", + "testlock", armlocks.ManagementLockObject{ Properties: &armlocks.ManagementLockProperties{ Level: to.Ptr(armlocks.LockLevelReadOnly), @@ -51,13 +51,13 @@ func ExampleManagementLocksClient_DeleteAtResourceGroupLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.DeleteAtResourceGroupLevel(ctx, - "", - "", + "resourcegroupname", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -71,13 +71,13 @@ func ExampleManagementLocksClient_GetAtResourceGroupLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetAtResourceGroupLevel(ctx, - "", - "", + "resourcegroupname", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -98,8 +98,8 @@ func ExampleManagementLocksClient_CreateOrUpdateByScope() { log.Fatalf("failed to create client: %v", err) } res, err := client.CreateOrUpdateByScope(ctx, - "", - "", + "subscriptions/subscriptionId", + "testlock", armlocks.ManagementLockObject{ Properties: &armlocks.ManagementLockProperties{ Level: to.Ptr(armlocks.LockLevelReadOnly), @@ -125,8 +125,8 @@ func ExampleManagementLocksClient_DeleteByScope() { log.Fatalf("failed to create client: %v", err) } _, err = client.DeleteByScope(ctx, - "", - "", + "subscriptions/subscriptionId", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -145,8 +145,8 @@ func ExampleManagementLocksClient_GetByScope() { log.Fatalf("failed to create client: %v", err) } res, err := client.GetByScope(ctx, - "", - "", + "subscriptions/subscriptionId", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -162,17 +162,17 @@ func ExampleManagementLocksClient_CreateOrUpdateAtResourceLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.CreateOrUpdateAtResourceLevel(ctx, - "", - "", - "", - "", - "", - "", + "resourcegroupname", + "Microsoft.Storage", + "parentResourcePath", + "storageAccounts", + "teststorageaccount", + "testlock", armlocks.ManagementLockObject{ Properties: &armlocks.ManagementLockProperties{ Level: to.Ptr(armlocks.LockLevelReadOnly), @@ -193,17 +193,17 @@ func ExampleManagementLocksClient_DeleteAtResourceLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.DeleteAtResourceLevel(ctx, - "", - "", - "", - "", - "", - "", + "resourcegroupname", + "Microsoft.Storage", + "parentResourcePath", + "storageAccounts", + "teststorageaccount", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -217,17 +217,17 @@ func ExampleManagementLocksClient_GetAtResourceLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetAtResourceLevel(ctx, - "", - "", - "", - "", - "", - "", + "resourcegroupname", + "Microsoft.Storage", + "parentResourcePath", + "storageAccounts", + "teststorageaccount", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -243,12 +243,12 @@ func ExampleManagementLocksClient_CreateOrUpdateAtSubscriptionLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.CreateOrUpdateAtSubscriptionLevel(ctx, - "", + "testlock", armlocks.ManagementLockObject{ Properties: &armlocks.ManagementLockProperties{ Level: to.Ptr(armlocks.LockLevelReadOnly), @@ -269,12 +269,12 @@ func ExampleManagementLocksClient_DeleteAtSubscriptionLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = client.DeleteAtSubscriptionLevel(ctx, - "", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -288,12 +288,12 @@ func ExampleManagementLocksClient_GetAtSubscriptionLevel() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.GetAtSubscriptionLevel(ctx, - "", + "testlock", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -309,17 +309,16 @@ func ExampleManagementLocksClient_NewListAtResourceGroupLevelPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAtResourceGroupLevelPager("", + pager := client.NewListAtResourceGroupLevelPager("resourcegroupname", &armlocks.ManagementLocksClientListAtResourceGroupLevelOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -335,21 +334,20 @@ func ExampleManagementLocksClient_NewListAtResourceLevelPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAtResourceLevelPager("", - "", - "", - "", - "", + pager := client.NewListAtResourceLevelPager("resourcegroupname", + "Microsoft.Storage", + "parentResourcePath", + "storageAccounts", + "teststorageaccount", &armlocks.ManagementLocksClientListAtResourceLevelOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -365,7 +363,7 @@ func ExampleManagementLocksClient_NewListAtSubscriptionLevelPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armlocks.NewManagementLocksClient("", cred, nil) + client, err := armlocks.NewManagementLocksClient("subscriptionId", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -374,7 +372,6 @@ func ExampleManagementLocksClient_NewListAtSubscriptionLevelPager() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item @@ -394,13 +391,12 @@ func ExampleManagementLocksClient_NewListByScopePager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByScopePager("", + pager := client.NewListByScopePager("subscriptions/subscriptionId", &armlocks.ManagementLocksClientListByScopeOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) - return } for _, v := range nextResult.Value { // TODO: use page item diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go b/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go index 35a710c7aaa2..9dcade147923 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go @@ -33,7 +33,7 @@ func NewAuthorizationOperationsClient(credential azcore.TokenCredential, options if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -50,10 +50,11 @@ func NewAuthorizationOperationsClient(credential azcore.TokenCredential, options // NewListPager - Lists all of the available Microsoft.Authorization REST API operations. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // options - AuthorizationOperationsClientListOptions contains the optional parameters for the AuthorizationOperationsClient.List // method. func (client *AuthorizationOperationsClient) NewListPager(options *AuthorizationOperationsClientListOptions) *runtime.Pager[AuthorizationOperationsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[AuthorizationOperationsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[AuthorizationOperationsClientListResponse]{ More: func(page AuthorizationOperationsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -90,7 +91,7 @@ func (client *AuthorizationOperationsClient) listCreateRequest(ctx context.Conte reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go b/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go index e9b13860c258..f913c19a69c8 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go @@ -10,7 +10,7 @@ package armlocks const ( moduleName = "armlocks" - moduleVersion = "v0.4.0" + moduleVersion = "v1.0.0" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go b/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go index 084b55aa3ad2..05ea06660800 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go @@ -38,7 +38,7 @@ func NewManagementLocksClient(subscriptionID string, credential azcore.TokenCred if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -58,6 +58,7 @@ func NewManagementLocksClient(subscriptionID string, credential azcore.TokenCred // To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* // actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group to lock. // lockName - The lock name. The lock name can be a maximum of 260 characters. It cannot contain %, &, :, \, ?, /, or any // control characters. @@ -101,7 +102,7 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceGroupLevelCreateReq reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -118,6 +119,7 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceGroupLevelHandleRes // create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* // actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group containing the resource to lock. // resourceProviderNamespace - The resource provider namespace of the resource to lock. // parentResourcePath - The parent resource identity. @@ -175,7 +177,7 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceLevelCreateRequest( reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -192,6 +194,7 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceLevelHandleResponse // To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* // actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // lockName - The name of lock. The lock name can be a maximum of 260 characters. It cannot contain %, &, :, \, ?, /, or any // control characters. // parameters - The management lock parameters. @@ -230,7 +233,7 @@ func (client *ManagementLocksClient) createOrUpdateAtSubscriptionLevelCreateRequ reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -245,6 +248,7 @@ func (client *ManagementLocksClient) createOrUpdateAtSubscriptionLevelHandleResp // CreateOrUpdateByScope - Create or update a management lock by scope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // scope - The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, // '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for // resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' @@ -287,7 +291,7 @@ func (client *ManagementLocksClient) createOrUpdateByScopeCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } @@ -304,6 +308,7 @@ func (client *ManagementLocksClient) createOrUpdateByScopeHandleResponse(resp *h // actions. Of the built-in roles, only Owner and User Access Administrator are granted // those actions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group containing the lock. // lockName - The name of lock to delete. // options - ManagementLocksClientDeleteAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceGroupLevel @@ -345,7 +350,7 @@ func (client *ManagementLocksClient) deleteAtResourceGroupLevelCreateRequest(ctx reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -353,6 +358,7 @@ func (client *ManagementLocksClient) deleteAtResourceGroupLevelCreateRequest(ctx // actions. Of the built-in roles, only Owner and User Access Administrator are granted // those actions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group containing the resource with the lock to delete. // resourceProviderNamespace - The resource provider namespace of the resource with the lock to delete. // parentResourcePath - The parent resource identity. @@ -408,7 +414,7 @@ func (client *ManagementLocksClient) deleteAtResourceLevelCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -416,6 +422,7 @@ func (client *ManagementLocksClient) deleteAtResourceLevelCreateRequest(ctx cont // actions. Of the built-in roles, only Owner and User Access Administrator are granted // those actions. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // lockName - The name of lock to delete. // options - ManagementLocksClientDeleteAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtSubscriptionLevel // method. @@ -452,12 +459,13 @@ func (client *ManagementLocksClient) deleteAtSubscriptionLevelCreateRequest(ctx reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // DeleteByScope - Delete a management lock by scope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // scope - The scope for the lock. // lockName - The name of lock. // options - ManagementLocksClientDeleteByScopeOptions contains the optional parameters for the ManagementLocksClient.DeleteByScope @@ -495,12 +503,13 @@ func (client *ManagementLocksClient) deleteByScopeCreateRequest(ctx context.Cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // GetAtResourceGroupLevel - Gets a management lock at the resource group level. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the locked resource group. // lockName - The name of the lock to get. // options - ManagementLocksClientGetAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceGroupLevel @@ -542,7 +551,7 @@ func (client *ManagementLocksClient) getAtResourceGroupLevelCreateRequest(ctx co reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -557,6 +566,7 @@ func (client *ManagementLocksClient) getAtResourceGroupLevelHandleResponse(resp // GetAtResourceLevel - Get the management lock of a resource or any level below resource. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group. // resourceProviderNamespace - The namespace of the resource provider. // parentResourcePath - An extra path parameter needed in some services, like SQL Databases. @@ -612,7 +622,7 @@ func (client *ManagementLocksClient) getAtResourceLevelCreateRequest(ctx context reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -627,6 +637,7 @@ func (client *ManagementLocksClient) getAtResourceLevelHandleResponse(resp *http // GetAtSubscriptionLevel - Gets a management lock at the subscription level. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // lockName - The name of the lock to get. // options - ManagementLocksClientGetAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtSubscriptionLevel // method. @@ -663,7 +674,7 @@ func (client *ManagementLocksClient) getAtSubscriptionLevelCreateRequest(ctx con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -678,6 +689,7 @@ func (client *ManagementLocksClient) getAtSubscriptionLevelHandleResponse(resp * // GetByScope - Get a management lock by scope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // scope - The scope for the lock. // lockName - The name of lock. // options - ManagementLocksClientGetByScopeOptions contains the optional parameters for the ManagementLocksClient.GetByScope @@ -715,7 +727,7 @@ func (client *ManagementLocksClient) getByScopeCreateRequest(ctx context.Context reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -730,11 +742,12 @@ func (client *ManagementLocksClient) getByScopeHandleResponse(resp *http.Respons // NewListAtResourceGroupLevelPager - Gets all the management locks for a resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group containing the locks to get. // options - ManagementLocksClientListAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.ListAtResourceGroupLevel // method. func (client *ManagementLocksClient) NewListAtResourceGroupLevelPager(resourceGroupName string, options *ManagementLocksClientListAtResourceGroupLevelOptions) *runtime.Pager[ManagementLocksClientListAtResourceGroupLevelResponse] { - return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListAtResourceGroupLevelResponse]{ + return runtime.NewPager(runtime.PagingHandler[ManagementLocksClientListAtResourceGroupLevelResponse]{ More: func(page ManagementLocksClientListAtResourceGroupLevelResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -782,7 +795,7 @@ func (client *ManagementLocksClient) listAtResourceGroupLevelCreateRequest(ctx c } reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -797,6 +810,7 @@ func (client *ManagementLocksClient) listAtResourceGroupLevelHandleResponse(resp // NewListAtResourceLevelPager - Gets all the management locks for a resource or any level below resource. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // resourceGroupName - The name of the resource group containing the locked resource. The name is case insensitive. // resourceProviderNamespace - The namespace of the resource provider. // parentResourcePath - The parent resource identity. @@ -805,7 +819,7 @@ func (client *ManagementLocksClient) listAtResourceGroupLevelHandleResponse(resp // options - ManagementLocksClientListAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.ListAtResourceLevel // method. func (client *ManagementLocksClient) NewListAtResourceLevelPager(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, options *ManagementLocksClientListAtResourceLevelOptions) *runtime.Pager[ManagementLocksClientListAtResourceLevelResponse] { - return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListAtResourceLevelResponse]{ + return runtime.NewPager(runtime.PagingHandler[ManagementLocksClientListAtResourceLevelResponse]{ More: func(page ManagementLocksClientListAtResourceLevelResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -863,7 +877,7 @@ func (client *ManagementLocksClient) listAtResourceLevelCreateRequest(ctx contex } reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -878,10 +892,11 @@ func (client *ManagementLocksClient) listAtResourceLevelHandleResponse(resp *htt // NewListAtSubscriptionLevelPager - Gets all the management locks for a subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // options - ManagementLocksClientListAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.ListAtSubscriptionLevel // method. func (client *ManagementLocksClient) NewListAtSubscriptionLevelPager(options *ManagementLocksClientListAtSubscriptionLevelOptions) *runtime.Pager[ManagementLocksClientListAtSubscriptionLevelResponse] { - return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListAtSubscriptionLevelResponse]{ + return runtime.NewPager(runtime.PagingHandler[ManagementLocksClientListAtSubscriptionLevelResponse]{ More: func(page ManagementLocksClientListAtSubscriptionLevelResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -925,7 +940,7 @@ func (client *ManagementLocksClient) listAtSubscriptionLevelCreateRequest(ctx co } reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -940,6 +955,7 @@ func (client *ManagementLocksClient) listAtSubscriptionLevelHandleResponse(resp // NewListByScopePager - Gets all the management locks for a scope. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-05-01 // scope - The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, // '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for // resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' @@ -948,7 +964,7 @@ func (client *ManagementLocksClient) listAtSubscriptionLevelHandleResponse(resp // options - ManagementLocksClientListByScopeOptions contains the optional parameters for the ManagementLocksClient.ListByScope // method. func (client *ManagementLocksClient) NewListByScopePager(scope string, options *ManagementLocksClientListByScopeOptions) *runtime.Pager[ManagementLocksClientListByScopeResponse] { - return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListByScopeResponse]{ + return runtime.NewPager(runtime.PagingHandler[ManagementLocksClientListByScopeResponse]{ More: func(page ManagementLocksClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -992,7 +1008,7 @@ func (client *ManagementLocksClient) listByScopeCreateRequest(ctx context.Contex } reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go b/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go index 044bb67bde05..0d07abb81622 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go @@ -10,29 +10,11 @@ package armlocks import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagementLockListResult. -func (m ManagementLockListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type ManagementLockProperties. func (m ManagementLockProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -42,14 +24,6 @@ func (m ManagementLockProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -66,32 +40,32 @@ func (s SystemData) MarshalJSON() ([]byte, error) { func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": - err = unpopulate(val, &s.CreatedBy) + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": - err = unpopulate(val, &s.CreatedByType) + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil @@ -107,9 +81,12 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil } - return json.Unmarshal(data, v) + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil } diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go b/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go index cadf9c4389e7..4a26732c6b54 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go @@ -10,6 +10,7 @@ package armlocks import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" @@ -72,13 +73,13 @@ func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { m[k] = (*timeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { if data == nil || strings.EqualFold(string(data), "null") { return nil } var aux timeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { - return err + return fmt.Errorf("struct field %s: %v", fn, err) } *t = (*time.Time)(&aux) return nil