diff --git a/sdk/resourcemanager/resources/armlocks/CHANGELOG.md b/sdk/resourcemanager/resources/armlocks/CHANGELOG.md index 799221adc0ae..cf7d85ee4b01 100644 --- a/sdk/resourcemanager/resources/armlocks/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armlocks/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.2 (2023-10-16) +### Other Changes + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/resources/armlocks/authorizationoperations_client.go b/sdk/resourcemanager/resources/armlocks/authorizationoperations_client.go index 960aac853cd0..83d80308d2cc 100644 --- a/sdk/resourcemanager/resources/armlocks/authorizationoperations_client.go +++ b/sdk/resourcemanager/resources/armlocks/authorizationoperations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks diff --git a/sdk/resourcemanager/resources/armlocks/authorizationoperations_client_example_test.go b/sdk/resourcemanager/resources/armlocks/authorizationoperations_client_example_test.go deleted file mode 100644 index 8113cd1323bc..000000000000 --- a/sdk/resourcemanager/resources/armlocks/authorizationoperations_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//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. -// DO NOT EDIT. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ListProviderOperations.json -func ExampleAuthorizationOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAuthorizationOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armlocks.OperationListResult{ - // Value: []*armlocks.Operation{ - // { - // Name: to.Ptr("Microsoft.Authorization/locks/read"), - // Display: &armlocks.OperationDisplay{ - // Operation: to.Ptr("read"), - // Provider: to.Ptr("Microsoft.Authorization"), - // Resource: to.Ptr("locks"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armlocks/autorest.md b/sdk/resourcemanager/resources/armlocks/autorest.md index 22fe3d8b5f33..841181840298 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/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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: 1.1.1 +module-version: 1.1.2 package-locks: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armlocks/client_factory.go b/sdk/resourcemanager/resources/armlocks/client_factory.go index 1063ee97b20d..89e61eb6c2d0 100644 --- a/sdk/resourcemanager/resources/armlocks/client_factory.go +++ b/sdk/resourcemanager/resources/armlocks/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks diff --git a/sdk/resourcemanager/resources/armlocks/constants.go b/sdk/resourcemanager/resources/armlocks/constants.go index e666d4c519a2..6bb5cc32dda7 100644 --- a/sdk/resourcemanager/resources/armlocks/constants.go +++ b/sdk/resourcemanager/resources/armlocks/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks const ( moduleName = "armlocks" - moduleVersion = "v1.1.1" + moduleVersion = "v1.1.2" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/resources/armlocks/go.mod b/sdk/resourcemanager/resources/armlocks/go.mod index 0143ca903aae..758961cfa188 100644 --- a/sdk/resourcemanager/resources/armlocks/go.mod +++ b/sdk/resourcemanager/resources/armlocks/go.mod @@ -2,20 +2,12 @@ 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 v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/resources/armlocks/go.sum b/sdk/resourcemanager/resources/armlocks/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/resources/armlocks/go.sum +++ b/sdk/resourcemanager/resources/armlocks/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= 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/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/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/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/managementlocks_client.go b/sdk/resourcemanager/resources/armlocks/managementlocks_client.go index 1c0547445fa5..66eefafb5726 100644 --- a/sdk/resourcemanager/resources/armlocks/managementlocks_client.go +++ b/sdk/resourcemanager/resources/armlocks/managementlocks_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks @@ -57,18 +56,21 @@ func NewManagementLocksClient(subscriptionID string, credential azcore.TokenCred // - options - ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel // method. func (client *ManagementLocksClient) CreateOrUpdateAtResourceGroupLevel(ctx context.Context, resourceGroupName string, lockName string, parameters ManagementLockObject, options *ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions) (ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse, error) { + var err error req, err := client.createOrUpdateAtResourceGroupLevelCreateRequest(ctx, resourceGroupName, lockName, parameters, options) if err != nil { return ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse{}, err } - return client.createOrUpdateAtResourceGroupLevelHandleResponse(resp) + resp, err := client.createOrUpdateAtResourceGroupLevelHandleResponse(httpResp) + return resp, err } // createOrUpdateAtResourceGroupLevelCreateRequest creates the CreateOrUpdateAtResourceGroupLevel request. @@ -94,7 +96,10 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceGroupLevelCreateReq reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateAtResourceGroupLevelHandleResponse handles the CreateOrUpdateAtResourceGroupLevel response. @@ -123,18 +128,21 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceGroupLevelHandleRes // - options - ManagementLocksClientCreateOrUpdateAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceLevel // method. func (client *ManagementLocksClient) CreateOrUpdateAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockObject, options *ManagementLocksClientCreateOrUpdateAtResourceLevelOptions) (ManagementLocksClientCreateOrUpdateAtResourceLevelResponse, error) { + var err error req, err := client.createOrUpdateAtResourceLevelCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, parameters, options) if err != nil { return ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientCreateOrUpdateAtResourceLevelResponse{}, err } - return client.createOrUpdateAtResourceLevelHandleResponse(resp) + resp, err := client.createOrUpdateAtResourceLevelHandleResponse(httpResp) + return resp, err } // createOrUpdateAtResourceLevelCreateRequest creates the CreateOrUpdateAtResourceLevel request. @@ -170,7 +178,10 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceLevelCreateRequest( reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateAtResourceLevelHandleResponse handles the CreateOrUpdateAtResourceLevel response. @@ -194,18 +205,21 @@ func (client *ManagementLocksClient) createOrUpdateAtResourceLevelHandleResponse // - options - ManagementLocksClientCreateOrUpdateAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtSubscriptionLevel // method. func (client *ManagementLocksClient) CreateOrUpdateAtSubscriptionLevel(ctx context.Context, lockName string, parameters ManagementLockObject, options *ManagementLocksClientCreateOrUpdateAtSubscriptionLevelOptions) (ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse, error) { + var err error req, err := client.createOrUpdateAtSubscriptionLevelCreateRequest(ctx, lockName, parameters, options) if err != nil { return ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse{}, err } - return client.createOrUpdateAtSubscriptionLevelHandleResponse(resp) + resp, err := client.createOrUpdateAtSubscriptionLevelHandleResponse(httpResp) + return resp, err } // createOrUpdateAtSubscriptionLevelCreateRequest creates the CreateOrUpdateAtSubscriptionLevel request. @@ -227,7 +241,10 @@ func (client *ManagementLocksClient) createOrUpdateAtSubscriptionLevelCreateRequ reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateAtSubscriptionLevelHandleResponse handles the CreateOrUpdateAtSubscriptionLevel response. @@ -253,18 +270,21 @@ func (client *ManagementLocksClient) createOrUpdateAtSubscriptionLevelHandleResp // - options - ManagementLocksClientCreateOrUpdateByScopeOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateByScope // method. func (client *ManagementLocksClient) CreateOrUpdateByScope(ctx context.Context, scope string, lockName string, parameters ManagementLockObject, options *ManagementLocksClientCreateOrUpdateByScopeOptions) (ManagementLocksClientCreateOrUpdateByScopeResponse, error) { + var err error req, err := client.createOrUpdateByScopeCreateRequest(ctx, scope, lockName, parameters, options) if err != nil { return ManagementLocksClientCreateOrUpdateByScopeResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientCreateOrUpdateByScopeResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ManagementLocksClientCreateOrUpdateByScopeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientCreateOrUpdateByScopeResponse{}, err } - return client.createOrUpdateByScopeHandleResponse(resp) + resp, err := client.createOrUpdateByScopeHandleResponse(httpResp) + return resp, err } // createOrUpdateByScopeCreateRequest creates the CreateOrUpdateByScope request. @@ -286,7 +306,10 @@ func (client *ManagementLocksClient) createOrUpdateByScopeCreateRequest(ctx cont reqQP.Set("api-version", "2020-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateByScopeHandleResponse handles the CreateOrUpdateByScope response. @@ -309,16 +332,18 @@ func (client *ManagementLocksClient) createOrUpdateByScopeHandleResponse(resp *h // - options - ManagementLocksClientDeleteAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceGroupLevel // method. func (client *ManagementLocksClient) DeleteAtResourceGroupLevel(ctx context.Context, resourceGroupName string, lockName string, options *ManagementLocksClientDeleteAtResourceGroupLevelOptions) (ManagementLocksClientDeleteAtResourceGroupLevelResponse, error) { + var err error req, err := client.deleteAtResourceGroupLevelCreateRequest(ctx, resourceGroupName, lockName, options) if err != nil { return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, err } return ManagementLocksClientDeleteAtResourceGroupLevelResponse{}, nil } @@ -364,16 +389,18 @@ func (client *ManagementLocksClient) deleteAtResourceGroupLevelCreateRequest(ctx // - options - ManagementLocksClientDeleteAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceLevel // method. func (client *ManagementLocksClient) DeleteAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, options *ManagementLocksClientDeleteAtResourceLevelOptions) (ManagementLocksClientDeleteAtResourceLevelResponse, error) { + var err error req, err := client.deleteAtResourceLevelCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, options) if err != nil { return ManagementLocksClientDeleteAtResourceLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientDeleteAtResourceLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ManagementLocksClientDeleteAtResourceLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientDeleteAtResourceLevelResponse{}, err } return ManagementLocksClientDeleteAtResourceLevelResponse{}, nil } @@ -424,16 +451,18 @@ func (client *ManagementLocksClient) deleteAtResourceLevelCreateRequest(ctx cont // - options - ManagementLocksClientDeleteAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtSubscriptionLevel // method. func (client *ManagementLocksClient) DeleteAtSubscriptionLevel(ctx context.Context, lockName string, options *ManagementLocksClientDeleteAtSubscriptionLevelOptions) (ManagementLocksClientDeleteAtSubscriptionLevelResponse, error) { + var err error req, err := client.deleteAtSubscriptionLevelCreateRequest(ctx, lockName, options) if err != nil { return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, err } return ManagementLocksClientDeleteAtSubscriptionLevelResponse{}, nil } @@ -469,16 +498,18 @@ func (client *ManagementLocksClient) deleteAtSubscriptionLevelCreateRequest(ctx // - options - ManagementLocksClientDeleteByScopeOptions contains the optional parameters for the ManagementLocksClient.DeleteByScope // method. func (client *ManagementLocksClient) DeleteByScope(ctx context.Context, scope string, lockName string, options *ManagementLocksClientDeleteByScopeOptions) (ManagementLocksClientDeleteByScopeResponse, error) { + var err error req, err := client.deleteByScopeCreateRequest(ctx, scope, lockName, options) if err != nil { return ManagementLocksClientDeleteByScopeResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientDeleteByScopeResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ManagementLocksClientDeleteByScopeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientDeleteByScopeResponse{}, err } return ManagementLocksClientDeleteByScopeResponse{}, nil } @@ -514,18 +545,21 @@ func (client *ManagementLocksClient) deleteByScopeCreateRequest(ctx context.Cont // - options - ManagementLocksClientGetAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceGroupLevel // method. func (client *ManagementLocksClient) GetAtResourceGroupLevel(ctx context.Context, resourceGroupName string, lockName string, options *ManagementLocksClientGetAtResourceGroupLevelOptions) (ManagementLocksClientGetAtResourceGroupLevelResponse, error) { + var err error req, err := client.getAtResourceGroupLevelCreateRequest(ctx, resourceGroupName, lockName, options) if err != nil { return ManagementLocksClientGetAtResourceGroupLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientGetAtResourceGroupLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementLocksClientGetAtResourceGroupLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientGetAtResourceGroupLevelResponse{}, err } - return client.getAtResourceGroupLevelHandleResponse(resp) + resp, err := client.getAtResourceGroupLevelHandleResponse(httpResp) + return resp, err } // getAtResourceGroupLevelCreateRequest creates the GetAtResourceGroupLevel request. @@ -576,18 +610,21 @@ func (client *ManagementLocksClient) getAtResourceGroupLevelHandleResponse(resp // - options - ManagementLocksClientGetAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceLevel // method. func (client *ManagementLocksClient) GetAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, options *ManagementLocksClientGetAtResourceLevelOptions) (ManagementLocksClientGetAtResourceLevelResponse, error) { + var err error req, err := client.getAtResourceLevelCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, options) if err != nil { return ManagementLocksClientGetAtResourceLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientGetAtResourceLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementLocksClientGetAtResourceLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientGetAtResourceLevelResponse{}, err } - return client.getAtResourceLevelHandleResponse(resp) + resp, err := client.getAtResourceLevelHandleResponse(httpResp) + return resp, err } // getAtResourceLevelCreateRequest creates the GetAtResourceLevel request. @@ -643,18 +680,21 @@ func (client *ManagementLocksClient) getAtResourceLevelHandleResponse(resp *http // - options - ManagementLocksClientGetAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtSubscriptionLevel // method. func (client *ManagementLocksClient) GetAtSubscriptionLevel(ctx context.Context, lockName string, options *ManagementLocksClientGetAtSubscriptionLevelOptions) (ManagementLocksClientGetAtSubscriptionLevelResponse, error) { + var err error req, err := client.getAtSubscriptionLevelCreateRequest(ctx, lockName, options) if err != nil { return ManagementLocksClientGetAtSubscriptionLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientGetAtSubscriptionLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementLocksClientGetAtSubscriptionLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientGetAtSubscriptionLevelResponse{}, err } - return client.getAtSubscriptionLevelHandleResponse(resp) + resp, err := client.getAtSubscriptionLevelHandleResponse(httpResp) + return resp, err } // getAtSubscriptionLevelCreateRequest creates the GetAtSubscriptionLevel request. @@ -697,18 +737,21 @@ func (client *ManagementLocksClient) getAtSubscriptionLevelHandleResponse(resp * // - options - ManagementLocksClientGetByScopeOptions contains the optional parameters for the ManagementLocksClient.GetByScope // method. func (client *ManagementLocksClient) GetByScope(ctx context.Context, scope string, lockName string, options *ManagementLocksClientGetByScopeOptions) (ManagementLocksClientGetByScopeResponse, error) { + var err error req, err := client.getByScopeCreateRequest(ctx, scope, lockName, options) if err != nil { return ManagementLocksClientGetByScopeResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementLocksClientGetByScopeResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementLocksClientGetByScopeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementLocksClientGetByScopeResponse{}, err } - return client.getByScopeHandleResponse(resp) + resp, err := client.getByScopeHandleResponse(httpResp) + return resp, err } // getByScopeCreateRequest creates the GetByScope request. diff --git a/sdk/resourcemanager/resources/armlocks/managementlocks_client_example_test.go b/sdk/resourcemanager/resources/armlocks/managementlocks_client_example_test.go deleted file mode 100644 index 1458096d49a9..000000000000 --- a/sdk/resourcemanager/resources/armlocks/managementlocks_client_example_test.go +++ /dev/null @@ -1,471 +0,0 @@ -//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. -// DO NOT EDIT. - -package armlocks_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armlocks" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().CreateOrUpdateAtResourceGroupLevel(ctx, "resourcegroupname", "testlock", armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: to.Ptr(armlocks.LockLevelReadOnly), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementLocksClient().DeleteAtResourceGroupLevel(ctx, "resourcegroupname", "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().GetAtResourceGroupLevel(ctx, "resourcegroupname", "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().CreateOrUpdateByScope(ctx, "subscriptions/subscriptionId", "testlock", armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: to.Ptr(armlocks.LockLevelReadOnly), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementLocksClient().DeleteByScope(ctx, "subscriptions/subscriptionId", "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().GetByScope(ctx, "subscriptions/subscriptionId", "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().CreateOrUpdateAtResourceLevel(ctx, "resourcegroupname", "Microsoft.Storage", "parentResourcePath", "storageAccounts", "teststorageaccount", "testlock", armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: to.Ptr(armlocks.LockLevelReadOnly), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementLocksClient().DeleteAtResourceLevel(ctx, "resourcegroupname", "Microsoft.Storage", "parentResourcePath", "storageAccounts", "teststorageaccount", "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().GetAtResourceLevel(ctx, "resourcegroupname", "Microsoft.Storage", "parentResourcePath", "storageAccounts", "teststorageaccount", "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().CreateOrUpdateAtSubscriptionLevel(ctx, "testlock", armlocks.ManagementLockObject{ - Properties: &armlocks.ManagementLockProperties{ - Level: to.Ptr(armlocks.LockLevelReadOnly), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementLocksClient().DeleteAtSubscriptionLevel(ctx, "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementLocksClient().GetAtSubscriptionLevel(ctx, "testlock", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagementLockObject = armlocks.ManagementLockObject{ - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtResourceGroupLevel.json -func ExampleManagementLocksClient_NewListAtResourceGroupLevelPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementLocksClient().NewListAtResourceGroupLevelPager("resourcegroupname", &armlocks.ManagementLocksClientListAtResourceGroupLevelOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagementLockListResult = armlocks.ManagementLockListResult{ - // Value: []*armlocks.ManagementLockObject{ - // { - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtResourceLevel.json -func ExampleManagementLocksClient_NewListAtResourceLevelPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementLocksClient().NewListAtResourceLevelPager("resourcegroupname", "Microsoft.Storage", "parentResourcePath", "storageAccounts", "teststorageaccount", &armlocks.ManagementLocksClientListAtResourceLevelOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagementLockListResult = armlocks.ManagementLockListResult{ - // Value: []*armlocks.ManagementLockObject{ - // { - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtSubscriptionLevel.json -func ExampleManagementLocksClient_NewListAtSubscriptionLevelPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementLocksClient().NewListAtSubscriptionLevelPager(&armlocks.ManagementLocksClientListAtSubscriptionLevelOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagementLockListResult = armlocks.ManagementLockListResult{ - // Value: []*armlocks.ManagementLockObject{ - // { - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtScope.json -func ExampleManagementLocksClient_NewListByScopePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armlocks.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementLocksClient().NewListByScopePager("subscriptions/subscriptionId", &armlocks.ManagementLocksClientListByScopeOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagementLockListResult = armlocks.ManagementLockListResult{ - // Value: []*armlocks.ManagementLockObject{ - // { - // Name: to.Ptr("testlock"), - // Type: to.Ptr("Microsoft.Authorization/locks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.Authorization/locks/testlock"), - // Properties: &armlocks.ManagementLockProperties{ - // Level: to.Ptr(armlocks.LockLevelReadOnly), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armlocks/models.go b/sdk/resourcemanager/resources/armlocks/models.go index a8cdc4bf9873..59b3b07c7d91 100644 --- a/sdk/resourcemanager/resources/armlocks/models.go +++ b/sdk/resourcemanager/resources/armlocks/models.go @@ -3,20 +3,13 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks import "time" -// AuthorizationOperationsClientListOptions contains the optional parameters for the AuthorizationOperationsClient.NewListPager -// method. -type AuthorizationOperationsClientListOptions struct { - // placeholder for future optional parameters -} - // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -98,105 +91,6 @@ type ManagementLockProperties struct { Owners []*ManagementLockOwner } -// ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel -// method. -type ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientCreateOrUpdateAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceLevel -// method. -type ManagementLocksClientCreateOrUpdateAtResourceLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientCreateOrUpdateAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtSubscriptionLevel -// method. -type ManagementLocksClientCreateOrUpdateAtSubscriptionLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientCreateOrUpdateByScopeOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateByScope -// method. -type ManagementLocksClientCreateOrUpdateByScopeOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientDeleteAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceGroupLevel -// method. -type ManagementLocksClientDeleteAtResourceGroupLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientDeleteAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceLevel -// method. -type ManagementLocksClientDeleteAtResourceLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientDeleteAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtSubscriptionLevel -// method. -type ManagementLocksClientDeleteAtSubscriptionLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientDeleteByScopeOptions contains the optional parameters for the ManagementLocksClient.DeleteByScope -// method. -type ManagementLocksClientDeleteByScopeOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientGetAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceGroupLevel -// method. -type ManagementLocksClientGetAtResourceGroupLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientGetAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceLevel -// method. -type ManagementLocksClientGetAtResourceLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientGetAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtSubscriptionLevel -// method. -type ManagementLocksClientGetAtSubscriptionLevelOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientGetByScopeOptions contains the optional parameters for the ManagementLocksClient.GetByScope method. -type ManagementLocksClientGetByScopeOptions struct { - // placeholder for future optional parameters -} - -// ManagementLocksClientListAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.NewListAtResourceGroupLevelPager -// method. -type ManagementLocksClientListAtResourceGroupLevelOptions struct { - // The filter to apply on the operation. - Filter *string -} - -// ManagementLocksClientListAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.NewListAtResourceLevelPager -// method. -type ManagementLocksClientListAtResourceLevelOptions struct { - // The filter to apply on the operation. - Filter *string -} - -// ManagementLocksClientListAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.NewListAtSubscriptionLevelPager -// method. -type ManagementLocksClientListAtSubscriptionLevelOptions struct { - // The filter to apply on the operation. - Filter *string -} - -// ManagementLocksClientListByScopeOptions contains the optional parameters for the ManagementLocksClient.NewListByScopePager -// method. -type ManagementLocksClientListByScopeOptions struct { - // The filter to apply on the operation. - Filter *string -} - // Operation - Microsoft.Authorization operation type Operation struct { // The object that represents the operation. diff --git a/sdk/resourcemanager/resources/armlocks/models_serde.go b/sdk/resourcemanager/resources/armlocks/models_serde.go index b6a3120a1472..57d512305eeb 100644 --- a/sdk/resourcemanager/resources/armlocks/models_serde.go +++ b/sdk/resourcemanager/resources/armlocks/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks diff --git a/sdk/resourcemanager/resources/armlocks/options.go b/sdk/resourcemanager/resources/armlocks/options.go new file mode 100644 index 000000000000..2e4b37ceb684 --- /dev/null +++ b/sdk/resourcemanager/resources/armlocks/options.go @@ -0,0 +1,114 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armlocks + +// AuthorizationOperationsClientListOptions contains the optional parameters for the AuthorizationOperationsClient.NewListPager +// method. +type AuthorizationOperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel +// method. +type ManagementLocksClientCreateOrUpdateAtResourceGroupLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientCreateOrUpdateAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtResourceLevel +// method. +type ManagementLocksClientCreateOrUpdateAtResourceLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientCreateOrUpdateAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateAtSubscriptionLevel +// method. +type ManagementLocksClientCreateOrUpdateAtSubscriptionLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientCreateOrUpdateByScopeOptions contains the optional parameters for the ManagementLocksClient.CreateOrUpdateByScope +// method. +type ManagementLocksClientCreateOrUpdateByScopeOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientDeleteAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceGroupLevel +// method. +type ManagementLocksClientDeleteAtResourceGroupLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientDeleteAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtResourceLevel +// method. +type ManagementLocksClientDeleteAtResourceLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientDeleteAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.DeleteAtSubscriptionLevel +// method. +type ManagementLocksClientDeleteAtSubscriptionLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientDeleteByScopeOptions contains the optional parameters for the ManagementLocksClient.DeleteByScope +// method. +type ManagementLocksClientDeleteByScopeOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientGetAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceGroupLevel +// method. +type ManagementLocksClientGetAtResourceGroupLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientGetAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtResourceLevel +// method. +type ManagementLocksClientGetAtResourceLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientGetAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.GetAtSubscriptionLevel +// method. +type ManagementLocksClientGetAtSubscriptionLevelOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientGetByScopeOptions contains the optional parameters for the ManagementLocksClient.GetByScope method. +type ManagementLocksClientGetByScopeOptions struct { + // placeholder for future optional parameters +} + +// ManagementLocksClientListAtResourceGroupLevelOptions contains the optional parameters for the ManagementLocksClient.NewListAtResourceGroupLevelPager +// method. +type ManagementLocksClientListAtResourceGroupLevelOptions struct { + // The filter to apply on the operation. + Filter *string +} + +// ManagementLocksClientListAtResourceLevelOptions contains the optional parameters for the ManagementLocksClient.NewListAtResourceLevelPager +// method. +type ManagementLocksClientListAtResourceLevelOptions struct { + // The filter to apply on the operation. + Filter *string +} + +// ManagementLocksClientListAtSubscriptionLevelOptions contains the optional parameters for the ManagementLocksClient.NewListAtSubscriptionLevelPager +// method. +type ManagementLocksClientListAtSubscriptionLevelOptions struct { + // The filter to apply on the operation. + Filter *string +} + +// ManagementLocksClientListByScopeOptions contains the optional parameters for the ManagementLocksClient.NewListByScopePager +// method. +type ManagementLocksClientListByScopeOptions struct { + // The filter to apply on the operation. + Filter *string +} diff --git a/sdk/resourcemanager/resources/armlocks/response_types.go b/sdk/resourcemanager/resources/armlocks/response_types.go index 91d42f455b70..15ee181e7c0e 100644 --- a/sdk/resourcemanager/resources/armlocks/response_types.go +++ b/sdk/resourcemanager/resources/armlocks/response_types.go @@ -3,34 +3,39 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks // AuthorizationOperationsClientListResponse contains the response from method AuthorizationOperationsClient.NewListPager. type AuthorizationOperationsClientListResponse struct { + // Result of the request to list Microsoft.Authorization operations. It contains a list of operations and a URL link to get + // the next set of results. OperationListResult } // ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.CreateOrUpdateAtResourceGroupLevel. type ManagementLocksClientCreateOrUpdateAtResourceGroupLevelResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientCreateOrUpdateAtResourceLevelResponse contains the response from method ManagementLocksClient.CreateOrUpdateAtResourceLevel. type ManagementLocksClientCreateOrUpdateAtResourceLevelResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.CreateOrUpdateAtSubscriptionLevel. type ManagementLocksClientCreateOrUpdateAtSubscriptionLevelResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientCreateOrUpdateByScopeResponse contains the response from method ManagementLocksClient.CreateOrUpdateByScope. type ManagementLocksClientCreateOrUpdateByScopeResponse struct { + // The lock information. ManagementLockObject } @@ -56,40 +61,48 @@ type ManagementLocksClientDeleteByScopeResponse struct { // ManagementLocksClientGetAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.GetAtResourceGroupLevel. type ManagementLocksClientGetAtResourceGroupLevelResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientGetAtResourceLevelResponse contains the response from method ManagementLocksClient.GetAtResourceLevel. type ManagementLocksClientGetAtResourceLevelResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientGetAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.GetAtSubscriptionLevel. type ManagementLocksClientGetAtSubscriptionLevelResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientGetByScopeResponse contains the response from method ManagementLocksClient.GetByScope. type ManagementLocksClientGetByScopeResponse struct { + // The lock information. ManagementLockObject } // ManagementLocksClientListAtResourceGroupLevelResponse contains the response from method ManagementLocksClient.NewListAtResourceGroupLevelPager. type ManagementLocksClientListAtResourceGroupLevelResponse struct { + // The list of locks. ManagementLockListResult } // ManagementLocksClientListAtResourceLevelResponse contains the response from method ManagementLocksClient.NewListAtResourceLevelPager. type ManagementLocksClientListAtResourceLevelResponse struct { + // The list of locks. ManagementLockListResult } // ManagementLocksClientListAtSubscriptionLevelResponse contains the response from method ManagementLocksClient.NewListAtSubscriptionLevelPager. type ManagementLocksClientListAtSubscriptionLevelResponse struct { + // The list of locks. ManagementLockListResult } // ManagementLocksClientListByScopeResponse contains the response from method ManagementLocksClient.NewListByScopePager. type ManagementLocksClientListByScopeResponse struct { + // The list of locks. ManagementLockListResult } diff --git a/sdk/resourcemanager/resources/armlocks/time_rfc3339.go b/sdk/resourcemanager/resources/armlocks/time_rfc3339.go index 631fbd0292d6..ef87410a133d 100644 --- a/sdk/resourcemanager/resources/armlocks/time_rfc3339.go +++ b/sdk/resourcemanager/resources/armlocks/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armlocks