From e87e526499b5c3f02b5c1e72a45d33c26b87cd41 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 14 Apr 2022 05:25:38 +0000 Subject: [PATCH] CodeGen from PR 18591 in Azure/azure-rest-api-specs Merge 3c536bea49eff5a777c07d842a2074e2bbc45c89 into ba65174ad2569e80fdb5838a1dddc26b8c0d6f3d --- .../resources/armlocks/CHANGELOG.md | 94 +++++ .../resources/armlocks/autorest.md | 6 +- sdk/resourcemanager/resources/armlocks/go.mod | 9 +- sdk/resourcemanager/resources/armlocks/go.sum | 43 +-- ...ple_authorizationoperations_client_test.go | 40 -- ...ted_example_managementlocks_client_test.go | 357 ------------------ ...enerated_authorizationoperations_client.go | 61 ++- .../armlocks/zz_generated_constants.go | 16 +- .../zz_generated_managementlocks_client.go | 187 ++++++--- .../resources/armlocks/zz_generated_models.go | 113 +----- .../armlocks/zz_generated_models_serde.go | 115 ++++++ .../resources/armlocks/zz_generated_pagers.go | 287 -------------- .../armlocks/zz_generated_response_types.go | 109 +----- .../armlocks/zz_generated_time_rfc3339.go | 4 +- 14 files changed, 410 insertions(+), 1031 deletions(-) delete mode 100644 sdk/resourcemanager/resources/armlocks/ze_generated_example_authorizationoperations_client_test.go delete mode 100644 sdk/resourcemanager/resources/armlocks/ze_generated_example_managementlocks_client_test.go create mode 100644 sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/resources/armlocks/zz_generated_pagers.go diff --git a/sdk/resourcemanager/resources/armlocks/CHANGELOG.md b/sdk/resourcemanager/resources/armlocks/CHANGELOG.md index b7126b2b241f..5ada40eb3203 100644 --- a/sdk/resourcemanager/resources/armlocks/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armlocks/CHANGELOG.md @@ -1,5 +1,99 @@ # Release History +## 0.3.0 (2022-04-14) +### Breaking Changes + +- Function `NewAuthorizationOperationsClient` return value(s) have been changed from `(*AuthorizationOperationsClient)` to `(*AuthorizationOperationsClient, error)` +- Function `*AuthorizationOperationsClient.List` return value(s) have been changed from `(*AuthorizationOperationsClientListPager)` to `(*runtime.Pager[AuthorizationOperationsClientListResponse])` +- Function `*ManagementLocksClient.ListAtResourceGroupLevel` return value(s) have been changed from `(*ManagementLocksClientListAtResourceGroupLevelPager)` to `(*runtime.Pager[ManagementLocksClientListAtResourceGroupLevelResponse])` +- Function `*ManagementLocksClient.ListByScope` return value(s) have been changed from `(*ManagementLocksClientListByScopePager)` to `(*runtime.Pager[ManagementLocksClientListByScopeResponse])` +- Function `*ManagementLocksClient.ListAtSubscriptionLevel` return value(s) have been changed from `(*ManagementLocksClientListAtSubscriptionLevelPager)` to `(*runtime.Pager[ManagementLocksClientListAtSubscriptionLevelResponse])` +- Function `NewManagementLocksClient` return value(s) have been changed from `(*ManagementLocksClient)` to `(*ManagementLocksClient, error)` +- Function `*ManagementLocksClient.ListAtResourceLevel` return value(s) have been changed from `(*ManagementLocksClientListAtResourceLevelPager)` to `(*runtime.Pager[ManagementLocksClientListAtResourceLevelResponse])` +- Type of `ErrorAdditionalInfo.Info` has been changed from `map[string]interface{}` to `interface{}` +- Function `*ManagementLocksClientListAtResourceGroupLevelPager.NextPage` has been removed +- Function `CreatedByType.ToPtr` has been removed +- Function `*ManagementLocksClientListAtSubscriptionLevelPager.Err` has been removed +- Function `*AuthorizationOperationsClientListPager.PageResponse` has been removed +- Function `*ManagementLocksClientListAtResourceGroupLevelPager.Err` has been removed +- Function `*AuthorizationOperationsClientListPager.NextPage` has been removed +- Function `*ManagementLocksClientListByScopePager.Err` has been removed +- Function `*AuthorizationOperationsClientListPager.Err` has been removed +- Function `*ManagementLocksClientListAtResourceLevelPager.PageResponse` has been removed +- Function `*ManagementLocksClientListByScopePager.NextPage` has been removed +- Function `*ManagementLocksClientListAtResourceGroupLevelPager.PageResponse` has been removed +- Function `*ManagementLocksClientListByScopePager.PageResponse` has been removed +- Function `*ManagementLocksClientListAtSubscriptionLevelPager.NextPage` has been removed +- Function `*ManagementLocksClientListAtResourceLevelPager.Err` has been removed +- Function `*ManagementLocksClientListAtResourceLevelPager.NextPage` has been removed +- Function `LockLevel.ToPtr` has been removed +- Function `*ManagementLocksClientListAtSubscriptionLevelPager.PageResponse` has been removed +- Struct `AuthorizationOperationsClientListPager` has been removed +- Struct `AuthorizationOperationsClientListResult` has been removed +- Struct `ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResult` has been removed +- Struct `ManagementLocksClientCreateOrUpdateAtResourceLevelResult` has been removed +- Struct `ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResult` has been removed +- Struct `ManagementLocksClientCreateOrUpdateByScopeResult` has been removed +- Struct `ManagementLocksClientGetAtResourceGroupLevelResult` has been removed +- Struct `ManagementLocksClientGetAtResourceLevelResult` has been removed +- Struct `ManagementLocksClientGetAtSubscriptionLevelResult` has been removed +- Struct `ManagementLocksClientGetByScopeResult` has been removed +- Struct `ManagementLocksClientListAtResourceGroupLevelPager` has been removed +- Struct `ManagementLocksClientListAtResourceGroupLevelResult` has been removed +- Struct `ManagementLocksClientListAtResourceLevelPager` has been removed +- Struct `ManagementLocksClientListAtResourceLevelResult` has been removed +- Struct `ManagementLocksClientListAtSubscriptionLevelPager` has been removed +- Struct `ManagementLocksClientListAtSubscriptionLevelResult` has been removed +- Struct `ManagementLocksClientListByScopePager` has been removed +- Struct `ManagementLocksClientListByScopeResult` has been removed +- Field `ManagementLocksClientCreateOrUpdateAtResourceLevelResult` of struct `ManagementLocksClientCreateOrUpdateAtResourceLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientCreateOrUpdateAtResourceLevelResponse` has been removed +- Field `ManagementLocksClientListAtResourceGroupLevelResult` of struct `ManagementLocksClientListAtResourceGroupLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientListAtResourceGroupLevelResponse` has been removed +- Field `AuthorizationOperationsClientListResult` of struct `AuthorizationOperationsClientListResponse` has been removed +- Field `RawResponse` of struct `AuthorizationOperationsClientListResponse` has been removed +- Field `ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResult` of struct `ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse` has been removed +- Field `ManagementLocksClientListAtResourceLevelResult` of struct `ManagementLocksClientListAtResourceLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientListAtResourceLevelResponse` has been removed +- Field `ManagementLocksClientListByScopeResult` of struct `ManagementLocksClientListByScopeResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientListByScopeResponse` has been removed +- Field `ManagementLocksClientCreateOrUpdateByScopeResult` of struct `ManagementLocksClientCreateOrUpdateByScopeResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientCreateOrUpdateByScopeResponse` has been removed +- Field `ManagementLocksClientGetAtResourceGroupLevelResult` of struct `ManagementLocksClientGetAtResourceGroupLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientGetAtResourceGroupLevelResponse` has been removed +- Field `ManagementLocksClientListAtSubscriptionLevelResult` of struct `ManagementLocksClientListAtSubscriptionLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientListAtSubscriptionLevelResponse` has been removed +- Field `ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResult` of struct `ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse` has been removed +- Field `ManagementLocksClientGetAtResourceLevelResult` of struct `ManagementLocksClientGetAtResourceLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientGetAtResourceLevelResponse` has been removed +- Field `ManagementLocksClientGetAtSubscriptionLevelResult` of struct `ManagementLocksClientGetAtSubscriptionLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientGetAtSubscriptionLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientDeleteAtResourceLevelResponse` has been removed +- Field `ManagementLocksClientGetByScopeResult` of struct `ManagementLocksClientGetByScopeResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientGetByScopeResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientDeleteByScopeResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientDeleteAtSubscriptionLevelResponse` has been removed +- Field `RawResponse` of struct `ManagementLocksClientDeleteAtResourceGroupLevelResponse` has been removed + +### Features Added + +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse` +- New anonymous field `ManagementLockListResult` in struct `ManagementLocksClientListAtSubscriptionLevelResponse` +- New anonymous field `ManagementLockListResult` in struct `ManagementLocksClientListAtResourceLevelResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientGetAtResourceGroupLevelResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientGetByScopeResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientGetAtResourceLevelResponse` +- New anonymous field `ManagementLockListResult` in struct `ManagementLocksClientListAtResourceGroupLevelResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientCreateOrUpdateByScopeResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientGetAtSubscriptionLevelResponse` +- New anonymous field `OperationListResult` in struct `AuthorizationOperationsClientListResponse` +- New anonymous field `ManagementLockListResult` in struct `ManagementLocksClientListByScopeResponse` +- New anonymous field `ManagementLockObject` in struct `ManagementLocksClientCreateOrUpdateAtResourceLevelResponse` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/resources/armlocks/autorest.md b/sdk/resourcemanager/resources/armlocks/autorest.md index a576761760dc..61e71a4a6a02 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/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/resources/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.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 aa08990ab912..abeae5a05a81 100644 --- a/sdk/resourcemanager/resources/armlocks/go.mod +++ b/sdk/resourcemanager/resources/armlocks/go.mod @@ -1,8 +1,11 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armlocks -go 1.16 +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/resources/armlocks/go.sum b/sdk/resourcemanager/resources/armlocks/go.sum index 2ce51d3b8174..a7eaa30576c1 100644 --- a/sdk/resourcemanager/resources/armlocks/go.sum +++ b/sdk/resourcemanager/resources/armlocks/go.sum @@ -1,26 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -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/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/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/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/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= @@ -28,32 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc 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-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -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/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 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= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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 deleted file mode 100644 index 896c0577821f..000000000000 --- a/sdk/resourcemanager/resources/armlocks/ze_generated_example_authorizationoperations_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armlocks_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armlocks" -) - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ListProviderOperations.json -func ExampleAuthorizationOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewAuthorizationOperationsClient(cred, nil) - pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} 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 deleted file mode 100644 index 813ef410b46e..000000000000 --- a/sdk/resourcemanager/resources/armlocks/ze_generated_example_managementlocks_client_test.go +++ /dev/null @@ -1,357 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armlocks_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armlocks" -) - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_CreateOrUpdateAtResourceGroupLevel.json -func ExampleManagementLocksClient_CreateOrUpdateAtResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.CreateOrUpdateAtResourceGroupLevel(ctx, - "", - "", - armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: armlocks.LockLevel("ReadOnly").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_DeleteAtResourceGroupLevel.json -func ExampleManagementLocksClient_DeleteAtResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - _, err = client.DeleteAtResourceGroupLevel(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtResourceGroupLevel.json -func ExampleManagementLocksClient_GetAtResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.GetAtResourceGroupLevel(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientGetAtResourceGroupLevelResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_CreateOrUpdateAtScope.json -func ExampleManagementLocksClient_CreateOrUpdateByScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.CreateOrUpdateByScope(ctx, - "", - "", - armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: armlocks.LockLevel("ReadOnly").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientCreateOrUpdateByScopeResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_DeleteAtScope.json -func ExampleManagementLocksClient_DeleteByScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - _, err = client.DeleteByScope(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtScope.json -func ExampleManagementLocksClient_GetByScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.GetByScope(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientGetByScopeResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_CreateOrUpdateAtResourceLevel.json -func ExampleManagementLocksClient_CreateOrUpdateAtResourceLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.CreateOrUpdateAtResourceLevel(ctx, - "", - "", - "", - "", - "", - "", - armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: armlocks.LockLevel("ReadOnly").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientCreateOrUpdateAtResourceLevelResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_DeleteAtResourceLevel.json -func ExampleManagementLocksClient_DeleteAtResourceLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - _, err = client.DeleteAtResourceLevel(ctx, - "", - "", - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtResourceLevel.json -func ExampleManagementLocksClient_GetAtResourceLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.GetAtResourceLevel(ctx, - "", - "", - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientGetAtResourceLevelResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_CreateOrUpdateAtSubscriptionLevel.json -func ExampleManagementLocksClient_CreateOrUpdateAtSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.CreateOrUpdateAtSubscriptionLevel(ctx, - "", - armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: armlocks.LockLevel("ReadOnly").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_DeleteAtSubscriptionLevel.json -func ExampleManagementLocksClient_DeleteAtSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - _, err = client.DeleteAtSubscriptionLevel(ctx, - "", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtSubscriptionLevel.json -func ExampleManagementLocksClient_GetAtSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - res, err := client.GetAtSubscriptionLevel(ctx, - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ManagementLocksClientGetAtSubscriptionLevelResult) -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtResourceGroupLevel.json -func ExampleManagementLocksClient_ListAtResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - pager := client.ListAtResourceGroupLevel("", - &armlocks.ManagementLocksClientListAtResourceGroupLevelOptions{Filter: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtResourceLevel.json -func ExampleManagementLocksClient_ListAtResourceLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - pager := client.ListAtResourceLevel("", - "", - "", - "", - "", - &armlocks.ManagementLocksClientListAtResourceLevelOptions{Filter: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtSubscriptionLevel.json -func ExampleManagementLocksClient_ListAtSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - pager := client.ListAtSubscriptionLevel(&armlocks.ManagementLocksClientListAtSubscriptionLevelOptions{Filter: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtScope.json -func ExampleManagementLocksClient_ListByScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armlocks.NewManagementLocksClient("", cred, nil) - pager := client.ListByScope("", - &armlocks.ManagementLocksClientListByScopeOptions{Filter: nil}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go b/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go index 14f213bf3a81..db32d1012e46 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_authorizationoperations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -13,6 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -28,35 +29,55 @@ type AuthorizationOperationsClient struct { // NewAuthorizationOperationsClient creates a new instance of AuthorizationOperationsClient with the specified values. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAuthorizationOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *AuthorizationOperationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewAuthorizationOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationOperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AuthorizationOperationsClient{ - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists all of the available Microsoft.Authorization REST API operations. // If the operation fails it returns an *azcore.ResponseError type. // options - AuthorizationOperationsClientListOptions contains the optional parameters for the AuthorizationOperationsClient.List // method. -func (client *AuthorizationOperationsClient) List(options *AuthorizationOperationsClientListOptions) *AuthorizationOperationsClientListPager { - return &AuthorizationOperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *AuthorizationOperationsClient) List(options *AuthorizationOperationsClientListOptions) *runtime.Pager[AuthorizationOperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AuthorizationOperationsClientListResponse]{ + More: func(page AuthorizationOperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AuthorizationOperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationListResult.NextLink) + Fetcher: func(ctx context.Context, page *AuthorizationOperationsClientListResponse) (AuthorizationOperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationOperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationOperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationOperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -75,7 +96,7 @@ func (client *AuthorizationOperationsClient) listCreateRequest(ctx context.Conte // listHandleResponse handles the List response. func (client *AuthorizationOperationsClient) listHandleResponse(resp *http.Response) (AuthorizationOperationsClientListResponse, error) { - result := AuthorizationOperationsClientListResponse{RawResponse: resp} + result := AuthorizationOperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return AuthorizationOperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go b/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go index 6aac0b9396c8..b086ef5e69ad 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -10,7 +10,7 @@ package armlocks const ( moduleName = "armlocks" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // CreatedByType - The type of identity that created the resource. @@ -33,11 +33,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// ToPtr returns a *CreatedByType pointing to the current value. -func (c CreatedByType) ToPtr() *CreatedByType { - return &c -} - // LockLevel - The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized // users are able to read and modify the resources, but not delete. ReadOnly means // authorized users can only read from a resource, but they can't modify or delete it. @@ -57,8 +52,3 @@ func PossibleLockLevelValues() []LockLevel { LockLevelReadOnly, } } - -// ToPtr returns a *LockLevel pointing to the current value. -func (c LockLevel) ToPtr() *LockLevel { - return &c -} diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go b/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go index f52eb3910219..d4547764fd48 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_managementlocks_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type ManagementLocksClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewManagementLocksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagementLocksClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewManagementLocksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementLocksClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ManagementLocksClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdateAtResourceGroupLevel - When you apply a lock at a parent scope, all child resources inherit the same lock. @@ -102,7 +107,7 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceGroupLevelCreateReq // createOrUpdateAtResourceGroupLevelHandleResponse handles the CreateOrUpdateAtResourceGroupLevel response. func (client *ManagementLocksClient) createOrUpdateAtResourceGroupLevelHandleResponse(resp *http.Response) (ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse, error) { - result := ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{RawResponse: resp} + result := ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{}, err } @@ -176,7 +181,7 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceLevelCreateRequest( // createOrUpdateAtResourceLevelHandleResponse handles the CreateOrUpdateAtResourceLevel response. func (client *ManagementLocksClient) createOrUpdateAtResourceLevelHandleResponse(resp *http.Response) (ManagementLocksClientCreateOrUpdateAtResourceLevelResponse, error) { - result := ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{RawResponse: resp} + result := ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{}, err } @@ -231,7 +236,7 @@ func (client *ManagementLocksClient) createOrUpdateAtSubscriptionLevelCreateRequ // createOrUpdateAtSubscriptionLevelHandleResponse handles the CreateOrUpdateAtSubscriptionLevel response. func (client *ManagementLocksClient) createOrUpdateAtSubscriptionLevelHandleResponse(resp *http.Response) (ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse, error) { - result := ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{RawResponse: resp} + result := ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{}, err } @@ -288,7 +293,7 @@ func (client *ManagementLocksClient) createOrUpdateByScopeCreateRequest(ctx cont // createOrUpdateByScopeHandleResponse handles the CreateOrUpdateByScope response. func (client *ManagementLocksClient) createOrUpdateByScopeHandleResponse(resp *http.Response) (ManagementLocksClientCreateOrUpdateByScopeResponse, error) { - result := ManagementLocksClientCreateOrUpdateByScopeResponse{RawResponse: resp} + result := ManagementLocksClientCreateOrUpdateByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientCreateOrUpdateByScopeResponse{}, err } @@ -315,7 +320,7 @@ func (client *ManagementLocksClient) DeleteAtResourceGroupLevel(ctx context.Cont if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, runtime.NewResponseError(resp) } - return ManagementLocksClientDeleteAtResourceGroupLevelResponse{RawResponse: resp}, nil + return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, nil } // deleteAtResourceGroupLevelCreateRequest creates the DeleteAtResourceGroupLevel request. @@ -368,7 +373,7 @@ func (client *ManagementLocksClient) DeleteAtResourceLevel(ctx context.Context, if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ManagementLocksClientDeleteAtResourceLevelResponse{}, runtime.NewResponseError(resp) } - return ManagementLocksClientDeleteAtResourceLevelResponse{RawResponse: resp}, nil + return ManagementLocksClientDeleteAtResourceLevelResponse{}, nil } // deleteAtResourceLevelCreateRequest creates the DeleteAtResourceLevel request. @@ -426,7 +431,7 @@ func (client *ManagementLocksClient) DeleteAtSubscriptionLevel(ctx context.Conte if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, runtime.NewResponseError(resp) } - return ManagementLocksClientDeleteAtSubscriptionLevelResponse{RawResponse: resp}, nil + return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, nil } // deleteAtSubscriptionLevelCreateRequest creates the DeleteAtSubscriptionLevel request. @@ -469,7 +474,7 @@ func (client *ManagementLocksClient) DeleteByScope(ctx context.Context, scope st if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ManagementLocksClientDeleteByScopeResponse{}, runtime.NewResponseError(resp) } - return ManagementLocksClientDeleteByScopeResponse{RawResponse: resp}, nil + return ManagementLocksClientDeleteByScopeResponse{}, nil } // deleteByScopeCreateRequest creates the DeleteByScope request. @@ -543,7 +548,7 @@ func (client *ManagementLocksClient) getAtResourceGroupLevelCreateRequest(ctx co // getAtResourceGroupLevelHandleResponse handles the GetAtResourceGroupLevel response. func (client *ManagementLocksClient) getAtResourceGroupLevelHandleResponse(resp *http.Response) (ManagementLocksClientGetAtResourceGroupLevelResponse, error) { - result := ManagementLocksClientGetAtResourceGroupLevelResponse{RawResponse: resp} + result := ManagementLocksClientGetAtResourceGroupLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientGetAtResourceGroupLevelResponse{}, err } @@ -613,7 +618,7 @@ func (client *ManagementLocksClient) getAtResourceLevelCreateRequest(ctx context // getAtResourceLevelHandleResponse handles the GetAtResourceLevel response. func (client *ManagementLocksClient) getAtResourceLevelHandleResponse(resp *http.Response) (ManagementLocksClientGetAtResourceLevelResponse, error) { - result := ManagementLocksClientGetAtResourceLevelResponse{RawResponse: resp} + result := ManagementLocksClientGetAtResourceLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientGetAtResourceLevelResponse{}, err } @@ -664,7 +669,7 @@ func (client *ManagementLocksClient) getAtSubscriptionLevelCreateRequest(ctx con // getAtSubscriptionLevelHandleResponse handles the GetAtSubscriptionLevel response. func (client *ManagementLocksClient) getAtSubscriptionLevelHandleResponse(resp *http.Response) (ManagementLocksClientGetAtSubscriptionLevelResponse, error) { - result := ManagementLocksClientGetAtSubscriptionLevelResponse{RawResponse: resp} + result := ManagementLocksClientGetAtSubscriptionLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientGetAtSubscriptionLevelResponse{}, err } @@ -716,7 +721,7 @@ func (client *ManagementLocksClient) getByScopeCreateRequest(ctx context.Context // getByScopeHandleResponse handles the GetByScope response. func (client *ManagementLocksClient) getByScopeHandleResponse(resp *http.Response) (ManagementLocksClientGetByScopeResponse, error) { - result := ManagementLocksClientGetByScopeResponse{RawResponse: resp} + result := ManagementLocksClientGetByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockObject); err != nil { return ManagementLocksClientGetByScopeResponse{}, err } @@ -728,16 +733,32 @@ func (client *ManagementLocksClient) getByScopeHandleResponse(resp *http.Respons // 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) ListAtResourceGroupLevel(resourceGroupName string, options *ManagementLocksClientListAtResourceGroupLevelOptions) *ManagementLocksClientListAtResourceGroupLevelPager { - return &ManagementLocksClientListAtResourceGroupLevelPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listAtResourceGroupLevelCreateRequest(ctx, resourceGroupName, options) +func (client *ManagementLocksClient) ListAtResourceGroupLevel(resourceGroupName string, options *ManagementLocksClientListAtResourceGroupLevelOptions) *runtime.Pager[ManagementLocksClientListAtResourceGroupLevelResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListAtResourceGroupLevelResponse]{ + More: func(page ManagementLocksClientListAtResourceGroupLevelResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagementLocksClientListAtResourceGroupLevelResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ManagementLockListResult.NextLink) + Fetcher: func(ctx context.Context, page *ManagementLocksClientListAtResourceGroupLevelResponse) (ManagementLocksClientListAtResourceGroupLevelResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAtResourceGroupLevelCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementLocksClientListAtResourceGroupLevelResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagementLocksClientListAtResourceGroupLevelResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementLocksClientListAtResourceGroupLevelResponse{}, runtime.NewResponseError(resp) + } + return client.listAtResourceGroupLevelHandleResponse(resp) }, - } + }) } // listAtResourceGroupLevelCreateRequest creates the ListAtResourceGroupLevel request. @@ -767,7 +788,7 @@ func (client *ManagementLocksClient) listAtResourceGroupLevelCreateRequest(ctx c // listAtResourceGroupLevelHandleResponse handles the ListAtResourceGroupLevel response. func (client *ManagementLocksClient) listAtResourceGroupLevelHandleResponse(resp *http.Response) (ManagementLocksClientListAtResourceGroupLevelResponse, error) { - result := ManagementLocksClientListAtResourceGroupLevelResponse{RawResponse: resp} + result := ManagementLocksClientListAtResourceGroupLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockListResult); err != nil { return ManagementLocksClientListAtResourceGroupLevelResponse{}, err } @@ -783,16 +804,32 @@ func (client *ManagementLocksClient) listAtResourceGroupLevelHandleResponse(resp // resourceName - The name of the locked resource. // options - ManagementLocksClientListAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.ListAtResourceLevel // method. -func (client *ManagementLocksClient) ListAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, options *ManagementLocksClientListAtResourceLevelOptions) *ManagementLocksClientListAtResourceLevelPager { - return &ManagementLocksClientListAtResourceLevelPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listAtResourceLevelCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options) +func (client *ManagementLocksClient) ListAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, options *ManagementLocksClientListAtResourceLevelOptions) *runtime.Pager[ManagementLocksClientListAtResourceLevelResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListAtResourceLevelResponse]{ + More: func(page ManagementLocksClientListAtResourceLevelResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagementLocksClientListAtResourceLevelResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ManagementLockListResult.NextLink) + Fetcher: func(ctx context.Context, page *ManagementLocksClientListAtResourceLevelResponse) (ManagementLocksClientListAtResourceLevelResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAtResourceLevelCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementLocksClientListAtResourceLevelResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagementLocksClientListAtResourceLevelResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementLocksClientListAtResourceLevelResponse{}, runtime.NewResponseError(resp) + } + return client.listAtResourceLevelHandleResponse(resp) }, - } + }) } // listAtResourceLevelCreateRequest creates the ListAtResourceLevel request. @@ -832,7 +869,7 @@ func (client *ManagementLocksClient) listAtResourceLevelCreateRequest(ctx contex // listAtResourceLevelHandleResponse handles the ListAtResourceLevel response. func (client *ManagementLocksClient) listAtResourceLevelHandleResponse(resp *http.Response) (ManagementLocksClientListAtResourceLevelResponse, error) { - result := ManagementLocksClientListAtResourceLevelResponse{RawResponse: resp} + result := ManagementLocksClientListAtResourceLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockListResult); err != nil { return ManagementLocksClientListAtResourceLevelResponse{}, err } @@ -843,16 +880,32 @@ func (client *ManagementLocksClient) listAtResourceLevelHandleResponse(resp *htt // If the operation fails it returns an *azcore.ResponseError type. // options - ManagementLocksClientListAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.ListAtSubscriptionLevel // method. -func (client *ManagementLocksClient) ListAtSubscriptionLevel(options *ManagementLocksClientListAtSubscriptionLevelOptions) *ManagementLocksClientListAtSubscriptionLevelPager { - return &ManagementLocksClientListAtSubscriptionLevelPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listAtSubscriptionLevelCreateRequest(ctx, options) +func (client *ManagementLocksClient) ListAtSubscriptionLevel(options *ManagementLocksClientListAtSubscriptionLevelOptions) *runtime.Pager[ManagementLocksClientListAtSubscriptionLevelResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListAtSubscriptionLevelResponse]{ + More: func(page ManagementLocksClientListAtSubscriptionLevelResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagementLocksClientListAtSubscriptionLevelResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ManagementLockListResult.NextLink) + Fetcher: func(ctx context.Context, page *ManagementLocksClientListAtSubscriptionLevelResponse) (ManagementLocksClientListAtSubscriptionLevelResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listAtSubscriptionLevelCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementLocksClientListAtSubscriptionLevelResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagementLocksClientListAtSubscriptionLevelResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementLocksClientListAtSubscriptionLevelResponse{}, runtime.NewResponseError(resp) + } + return client.listAtSubscriptionLevelHandleResponse(resp) }, - } + }) } // listAtSubscriptionLevelCreateRequest creates the ListAtSubscriptionLevel request. @@ -878,7 +931,7 @@ func (client *ManagementLocksClient) listAtSubscriptionLevelCreateRequest(ctx co // listAtSubscriptionLevelHandleResponse handles the ListAtSubscriptionLevel response. func (client *ManagementLocksClient) listAtSubscriptionLevelHandleResponse(resp *http.Response) (ManagementLocksClientListAtSubscriptionLevelResponse, error) { - result := ManagementLocksClientListAtSubscriptionLevelResponse{RawResponse: resp} + result := ManagementLocksClientListAtSubscriptionLevelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockListResult); err != nil { return ManagementLocksClientListAtSubscriptionLevelResponse{}, err } @@ -894,16 +947,32 @@ func (client *ManagementLocksClient) listAtSubscriptionLevelHandleResponse(resp // resources. // options - ManagementLocksClientListByScopeOptions contains the optional parameters for the ManagementLocksClient.ListByScope // method. -func (client *ManagementLocksClient) ListByScope(scope string, options *ManagementLocksClientListByScopeOptions) *ManagementLocksClientListByScopePager { - return &ManagementLocksClientListByScopePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByScopeCreateRequest(ctx, scope, options) +func (client *ManagementLocksClient) ListByScope(scope string, options *ManagementLocksClientListByScopeOptions) *runtime.Pager[ManagementLocksClientListByScopeResponse] { + return runtime.NewPager(runtime.PageProcessor[ManagementLocksClientListByScopeResponse]{ + More: func(page ManagementLocksClientListByScopeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ManagementLocksClientListByScopeResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ManagementLockListResult.NextLink) + Fetcher: func(ctx context.Context, page *ManagementLocksClientListByScopeResponse) (ManagementLocksClientListByScopeResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScopeCreateRequest(ctx, scope, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagementLocksClientListByScopeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagementLocksClientListByScopeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagementLocksClientListByScopeResponse{}, runtime.NewResponseError(resp) + } + return client.listByScopeHandleResponse(resp) }, - } + }) } // listByScopeCreateRequest creates the ListByScope request. @@ -929,7 +998,7 @@ func (client *ManagementLocksClient) listByScopeCreateRequest(ctx context.Contex // listByScopeHandleResponse handles the ListByScope response. func (client *ManagementLocksClient) listByScopeHandleResponse(resp *http.Response) (ManagementLocksClientListByScopeResponse, error) { - result := ManagementLocksClientListByScopeResponse{RawResponse: resp} + result := ManagementLocksClientListByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ManagementLockListResult); err != nil { return ManagementLocksClientListByScopeResponse{}, err } diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_models.go b/sdk/resourcemanager/resources/armlocks/zz_generated_models.go index 9d860f9c090a..32bbdbdefa1b 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_models.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -8,12 +8,7 @@ package armlocks -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) +import "time" // AuthorizationOperationsClientListOptions contains the optional parameters for the AuthorizationOperationsClient.List method. type AuthorizationOperationsClientListOptions struct { @@ -23,7 +18,7 @@ type AuthorizationOperationsClientListOptions struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info interface{} `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -47,17 +42,6 @@ type ErrorDetail struct { Target *string `json:"target,omitempty" azure:"ro"` } -// 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) -} - // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { @@ -74,14 +58,6 @@ type ManagementLockListResult struct { Value []*ManagementLockObject `json:"value,omitempty"` } -// 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) -} - // ManagementLockObject - The lock information. type ManagementLockObject struct { // REQUIRED; The properties of the lock. @@ -120,15 +96,6 @@ type ManagementLockProperties struct { Owners []*ManagementLockOwner `json:"owners,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ManagementLockProperties. -func (m ManagementLockProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "level", m.Level) - populate(objectMap, "notes", m.Notes) - populate(objectMap, "owners", m.Owners) - return json.Marshal(objectMap) -} - // ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel // method. type ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions struct { @@ -258,14 +225,6 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty"` } -// 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) -} - // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -286,67 +245,3 @@ type SystemData struct { // The type of identity that last modified the resource. LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go b/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go new file mode 100644 index 000000000000..044bb67bde05 --- /dev/null +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_models_serde.go @@ -0,0 +1,115 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armlocks + +import ( + "encoding/json" + "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{}) + populate(objectMap, "level", m.Level) + populate(objectMap, "notes", m.Notes) + populate(objectMap, "owners", m.Owners) + 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{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_pagers.go b/sdk/resourcemanager/resources/armlocks/zz_generated_pagers.go deleted file mode 100644 index a321a75fab61..000000000000 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_pagers.go +++ /dev/null @@ -1,287 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armlocks - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// AuthorizationOperationsClientListPager provides operations for iterating over paged responses. -type AuthorizationOperationsClientListPager struct { - client *AuthorizationOperationsClient - current AuthorizationOperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AuthorizationOperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AuthorizationOperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AuthorizationOperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationListResult.NextLink == nil || len(*p.current.OperationListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AuthorizationOperationsClientListResponse page. -func (p *AuthorizationOperationsClientListPager) PageResponse() AuthorizationOperationsClientListResponse { - return p.current -} - -// ManagementLocksClientListAtResourceGroupLevelPager provides operations for iterating over paged responses. -type ManagementLocksClientListAtResourceGroupLevelPager struct { - client *ManagementLocksClient - current ManagementLocksClientListAtResourceGroupLevelResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagementLocksClientListAtResourceGroupLevelResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagementLocksClientListAtResourceGroupLevelPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagementLocksClientListAtResourceGroupLevelPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ManagementLockListResult.NextLink == nil || len(*p.current.ManagementLockListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listAtResourceGroupLevelHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagementLocksClientListAtResourceGroupLevelResponse page. -func (p *ManagementLocksClientListAtResourceGroupLevelPager) PageResponse() ManagementLocksClientListAtResourceGroupLevelResponse { - return p.current -} - -// ManagementLocksClientListAtResourceLevelPager provides operations for iterating over paged responses. -type ManagementLocksClientListAtResourceLevelPager struct { - client *ManagementLocksClient - current ManagementLocksClientListAtResourceLevelResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagementLocksClientListAtResourceLevelResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagementLocksClientListAtResourceLevelPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagementLocksClientListAtResourceLevelPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ManagementLockListResult.NextLink == nil || len(*p.current.ManagementLockListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listAtResourceLevelHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagementLocksClientListAtResourceLevelResponse page. -func (p *ManagementLocksClientListAtResourceLevelPager) PageResponse() ManagementLocksClientListAtResourceLevelResponse { - return p.current -} - -// ManagementLocksClientListAtSubscriptionLevelPager provides operations for iterating over paged responses. -type ManagementLocksClientListAtSubscriptionLevelPager struct { - client *ManagementLocksClient - current ManagementLocksClientListAtSubscriptionLevelResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagementLocksClientListAtSubscriptionLevelResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagementLocksClientListAtSubscriptionLevelPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagementLocksClientListAtSubscriptionLevelPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ManagementLockListResult.NextLink == nil || len(*p.current.ManagementLockListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listAtSubscriptionLevelHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagementLocksClientListAtSubscriptionLevelResponse page. -func (p *ManagementLocksClientListAtSubscriptionLevelPager) PageResponse() ManagementLocksClientListAtSubscriptionLevelResponse { - return p.current -} - -// ManagementLocksClientListByScopePager provides operations for iterating over paged responses. -type ManagementLocksClientListByScopePager struct { - client *ManagementLocksClient - current ManagementLocksClientListByScopeResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ManagementLocksClientListByScopeResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ManagementLocksClientListByScopePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ManagementLocksClientListByScopePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ManagementLockListResult.NextLink == nil || len(*p.current.ManagementLockListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByScopeHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ManagementLocksClientListByScopeResponse page. -func (p *ManagementLocksClientListByScopePager) PageResponse() ManagementLocksClientListByScopeResponse { - return p.current -} diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_response_types.go b/sdk/resourcemanager/resources/armlocks/zz_generated_response_types.go index 7e8b03b84a67..2c89bef6ae77 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_response_types.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -8,184 +8,87 @@ package armlocks -import "net/http" - // AuthorizationOperationsClientListResponse contains the response from method AuthorizationOperationsClient.List. type AuthorizationOperationsClientListResponse struct { - AuthorizationOperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AuthorizationOperationsClientListResult contains the result from method AuthorizationOperationsClient.List. -type AuthorizationOperationsClientListResult struct { OperationListResult } // ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel. type ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse struct { - ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResult contains the result from method ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel. -type ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResult struct { ManagementLockObject } // ManagementLocksClientCreateOrUpdateAtResourceLevelResponse contains the response from method ManagementLocksClient.CreateOrUpdateAtResourceLevel. type ManagementLocksClientCreateOrUpdateAtResourceLevelResponse struct { - ManagementLocksClientCreateOrUpdateAtResourceLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientCreateOrUpdateAtResourceLevelResult contains the result from method ManagementLocksClient.CreateOrUpdateAtResourceLevel. -type ManagementLocksClientCreateOrUpdateAtResourceLevelResult struct { ManagementLockObject } // ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.CreateOrUpdateAtSubscriptionLevel. type ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse struct { - ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResult contains the result from method ManagementLocksClient.CreateOrUpdateAtSubscriptionLevel. -type ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResult struct { ManagementLockObject } // ManagementLocksClientCreateOrUpdateByScopeResponse contains the response from method ManagementLocksClient.CreateOrUpdateByScope. type ManagementLocksClientCreateOrUpdateByScopeResponse struct { - ManagementLocksClientCreateOrUpdateByScopeResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientCreateOrUpdateByScopeResult contains the result from method ManagementLocksClient.CreateOrUpdateByScope. -type ManagementLocksClientCreateOrUpdateByScopeResult struct { ManagementLockObject } // ManagementLocksClientDeleteAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.DeleteAtResourceGroupLevel. type ManagementLocksClientDeleteAtResourceGroupLevelResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ManagementLocksClientDeleteAtResourceLevelResponse contains the response from method ManagementLocksClient.DeleteAtResourceLevel. type ManagementLocksClientDeleteAtResourceLevelResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ManagementLocksClientDeleteAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.DeleteAtSubscriptionLevel. type ManagementLocksClientDeleteAtSubscriptionLevelResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ManagementLocksClientDeleteByScopeResponse contains the response from method ManagementLocksClient.DeleteByScope. type ManagementLocksClientDeleteByScopeResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ManagementLocksClientGetAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.GetAtResourceGroupLevel. type ManagementLocksClientGetAtResourceGroupLevelResponse struct { - ManagementLocksClientGetAtResourceGroupLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientGetAtResourceGroupLevelResult contains the result from method ManagementLocksClient.GetAtResourceGroupLevel. -type ManagementLocksClientGetAtResourceGroupLevelResult struct { ManagementLockObject } // ManagementLocksClientGetAtResourceLevelResponse contains the response from method ManagementLocksClient.GetAtResourceLevel. type ManagementLocksClientGetAtResourceLevelResponse struct { - ManagementLocksClientGetAtResourceLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientGetAtResourceLevelResult contains the result from method ManagementLocksClient.GetAtResourceLevel. -type ManagementLocksClientGetAtResourceLevelResult struct { ManagementLockObject } // ManagementLocksClientGetAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.GetAtSubscriptionLevel. type ManagementLocksClientGetAtSubscriptionLevelResponse struct { - ManagementLocksClientGetAtSubscriptionLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientGetAtSubscriptionLevelResult contains the result from method ManagementLocksClient.GetAtSubscriptionLevel. -type ManagementLocksClientGetAtSubscriptionLevelResult struct { ManagementLockObject } // ManagementLocksClientGetByScopeResponse contains the response from method ManagementLocksClient.GetByScope. type ManagementLocksClientGetByScopeResponse struct { - ManagementLocksClientGetByScopeResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientGetByScopeResult contains the result from method ManagementLocksClient.GetByScope. -type ManagementLocksClientGetByScopeResult struct { ManagementLockObject } // ManagementLocksClientListAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.ListAtResourceGroupLevel. type ManagementLocksClientListAtResourceGroupLevelResponse struct { - ManagementLocksClientListAtResourceGroupLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientListAtResourceGroupLevelResult contains the result from method ManagementLocksClient.ListAtResourceGroupLevel. -type ManagementLocksClientListAtResourceGroupLevelResult struct { ManagementLockListResult } // ManagementLocksClientListAtResourceLevelResponse contains the response from method ManagementLocksClient.ListAtResourceLevel. type ManagementLocksClientListAtResourceLevelResponse struct { - ManagementLocksClientListAtResourceLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientListAtResourceLevelResult contains the result from method ManagementLocksClient.ListAtResourceLevel. -type ManagementLocksClientListAtResourceLevelResult struct { ManagementLockListResult } // ManagementLocksClientListAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.ListAtSubscriptionLevel. type ManagementLocksClientListAtSubscriptionLevelResponse struct { - ManagementLocksClientListAtSubscriptionLevelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientListAtSubscriptionLevelResult contains the result from method ManagementLocksClient.ListAtSubscriptionLevel. -type ManagementLocksClientListAtSubscriptionLevelResult struct { ManagementLockListResult } // ManagementLocksClientListByScopeResponse contains the response from method ManagementLocksClient.ListByScope. type ManagementLocksClientListByScopeResponse struct { - ManagementLocksClientListByScopeResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ManagementLocksClientListByScopeResult contains the result from method ManagementLocksClient.ListByScope. -type ManagementLocksClientListByScopeResult struct { ManagementLockListResult } diff --git a/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go b/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go index b508d61785ce..cadf9c4389e7 100644 --- a/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/resources/armlocks/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information.