@azure/arm-locks 1.2.0 → 2.0.0-alpha.20211015.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +63 -80
  4. package/dist/index.js +1796 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/esm/index.d.ts +534 -0
  9. package/esm/index.d.ts.map +1 -0
  10. package/esm/index.js +13 -0
  11. package/esm/index.js.map +1 -0
  12. package/esm/managementLockClient.d.ts +9 -18
  13. package/esm/managementLockClient.d.ts.map +1 -1
  14. package/esm/managementLockClient.js +12 -28
  15. package/esm/managementLockClient.js.map +1 -1
  16. package/esm/managementLockClientContext.d.ts +10 -16
  17. package/esm/managementLockClientContext.d.ts.map +1 -1
  18. package/esm/managementLockClientContext.js +34 -46
  19. package/esm/managementLockClientContext.js.map +1 -1
  20. package/esm/models/index.d.ts +208 -445
  21. package/esm/models/index.d.ts.map +1 -1
  22. package/esm/models/index.js +9 -2
  23. package/esm/models/index.js.map +1 -1
  24. package/esm/models/mappers.d.ts +7 -9
  25. package/esm/models/mappers.d.ts.map +1 -1
  26. package/esm/models/mappers.js +69 -78
  27. package/esm/models/mappers.js.map +1 -1
  28. package/esm/models/parameters.d.ts +16 -13
  29. package/esm/models/parameters.d.ts.map +1 -1
  30. package/esm/models/parameters.js +78 -54
  31. package/esm/models/parameters.js.map +1 -1
  32. package/esm/operations/authorizationOperations.d.ts +27 -26
  33. package/esm/operations/authorizationOperations.d.ts.map +1 -1
  34. package/esm/operations/authorizationOperations.js +158 -50
  35. package/esm/operations/authorizationOperations.js.map +1 -1
  36. package/esm/operations/index.d.ts.map +1 -1
  37. package/esm/operations/index.js +3 -5
  38. package/esm/operations/index.js.map +1 -1
  39. package/esm/operations/managementLocks.d.ts +203 -393
  40. package/esm/operations/managementLocks.d.ts.map +1 -1
  41. package/esm/operations/managementLocks.js +993 -485
  42. package/esm/operations/managementLocks.js.map +1 -1
  43. package/esm/operationsInterfaces/authorizationOperations.d.ts +18 -0
  44. package/esm/operationsInterfaces/authorizationOperations.d.ts.map +1 -0
  45. package/esm/operationsInterfaces/authorizationOperations.js +9 -0
  46. package/esm/operationsInterfaces/authorizationOperations.js.map +1 -0
  47. package/esm/operationsInterfaces/index.d.ts +3 -0
  48. package/esm/operationsInterfaces/index.d.ts.map +1 -0
  49. package/esm/operationsInterfaces/index.js +10 -0
  50. package/esm/operationsInterfaces/index.js.map +1 -0
  51. package/esm/operationsInterfaces/managementLocks.d.ts +198 -0
  52. package/esm/operationsInterfaces/managementLocks.d.ts.map +1 -0
  53. package/esm/operationsInterfaces/managementLocks.js +9 -0
  54. package/esm/operationsInterfaces/managementLocks.js.map +1 -0
  55. package/package.json +53 -16
  56. package/review/arm-locks.api.md +313 -0
  57. package/rollup.config.js +181 -30
  58. package/src/index.ts +13 -0
  59. package/src/managementLockClient.ts +23 -36
  60. package/src/managementLockClientContext.ts +47 -45
  61. package/src/models/index.ts +256 -470
  62. package/src/models/mappers.ts +72 -82
  63. package/src/models/parameters.ts +97 -55
  64. package/src/operations/authorizationOperations.ts +155 -70
  65. package/src/operations/index.ts +3 -5
  66. package/src/operations/managementLocks.ts +1165 -869
  67. package/src/operationsInterfaces/authorizationOperations.ts +36 -0
  68. package/src/operationsInterfaces/index.ts +10 -0
  69. package/src/operationsInterfaces/managementLocks.ts +332 -0
  70. package/tsconfig.json +3 -2
  71. package/dist/arm-locks.js +0 -1280
  72. package/dist/arm-locks.js.map +0 -1
  73. package/dist/arm-locks.min.js +0 -1
  74. package/dist/arm-locks.min.js.map +0 -1
  75. package/esm/models/authorizationOperationsMappers.d.ts +0 -2
  76. package/esm/models/authorizationOperationsMappers.d.ts.map +0 -1
  77. package/esm/models/authorizationOperationsMappers.js +0 -9
  78. package/esm/models/authorizationOperationsMappers.js.map +0 -1
  79. package/esm/models/managementLocksMappers.d.ts +0 -2
  80. package/esm/models/managementLocksMappers.d.ts.map +0 -1
  81. package/esm/models/managementLocksMappers.js +0 -9
  82. package/esm/models/managementLocksMappers.js.map +0 -1
  83. package/src/models/authorizationOperationsMappers.ts +0 -14
  84. package/src/models/managementLocksMappers.ts +0 -15
@@ -1,251 +1,742 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/managementLocksMappers";
9
+ import "@azure/core-paging";
10
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
11
+ import { ManagementLocks } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { ManagementLockClientContext } from "../managementLockClientContext";
16
+ import {
17
+ ManagementLockObject,
18
+ ManagementLocksListAtResourceGroupLevelNextOptionalParams,
19
+ ManagementLocksListAtResourceGroupLevelOptionalParams,
20
+ ManagementLocksListAtResourceLevelNextOptionalParams,
21
+ ManagementLocksListAtResourceLevelOptionalParams,
22
+ ManagementLocksListAtSubscriptionLevelNextOptionalParams,
23
+ ManagementLocksListAtSubscriptionLevelOptionalParams,
24
+ ManagementLocksListByScopeNextOptionalParams,
25
+ ManagementLocksListByScopeOptionalParams,
26
+ ManagementLocksListAtResourceGroupLevelNextNextOptionalParams,
27
+ ManagementLocksListAtResourceLevelNextNextOptionalParams,
28
+ ManagementLocksListAtSubscriptionLevelNextNextOptionalParams,
29
+ ManagementLocksListByScopeNextNextOptionalParams,
30
+ ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams,
31
+ ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse,
32
+ ManagementLocksDeleteAtResourceGroupLevelOptionalParams,
33
+ ManagementLocksGetAtResourceGroupLevelOptionalParams,
34
+ ManagementLocksGetAtResourceGroupLevelResponse,
35
+ ManagementLocksCreateOrUpdateByScopeOptionalParams,
36
+ ManagementLocksCreateOrUpdateByScopeResponse,
37
+ ManagementLocksDeleteByScopeOptionalParams,
38
+ ManagementLocksGetByScopeOptionalParams,
39
+ ManagementLocksGetByScopeResponse,
40
+ ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams,
41
+ ManagementLocksCreateOrUpdateAtResourceLevelResponse,
42
+ ManagementLocksDeleteAtResourceLevelOptionalParams,
43
+ ManagementLocksGetAtResourceLevelOptionalParams,
44
+ ManagementLocksGetAtResourceLevelResponse,
45
+ ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams,
46
+ ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse,
47
+ ManagementLocksDeleteAtSubscriptionLevelOptionalParams,
48
+ ManagementLocksGetAtSubscriptionLevelOptionalParams,
49
+ ManagementLocksGetAtSubscriptionLevelResponse,
50
+ ManagementLocksListAtResourceGroupLevelResponse,
51
+ ManagementLocksListAtResourceLevelResponse,
52
+ ManagementLocksListAtSubscriptionLevelResponse,
53
+ ManagementLocksListByScopeResponse,
54
+ ManagementLocksListAtResourceGroupLevelNextResponse,
55
+ ManagementLocksListAtResourceLevelNextResponse,
56
+ ManagementLocksListAtSubscriptionLevelNextResponse,
57
+ ManagementLocksListByScopeNextResponse,
58
+ ManagementLocksListAtResourceGroupLevelNextNextResponse,
59
+ ManagementLocksListAtResourceLevelNextNextResponse,
60
+ ManagementLocksListAtSubscriptionLevelNextNextResponse,
61
+ ManagementLocksListByScopeNextNextResponse
62
+ } from "../models";
16
63
 
64
+ /// <reference lib="esnext.asynciterable" />
17
65
  /** Class representing a ManagementLocks. */
