3
// Copyright (c) Microsoft and contributors. All rights reserved.
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
// http://www.apache.org/licenses/LICENSE-2.0
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
17
// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
18
// Changes may cause incorrect behavior and will be lost if the code is
22
"github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
27
// ManagementLocksClient is the client for the ManagementLocks methods of the
28
// Authorization service.
29
type ManagementLocksClient struct {
33
// NewManagementLocksClient creates an instance of the ManagementLocksClient
35
func NewManagementLocksClient(subscriptionID string) ManagementLocksClient {
36
return NewManagementLocksClientWithBaseURI(DefaultBaseURI, subscriptionID)
39
// NewManagementLocksClientWithBaseURI creates an instance of the
40
// ManagementLocksClient client.
41
func NewManagementLocksClientWithBaseURI(baseURI string, subscriptionID string) ManagementLocksClient {
42
return ManagementLocksClient{NewWithBaseURI(baseURI, subscriptionID)}
45
// CreateOrUpdateAtResourceGroupLevel create or update a management lock at
46
// the resource group level.
48
// resourceGroupName is the resource group name. lockName is the lock name.
49
// parameters is the management lock parameters.
50
func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevel(resourceGroupName string, lockName string, parameters ManagementLockProperties) (result ManagementLockObject, ae error) {
51
req, err := client.CreateOrUpdateAtResourceGroupLevelPreparer(resourceGroupName, lockName, parameters)
53
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", "Failure preparing request")
56
resp, err := client.CreateOrUpdateAtResourceGroupLevelSender(req)
58
result.Response = autorest.Response{Response: resp}
59
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", "Failure sending request")
62
result, err = client.CreateOrUpdateAtResourceGroupLevelResponder(resp)
64
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", "Failure responding to request")
70
// CreateOrUpdateAtResourceGroupLevelPreparer prepares the CreateOrUpdateAtResourceGroupLevel request.
71
func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelPreparer(resourceGroupName string, lockName string, parameters ManagementLockProperties) (*http.Request, error) {
72
pathParameters := map[string]interface{}{
73
"lockName": url.QueryEscape(lockName),
74
"resourceGroupName": url.QueryEscape(resourceGroupName),
75
"subscriptionId": url.QueryEscape(client.SubscriptionID),
78
queryParameters := map[string]interface{}{
79
"api-version": APIVersion,
82
return autorest.Prepare(&http.Request{},
85
autorest.WithBaseURL(client.BaseURI),
86
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}"),
87
autorest.WithJSON(parameters),
88
autorest.WithPathParameters(pathParameters),
89
autorest.WithQueryParameters(queryParameters))
92
// CreateOrUpdateAtResourceGroupLevelSender sends the CreateOrUpdateAtResourceGroupLevel request. The method will close the
93
// http.Response Body if it receives an error.
94
func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
95
return client.Send(req, http.StatusOK, http.StatusCreated)
98
// CreateOrUpdateAtResourceGroupLevelResponder handles the response to the CreateOrUpdateAtResourceGroupLevel request. The method always
99
// closes the http.Response Body.
100
func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
101
err = autorest.Respond(
103
client.ByInspecting(),
104
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
105
autorest.ByUnmarshallingJSON(&result),
106
autorest.ByClosing())
107
result.Response = autorest.Response{Response: resp}
111
// CreateOrUpdateAtResourceLevel create or update a management lock at the
112
// resource level or any level below resource.
114
// resourceGroupName is the name of the resource group.
115
// resourceProviderNamespace is resource identity. parentResourcePath is
116
// resource identity. resourceType is resource identity. resourceName is
117
// resource identity. lockName is the name of lock. parameters is create or
118
// update management lock parameters.
119
func (client ManagementLocksClient) CreateOrUpdateAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockProperties) (result ManagementLockObject, ae error) {
120
req, err := client.CreateOrUpdateAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, parameters)
122
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceLevel", "Failure preparing request")
125
resp, err := client.CreateOrUpdateAtResourceLevelSender(req)
127
result.Response = autorest.Response{Response: resp}
128
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceLevel", "Failure sending request")
131
result, err = client.CreateOrUpdateAtResourceLevelResponder(resp)
133
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceLevel", "Failure responding to request")
139
// CreateOrUpdateAtResourceLevelPreparer prepares the CreateOrUpdateAtResourceLevel request.
140
func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockProperties) (*http.Request, error) {
141
pathParameters := map[string]interface{}{
142
"lockName": url.QueryEscape(lockName),
143
"parentResourcePath": parentResourcePath,
144
"resourceGroupName": url.QueryEscape(resourceGroupName),
145
"resourceName": url.QueryEscape(resourceName),
146
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
147
"resourceType": resourceType,
148
"subscriptionId": url.QueryEscape(client.SubscriptionID),
151
queryParameters := map[string]interface{}{
152
"api-version": APIVersion,
155
return autorest.Prepare(&http.Request{},
158
autorest.WithBaseURL(client.BaseURI),
159
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}"),
160
autorest.WithJSON(parameters),
161
autorest.WithPathParameters(pathParameters),
162
autorest.WithQueryParameters(queryParameters))
165
// CreateOrUpdateAtResourceLevelSender sends the CreateOrUpdateAtResourceLevel request. The method will close the
166
// http.Response Body if it receives an error.
167
func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelSender(req *http.Request) (*http.Response, error) {
168
return client.Send(req, http.StatusOK, http.StatusCreated)
171
// CreateOrUpdateAtResourceLevelResponder handles the response to the CreateOrUpdateAtResourceLevel request. The method always
172
// closes the http.Response Body.
173
func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
174
err = autorest.Respond(
176
client.ByInspecting(),
177
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
178
autorest.ByUnmarshallingJSON(&result),
179
autorest.ByClosing())
180
result.Response = autorest.Response{Response: resp}
184
// CreateOrUpdateAtSubscriptionLevel create or update a management lock at the
185
// subscription level.
187
// lockName is the name of lock. parameters is the management lock parameters.
188
func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevel(lockName string, parameters ManagementLockProperties) (result ManagementLockObject, ae error) {
189
req, err := client.CreateOrUpdateAtSubscriptionLevelPreparer(lockName, parameters)
191
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", "Failure preparing request")
194
resp, err := client.CreateOrUpdateAtSubscriptionLevelSender(req)
196
result.Response = autorest.Response{Response: resp}
197
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", "Failure sending request")
200
result, err = client.CreateOrUpdateAtSubscriptionLevelResponder(resp)
202
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", "Failure responding to request")
208
// CreateOrUpdateAtSubscriptionLevelPreparer prepares the CreateOrUpdateAtSubscriptionLevel request.
209
func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelPreparer(lockName string, parameters ManagementLockProperties) (*http.Request, error) {
210
pathParameters := map[string]interface{}{
211
"lockName": url.QueryEscape(lockName),
212
"subscriptionId": url.QueryEscape(client.SubscriptionID),
215
queryParameters := map[string]interface{}{
216
"api-version": APIVersion,
219
return autorest.Prepare(&http.Request{},
222
autorest.WithBaseURL(client.BaseURI),
223
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}"),
224
autorest.WithJSON(parameters),
225
autorest.WithPathParameters(pathParameters),
226
autorest.WithQueryParameters(queryParameters))
229
// CreateOrUpdateAtSubscriptionLevelSender sends the CreateOrUpdateAtSubscriptionLevel request. The method will close the
230
// http.Response Body if it receives an error.
231
func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
232
return client.Send(req, http.StatusCreated, http.StatusOK)
235
// CreateOrUpdateAtSubscriptionLevelResponder handles the response to the CreateOrUpdateAtSubscriptionLevel request. The method always
236
// closes the http.Response Body.
237
func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
238
err = autorest.Respond(
240
client.ByInspecting(),
241
autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
242
autorest.ByUnmarshallingJSON(&result),
243
autorest.ByClosing())
244
result.Response = autorest.Response{Response: resp}
248
// DeleteAtResourceGroupLevel deletes the management lock of a resource group.
250
// resourceGroup is the resource group names. lockName is the name of lock.
251
func (client ManagementLocksClient) DeleteAtResourceGroupLevel(resourceGroup string, lockName string) (result autorest.Response, ae error) {
252
req, err := client.DeleteAtResourceGroupLevelPreparer(resourceGroup, lockName)
254
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceGroupLevel", "Failure preparing request")
257
resp, err := client.DeleteAtResourceGroupLevelSender(req)
259
result.Response = resp
260
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceGroupLevel", "Failure sending request")
263
result, err = client.DeleteAtResourceGroupLevelResponder(resp)
265
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceGroupLevel", "Failure responding to request")
271
// DeleteAtResourceGroupLevelPreparer prepares the DeleteAtResourceGroupLevel request.
272
func (client ManagementLocksClient) DeleteAtResourceGroupLevelPreparer(resourceGroup string, lockName string) (*http.Request, error) {
273
pathParameters := map[string]interface{}{
274
"lockName": url.QueryEscape(lockName),
275
"resourceGroup": url.QueryEscape(resourceGroup),
276
"subscriptionId": url.QueryEscape(client.SubscriptionID),
279
queryParameters := map[string]interface{}{
280
"api-version": APIVersion,
283
return autorest.Prepare(&http.Request{},
286
autorest.WithBaseURL(client.BaseURI),
287
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Authorization/locks/{lockName}"),
288
autorest.WithPathParameters(pathParameters),
289
autorest.WithQueryParameters(queryParameters))
292
// DeleteAtResourceGroupLevelSender sends the DeleteAtResourceGroupLevel request. The method will close the
293
// http.Response Body if it receives an error.
294
func (client ManagementLocksClient) DeleteAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
295
return client.Send(req, http.StatusNoContent, http.StatusOK, http.StatusAccepted)
298
// DeleteAtResourceGroupLevelResponder handles the response to the DeleteAtResourceGroupLevel request. The method always
299
// closes the http.Response Body.
300
func (client ManagementLocksClient) DeleteAtResourceGroupLevelResponder(resp *http.Response) (result autorest.Response, err error) {
301
err = autorest.Respond(
303
client.ByInspecting(),
304
autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
305
autorest.ByClosing())
306
result.Response = resp
310
// DeleteAtResourceLevel deletes the management lock of a resource or any
311
// level below resource.
313
// resourceGroupName is the name of the resource group.
314
// resourceProviderNamespace is resource identity. parentResourcePath is
315
// resource identity. resourceType is resource identity. resourceName is
316
// resource identity. lockName is the name of lock.
317
func (client ManagementLocksClient) DeleteAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result autorest.Response, ae error) {
318
req, err := client.DeleteAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName)
320
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceLevel", "Failure preparing request")
323
resp, err := client.DeleteAtResourceLevelSender(req)
325
result.Response = resp
326
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceLevel", "Failure sending request")
329
result, err = client.DeleteAtResourceLevelResponder(resp)
331
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceLevel", "Failure responding to request")
337
// DeleteAtResourceLevelPreparer prepares the DeleteAtResourceLevel request.
338
func (client ManagementLocksClient) DeleteAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (*http.Request, error) {
339
pathParameters := map[string]interface{}{
340
"lockName": url.QueryEscape(lockName),
341
"parentResourcePath": parentResourcePath,
342
"resourceGroupName": url.QueryEscape(resourceGroupName),
343
"resourceName": url.QueryEscape(resourceName),
344
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
345
"resourceType": resourceType,
346
"subscriptionId": url.QueryEscape(client.SubscriptionID),
349
queryParameters := map[string]interface{}{
350
"api-version": APIVersion,
353
return autorest.Prepare(&http.Request{},
356
autorest.WithBaseURL(client.BaseURI),
357
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}"),
358
autorest.WithPathParameters(pathParameters),
359
autorest.WithQueryParameters(queryParameters))
362
// DeleteAtResourceLevelSender sends the DeleteAtResourceLevel request. The method will close the
363
// http.Response Body if it receives an error.
364
func (client ManagementLocksClient) DeleteAtResourceLevelSender(req *http.Request) (*http.Response, error) {
365
return client.Send(req, http.StatusNoContent, http.StatusOK, http.StatusAccepted)
368
// DeleteAtResourceLevelResponder handles the response to the DeleteAtResourceLevel request. The method always
369
// closes the http.Response Body.
370
func (client ManagementLocksClient) DeleteAtResourceLevelResponder(resp *http.Response) (result autorest.Response, err error) {
371
err = autorest.Respond(
373
client.ByInspecting(),
374
autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
375
autorest.ByClosing())
376
result.Response = resp
380
// DeleteAtSubscriptionLevel deletes the management lock of a subscription.
382
// lockName is the name of lock.
383
func (client ManagementLocksClient) DeleteAtSubscriptionLevel(lockName string) (result autorest.Response, ae error) {
384
req, err := client.DeleteAtSubscriptionLevelPreparer(lockName)
386
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtSubscriptionLevel", "Failure preparing request")
389
resp, err := client.DeleteAtSubscriptionLevelSender(req)
391
result.Response = resp
392
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtSubscriptionLevel", "Failure sending request")
395
result, err = client.DeleteAtSubscriptionLevelResponder(resp)
397
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtSubscriptionLevel", "Failure responding to request")
403
// DeleteAtSubscriptionLevelPreparer prepares the DeleteAtSubscriptionLevel request.
404
func (client ManagementLocksClient) DeleteAtSubscriptionLevelPreparer(lockName string) (*http.Request, error) {
405
pathParameters := map[string]interface{}{
406
"lockName": url.QueryEscape(lockName),
407
"subscriptionId": url.QueryEscape(client.SubscriptionID),
410
queryParameters := map[string]interface{}{
411
"api-version": APIVersion,
414
return autorest.Prepare(&http.Request{},
417
autorest.WithBaseURL(client.BaseURI),
418
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}"),
419
autorest.WithPathParameters(pathParameters),
420
autorest.WithQueryParameters(queryParameters))
423
// DeleteAtSubscriptionLevelSender sends the DeleteAtSubscriptionLevel request. The method will close the
424
// http.Response Body if it receives an error.
425
func (client ManagementLocksClient) DeleteAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
426
return client.Send(req, http.StatusNoContent, http.StatusOK, http.StatusAccepted)
429
// DeleteAtSubscriptionLevelResponder handles the response to the DeleteAtSubscriptionLevel request. The method always
430
// closes the http.Response Body.
431
func (client ManagementLocksClient) DeleteAtSubscriptionLevelResponder(resp *http.Response) (result autorest.Response, err error) {
432
err = autorest.Respond(
434
client.ByInspecting(),
435
autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
436
autorest.ByClosing())
437
result.Response = resp
441
// Get gets the management lock of a scope.
443
// lockName is name of the management lock.
444
func (client ManagementLocksClient) Get(lockName string) (result ManagementLockObject, ae error) {
445
req, err := client.GetPreparer(lockName)
447
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "Get", "Failure preparing request")
450
resp, err := client.GetSender(req)
452
result.Response = autorest.Response{Response: resp}
453
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "Get", "Failure sending request")
456
result, err = client.GetResponder(resp)
458
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "Get", "Failure responding to request")
464
// GetPreparer prepares the Get request.
465
func (client ManagementLocksClient) GetPreparer(lockName string) (*http.Request, error) {
466
pathParameters := map[string]interface{}{
467
"lockName": url.QueryEscape(lockName),
468
"subscriptionId": url.QueryEscape(client.SubscriptionID),
471
queryParameters := map[string]interface{}{
472
"api-version": APIVersion,
475
return autorest.Prepare(&http.Request{},
478
autorest.WithBaseURL(client.BaseURI),
479
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}"),
480
autorest.WithPathParameters(pathParameters),
481
autorest.WithQueryParameters(queryParameters))
484
// GetSender sends the Get request. The method will close the
485
// http.Response Body if it receives an error.
486
func (client ManagementLocksClient) GetSender(req *http.Request) (*http.Response, error) {
487
return client.Send(req, http.StatusOK, http.StatusNoContent)
490
// GetResponder handles the response to the Get request. The method always
491
// closes the http.Response Body.
492
func (client ManagementLocksClient) GetResponder(resp *http.Response) (result ManagementLockObject, err error) {
493
err = autorest.Respond(
495
client.ByInspecting(),
496
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
497
autorest.ByUnmarshallingJSON(&result),
498
autorest.ByClosing())
499
result.Response = autorest.Response{Response: resp}
503
// ListAtResourceGroupLevel gets all the management locks of a resource group.
505
// resourceGroupName is resource group name. filter is the filter to apply on
507
func (client ManagementLocksClient) ListAtResourceGroupLevel(resourceGroupName string, filter string) (result ManagementLockListResult, ae error) {
508
req, err := client.ListAtResourceGroupLevelPreparer(resourceGroupName, filter)
510
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure preparing request")
513
resp, err := client.ListAtResourceGroupLevelSender(req)
515
result.Response = autorest.Response{Response: resp}
516
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure sending request")
519
result, err = client.ListAtResourceGroupLevelResponder(resp)
521
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure responding to request")
527
// ListAtResourceGroupLevelPreparer prepares the ListAtResourceGroupLevel request.
528
func (client ManagementLocksClient) ListAtResourceGroupLevelPreparer(resourceGroupName string, filter string) (*http.Request, error) {
529
pathParameters := map[string]interface{}{
530
"resourceGroupName": url.QueryEscape(resourceGroupName),
531
"subscriptionId": url.QueryEscape(client.SubscriptionID),
534
queryParameters := map[string]interface{}{
535
"api-version": APIVersion,
538
queryParameters["$filter"] = filter
541
return autorest.Prepare(&http.Request{},
544
autorest.WithBaseURL(client.BaseURI),
545
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks"),
546
autorest.WithPathParameters(pathParameters),
547
autorest.WithQueryParameters(queryParameters))
550
// ListAtResourceGroupLevelSender sends the ListAtResourceGroupLevel request. The method will close the
551
// http.Response Body if it receives an error.
552
func (client ManagementLocksClient) ListAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
553
return client.Send(req, http.StatusOK)
556
// ListAtResourceGroupLevelResponder handles the response to the ListAtResourceGroupLevel request. The method always
557
// closes the http.Response Body.
558
func (client ManagementLocksClient) ListAtResourceGroupLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
559
err = autorest.Respond(
561
client.ByInspecting(),
562
autorest.WithErrorUnlessStatusCode(http.StatusOK),
563
autorest.ByUnmarshallingJSON(&result),
564
autorest.ByClosing())
565
result.Response = autorest.Response{Response: resp}
569
// ListAtResourceGroupLevelNextResults retrieves the next set of results, if any.
570
func (client ManagementLocksClient) ListAtResourceGroupLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
571
req, err := lastResults.ManagementLockListResultPreparer()
573
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure preparing next results request request")
579
resp, err := client.ListAtResourceGroupLevelSender(req)
581
result.Response = autorest.Response{Response: resp}
582
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure sending next results request request")
585
result, err = client.ListAtResourceGroupLevelResponder(resp)
587
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure responding to next results request request")
593
// ListAtResourceLevel gets all the management locks of a resource or any
594
// level below resource.
596
// resourceGroupName is the name of the resource group. The name is case
597
// insensitive. resourceProviderNamespace is resource identity.
598
// parentResourcePath is resource identity. resourceType is resource
599
// identity. resourceName is resource identity. filter is the filter to apply
601
func (client ManagementLocksClient) ListAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result ManagementLockListResult, ae error) {
602
req, err := client.ListAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
604
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure preparing request")
607
resp, err := client.ListAtResourceLevelSender(req)
609
result.Response = autorest.Response{Response: resp}
610
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure sending request")
613
result, err = client.ListAtResourceLevelResponder(resp)
615
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure responding to request")
621
// ListAtResourceLevelPreparer prepares the ListAtResourceLevel request.
622
func (client ManagementLocksClient) ListAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
623
pathParameters := map[string]interface{}{
624
"parentResourcePath": parentResourcePath,
625
"resourceGroupName": url.QueryEscape(resourceGroupName),
626
"resourceName": url.QueryEscape(resourceName),
627
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
628
"resourceType": resourceType,
629
"subscriptionId": url.QueryEscape(client.SubscriptionID),
632
queryParameters := map[string]interface{}{
633
"api-version": APIVersion,
636
queryParameters["$filter"] = filter
639
return autorest.Prepare(&http.Request{},
642
autorest.WithBaseURL(client.BaseURI),
643
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks"),
644
autorest.WithPathParameters(pathParameters),
645
autorest.WithQueryParameters(queryParameters))
648
// ListAtResourceLevelSender sends the ListAtResourceLevel request. The method will close the
649
// http.Response Body if it receives an error.
650
func (client ManagementLocksClient) ListAtResourceLevelSender(req *http.Request) (*http.Response, error) {
651
return client.Send(req, http.StatusOK)
654
// ListAtResourceLevelResponder handles the response to the ListAtResourceLevel request. The method always
655
// closes the http.Response Body.
656
func (client ManagementLocksClient) ListAtResourceLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
657
err = autorest.Respond(
659
client.ByInspecting(),
660
autorest.WithErrorUnlessStatusCode(http.StatusOK),
661
autorest.ByUnmarshallingJSON(&result),
662
autorest.ByClosing())
663
result.Response = autorest.Response{Response: resp}
667
// ListAtResourceLevelNextResults retrieves the next set of results, if any.
668
func (client ManagementLocksClient) ListAtResourceLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
669
req, err := lastResults.ManagementLockListResultPreparer()
671
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure preparing next results request request")
677
resp, err := client.ListAtResourceLevelSender(req)
679
result.Response = autorest.Response{Response: resp}
680
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure sending next results request request")
683
result, err = client.ListAtResourceLevelResponder(resp)
685
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure responding to next results request request")
691
// ListAtSubscriptionLevel gets all the management locks of a subscription.
693
// filter is the filter to apply on the operation.
694
func (client ManagementLocksClient) ListAtSubscriptionLevel(filter string) (result ManagementLockListResult, ae error) {
695
req, err := client.ListAtSubscriptionLevelPreparer(filter)
697
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure preparing request")
700
resp, err := client.ListAtSubscriptionLevelSender(req)
702
result.Response = autorest.Response{Response: resp}
703
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure sending request")
706
result, err = client.ListAtSubscriptionLevelResponder(resp)
708
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure responding to request")
714
// ListAtSubscriptionLevelPreparer prepares the ListAtSubscriptionLevel request.
715
func (client ManagementLocksClient) ListAtSubscriptionLevelPreparer(filter string) (*http.Request, error) {
716
pathParameters := map[string]interface{}{
717
"subscriptionId": url.QueryEscape(client.SubscriptionID),
720
queryParameters := map[string]interface{}{
721
"api-version": APIVersion,
724
queryParameters["$filter"] = filter
727
return autorest.Prepare(&http.Request{},
730
autorest.WithBaseURL(client.BaseURI),
731
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks"),
732
autorest.WithPathParameters(pathParameters),
733
autorest.WithQueryParameters(queryParameters))
736
// ListAtSubscriptionLevelSender sends the ListAtSubscriptionLevel request. The method will close the
737
// http.Response Body if it receives an error.
738
func (client ManagementLocksClient) ListAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
739
return client.Send(req, http.StatusOK)
742
// ListAtSubscriptionLevelResponder handles the response to the ListAtSubscriptionLevel request. The method always
743
// closes the http.Response Body.
744
func (client ManagementLocksClient) ListAtSubscriptionLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
745
err = autorest.Respond(
747
client.ByInspecting(),
748
autorest.WithErrorUnlessStatusCode(http.StatusOK),
749
autorest.ByUnmarshallingJSON(&result),
750
autorest.ByClosing())
751
result.Response = autorest.Response{Response: resp}
755
// ListAtSubscriptionLevelNextResults retrieves the next set of results, if any.
756
func (client ManagementLocksClient) ListAtSubscriptionLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
757
req, err := lastResults.ManagementLockListResultPreparer()
759
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure preparing next results request request")
765
resp, err := client.ListAtSubscriptionLevelSender(req)
767
result.Response = autorest.Response{Response: resp}
768
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure sending next results request request")
771
result, err = client.ListAtSubscriptionLevelResponder(resp)
773
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure responding to next results request request")
779
// ListNext get a list of management locks at resource level or below.
781
// nextLink is nextLink from the previous successful call to List operation.
782
func (client ManagementLocksClient) ListNext(nextLink string) (result ManagementLockListResult, ae error) {
783
req, err := client.ListNextPreparer(nextLink)
785
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure preparing request")
788
resp, err := client.ListNextSender(req)
790
result.Response = autorest.Response{Response: resp}
791
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure sending request")
794
result, err = client.ListNextResponder(resp)
796
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure responding to request")
802
// ListNextPreparer prepares the ListNext request.
803
func (client ManagementLocksClient) ListNextPreparer(nextLink string) (*http.Request, error) {
804
pathParameters := map[string]interface{}{
805
"nextLink": nextLink,
806
"subscriptionId": url.QueryEscape(client.SubscriptionID),
809
return autorest.Prepare(&http.Request{},
812
autorest.WithBaseURL(client.BaseURI),
813
autorest.WithPath("/{nextLink}"),
814
autorest.WithPathParameters(pathParameters))
817
// ListNextSender sends the ListNext request. The method will close the
818
// http.Response Body if it receives an error.
819
func (client ManagementLocksClient) ListNextSender(req *http.Request) (*http.Response, error) {
820
return client.Send(req, http.StatusOK)
823
// ListNextResponder handles the response to the ListNext request. The method always
824
// closes the http.Response Body.
825
func (client ManagementLocksClient) ListNextResponder(resp *http.Response) (result ManagementLockListResult, err error) {
826
err = autorest.Respond(
828
client.ByInspecting(),
829
autorest.WithErrorUnlessStatusCode(http.StatusOK),
830
autorest.ByUnmarshallingJSON(&result),
831
autorest.ByClosing())
832
result.Response = autorest.Response{Response: resp}
836
// ListNextNextResults retrieves the next set of results, if any.
837
func (client ManagementLocksClient) ListNextNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
838
req, err := lastResults.ManagementLockListResultPreparer()
840
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure preparing next results request request")
846
resp, err := client.ListNextSender(req)
848
result.Response = autorest.Response{Response: resp}
849
return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure sending next results request request")
852
result, err = client.ListNextResponder(resp)
854
ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure responding to next results request request")