18
- export class ManagementLocks {
66
+ export class ManagementLocksImpl implements ManagementLocks {
19
67
  private readonly client: ManagementLockClientContext;
20
68
 
21
69
  /**
22
- * Create a ManagementLocks.
23
- * @param {ManagementLockClientContext} client Reference to the service client.
70
+ * Initialize a new instance of the class ManagementLocks class.
71
+ * @param client Reference to the service client
24
72
  */
25
73
  constructor(client: ManagementLockClientContext) {
26
74
  this.client = client;
27
75
  }
28
76
 
29
77
  /**
30
- * When you apply a lock at a parent scope, all child resources inherit the same lock. To create
31
- * management locks, you must have access to Microsoft.Authorization/* or
32
- * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
33
- * Administrator are granted those actions.
34
- * @summary Creates or updates a management lock at the resource group level.
35
- * @param resourceGroupName The name of the resource group to lock.
36
- * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot
37
- * contain <, > %, &, :, \, ?, /, or any control characters.
38
- * @param parameters The management lock parameters.
39
- * @param [options] The optional parameters
40
- * @returns Promise<Models.ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse>
41
- */
42
- createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse>;
43
- /**
44
- * @param resourceGroupName The name of the resource group to lock.
45
- * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot
46
- * contain <, > %, &, :, \, ?, /, or any control characters.
47
- * @param parameters The management lock parameters.
48
- * @param callback The callback
49
- */
50
- createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
51
- /**
52
- * @param resourceGroupName The name of the resource group to lock.
53
- * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot
54
- * contain <, > %, &, :, \, ?, /, or any control characters.
55
- * @param parameters The management lock parameters.
56
- * @param options The optional parameters
57
- * @param callback The callback
78
+ * Gets all the management locks for a resource group.
79
+ * @param resourceGroupName The name of the resource group containing the locks to get.
80
+ * @param options The options parameters.
58
81
  */
59
- createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
60
- createOrUpdateAtResourceGroupLevel(resourceGroupName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse> {
61
- return this.client.sendOperationRequest(
62
- {
82
+ public listAtResourceGroupLevel(
83
+ resourceGroupName: string,
84
+ options?: ManagementLocksListAtResourceGroupLevelOptionalParams
85
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
86
+ const iter = this.listAtResourceGroupLevelPagingAll(
87
+ resourceGroupName,
88
+ options
89
+ );
90
+ return {
91
+ next() {
92
+ return iter.next();
93
+ },
94
+ [Symbol.asyncIterator]() {
95
+ return this;
96
+ },
97
+ byPage: () => {
98
+ return this.listAtResourceGroupLevelPagingPage(
99
+ resourceGroupName,
100
+ options
101
+ );
102
+ }
103
+ };
104
+ }
105
+
106
+ private async *listAtResourceGroupLevelPagingPage(
107
+ resourceGroupName: string,
108
+ options?: ManagementLocksListAtResourceGroupLevelOptionalParams
109
+ ): AsyncIterableIterator<ManagementLockObject[]> {
110
+ let result = await this._listAtResourceGroupLevel(
111
+ resourceGroupName,
112
+ options
113
+ );
114
+ yield result.value || [];
115
+ let continuationToken = result.nextLink;
116
+ while (continuationToken) {
117
+ result = await this._listAtResourceGroupLevelNext(
63
118
  resourceGroupName,
64
- lockName,
65
- parameters,
119
+ continuationToken,
66
120
  options
67
- },
68
- createOrUpdateAtResourceGroupLevelOperationSpec,
69
- callback) as Promise<Models.ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse>;
121
+ );
122
+ continuationToken = result.nextLink;
123
+ yield result.value || [];
124
+ }
125
+ }
126
+
127
+ private async *listAtResourceGroupLevelPagingAll(
128
+ resourceGroupName: string,
129
+ options?: ManagementLocksListAtResourceGroupLevelOptionalParams
130
+ ): AsyncIterableIterator<ManagementLockObject> {
131
+ for await (const page of this.listAtResourceGroupLevelPagingPage(
132
+ resourceGroupName,
133
+ options
134
+ )) {
135
+ yield* page;
136
+ }
70
137
  }
71
138
 
72
139
  /**
73
- * To delete management locks, you must have access to Microsoft.Authorization/* or
74
- * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
75
- * Administrator are granted those actions.
76
- * @summary Deletes a management lock at the resource group level.
77
- * @param resourceGroupName The name of the resource group containing the lock.
78
- * @param lockName The name of lock to delete.
79
- * @param [options] The optional parameters
80
- * @returns Promise<msRest.RestResponse>
81
- */
82
- deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
83
- /**
84
- * @param resourceGroupName The name of the resource group containing the lock.
85
- * @param lockName The name of lock to delete.
86
- * @param callback The callback
87
- */
88
- deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, callback: msRest.ServiceCallback<void>): void;
89
- /**
90
- * @param resourceGroupName The name of the resource group containing the lock.
91
- * @param lockName The name of lock to delete.
92
- * @param options The optional parameters
93
- * @param callback The callback
140
+ * Gets all the management locks for a resource or any level below resource.
141
+ * @param resourceGroupName The name of the resource group containing the locked resource. The name is
142
+ * case insensitive.
143
+ * @param resourceProviderNamespace The namespace of the resource provider.
144
+ * @param parentResourcePath The parent resource identity.
145
+ * @param resourceType The resource type of the locked resource.
146
+ * @param resourceName The name of the locked resource.
147
+ * @param options The options parameters.
94
148
  */
95
- deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
96
- deleteAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
97
- return this.client.sendOperationRequest(
98
- {
149
+ public listAtResourceLevel(
150
+ resourceGroupName: string,
151
+ resourceProviderNamespace: string,
152
+ parentResourcePath: string,
153
+ resourceType: string,
154
+ resourceName: string,
155
+ options?: ManagementLocksListAtResourceLevelOptionalParams
156
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
157
+ const iter = this.listAtResourceLevelPagingAll(
158
+ resourceGroupName,
159
+ resourceProviderNamespace,
160
+ parentResourcePath,
161
+ resourceType,
162
+ resourceName,
163
+ options
164
+ );
165
+ return {
166
+ next() {
167
+ return iter.next();
168
+ },
169
+ [Symbol.asyncIterator]() {
170
+ return this;
171
+ },
172
+ byPage: () => {
173
+ return this.listAtResourceLevelPagingPage(
174
+ resourceGroupName,
175
+ resourceProviderNamespace,
176
+ parentResourcePath,
177
+ resourceType,
178
+ resourceName,
179
+ options
180
+ );
181
+ }
182
+ };
183
+ }
184
+
185
+ private async *listAtResourceLevelPagingPage(
186
+ resourceGroupName: string,
187
+ resourceProviderNamespace: string,
188
+ parentResourcePath: string,
189
+ resourceType: string,
190
+ resourceName: string,
191
+ options?: ManagementLocksListAtResourceLevelOptionalParams
192
+ ): AsyncIterableIterator<ManagementLockObject[]> {
193
+ let result = await this._listAtResourceLevel(
194
+ resourceGroupName,
195
+ resourceProviderNamespace,
196
+ parentResourcePath,
197
+ resourceType,
198
+ resourceName,
199
+ options
200
+ );
201
+ yield result.value || [];
202
+ let continuationToken = result.nextLink;
203
+ while (continuationToken) {
204
+ result = await this._listAtResourceLevelNext(
99
205
  resourceGroupName,
100
- lockName,
206
+ resourceProviderNamespace,
207
+ parentResourcePath,
208
+ resourceType,
209
+ resourceName,
210
+ continuationToken,
101
211
  options
102
- },
103
- deleteAtResourceGroupLevelOperationSpec,
104
- callback);
212
+ );
213
+ continuationToken = result.nextLink;
214
+ yield result.value || [];
215
+ }
216
+ }
217
+
218
+ private async *listAtResourceLevelPagingAll(
219
+ resourceGroupName: string,
220
+ resourceProviderNamespace: string,
221
+ parentResourcePath: string,
222
+ resourceType: string,
223
+ resourceName: string,
224
+ options?: ManagementLocksListAtResourceLevelOptionalParams
225
+ ): AsyncIterableIterator<ManagementLockObject> {
226
+ for await (const page of this.listAtResourceLevelPagingPage(
227
+ resourceGroupName,
228
+ resourceProviderNamespace,
229
+ parentResourcePath,
230
+ resourceType,
231
+ resourceName,
232
+ options
233
+ )) {
234
+ yield* page;
235
+ }
105
236
  }
106
237
 
107
238
  /**
108
- * Gets a management lock at the resource group level.
109
- * @param resourceGroupName The name of the locked resource group.
110
- * @param lockName The name of the lock to get.
111
- * @param [options] The optional parameters
112
- * @returns Promise<Models.ManagementLocksGetAtResourceGroupLevelResponse>
239
+ * Gets all the management locks for a subscription.
240
+ * @param options The options parameters.
113
241
  */
114
- getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksGetAtResourceGroupLevelResponse>;
242
+ public listAtSubscriptionLevel(
243
+ options?: ManagementLocksListAtSubscriptionLevelOptionalParams
244
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
245
+ const iter = this.listAtSubscriptionLevelPagingAll(options);
246
+ return {
247
+ next() {
248
+ return iter.next();
249
+ },
250
+ [Symbol.asyncIterator]() {
251
+ return this;
252
+ },
253
+ byPage: () => {
254
+ return this.listAtSubscriptionLevelPagingPage(options);
255
+ }
256
+ };
257
+ }
258
+
259
+ private async *listAtSubscriptionLevelPagingPage(
260
+ options?: ManagementLocksListAtSubscriptionLevelOptionalParams
261
+ ): AsyncIterableIterator<ManagementLockObject[]> {
262
+ let result = await this._listAtSubscriptionLevel(options);
263
+ yield result.value || [];
264
+ let continuationToken = result.nextLink;
265
+ while (continuationToken) {
266
+ result = await this._listAtSubscriptionLevelNext(
267
+ continuationToken,
268
+ options
269
+ );
270
+ continuationToken = result.nextLink;
271
+ yield result.value || [];
272
+ }
273
+ }
274
+
275
+ private async *listAtSubscriptionLevelPagingAll(
276
+ options?: ManagementLocksListAtSubscriptionLevelOptionalParams
277
+ ): AsyncIterableIterator<ManagementLockObject> {
278
+ for await (const page of this.listAtSubscriptionLevelPagingPage(options)) {
279
+ yield* page;
280
+ }
281
+ }
282
+
115
283
  /**
116
- * @param resourceGroupName The name of the locked resource group.
117
- * @param lockName The name of the lock to get.
118
- * @param callback The callback
284
+ * Gets all the management locks for a scope.
285
+ * @param scope The scope for the lock. When providing a scope for the assignment, use
286
+ * '/subscriptions/{subscriptionId}' for subscriptions,
287
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
288
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
289
+ * for resources.
290
+ * @param options The options parameters.
119
291
  */
120
- getAtResourceGroupLevel(resourceGroupName: string, lockName: string, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
292
+ public listByScope(
293
+ scope: string,
294
+ options?: ManagementLocksListByScopeOptionalParams
295
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
296
+ const iter = this.listByScopePagingAll(scope, options);
297
+ return {
298
+ next() {
299
+ return iter.next();
300
+ },
301
+ [Symbol.asyncIterator]() {
302
+ return this;
303
+ },
304
+ byPage: () => {
305
+ return this.listByScopePagingPage(scope, options);
306
+ }
307
+ };
308
+ }
309
+
310
+ private async *listByScopePagingPage(
311
+ scope: string,
312
+ options?: ManagementLocksListByScopeOptionalParams
313
+ ): AsyncIterableIterator<ManagementLockObject[]> {
314
+ let result = await this._listByScope(scope, options);
315
+ yield result.value || [];
316
+ let continuationToken = result.nextLink;
317
+ while (continuationToken) {
318
+ result = await this._listByScopeNext(scope, continuationToken, options);
319
+ continuationToken = result.nextLink;
320
+ yield result.value || [];
321
+ }
322
+ }
323
+
324
+ private async *listByScopePagingAll(
325
+ scope: string,
326
+ options?: ManagementLocksListByScopeOptionalParams
327
+ ): AsyncIterableIterator<ManagementLockObject> {
328
+ for await (const page of this.listByScopePagingPage(scope, options)) {
329
+ yield* page;
330
+ }
331
+ }
332
+
121
333
  /**
122
- * @param resourceGroupName The name of the locked resource group.
123
- * @param lockName The name of the lock to get.
124
- * @param options The optional parameters
125
- * @param callback The callback
334
+ * ListAtResourceGroupLevelNext
335
+ * @param resourceGroupName The name of the resource group containing the locks to get.
336
+ * @param nextLink The nextLink from the previous successful call to the ListAtResourceGroupLevel
337
+ * method.
338
+ * @param options The options parameters.
126
339
  */
127
- getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
128
- getAtResourceGroupLevel(resourceGroupName: string, lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksGetAtResourceGroupLevelResponse> {
129
- return this.client.sendOperationRequest(
130
- {
340
+ public listAtResourceGroupLevelNext(
341
+ resourceGroupName: string,
342
+ nextLink: string,
343
+ options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams
344
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
345
+ const iter = this.listAtResourceGroupLevelNextPagingAll(
346
+ resourceGroupName,
347
+ nextLink,
348
+ options
349
+ );
350
+ return {
351
+ next() {
352
+ return iter.next();
353
+ },
354
+ [Symbol.asyncIterator]() {
355
+ return this;
356
+ },
357
+ byPage: () => {
358
+ return this.listAtResourceGroupLevelNextPagingPage(
359
+ resourceGroupName,
360
+ nextLink,
361
+ options
362
+ );
363
+ }
364
+ };
365
+ }
366
+
367
+ private async *listAtResourceGroupLevelNextPagingPage(
368
+ resourceGroupName: string,
369
+ nextLink: string,
370
+ options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams
371
+ ): AsyncIterableIterator<ManagementLockObject[]> {
372
+ let result = await this._listAtResourceGroupLevelNext(
373
+ resourceGroupName,
374
+ nextLink,
375
+ options
376
+ );
377
+ yield result.value || [];
378
+ let continuationToken = result.nextLink;
379
+ while (continuationToken) {
380
+ result = await this._listAtResourceGroupLevelNextNext(
131
381
  resourceGroupName,
132
- lockName,
382
+ continuationToken,
133
383
  options
134
- },
135
- getAtResourceGroupLevelOperationSpec,
136
- callback) as Promise<Models.ManagementLocksGetAtResourceGroupLevelResponse>;
384
+ );
385
+ continuationToken = result.nextLink;
386
+ yield result.value || [];
387
+ }
388
+ }
389
+
390
+ private async *listAtResourceGroupLevelNextPagingAll(
391
+ resourceGroupName: string,
392
+ nextLink: string,
393
+ options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams
394
+ ): AsyncIterableIterator<ManagementLockObject> {
395
+ for await (const page of this.listAtResourceGroupLevelNextPagingPage(
396
+ resourceGroupName,
397
+ nextLink,
398
+ options
399
+ )) {
400
+ yield* page;
401
+ }
137
402
  }
138
403
 
139
404
  /**
140
- * Create or update a management lock by scope.
141
- * @param scope The scope for the lock. When providing a scope for the assignment, use
142
- * '/subscriptions/{subscriptionId}' for subscriptions,
143
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
144
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
145
- * for resources.
146
- * @param lockName The name of lock.
147
- * @param parameters Create or update management lock parameters.
148
- * @param [options] The optional parameters
149
- * @returns Promise<Models.ManagementLocksCreateOrUpdateByScopeResponse>
405
+ * ListAtResourceLevelNext
406
+ * @param resourceGroupName The name of the resource group containing the locked resource. The name is
407
+ * case insensitive.
408
+ * @param resourceProviderNamespace The namespace of the resource provider.
409
+ * @param parentResourcePath The parent resource identity.
410
+ * @param resourceType The resource type of the locked resource.
411
+ * @param resourceName The name of the locked resource.
412
+ * @param nextLink The nextLink from the previous successful call to the ListAtResourceLevel method.
413
+ * @param options The options parameters.
150
414
  */
151
- createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksCreateOrUpdateByScopeResponse>;
415
+ public listAtResourceLevelNext(
416
+ resourceGroupName: string,
417
+ resourceProviderNamespace: string,
418
+ parentResourcePath: string,
419
+ resourceType: string,
420
+ resourceName: string,
421
+ nextLink: string,
422
+ options?: ManagementLocksListAtResourceLevelNextOptionalParams
423
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
424
+ const iter = this.listAtResourceLevelNextPagingAll(
425
+ resourceGroupName,
426
+ resourceProviderNamespace,
427
+ parentResourcePath,
428
+ resourceType,
429
+ resourceName,
430
+ nextLink,
431
+ options
432
+ );
433
+ return {
434
+ next() {
435
+ return iter.next();
436
+ },
437
+ [Symbol.asyncIterator]() {
438
+ return this;
439
+ },
440
+ byPage: () => {
441
+ return this.listAtResourceLevelNextPagingPage(
442
+ resourceGroupName,
443
+ resourceProviderNamespace,
444
+ parentResourcePath,
445
+ resourceType,
446
+ resourceName,
447
+ nextLink,
448
+ options
449
+ );
450
+ }
451
+ };
452
+ }
453
+
454
+ private async *listAtResourceLevelNextPagingPage(
455
+ resourceGroupName: string,
456
+ resourceProviderNamespace: string,
457
+ parentResourcePath: string,
458
+ resourceType: string,
459
+ resourceName: string,
460
+ nextLink: string,
461
+ options?: ManagementLocksListAtResourceLevelNextOptionalParams
462
+ ): AsyncIterableIterator<ManagementLockObject[]> {
463
+ let result = await this._listAtResourceLevelNext(
464
+ resourceGroupName,
465
+ resourceProviderNamespace,
466
+ parentResourcePath,
467
+ resourceType,
468
+ resourceName,
469
+ nextLink,
470
+ options
471
+ );
472
+ yield result.value || [];
473
+ let continuationToken = result.nextLink;
474
+ while (continuationToken) {
475
+ result = await this._listAtResourceLevelNextNext(
476
+ resourceGroupName,
477
+ resourceProviderNamespace,
478
+ parentResourcePath,
479
+ resourceType,
480
+ resourceName,
481
+ continuationToken,
482
+ options
483
+ );
484
+ continuationToken = result.nextLink;
485
+ yield result.value || [];
486
+ }
487
+ }
488
+
489
+ private async *listAtResourceLevelNextPagingAll(
490
+ resourceGroupName: string,
491
+ resourceProviderNamespace: string,
492
+ parentResourcePath: string,
493
+ resourceType: string,
494
+ resourceName: string,
495
+ nextLink: string,
496
+ options?: ManagementLocksListAtResourceLevelNextOptionalParams
497
+ ): AsyncIterableIterator<ManagementLockObject> {
498
+ for await (const page of this.listAtResourceLevelNextPagingPage(
499
+ resourceGroupName,
500
+ resourceProviderNamespace,
501
+ parentResourcePath,
502
+ resourceType,
503
+ resourceName,
504
+ nextLink,
505
+ options
506
+ )) {
507
+ yield* page;
508
+ }
509
+ }
510
+
152
511
  /**
153
- * @param scope The scope for the lock. When providing a scope for the assignment, use
154
- * '/subscriptions/{subscriptionId}' for subscriptions,
155
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
156
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
157
- * for resources.
158
- * @param lockName The name of lock.
159
- * @param parameters Create or update management lock parameters.
160
- * @param callback The callback
512
+ * ListAtSubscriptionLevelNext
513
+ * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionLevel
514
+ * method.
515
+ * @param options The options parameters.
161
516
  */
162
- createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
517
+ public listAtSubscriptionLevelNext(
518
+ nextLink: string,
519
+ options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams
520
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
521
+ const iter = this.listAtSubscriptionLevelNextPagingAll(nextLink, options);
522
+ return {
523
+ next() {
524
+ return iter.next();
525
+ },
526
+ [Symbol.asyncIterator]() {
527
+ return this;
528
+ },
529
+ byPage: () => {
530
+ return this.listAtSubscriptionLevelNextPagingPage(nextLink, options);
531
+ }
532
+ };
533
+ }
534
+
535
+ private async *listAtSubscriptionLevelNextPagingPage(
536
+ nextLink: string,
537
+ options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams
538
+ ): AsyncIterableIterator<ManagementLockObject[]> {
539
+ let result = await this._listAtSubscriptionLevelNext(nextLink, options);
540
+ yield result.value || [];
541
+ let continuationToken = result.nextLink;
542
+ while (continuationToken) {
543
+ result = await this._listAtSubscriptionLevelNextNext(
544
+ continuationToken,
545
+ options
546
+ );
547
+ continuationToken = result.nextLink;
548
+ yield result.value || [];
549
+ }
550
+ }
551
+
552
+ private async *listAtSubscriptionLevelNextPagingAll(
553
+ nextLink: string,
554
+ options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams
555
+ ): AsyncIterableIterator<ManagementLockObject> {
556
+ for await (const page of this.listAtSubscriptionLevelNextPagingPage(
557
+ nextLink,
558
+ options
559
+ )) {
560
+ yield* page;
561
+ }
562
+ }
563
+
163
564
  /**
565
+ * ListByScopeNext
164
566
  * @param scope The scope for the lock. When providing a scope for the assignment, use
165
- * '/subscriptions/{subscriptionId}' for subscriptions,
166
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
167
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
168
- * for resources.
169
- * @param lockName The name of lock.
170
- * @param parameters Create or update management lock parameters.
171
- * @param options The optional parameters
172
- * @param callback The callback
567
+ * '/subscriptions/{subscriptionId}' for subscriptions,
568
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
569
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
570
+ * for resources.
571
+ * @param nextLink The nextLink from the previous successful call to the ListByScope method.
572
+ * @param options The options parameters.
173
573
  */
174
- createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
175
- createOrUpdateByScope(scope: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksCreateOrUpdateByScopeResponse> {
176
- return this.client.sendOperationRequest(
177
- {
574
+ public listByScopeNext(
575
+ scope: string,
576
+ nextLink: string,
577
+ options?: ManagementLocksListByScopeNextOptionalParams
578
+ ): PagedAsyncIterableIterator<ManagementLockObject> {
579
+ const iter = this.listByScopeNextPagingAll(scope, nextLink, options);
580
+ return {
581
+ next() {
582
+ return iter.next();
583
+ },
584
+ [Symbol.asyncIterator]() {
585
+ return this;
586
+ },
587
+ byPage: () => {
588
+ return this.listByScopeNextPagingPage(scope, nextLink, options);
589
+ }
590
+ };
591
+ }
592
+
593
+ private async *listByScopeNextPagingPage(
594
+ scope: string,
595
+ nextLink: string,
596
+ options?: ManagementLocksListByScopeNextOptionalParams
597
+ ): AsyncIterableIterator<ManagementLockObject[]> {
598
+ let result = await this._listByScopeNext(scope, nextLink, options);
599
+ yield result.value || [];
600
+ let continuationToken = result.nextLink;
601
+ while (continuationToken) {
602
+ result = await this._listByScopeNextNext(
178
603
  scope,
179
- lockName,
180
- parameters,
604
+ continuationToken,
181
605
  options
182
- },
183
- createOrUpdateByScopeOperationSpec,
184
- callback) as Promise<Models.ManagementLocksCreateOrUpdateByScopeResponse>;
606
+ );
607
+ continuationToken = result.nextLink;
608
+ yield result.value || [];
609
+ }
610
+ }
611
+
612
+ private async *listByScopeNextPagingAll(
613
+ scope: string,
614
+ nextLink: string,
615
+ options?: ManagementLocksListByScopeNextOptionalParams
616
+ ): AsyncIterableIterator<ManagementLockObject> {
617
+ for await (const page of this.listByScopeNextPagingPage(
618
+ scope,
619
+ nextLink,
620
+ options
621
+ )) {
622
+ yield* page;
623
+ }
185
624
  }
186
625
 
187
626
  /**
188
- * Delete a management lock by scope.
189
- * @param scope The scope for the lock.
190
- * @param lockName The name of lock.
191
- * @param [options] The optional parameters
192
- * @returns Promise<msRest.RestResponse>
627
+ * When you apply a lock at a parent scope, all child resources inherit the same lock. To create
628
+ * management locks, you must have access to Microsoft.Authorization/* or
629
+ * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
630
+ * Administrator are granted those actions.
631
+ * @param resourceGroupName The name of the resource group to lock.
632
+ * @param lockName The lock name. The lock name can be a maximum of 260 characters. It cannot contain
633
+ * <, > %, &, :, \, ?, /, or any control characters.
634
+ * @param parameters The management lock parameters.
635
+ * @param options The options parameters.
193
636
  */
194
- deleteByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
637
+ createOrUpdateAtResourceGroupLevel(
638
+ resourceGroupName: string,
639
+ lockName: string,
640
+ parameters: ManagementLockObject,
641
+ options?: ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams
642
+ ): Promise<ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse> {
643
+ return this.client.sendOperationRequest(
644
+ { resourceGroupName, lockName, parameters, options },
645
+ createOrUpdateAtResourceGroupLevelOperationSpec
646
+ );
647
+ }
648
+
195
649
  /**
196
- * @param scope The scope for the lock.
197
- * @param lockName The name of lock.
198
- * @param callback The callback
650
+ * To delete management locks, you must have access to Microsoft.Authorization/* or
651
+ * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
652
+ * Administrator are granted those actions.
653
+ * @param resourceGroupName The name of the resource group containing the lock.
654
+ * @param lockName The name of lock to delete.
655
+ * @param options The options parameters.
199
656
  */
200
- deleteByScope(scope: string, lockName: string, callback: msRest.ServiceCallback<void>): void;
657
+ deleteAtResourceGroupLevel(
658
+ resourceGroupName: string,
659
+ lockName: string,
660
+ options?: ManagementLocksDeleteAtResourceGroupLevelOptionalParams
661
+ ): Promise<void> {
662
+ return this.client.sendOperationRequest(
663
+ { resourceGroupName, lockName, options },
664
+ deleteAtResourceGroupLevelOperationSpec
665
+ );
666
+ }
667
+
201
668
  /**
202
- * @param scope The scope for the lock.
203
- * @param lockName The name of lock.
204
- * @param options The optional parameters
205
- * @param callback The callback
669
+ * Gets a management lock at the resource group level.
670
+ * @param resourceGroupName The name of the locked resource group.
671
+ * @param lockName The name of the lock to get.
672
+ * @param options The options parameters.
206
673
  */
207
- deleteByScope(scope: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
208
- deleteByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
674
+ getAtResourceGroupLevel(
675
+ resourceGroupName: string,
676
+ lockName: string,
677
+ options?: ManagementLocksGetAtResourceGroupLevelOptionalParams
678
+ ): Promise<ManagementLocksGetAtResourceGroupLevelResponse> {
209
679
  return this.client.sendOperationRequest(
210
- {
211
- scope,
212
- lockName,
213
- options
214
- },
215
- deleteByScopeOperationSpec,
216
- callback);
680
+ { resourceGroupName, lockName, options },
681
+ getAtResourceGroupLevelOperationSpec
682
+ );
217
683
  }
218
684
 
219
685
  /**
220
- * Get a management lock by scope.
221
- * @param scope The scope for the lock.
686
+ * Create or update a management lock by scope.
687
+ * @param scope The scope for the lock. When providing a scope for the assignment, use
688
+ * '/subscriptions/{subscriptionId}' for subscriptions,
689
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
690
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
691
+ * for resources.
222
692
  * @param lockName The name of lock.
223
- * @param [options] The optional parameters
224
- * @returns Promise<Models.ManagementLocksGetByScopeResponse>
693
+ * @param parameters Create or update management lock parameters.
694
+ * @param options The options parameters.
225
695
  */
226
- getByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksGetByScopeResponse>;
696
+ createOrUpdateByScope(
697
+ scope: string,
698
+ lockName: string,
699
+ parameters: ManagementLockObject,
700
+ options?: ManagementLocksCreateOrUpdateByScopeOptionalParams
701
+ ): Promise<ManagementLocksCreateOrUpdateByScopeResponse> {
702
+ return this.client.sendOperationRequest(
703
+ { scope, lockName, parameters, options },
704
+ createOrUpdateByScopeOperationSpec
705
+ );
706
+ }
707
+
227
708
  /**
709
+ * Delete a management lock by scope.
228
710
  * @param scope The scope for the lock.
229
711
  * @param lockName The name of lock.
230
- * @param callback The callback
712
+ * @param options The options parameters.
231
713
  */
232
- getByScope(scope: string, lockName: string, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
714
+ deleteByScope(
715
+ scope: string,
716
+ lockName: string,
717
+ options?: ManagementLocksDeleteByScopeOptionalParams
718
+ ): Promise<void> {
719
+ return this.client.sendOperationRequest(
720
+ { scope, lockName, options },
721
+ deleteByScopeOperationSpec
722
+ );
723
+ }
724
+
233
725
  /**
726
+ * Get a management lock by scope.
234
727
  * @param scope The scope for the lock.
235
728
  * @param lockName The name of lock.
236
- * @param options The optional parameters
237
- * @param callback The callback
729
+ * @param options The options parameters.
238
730
  */
239
- getByScope(scope: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
240
- getByScope(scope: string, lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksGetByScopeResponse> {
731
+ getByScope(
732
+ scope: string,
733
+ lockName: string,
734
+ options?: ManagementLocksGetByScopeOptionalParams
735
+ ): Promise<ManagementLocksGetByScopeResponse> {
241
736
  return this.client.sendOperationRequest(
242
- {
243
- scope,
244
- lockName,
245
- options
246
- },
247
- getByScopeOperationSpec,
248
- callback) as Promise<Models.ManagementLocksGetByScopeResponse>;
737
+ { scope, lockName, options },
738
+ getByScopeOperationSpec
739
+ );
249
740
  }
250
741
 
251
742
  /**
@@ -253,46 +744,26 @@ export class ManagementLocks {
253
744
  * management locks, you must have access to Microsoft.Authorization/* or
254
745
  * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
255
746
  * Administrator are granted those actions.
256
- * @summary Creates or updates a management lock at the resource level or any level below the
257
- * resource.
258
747
  * @param resourceGroupName The name of the resource group containing the resource to lock.
259
748
  * @param resourceProviderNamespace The resource provider namespace of the resource to lock.
260
749
  * @param parentResourcePath The parent resource identity.
261
750
  * @param resourceType The resource type of the resource to lock.
262
751
  * @param resourceName The name of the resource to lock.
263
752
  * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot
264
- * contain <, > %, &, :, \, ?, /, or any control characters.
753
+ * contain <, > %, &, :, \, ?, /, or any control characters.
265
754
  * @param parameters Parameters for creating or updating a management lock.
266
- * @param [options] The optional parameters
267
- * @returns Promise<Models.ManagementLocksCreateOrUpdateAtResourceLevelResponse>
755
+ * @param options The options parameters.
268
756
  */
269
- createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksCreateOrUpdateAtResourceLevelResponse>;
270
- /**
271
- * @param resourceGroupName The name of the resource group containing the resource to lock.
272
- * @param resourceProviderNamespace The resource provider namespace of the resource to lock.
273
- * @param parentResourcePath The parent resource identity.
274
- * @param resourceType The resource type of the resource to lock.
275
- * @param resourceName The name of the resource to lock.
276
- * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot
277
- * contain <, > %, &, :, \, ?, /, or any control characters.
278
- * @param parameters Parameters for creating or updating a management lock.
279
- * @param callback The callback
280
- */
281
- createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
282
- /**
283
- * @param resourceGroupName The name of the resource group containing the resource to lock.
284
- * @param resourceProviderNamespace The resource provider namespace of the resource to lock.
285
- * @param parentResourcePath The parent resource identity.
286
- * @param resourceType The resource type of the resource to lock.
287
- * @param resourceName The name of the resource to lock.
288
- * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot
289
- * contain <, > %, &, :, \, ?, /, or any control characters.
290
- * @param parameters Parameters for creating or updating a management lock.
291
- * @param options The optional parameters
292
- * @param callback The callback
293
- */
294
- createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
295
- createOrUpdateAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksCreateOrUpdateAtResourceLevelResponse> {
757
+ createOrUpdateAtResourceLevel(
758
+ resourceGroupName: string,
759
+ resourceProviderNamespace: string,
760
+ parentResourcePath: string,
761
+ resourceType: string,
762
+ resourceName: string,
763
+ lockName: string,
764
+ parameters: ManagementLockObject,
765
+ options?: ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams
766
+ ): Promise<ManagementLocksCreateOrUpdateAtResourceLevelResponse> {
296
767
  return this.client.sendOperationRequest(
297
768
  {
298
769
  resourceGroupName,
@@ -304,53 +775,33 @@ export class ManagementLocks {
304
775
  parameters,
305
776
  options
306
777
  },
307
- createOrUpdateAtResourceLevelOperationSpec,
308
- callback) as Promise<Models.ManagementLocksCreateOrUpdateAtResourceLevelResponse>;
778
+ createOrUpdateAtResourceLevelOperationSpec
779
+ );
309
780
  }
310
781
 
311
782
  /**
312
783
  * To delete management locks, you must have access to Microsoft.Authorization/* or
313
784
  * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
314
785
  * Administrator are granted those actions.
315
- * @summary Deletes the management lock of a resource or any level below the resource.
316
- * @param resourceGroupName The name of the resource group containing the resource with the lock to
317
- * delete.
318
- * @param resourceProviderNamespace The resource provider namespace of the resource with the lock
319
- * to delete.
320
- * @param parentResourcePath The parent resource identity.
321
- * @param resourceType The resource type of the resource with the lock to delete.
322
- * @param resourceName The name of the resource with the lock to delete.
323
- * @param lockName The name of the lock to delete.
324
- * @param [options] The optional parameters
325
- * @returns Promise<msRest.RestResponse>
326
- */
327
- deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
328
- /**
329
786
  * @param resourceGroupName The name of the resource group containing the resource with the lock to
330
- * delete.
331
- * @param resourceProviderNamespace The resource provider namespace of the resource with the lock
332
- * to delete.
787
+ * delete.
788
+ * @param resourceProviderNamespace The resource provider namespace of the resource with the lock to
789
+ * delete.
333
790
  * @param parentResourcePath The parent resource identity.
334
791
  * @param resourceType The resource type of the resource with the lock to delete.
335
792
  * @param resourceName The name of the resource with the lock to delete.
336
793
  * @param lockName The name of the lock to delete.
337
- * @param callback The callback
794
+ * @param options The options parameters.
338
795
  */
339
- deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, callback: msRest.ServiceCallback<void>): void;
340
- /**
341
- * @param resourceGroupName The name of the resource group containing the resource with the lock to
342
- * delete.
343
- * @param resourceProviderNamespace The resource provider namespace of the resource with the lock
344
- * to delete.
345
- * @param parentResourcePath The parent resource identity.
346
- * @param resourceType The resource type of the resource with the lock to delete.
347
- * @param resourceName The name of the resource with the lock to delete.
348
- * @param lockName The name of the lock to delete.
349
- * @param options The optional parameters
350
- * @param callback The callback
351
- */
352
- deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
353
- deleteAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
796
+ deleteAtResourceLevel(
797
+ resourceGroupName: string,
798
+ resourceProviderNamespace: string,
799
+ parentResourcePath: string,
800
+ resourceType: string,
801
+ resourceName: string,
802
+ lockName: string,
803
+ options?: ManagementLocksDeleteAtResourceLevelOptionalParams
804
+ ): Promise<void> {
354
805
  return this.client.sendOperationRequest(
355
806
  {
356
807
  resourceGroupName,
@@ -361,8 +812,8 @@ export class ManagementLocks {
361
812
  lockName,
362
813
  options
363
814
  },
364
- deleteAtResourceLevelOperationSpec,
365
- callback);
815
+ deleteAtResourceLevelOperationSpec
816
+ );
366
817
  }
367
818
 
368
819
  /**
@@ -373,32 +824,17 @@ export class ManagementLocks {
373
824
  * @param resourceType The type of the resource.
374
825
  * @param resourceName The name of the resource.
375
826
  * @param lockName The name of lock.
376
- * @param [options] The optional parameters
377
- * @returns Promise<Models.ManagementLocksGetAtResourceLevelResponse>
378
- */
379
- getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksGetAtResourceLevelResponse>;
380
- /**
381
- * @param resourceGroupName The name of the resource group.
382
- * @param resourceProviderNamespace The namespace of the resource provider.
383
- * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases.
384
- * @param resourceType The type of the resource.
385
- * @param resourceName The name of the resource.
386
- * @param lockName The name of lock.
387
- * @param callback The callback
388
- */
389
- getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
390
- /**
391
- * @param resourceGroupName The name of the resource group.
392
- * @param resourceProviderNamespace The namespace of the resource provider.
393
- * @param parentResourcePath An extra path parameter needed in some services, like SQL Databases.
394
- * @param resourceType The type of the resource.
395
- * @param resourceName The name of the resource.
396
- * @param lockName The name of lock.
397
- * @param options The optional parameters
398
- * @param callback The callback
827
+ * @param options The options parameters.
399
828
  */
400
- getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
401
- getAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksGetAtResourceLevelResponse> {
829
+ getAtResourceLevel(
830
+ resourceGroupName: string,
831
+ resourceProviderNamespace: string,
832
+ parentResourcePath: string,
833
+ resourceType: string,
834
+ resourceName: string,
835
+ lockName: string,
836
+ options?: ManagementLocksGetAtResourceLevelOptionalParams
837
+ ): Promise<ManagementLocksGetAtResourceLevelResponse> {
402
838
  return this.client.sendOperationRequest(
403
839
  {
404
840
  resourceGroupName,
@@ -409,8 +845,8 @@ export class ManagementLocks {
409
845
  lockName,
410
846
  options
411
847
  },
412
- getAtResourceLevelOperationSpec,
413
- callback) as Promise<Models.ManagementLocksGetAtResourceLevelResponse>;
848
+ getAtResourceLevelOperationSpec
849
+ );
414
850
  }
415
851
 
416
852
  /**
@@ -418,161 +854,87 @@ export class ManagementLocks {
418
854
  * management locks, you must have access to Microsoft.Authorization/* or
419
855
  * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
420
856
  * Administrator are granted those actions.
421
- * @summary Creates or updates a management lock at the subscription level.
422
857
  * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot
423
- * contain <, > %, &, :, \, ?, /, or any control characters.
858
+ * contain <, > %, &, :, \, ?, /, or any control characters.
424
859
  * @param parameters The management lock parameters.
425
- * @param [options] The optional parameters
426
- * @returns Promise<Models.ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse>
860
+ * @param options The options parameters.
427
861
  */
428
- createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse>;
429
- /**
430
- * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot
431
- * contain <, > %, &, :, \, ?, /, or any control characters.
432
- * @param parameters The management lock parameters.
433
- * @param callback The callback
434
- */
435
- createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
436
- /**
437
- * @param lockName The name of lock. The lock name can be a maximum of 260 characters. It cannot
438
- * contain <, > %, &, :, \, ?, /, or any control characters.
439
- * @param parameters The management lock parameters.
440
- * @param options The optional parameters
441
- * @param callback The callback
442
- */
443
- createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
444
- createOrUpdateAtSubscriptionLevel(lockName: string, parameters: Models.ManagementLockObject, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse> {
862
+ createOrUpdateAtSubscriptionLevel(
863
+ lockName: string,
864
+ parameters: ManagementLockObject,
865
+ options?: ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams
866
+ ): Promise<ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse> {
445
867
  return this.client.sendOperationRequest(
446
- {
447
- lockName,
448
- parameters,
449
- options
450
- },
451
- createOrUpdateAtSubscriptionLevelOperationSpec,
452
- callback) as Promise<Models.ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse>;
868
+ { lockName, parameters, options },
869
+ createOrUpdateAtSubscriptionLevelOperationSpec
870
+ );
453
871
  }
454
872
 
455
873
  /**
456
874
  * To delete management locks, you must have access to Microsoft.Authorization/* or
457
875
  * Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access
458
876
  * Administrator are granted those actions.
459
- * @summary Deletes the management lock at the subscription level.
460
877
  * @param lockName The name of lock to delete.
461
- * @param [options] The optional parameters
462
- * @returns Promise<msRest.RestResponse>
878
+ * @param options The options parameters.
463
879
  */
464
- deleteAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
465
- /**
466
- * @param lockName The name of lock to delete.
467
- * @param callback The callback
468
- */
469
- deleteAtSubscriptionLevel(lockName: string, callback: msRest.ServiceCallback<void>): void;
470
- /**
471
- * @param lockName The name of lock to delete.
472
- * @param options The optional parameters
473
- * @param callback The callback
474
- */
475
- deleteAtSubscriptionLevel(lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
476
- deleteAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
880
+ deleteAtSubscriptionLevel(
881
+ lockName: string,
882
+ options?: ManagementLocksDeleteAtSubscriptionLevelOptionalParams
883
+ ): Promise<void> {
477
884
  return this.client.sendOperationRequest(
478
- {
479
- lockName,
480
- options
481
- },
482
- deleteAtSubscriptionLevelOperationSpec,
483
- callback);
885
+ { lockName, options },
886
+ deleteAtSubscriptionLevelOperationSpec
887
+ );
484
888
  }
485
889
 
486
890
  /**
487
891
  * Gets a management lock at the subscription level.
488
892
  * @param lockName The name of the lock to get.
489
- * @param [options] The optional parameters
490
- * @returns Promise<Models.ManagementLocksGetAtSubscriptionLevelResponse>
491
- */
492
- getAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksGetAtSubscriptionLevelResponse>;
493
- /**
494
- * @param lockName The name of the lock to get.
495
- * @param callback The callback
496
- */
497
- getAtSubscriptionLevel(lockName: string, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
498
- /**
499
- * @param lockName The name of the lock to get.
500
- * @param options The optional parameters
501
- * @param callback The callback
893
+ * @param options The options parameters.
502
894
  */
503
- getAtSubscriptionLevel(lockName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockObject>): void;
504
- getAtSubscriptionLevel(lockName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockObject>, callback?: msRest.ServiceCallback<Models.ManagementLockObject>): Promise<Models.ManagementLocksGetAtSubscriptionLevelResponse> {
895
+ getAtSubscriptionLevel(
896
+ lockName: string,
897
+ options?: ManagementLocksGetAtSubscriptionLevelOptionalParams
898
+ ): Promise<ManagementLocksGetAtSubscriptionLevelResponse> {
505
899
  return this.client.sendOperationRequest(
506
- {
507
- lockName,
508
- options
509
- },
510
- getAtSubscriptionLevelOperationSpec,
511
- callback) as Promise<Models.ManagementLocksGetAtSubscriptionLevelResponse>;
900
+ { lockName, options },
901
+ getAtSubscriptionLevelOperationSpec
902
+ );
512
903
  }
513
904
 
514
905
  /**
515
906
  * Gets all the management locks for a resource group.
516
907
  * @param resourceGroupName The name of the resource group containing the locks to get.
517
- * @param [options] The optional parameters
518
- * @returns Promise<Models.ManagementLocksListAtResourceGroupLevelResponse>
908
+ * @param options The options parameters.
519
909
  */
520
- listAtResourceGroupLevel(resourceGroupName: string, options?: Models.ManagementLocksListAtResourceGroupLevelOptionalParams): Promise<Models.ManagementLocksListAtResourceGroupLevelResponse>;
521
- /**
522
- * @param resourceGroupName The name of the resource group containing the locks to get.
523
- * @param callback The callback
524
- */
525
- listAtResourceGroupLevel(resourceGroupName: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
526
- /**
527
- * @param resourceGroupName The name of the resource group containing the locks to get.
528
- * @param options The optional parameters
529
- * @param callback The callback
530
- */
531
- listAtResourceGroupLevel(resourceGroupName: string, options: Models.ManagementLocksListAtResourceGroupLevelOptionalParams, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
532
- listAtResourceGroupLevel(resourceGroupName: string, options?: Models.ManagementLocksListAtResourceGroupLevelOptionalParams | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListAtResourceGroupLevelResponse> {
910
+ private _listAtResourceGroupLevel(
911
+ resourceGroupName: string,
912
+ options?: ManagementLocksListAtResourceGroupLevelOptionalParams
913
+ ): Promise<ManagementLocksListAtResourceGroupLevelResponse> {
533
914
  return this.client.sendOperationRequest(
534
- {
535
- resourceGroupName,
536
- options
537
- },
538
- listAtResourceGroupLevelOperationSpec,
539
- callback) as Promise<Models.ManagementLocksListAtResourceGroupLevelResponse>;
915
+ { resourceGroupName, options },
916
+ listAtResourceGroupLevelOperationSpec
917
+ );
540
918
  }
541
919
 
542
920
  /**
543
921
  * Gets all the management locks for a resource or any level below resource.
544
- * @param resourceGroupName The name of the resource group containing the locked resource. The name
545
- * is case insensitive.
546
- * @param resourceProviderNamespace The namespace of the resource provider.
547
- * @param parentResourcePath The parent resource identity.
548
- * @param resourceType The resource type of the locked resource.
549
- * @param resourceName The name of the locked resource.
550
- * @param [options] The optional parameters
551
- * @returns Promise<Models.ManagementLocksListAtResourceLevelResponse>
552
- */
553
- listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.ManagementLocksListAtResourceLevelOptionalParams): Promise<Models.ManagementLocksListAtResourceLevelResponse>;
554
- /**
555
- * @param resourceGroupName The name of the resource group containing the locked resource. The name
556
- * is case insensitive.
922
+ * @param resourceGroupName The name of the resource group containing the locked resource. The name is
923
+ * case insensitive.
557
924
  * @param resourceProviderNamespace The namespace of the resource provider.
558
925
  * @param parentResourcePath The parent resource identity.
559
926
  * @param resourceType The resource type of the locked resource.
560
927
  * @param resourceName The name of the locked resource.
561
- * @param callback The callback
928
+ * @param options The options parameters.
562
929
  */
563
- listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
564
- /**
565
- * @param resourceGroupName The name of the resource group containing the locked resource. The name
566
- * is case insensitive.
567
- * @param resourceProviderNamespace The namespace of the resource provider.
568
- * @param parentResourcePath The parent resource identity.
569
- * @param resourceType The resource type of the locked resource.
570
- * @param resourceName The name of the locked resource.
571
- * @param options The optional parameters
572
- * @param callback The callback
573
- */
574
- listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options: Models.ManagementLocksListAtResourceLevelOptionalParams, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
575
- listAtResourceLevel(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, options?: Models.ManagementLocksListAtResourceLevelOptionalParams | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListAtResourceLevelResponse> {
930
+ private _listAtResourceLevel(
931
+ resourceGroupName: string,
932
+ resourceProviderNamespace: string,
933
+ parentResourcePath: string,
934
+ resourceType: string,
935
+ resourceName: string,
936
+ options?: ManagementLocksListAtResourceLevelOptionalParams
937
+ ): Promise<ManagementLocksListAtResourceLevelResponse> {
576
938
  return this.client.sendOperationRequest(
577
939
  {
578
940
  resourceGroupName,
@@ -582,713 +944,647 @@ export class ManagementLocks {
582
944
  resourceName,
583
945
  options
584
946
  },
585
- listAtResourceLevelOperationSpec,
586
- callback) as Promise<Models.ManagementLocksListAtResourceLevelResponse>;
947
+ listAtResourceLevelOperationSpec
948
+ );
587
949
  }
588
950
 
589
951
  /**
590
952
  * Gets all the management locks for a subscription.
591
- * @param [options] The optional parameters
592
- * @returns Promise<Models.ManagementLocksListAtSubscriptionLevelResponse>
953
+ * @param options The options parameters.
593
954
  */
594
- listAtSubscriptionLevel(options?: Models.ManagementLocksListAtSubscriptionLevelOptionalParams): Promise<Models.ManagementLocksListAtSubscriptionLevelResponse>;
595
- /**
596
- * @param callback The callback
597
- */
598
- listAtSubscriptionLevel(callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
599
- /**
600
- * @param options The optional parameters
601
- * @param callback The callback
602
- */
603
- listAtSubscriptionLevel(options: Models.ManagementLocksListAtSubscriptionLevelOptionalParams, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
604
- listAtSubscriptionLevel(options?: Models.ManagementLocksListAtSubscriptionLevelOptionalParams | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListAtSubscriptionLevelResponse> {
955
+ private _listAtSubscriptionLevel(
956
+ options?: ManagementLocksListAtSubscriptionLevelOptionalParams
957
+ ): Promise<ManagementLocksListAtSubscriptionLevelResponse> {
605
958
  return this.client.sendOperationRequest(
606
- {
607
- options
608
- },
609
- listAtSubscriptionLevelOperationSpec,
610
- callback) as Promise<Models.ManagementLocksListAtSubscriptionLevelResponse>;
959
+ { options },
960
+ listAtSubscriptionLevelOperationSpec
961
+ );
611
962
  }
612
963
 
613
964
  /**
614
965
  * Gets all the management locks for a scope.
615
966
  * @param scope The scope for the lock. When providing a scope for the assignment, use
616
- * '/subscriptions/{subscriptionId}' for subscriptions,
617
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
618
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
619
- * for resources.
620
- * @param [options] The optional parameters
621
- * @returns Promise<Models.ManagementLocksListByScopeResponse>
967
+ * '/subscriptions/{subscriptionId}' for subscriptions,
968
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
969
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
970
+ * for resources.
971
+ * @param options The options parameters.
622
972
  */
623
- listByScope(scope: string, options?: Models.ManagementLocksListByScopeOptionalParams): Promise<Models.ManagementLocksListByScopeResponse>;
624
- /**
625
- * @param scope The scope for the lock. When providing a scope for the assignment, use
626
- * '/subscriptions/{subscriptionId}' for subscriptions,
627
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
628
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
629
- * for resources.
630
- * @param callback The callback
631
- */
632
- listByScope(scope: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
633
- /**
634
- * @param scope The scope for the lock. When providing a scope for the assignment, use
635
- * '/subscriptions/{subscriptionId}' for subscriptions,
636
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
637
- * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
638
- * for resources.
639
- * @param options The optional parameters
640
- * @param callback The callback
641
- */
642
- listByScope(scope: string, options: Models.ManagementLocksListByScopeOptionalParams, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
643
- listByScope(scope: string, options?: Models.ManagementLocksListByScopeOptionalParams | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListByScopeResponse> {
973
+ private _listByScope(
974
+ scope: string,
975
+ options?: ManagementLocksListByScopeOptionalParams
976
+ ): Promise<ManagementLocksListByScopeResponse> {
644
977
  return this.client.sendOperationRequest(
645
- {
646
- scope,
647
- options
648
- },
649
- listByScopeOperationSpec,
650
- callback) as Promise<Models.ManagementLocksListByScopeResponse>;
978
+ { scope, options },
979
+ listByScopeOperationSpec
980
+ );
651
981
  }
652
982
 
653
983
  /**
654
- * Gets all the management locks for a resource group.
655
- * @param nextPageLink The NextLink from the previous successful call to List operation.
656
- * @param [options] The optional parameters
657
- * @returns Promise<Models.ManagementLocksListAtResourceGroupLevelNextResponse>
658
- */
659
- listAtResourceGroupLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksListAtResourceGroupLevelNextResponse>;
660
- /**
661
- * @param nextPageLink The NextLink from the previous successful call to List operation.
662
- * @param callback The callback
984
+ * ListAtResourceGroupLevelNext
985
+ * @param resourceGroupName The name of the resource group containing the locks to get.
986
+ * @param nextLink The nextLink from the previous successful call to the ListAtResourceGroupLevel
987
+ * method.
988
+ * @param options The options parameters.
663
989
  */
664
- listAtResourceGroupLevelNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
990
+ private _listAtResourceGroupLevelNext(
991
+ resourceGroupName: string,
992
+ nextLink: string,
993
+ options?: ManagementLocksListAtResourceGroupLevelNextOptionalParams
994
+ ): Promise<ManagementLocksListAtResourceGroupLevelNextResponse> {
995
+ return this.client.sendOperationRequest(
996
+ { resourceGroupName, nextLink, options },
997
+ listAtResourceGroupLevelNextOperationSpec
998
+ );
999
+ }
1000
+
665
1001
  /**
666
- * @param nextPageLink The NextLink from the previous successful call to List operation.
667
- * @param options The optional parameters
668
- * @param callback The callback
1002
+ * ListAtResourceLevelNext
1003
+ * @param resourceGroupName The name of the resource group containing the locked resource. The name is
1004
+ * case insensitive.
1005
+ * @param resourceProviderNamespace The namespace of the resource provider.
1006
+ * @param parentResourcePath The parent resource identity.
1007
+ * @param resourceType The resource type of the locked resource.
1008
+ * @param resourceName The name of the locked resource.
1009
+ * @param nextLink The nextLink from the previous successful call to the ListAtResourceLevel method.
1010
+ * @param options The options parameters.
669
1011
  */
670
- listAtResourceGroupLevelNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
671
- listAtResourceGroupLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListAtResourceGroupLevelNextResponse> {
1012
+ private _listAtResourceLevelNext(
1013
+ resourceGroupName: string,
1014
+ resourceProviderNamespace: string,
1015
+ parentResourcePath: string,
1016
+ resourceType: string,
1017
+ resourceName: string,
1018
+ nextLink: string,
1019
+ options?: ManagementLocksListAtResourceLevelNextOptionalParams
1020
+ ): Promise<ManagementLocksListAtResourceLevelNextResponse> {
672
1021
  return this.client.sendOperationRequest(
673
1022
  {
674
- nextPageLink,
1023
+ resourceGroupName,
1024
+ resourceProviderNamespace,
1025
+ parentResourcePath,
1026
+ resourceType,
1027
+ resourceName,
1028
+ nextLink,
675
1029
  options
676
1030
  },
677
- listAtResourceGroupLevelNextOperationSpec,
678
- callback) as Promise<Models.ManagementLocksListAtResourceGroupLevelNextResponse>;
1031
+ listAtResourceLevelNextOperationSpec
1032
+ );
679
1033
  }
680
1034
 
681
1035
  /**
682
- * Gets all the management locks for a resource or any level below resource.
683
- * @param nextPageLink The NextLink from the previous successful call to List operation.
684
- * @param [options] The optional parameters
685
- * @returns Promise<Models.ManagementLocksListAtResourceLevelNextResponse>
686
- */
687
- listAtResourceLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksListAtResourceLevelNextResponse>;
688
- /**
689
- * @param nextPageLink The NextLink from the previous successful call to List operation.
690
- * @param callback The callback
1036
+ * ListAtSubscriptionLevelNext
1037
+ * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionLevel
1038
+ * method.
1039
+ * @param options The options parameters.
691
1040
  */
692
- listAtResourceLevelNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
693
- /**
694
- * @param nextPageLink The NextLink from the previous successful call to List operation.
695
- * @param options The optional parameters
696
- * @param callback The callback
697
- */
698
- listAtResourceLevelNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
699
- listAtResourceLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListAtResourceLevelNextResponse> {
1041
+ private _listAtSubscriptionLevelNext(
1042
+ nextLink: string,
1043
+ options?: ManagementLocksListAtSubscriptionLevelNextOptionalParams
1044
+ ): Promise<ManagementLocksListAtSubscriptionLevelNextResponse> {
700
1045
  return this.client.sendOperationRequest(
701
- {
702
- nextPageLink,
703
- options
704
- },
705
- listAtResourceLevelNextOperationSpec,
706
- callback) as Promise<Models.ManagementLocksListAtResourceLevelNextResponse>;
1046
+ { nextLink, options },
1047
+ listAtSubscriptionLevelNextOperationSpec
1048
+ );
707
1049
  }
708
1050
 
709
1051
  /**
710
- * Gets all the management locks for a subscription.
711
- * @param nextPageLink The NextLink from the previous successful call to List operation.
712
- * @param [options] The optional parameters
713
- * @returns Promise<Models.ManagementLocksListAtSubscriptionLevelNextResponse>
1052
+ * ListByScopeNext
1053
+ * @param scope The scope for the lock. When providing a scope for the assignment, use
1054
+ * '/subscriptions/{subscriptionId}' for subscriptions,
1055
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
1056
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
1057
+ * for resources.
1058
+ * @param nextLink The nextLink from the previous successful call to the ListByScope method.
1059
+ * @param options The options parameters.
714
1060
  */
715
- listAtSubscriptionLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksListAtSubscriptionLevelNextResponse>;
1061
+ private _listByScopeNext(
1062
+ scope: string,
1063
+ nextLink: string,
1064
+ options?: ManagementLocksListByScopeNextOptionalParams
1065
+ ): Promise<ManagementLocksListByScopeNextResponse> {
1066
+ return this.client.sendOperationRequest(
1067
+ { scope, nextLink, options },
1068
+ listByScopeNextOperationSpec
1069
+ );
1070
+ }
1071
+
716
1072
  /**
717
- * @param nextPageLink The NextLink from the previous successful call to List operation.
718
- * @param callback The callback
1073
+ * ListAtResourceGroupLevelNextNext
1074
+ * @param resourceGroupName The name of the resource group containing the locks to get.
1075
+ * @param nextLink The nextLink from the previous successful call to the ListAtResourceGroupLevelNext
1076
+ * method.
1077
+ * @param options The options parameters.
719
1078
  */
720
- listAtSubscriptionLevelNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
1079
+ private _listAtResourceGroupLevelNextNext(
1080
+ resourceGroupName: string,
1081
+ nextLink: string,
1082
+ options?: ManagementLocksListAtResourceGroupLevelNextNextOptionalParams
1083
+ ): Promise<ManagementLocksListAtResourceGroupLevelNextNextResponse> {
1084
+ return this.client.sendOperationRequest(
1085
+ { resourceGroupName, nextLink, options },
1086
+ listAtResourceGroupLevelNextNextOperationSpec
1087
+ );
1088
+ }
1089
+
721
1090
  /**
722
- * @param nextPageLink The NextLink from the previous successful call to List operation.
723
- * @param options The optional parameters
724
- * @param callback The callback
1091
+ * ListAtResourceLevelNextNext
1092
+ * @param resourceGroupName The name of the resource group containing the locked resource. The name is
1093
+ * case insensitive.
1094
+ * @param resourceProviderNamespace The namespace of the resource provider.
1095
+ * @param parentResourcePath The parent resource identity.
1096
+ * @param resourceType The resource type of the locked resource.
1097
+ * @param resourceName The name of the locked resource.
1098
+ * @param nextLink The nextLink from the previous successful call to the ListAtResourceLevelNext
1099
+ * method.
1100
+ * @param options The options parameters.
725
1101
  */
726
- listAtSubscriptionLevelNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
727
- listAtSubscriptionLevelNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListAtSubscriptionLevelNextResponse> {
1102
+ private _listAtResourceLevelNextNext(
1103
+ resourceGroupName: string,
1104
+ resourceProviderNamespace: string,
1105
+ parentResourcePath: string,
1106
+ resourceType: string,
1107
+ resourceName: string,
1108
+ nextLink: string,
1109
+ options?: ManagementLocksListAtResourceLevelNextNextOptionalParams
1110
+ ): Promise<ManagementLocksListAtResourceLevelNextNextResponse> {
728
1111
  return this.client.sendOperationRequest(
729
1112
  {
730
- nextPageLink,
1113
+ resourceGroupName,
1114
+ resourceProviderNamespace,
1115
+ parentResourcePath,
1116
+ resourceType,
1117
+ resourceName,
1118
+ nextLink,
731
1119
  options
732
1120
  },
733
- listAtSubscriptionLevelNextOperationSpec,
734
- callback) as Promise<Models.ManagementLocksListAtSubscriptionLevelNextResponse>;
1121
+ listAtResourceLevelNextNextOperationSpec
1122
+ );
735
1123
  }
736
1124
 
737
1125
  /**
738
- * Gets all the management locks for a scope.
739
- * @param nextPageLink The NextLink from the previous successful call to List operation.
740
- * @param [options] The optional parameters
741
- * @returns Promise<Models.ManagementLocksListByScopeNextResponse>
742
- */
743
- listByScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ManagementLocksListByScopeNextResponse>;
744
- /**
745
- * @param nextPageLink The NextLink from the previous successful call to List operation.
746
- * @param callback The callback
1126
+ * ListAtSubscriptionLevelNextNext
1127
+ * @param nextLink The nextLink from the previous successful call to the ListAtSubscriptionLevelNext
1128
+ * method.
1129
+ * @param options The options parameters.
747
1130
  */
748
- listByScopeNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
1131
+ private _listAtSubscriptionLevelNextNext(
1132
+ nextLink: string,
1133
+ options?: ManagementLocksListAtSubscriptionLevelNextNextOptionalParams
1134
+ ): Promise<ManagementLocksListAtSubscriptionLevelNextNextResponse> {
1135
+ return this.client.sendOperationRequest(
1136
+ { nextLink, options },
1137
+ listAtSubscriptionLevelNextNextOperationSpec
1138
+ );
1139
+ }
1140
+
749
1141
  /**
750
- * @param nextPageLink The NextLink from the previous successful call to List operation.
751
- * @param options The optional parameters
752
- * @param callback The callback
1142
+ * ListByScopeNextNext
1143
+ * @param scope The scope for the lock. When providing a scope for the assignment, use
1144
+ * '/subscriptions/{subscriptionId}' for subscriptions,
1145
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and
1146
+ * '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
1147
+ * for resources.
1148
+ * @param nextLink The nextLink from the previous successful call to the ListByScopeNext method.
1149
+ * @param options The options parameters.
753
1150
  */
754
- listByScopeNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ManagementLockListResult>): void;
755
- listByScopeNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ManagementLockListResult>, callback?: msRest.ServiceCallback<Models.ManagementLockListResult>): Promise<Models.ManagementLocksListByScopeNextResponse> {
1151
+ private _listByScopeNextNext(
1152
+ scope: string,
1153
+ nextLink: string,
1154
+ options?: ManagementLocksListByScopeNextNextOptionalParams
1155
+ ): Promise<ManagementLocksListByScopeNextNextResponse> {
756
1156
  return this.client.sendOperationRequest(
757
- {
758
- nextPageLink,
759
- options
760
- },
761
- listByScopeNextOperationSpec,
762
- callback) as Promise<Models.ManagementLocksListByScopeNextResponse>;
1157
+ { scope, nextLink, options },
1158
+ listByScopeNextNextOperationSpec
1159
+ );
763
1160
  }
764
1161
  }
765
-
766
1162
  // Operation Specifications
767
- const serializer = new msRest.Serializer(Mappers);
768
- const createOrUpdateAtResourceGroupLevelOperationSpec: msRest.OperationSpec = {
1163
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1164
+
1165
+ const createOrUpdateAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = {
1166
+ path:
1167
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
769
1168
  httpMethod: "PUT",
770
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
771
- urlParameters: [
772
- Parameters.resourceGroupName,
773
- Parameters.lockName,
774
- Parameters.subscriptionId
775
- ],
776
- queryParameters: [
777
- Parameters.apiVersion
778
- ],
779
- headerParameters: [
780
- Parameters.acceptLanguage
781
- ],
782
- requestBody: {
783
- parameterPath: "parameters",
784
- mapper: {
785
- ...Mappers.ManagementLockObject,
786
- required: true
787
- }
788
- },
789
1169
  responses: {
790
1170
  200: {
791
1171
  bodyMapper: Mappers.ManagementLockObject
792
1172
  },
793
1173
  201: {
794
1174
  bodyMapper: Mappers.ManagementLockObject
795
- },
796
- default: {
797
- bodyMapper: Mappers.CloudError
798
1175
  }
799
1176
  },
800
- serializer
801
- };
802
-
803
- const deleteAtResourceGroupLevelOperationSpec: msRest.OperationSpec = {
804
- httpMethod: "DELETE",
805
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
1177
+ requestBody: Parameters.parameters,
1178
+ queryParameters: [Parameters.apiVersion],
806
1179
  urlParameters: [
1180
+ Parameters.$host,
807
1181
  Parameters.resourceGroupName,
808
1182
  Parameters.lockName,
809
1183
  Parameters.subscriptionId
810
1184
  ],
811
- queryParameters: [
812
- Parameters.apiVersion
813
- ],
814
- headerParameters: [
815
- Parameters.acceptLanguage
816
- ],
817
- responses: {
818
- 200: {},
819
- 204: {},
820
- default: {
821
- bodyMapper: Mappers.CloudError
822
- }
823
- },
1185
+ headerParameters: [Parameters.accept, Parameters.contentType],
1186
+ mediaType: "json",
824
1187
  serializer
825
1188
  };
826
-
827
- const getAtResourceGroupLevelOperationSpec: msRest.OperationSpec = {
828
- httpMethod: "GET",
829
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
1189
+ const deleteAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = {
1190
+ path:
1191
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
1192
+ httpMethod: "DELETE",
1193
+ responses: { 200: {}, 204: {} },
1194
+ queryParameters: [Parameters.apiVersion],
830
1195
  urlParameters: [
1196
+ Parameters.$host,
831
1197
  Parameters.resourceGroupName,
832
1198
  Parameters.lockName,
833
1199
  Parameters.subscriptionId
834
1200
  ],
835
- queryParameters: [
836
- Parameters.apiVersion
837
- ],
838
- headerParameters: [
839
- Parameters.acceptLanguage
840
- ],
1201
+ serializer
1202
+ };
1203
+ const getAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = {
1204
+ path:
1205
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
1206
+ httpMethod: "GET",
841
1207
  responses: {
842
1208
  200: {
843
1209
  bodyMapper: Mappers.ManagementLockObject
844
- },
845
- default: {
846
- bodyMapper: Mappers.CloudError
847
1210
  }
848
1211
  },
1212
+ queryParameters: [Parameters.apiVersion],
1213
+ urlParameters: [
1214
+ Parameters.$host,
1215
+ Parameters.resourceGroupName,
1216
+ Parameters.lockName,
1217
+ Parameters.subscriptionId
1218
+ ],
1219
+ headerParameters: [Parameters.accept],
849
1220
  serializer
850
1221
  };
851
-
852
- const createOrUpdateByScopeOperationSpec: msRest.OperationSpec = {
1222
+ const createOrUpdateByScopeOperationSpec: coreClient.OperationSpec = {
1223
+ path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}",
853
1224
  httpMethod: "PUT",
854
- path: "{scope}/providers/Microsoft.Authorization/locks/{lockName}",
855
- urlParameters: [
856
- Parameters.scope,
857
- Parameters.lockName
858
- ],
859
- queryParameters: [
860
- Parameters.apiVersion
861
- ],
862
- headerParameters: [
863
- Parameters.acceptLanguage
864
- ],
865
- requestBody: {
866
- parameterPath: "parameters",
867
- mapper: {
868
- ...Mappers.ManagementLockObject,
869
- required: true
870
- }
871
- },
872
1225
  responses: {
873
1226
  200: {
874
1227
  bodyMapper: Mappers.ManagementLockObject
875
1228
  },
876
1229
  201: {
877
1230
  bodyMapper: Mappers.ManagementLockObject
878
- },
879
- default: {
880
- bodyMapper: Mappers.CloudError
881
1231
  }
882
1232
  },
1233
+ requestBody: Parameters.parameters,
1234
+ queryParameters: [Parameters.apiVersion],
1235
+ urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope],
1236
+ headerParameters: [Parameters.accept, Parameters.contentType],
1237
+ mediaType: "json",
883
1238
  serializer
884
1239
  };
885
-
886
- const deleteByScopeOperationSpec: msRest.OperationSpec = {
1240
+ const deleteByScopeOperationSpec: coreClient.OperationSpec = {
1241
+ path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}",
887
1242
  httpMethod: "DELETE",
888
- path: "{scope}/providers/Microsoft.Authorization/locks/{lockName}",
889
- urlParameters: [
890
- Parameters.scope,
891
- Parameters.lockName
892
- ],
893
- queryParameters: [
894
- Parameters.apiVersion
895
- ],
896
- headerParameters: [
897
- Parameters.acceptLanguage
898
- ],
899
- responses: {
900
- 200: {},
901
- 204: {},
902
- default: {
903
- bodyMapper: Mappers.CloudError
904
- }
905
- },
1243
+ responses: { 200: {}, 204: {} },
1244
+ queryParameters: [Parameters.apiVersion],
1245
+ urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope],
906
1246
  serializer
907
1247
  };
908
-
909
- const getByScopeOperationSpec: msRest.OperationSpec = {
1248
+ const getByScopeOperationSpec: coreClient.OperationSpec = {
1249
+ path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}",
910
1250
  httpMethod: "GET",
911
- path: "{scope}/providers/Microsoft.Authorization/locks/{lockName}",
912
- urlParameters: [
913
- Parameters.scope,
914
- Parameters.lockName
915
- ],
916
- queryParameters: [
917
- Parameters.apiVersion
918
- ],
919
- headerParameters: [
920
- Parameters.acceptLanguage
921
- ],
922
1251
  responses: {
923
1252
  200: {
924
1253
  bodyMapper: Mappers.ManagementLockObject
925
- },
926
- default: {
927
- bodyMapper: Mappers.CloudError
928
1254
  }
929
1255
  },
1256
+ queryParameters: [Parameters.apiVersion],
1257
+ urlParameters: [Parameters.$host, Parameters.lockName, Parameters.scope],
1258
+ headerParameters: [Parameters.accept],
930
1259
  serializer
931
1260
  };
932
-
933
- const createOrUpdateAtResourceLevelOperationSpec: msRest.OperationSpec = {
1261
+ const createOrUpdateAtResourceLevelOperationSpec: coreClient.OperationSpec = {
1262
+ path:
1263
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
934
1264
  httpMethod: "PUT",
935
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
936
- urlParameters: [
937
- Parameters.resourceGroupName,
938
- Parameters.resourceProviderNamespace,
939
- Parameters.parentResourcePath,
940
- Parameters.resourceType,
941
- Parameters.resourceName,
942
- Parameters.lockName,
943
- Parameters.subscriptionId
944
- ],
945
- queryParameters: [
946
- Parameters.apiVersion
947
- ],
948
- headerParameters: [
949
- Parameters.acceptLanguage
950
- ],
951
- requestBody: {
952
- parameterPath: "parameters",
953
- mapper: {
954
- ...Mappers.ManagementLockObject,
955
- required: true
956
- }
957
- },
958
1265
  responses: {
959
1266
  200: {
960
1267
  bodyMapper: Mappers.ManagementLockObject
961
1268
  },
962
1269
  201: {
963
1270
  bodyMapper: Mappers.ManagementLockObject
964
- },
965
- default: {
966
- bodyMapper: Mappers.CloudError
967
1271
  }
968
1272
  },
969
- serializer
970
- };
971
-
972
- const deleteAtResourceLevelOperationSpec: msRest.OperationSpec = {
973
- httpMethod: "DELETE",
974
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
1273
+ requestBody: Parameters.parameters,
1274
+ queryParameters: [Parameters.apiVersion],
975
1275
  urlParameters: [
1276
+ Parameters.$host,
976
1277
  Parameters.resourceGroupName,
1278
+ Parameters.lockName,
1279
+ Parameters.subscriptionId,
977
1280
  Parameters.resourceProviderNamespace,
978
1281
  Parameters.parentResourcePath,
979
1282
  Parameters.resourceType,
980
- Parameters.resourceName,
981
- Parameters.lockName,
982
- Parameters.subscriptionId
983
- ],
984
- queryParameters: [
985
- Parameters.apiVersion
986
- ],
987
- headerParameters: [
988
- Parameters.acceptLanguage
1283
+ Parameters.resourceName
989
1284
  ],
990
- responses: {
991
- 200: {},
992
- 204: {},
993
- default: {
994
- bodyMapper: Mappers.CloudError
995
- }
996
- },
1285
+ headerParameters: [Parameters.accept, Parameters.contentType],
1286
+ mediaType: "json",
997
1287
  serializer
998
1288
  };
999
-
1000
- const getAtResourceLevelOperationSpec: msRest.OperationSpec = {
1001
- httpMethod: "GET",
1002
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
1289
+ const deleteAtResourceLevelOperationSpec: coreClient.OperationSpec = {
1290
+ path:
1291
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
1292
+ httpMethod: "DELETE",
1293
+ responses: { 200: {}, 204: {} },
1294
+ queryParameters: [Parameters.apiVersion],
1003
1295
  urlParameters: [
1296
+ Parameters.$host,
1004
1297
  Parameters.resourceGroupName,
1298
+ Parameters.lockName,
1299
+ Parameters.subscriptionId,
1005
1300
  Parameters.resourceProviderNamespace,
1006
1301
  Parameters.parentResourcePath,
1007
1302
  Parameters.resourceType,
1008
- Parameters.resourceName,
1009
- Parameters.lockName,
1010
- Parameters.subscriptionId
1011
- ],
1012
- queryParameters: [
1013
- Parameters.apiVersion
1014
- ],
1015
- headerParameters: [
1016
- Parameters.acceptLanguage
1303
+ Parameters.resourceName
1017
1304
  ],
1305
+ serializer
1306
+ };
1307
+ const getAtResourceLevelOperationSpec: coreClient.OperationSpec = {
1308
+ path:
1309
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
1310
+ httpMethod: "GET",
1018
1311
  responses: {
1019
1312
  200: {
1020
1313
  bodyMapper: Mappers.ManagementLockObject
1021
- },
1022
- default: {
1023
- bodyMapper: Mappers.CloudError
1024
1314
  }
1025
1315
  },
1026
- serializer
1027
- };
1028
-
1029
- const createOrUpdateAtSubscriptionLevelOperationSpec: msRest.OperationSpec = {
1030
- httpMethod: "PUT",
1031
- path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1316
+ queryParameters: [Parameters.apiVersion],
1032
1317
  urlParameters: [
1318
+ Parameters.$host,
1319
+ Parameters.resourceGroupName,
1033
1320
  Parameters.lockName,
1034
- Parameters.subscriptionId
1035
- ],
1036
- queryParameters: [
1037
- Parameters.apiVersion
1038
- ],
1039
- headerParameters: [
1040
- Parameters.acceptLanguage
1321
+ Parameters.subscriptionId,
1322
+ Parameters.resourceProviderNamespace,
1323
+ Parameters.parentResourcePath,
1324
+ Parameters.resourceType,
1325
+ Parameters.resourceName
1041
1326
  ],
1042
- requestBody: {
1043
- parameterPath: "parameters",
1044
- mapper: {
1045
- ...Mappers.ManagementLockObject,
1046
- required: true
1047
- }
1048
- },
1327
+ headerParameters: [Parameters.accept],
1328
+ serializer
1329
+ };
1330
+ const createOrUpdateAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = {
1331
+ path:
1332
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1333
+ httpMethod: "PUT",
1049
1334
  responses: {
1050
1335
  200: {
1051
1336
  bodyMapper: Mappers.ManagementLockObject
1052
1337
  },
1053
1338
  201: {
1054
1339
  bodyMapper: Mappers.ManagementLockObject
1055
- },
1056
- default: {
1057
- bodyMapper: Mappers.CloudError
1058
1340
  }
1059
1341
  },
1060
- serializer
1061
- };
1062
-
1063
- const deleteAtSubscriptionLevelOperationSpec: msRest.OperationSpec = {
1064
- httpMethod: "DELETE",
1065
- path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1342
+ requestBody: Parameters.parameters,
1343
+ queryParameters: [Parameters.apiVersion],
1066
1344
  urlParameters: [
1345
+ Parameters.$host,
1067
1346
  Parameters.lockName,
1068
1347
  Parameters.subscriptionId
1069
1348
  ],
1070
- queryParameters: [
1071
- Parameters.apiVersion
1072
- ],
1073
- headerParameters: [
1074
- Parameters.acceptLanguage
1075
- ],
1076
- responses: {
1077
- 200: {},
1078
- 204: {},
1079
- default: {
1080
- bodyMapper: Mappers.CloudError
1081
- }
1082
- },
1349
+ headerParameters: [Parameters.accept, Parameters.contentType],
1350
+ mediaType: "json",
1083
1351
  serializer
1084
1352
  };
1085
-
1086
- const getAtSubscriptionLevelOperationSpec: msRest.OperationSpec = {
1087
- httpMethod: "GET",
1088
- path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1353
+ const deleteAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = {
1354
+ path:
1355
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1356
+ httpMethod: "DELETE",
1357
+ responses: { 200: {}, 204: {} },
1358
+ queryParameters: [Parameters.apiVersion],
1089
1359
  urlParameters: [
1360
+ Parameters.$host,
1090
1361
  Parameters.lockName,
1091
1362
  Parameters.subscriptionId
1092
1363
  ],
1093
- queryParameters: [
1094
- Parameters.apiVersion
1095
- ],
1096
- headerParameters: [
1097
- Parameters.acceptLanguage
1098
- ],
1364
+ serializer
1365
+ };
1366
+ const getAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = {
1367
+ path:
1368
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1369
+ httpMethod: "GET",
1099
1370
  responses: {
1100
1371
  200: {
1101
1372
  bodyMapper: Mappers.ManagementLockObject
1102
- },
1103
- default: {
1104
- bodyMapper: Mappers.CloudError
1105
1373
  }
1106
1374
  },
1375
+ queryParameters: [Parameters.apiVersion],
1376
+ urlParameters: [
1377
+ Parameters.$host,
1378
+ Parameters.lockName,
1379
+ Parameters.subscriptionId
1380
+ ],
1381
+ headerParameters: [Parameters.accept],
1107
1382
  serializer
1108
1383
  };
1109
-
1110
- const listAtResourceGroupLevelOperationSpec: msRest.OperationSpec = {
1384
+ const listAtResourceGroupLevelOperationSpec: coreClient.OperationSpec = {
1385
+ path:
1386
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks",
1111
1387
  httpMethod: "GET",
1112
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks",
1388
+ responses: {
1389
+ 200: {
1390
+ bodyMapper: Mappers.ManagementLockListResult
1391
+ }
1392
+ },
1393
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1113
1394
  urlParameters: [
1395
+ Parameters.$host,
1114
1396
  Parameters.resourceGroupName,
1115
1397
  Parameters.subscriptionId
1116
1398
  ],
1117
- queryParameters: [
1118
- Parameters.filter,
1119
- Parameters.apiVersion
1120
- ],
1121
- headerParameters: [
1122
- Parameters.acceptLanguage
1123
- ],
1399
+ headerParameters: [Parameters.accept],
1400
+ serializer
1401
+ };
1402
+ const listAtResourceLevelOperationSpec: coreClient.OperationSpec = {
1403
+ path:
1404
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks",
1405
+ httpMethod: "GET",
1124
1406
  responses: {
1125
1407
  200: {
1126
1408
  bodyMapper: Mappers.ManagementLockListResult
1127
- },
1128
- default: {
1129
- bodyMapper: Mappers.CloudError
1130
1409
  }
1131
1410
  },
1132
- serializer
1133
- };
1134
-
1135
- const listAtResourceLevelOperationSpec: msRest.OperationSpec = {
1136
- httpMethod: "GET",
1137
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks",
1411
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1138
1412
  urlParameters: [
1413
+ Parameters.$host,
1139
1414
  Parameters.resourceGroupName,
1415
+ Parameters.subscriptionId,
1140
1416
  Parameters.resourceProviderNamespace,
1141
1417
  Parameters.parentResourcePath,
1142
1418
  Parameters.resourceType,
1143
- Parameters.resourceName,
1144
- Parameters.subscriptionId
1145
- ],
1146
- queryParameters: [
1147
- Parameters.filter,
1148
- Parameters.apiVersion
1149
- ],
1150
- headerParameters: [
1151
- Parameters.acceptLanguage
1419
+ Parameters.resourceName
1152
1420
  ],
1421
+ headerParameters: [Parameters.accept],
1422
+ serializer
1423
+ };
1424
+ const listAtSubscriptionLevelOperationSpec: coreClient.OperationSpec = {
1425
+ path:
1426
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks",
1427
+ httpMethod: "GET",
1153
1428
  responses: {
1154
1429
  200: {
1155
1430
  bodyMapper: Mappers.ManagementLockListResult
1156
- },
1157
- default: {
1158
- bodyMapper: Mappers.CloudError
1159
1431
  }
1160
1432
  },
1433
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1434
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
1435
+ headerParameters: [Parameters.accept],
1161
1436
  serializer
1162
1437
  };
1163
-
1164
- const listAtSubscriptionLevelOperationSpec: msRest.OperationSpec = {
1438
+ const listByScopeOperationSpec: coreClient.OperationSpec = {
1439
+ path: "/{scope}/providers/Microsoft.Authorization/locks",
1165
1440
  httpMethod: "GET",
1166
- path: "subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks",
1167
- urlParameters: [
1168
- Parameters.subscriptionId
1169
- ],
1170
- queryParameters: [
1171
- Parameters.filter,
1172
- Parameters.apiVersion
1173
- ],
1174
- headerParameters: [
1175
- Parameters.acceptLanguage
1176
- ],
1177
1441
  responses: {
1178
1442
  200: {
1179
1443
  bodyMapper: Mappers.ManagementLockListResult
1180
- },
1181
- default: {
1182
- bodyMapper: Mappers.CloudError
1183
1444
  }
1184
1445
  },
1446
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1447
+ urlParameters: [Parameters.$host, Parameters.scope],
1448
+ headerParameters: [Parameters.accept],
1185
1449
  serializer
1186
1450
  };
1187
-
1188
- const listByScopeOperationSpec: msRest.OperationSpec = {
1451
+ const listAtResourceGroupLevelNextOperationSpec: coreClient.OperationSpec = {
1452
+ path: "{nextLink}",
1189
1453
  httpMethod: "GET",
1190
- path: "{scope}/providers/Microsoft.Authorization/locks",
1191
- urlParameters: [
1192
- Parameters.scope
1193
- ],
1194
- queryParameters: [
1195
- Parameters.filter,
1196
- Parameters.apiVersion
1197
- ],
1198
- headerParameters: [
1199
- Parameters.acceptLanguage
1200
- ],
1201
1454
  responses: {
1202
1455
  200: {
1203
1456
  bodyMapper: Mappers.ManagementLockListResult
1204
- },
1205
- default: {
1206
- bodyMapper: Mappers.CloudError
1207
1457
  }
1208
1458
  },
1459
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1460
+ urlParameters: [
1461
+ Parameters.$host,
1462
+ Parameters.nextLink,
1463
+ Parameters.resourceGroupName,
1464
+ Parameters.subscriptionId
1465
+ ],
1466
+ headerParameters: [Parameters.accept],
1209
1467
  serializer
1210
1468
  };
1211
-
1212
- const listAtResourceGroupLevelNextOperationSpec: msRest.OperationSpec = {
1213
- httpMethod: "GET",
1214
- baseUrl: "https://management.azure.com",
1469
+ const listAtResourceLevelNextOperationSpec: coreClient.OperationSpec = {
1215
1470
  path: "{nextLink}",
1216
- urlParameters: [
1217
- Parameters.nextPageLink
1218
- ],
1219
- headerParameters: [
1220
- Parameters.acceptLanguage
1221
- ],
1471
+ httpMethod: "GET",
1222
1472
  responses: {
1223
1473
  200: {
1224
1474
  bodyMapper: Mappers.ManagementLockListResult
1225
- },
1226
- default: {
1227
- bodyMapper: Mappers.CloudError
1228
1475
  }
1229
1476
  },
1477
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1478
+ urlParameters: [
1479
+ Parameters.$host,
1480
+ Parameters.nextLink,
1481
+ Parameters.resourceGroupName,
1482
+ Parameters.subscriptionId,
1483
+ Parameters.resourceProviderNamespace,
1484
+ Parameters.parentResourcePath,
1485
+ Parameters.resourceType,
1486
+ Parameters.resourceName
1487
+ ],
1488
+ headerParameters: [Parameters.accept],
1230
1489
  serializer
1231
1490
  };
1232
-
1233
- const listAtResourceLevelNextOperationSpec: msRest.OperationSpec = {
1234
- httpMethod: "GET",
1235
- baseUrl: "https://management.azure.com",
1491
+ const listAtSubscriptionLevelNextOperationSpec: coreClient.OperationSpec = {
1236
1492
  path: "{nextLink}",
1493
+ httpMethod: "GET",
1494
+ responses: {
1495
+ 200: {
1496
+ bodyMapper: Mappers.ManagementLockListResult
1497
+ }
1498
+ },
1499
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1237
1500
  urlParameters: [
1238
- Parameters.nextPageLink
1239
- ],
1240
- headerParameters: [
1241
- Parameters.acceptLanguage
1501
+ Parameters.$host,
1502
+ Parameters.nextLink,
1503
+ Parameters.subscriptionId
1242
1504
  ],
1505
+ headerParameters: [Parameters.accept],
1506
+ serializer
1507
+ };
1508
+ const listByScopeNextOperationSpec: coreClient.OperationSpec = {
1509
+ path: "{nextLink}",
1510
+ httpMethod: "GET",
1243
1511
  responses: {
1244
1512
  200: {
1245
1513
  bodyMapper: Mappers.ManagementLockListResult
1246
- },
1247
- default: {
1248
- bodyMapper: Mappers.CloudError
1249
1514
  }
1250
1515
  },
1516
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1517
+ urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],
1518
+ headerParameters: [Parameters.accept],
1251
1519
  serializer
1252
1520
  };
1253
-
1254
- const listAtSubscriptionLevelNextOperationSpec: msRest.OperationSpec = {
1255
- httpMethod: "GET",
1256
- baseUrl: "https://management.azure.com",
1521
+ const listAtResourceGroupLevelNextNextOperationSpec: coreClient.OperationSpec = {
1257
1522
  path: "{nextLink}",
1523
+ httpMethod: "GET",
1524
+ responses: {
1525
+ 200: {
1526
+ bodyMapper: Mappers.ManagementLockListResult
1527
+ }
1528
+ },
1529
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1258
1530
  urlParameters: [
1259
- Parameters.nextPageLink
1260
- ],
1261
- headerParameters: [
1262
- Parameters.acceptLanguage
1531
+ Parameters.$host,
1532
+ Parameters.nextLink,
1533
+ Parameters.resourceGroupName,
1534
+ Parameters.subscriptionId
1263
1535
  ],
1536
+ headerParameters: [Parameters.accept],
1537
+ serializer
1538
+ };
1539
+ const listAtResourceLevelNextNextOperationSpec: coreClient.OperationSpec = {
1540
+ path: "{nextLink}",
1541
+ httpMethod: "GET",
1264
1542
  responses: {
1265
1543
  200: {
1266
1544
  bodyMapper: Mappers.ManagementLockListResult
1267
- },
1268
- default: {
1269
- bodyMapper: Mappers.CloudError
1270
1545
  }
1271
1546
  },
1547
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1548
+ urlParameters: [
1549
+ Parameters.$host,
1550
+ Parameters.nextLink,
1551
+ Parameters.resourceGroupName,
1552
+ Parameters.subscriptionId,
1553
+ Parameters.resourceProviderNamespace,
1554
+ Parameters.parentResourcePath,
1555
+ Parameters.resourceType,
1556
+ Parameters.resourceName
1557
+ ],
1558
+ headerParameters: [Parameters.accept],
1272
1559
  serializer
1273
1560
  };
1274
-
1275
- const listByScopeNextOperationSpec: msRest.OperationSpec = {
1276
- httpMethod: "GET",
1277
- baseUrl: "https://management.azure.com",
1561
+ const listAtSubscriptionLevelNextNextOperationSpec: coreClient.OperationSpec = {
1278
1562
  path: "{nextLink}",
1563
+ httpMethod: "GET",
1564
+ responses: {
1565
+ 200: {
1566
+ bodyMapper: Mappers.ManagementLockListResult
1567
+ }
1568
+ },
1569
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1279
1570
  urlParameters: [
1280
- Parameters.nextPageLink
1281
- ],
1282
- headerParameters: [
1283
- Parameters.acceptLanguage
1571
+ Parameters.$host,
1572
+ Parameters.nextLink,
1573
+ Parameters.subscriptionId
1284
1574
  ],
1575
+ headerParameters: [Parameters.accept],
1576
+ serializer
1577
+ };
1578
+ const listByScopeNextNextOperationSpec: coreClient.OperationSpec = {
1579
+ path: "{nextLink}",
1580
+ httpMethod: "GET",
1285
1581
  responses: {
1286
1582
  200: {
1287
1583
  bodyMapper: Mappers.ManagementLockListResult
1288
- },
1289
- default: {
1290
- bodyMapper: Mappers.CloudError
1291
1584
  }
1292
1585
  },
1586
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
1587
+ urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],
1588
+ headerParameters: [Parameters.accept],
1293
1589
  serializer
1294
1590
  };