@azure/arm-locks 2.0.1-alpha.20220414.1 → 2.1.0-alpha.20220908.1

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 (103) hide show
  1. package/CHANGELOG.md +15 -11
  2. package/LICENSE +1 -1
  3. package/README.md +11 -0
  4. package/dist/index.js +265 -8
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/authorizationOperationsListSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/authorizationOperationsListSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/authorizationOperationsListSample.js +43 -0
  11. package/dist-esm/samples-dev/authorizationOperationsListSample.js.map +1 -0
  12. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceGroupLevelSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceGroupLevelSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceGroupLevelSample.js +32 -0
  15. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceGroupLevelSample.js.map +1 -0
  16. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceLevelSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceLevelSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceLevelSample.js +36 -0
  19. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtResourceLevelSample.js.map +1 -0
  20. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtSubscriptionLevelSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtSubscriptionLevelSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtSubscriptionLevelSample.js +31 -0
  23. package/dist-esm/samples-dev/managementLocksCreateOrUpdateAtSubscriptionLevelSample.js.map +1 -0
  24. package/dist-esm/samples-dev/managementLocksCreateOrUpdateByScopeSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/managementLocksCreateOrUpdateByScopeSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/managementLocksCreateOrUpdateByScopeSample.js +32 -0
  27. package/dist-esm/samples-dev/managementLocksCreateOrUpdateByScopeSample.js.map +1 -0
  28. package/dist-esm/samples-dev/managementLocksDeleteAtResourceGroupLevelSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/managementLocksDeleteAtResourceGroupLevelSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/managementLocksDeleteAtResourceGroupLevelSample.js +31 -0
  31. package/dist-esm/samples-dev/managementLocksDeleteAtResourceGroupLevelSample.js.map +1 -0
  32. package/dist-esm/samples-dev/managementLocksDeleteAtResourceLevelSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/managementLocksDeleteAtResourceLevelSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/managementLocksDeleteAtResourceLevelSample.js +35 -0
  35. package/dist-esm/samples-dev/managementLocksDeleteAtResourceLevelSample.js.map +1 -0
  36. package/dist-esm/samples-dev/managementLocksDeleteAtSubscriptionLevelSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/managementLocksDeleteAtSubscriptionLevelSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/managementLocksDeleteAtSubscriptionLevelSample.js +30 -0
  39. package/dist-esm/samples-dev/managementLocksDeleteAtSubscriptionLevelSample.js.map +1 -0
  40. package/dist-esm/samples-dev/managementLocksDeleteByScopeSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/managementLocksDeleteByScopeSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/managementLocksDeleteByScopeSample.js +31 -0
  43. package/dist-esm/samples-dev/managementLocksDeleteByScopeSample.js.map +1 -0
  44. package/dist-esm/samples-dev/managementLocksGetAtResourceGroupLevelSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/managementLocksGetAtResourceGroupLevelSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/managementLocksGetAtResourceGroupLevelSample.js +31 -0
  47. package/dist-esm/samples-dev/managementLocksGetAtResourceGroupLevelSample.js.map +1 -0
  48. package/dist-esm/samples-dev/managementLocksGetAtResourceLevelSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/managementLocksGetAtResourceLevelSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/managementLocksGetAtResourceLevelSample.js +35 -0
  51. package/dist-esm/samples-dev/managementLocksGetAtResourceLevelSample.js.map +1 -0
  52. package/dist-esm/samples-dev/managementLocksGetAtSubscriptionLevelSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/managementLocksGetAtSubscriptionLevelSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/managementLocksGetAtSubscriptionLevelSample.js +30 -0
  55. package/dist-esm/samples-dev/managementLocksGetAtSubscriptionLevelSample.js.map +1 -0
  56. package/dist-esm/samples-dev/managementLocksGetByScopeSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/managementLocksGetByScopeSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/managementLocksGetByScopeSample.js +31 -0
  59. package/dist-esm/samples-dev/managementLocksGetByScopeSample.js.map +1 -0
  60. package/dist-esm/samples-dev/managementLocksListAtResourceGroupLevelSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/managementLocksListAtResourceGroupLevelSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/managementLocksListAtResourceGroupLevelSample.js +44 -0
  63. package/dist-esm/samples-dev/managementLocksListAtResourceGroupLevelSample.js.map +1 -0
  64. package/dist-esm/samples-dev/managementLocksListAtResourceLevelSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/managementLocksListAtResourceLevelSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/managementLocksListAtResourceLevelSample.js +48 -0
  67. package/dist-esm/samples-dev/managementLocksListAtResourceLevelSample.js.map +1 -0
  68. package/dist-esm/samples-dev/managementLocksListAtSubscriptionLevelSample.d.ts +2 -0
  69. package/dist-esm/samples-dev/managementLocksListAtSubscriptionLevelSample.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/managementLocksListAtSubscriptionLevelSample.js +43 -0
  71. package/dist-esm/samples-dev/managementLocksListAtSubscriptionLevelSample.js.map +1 -0
  72. package/dist-esm/samples-dev/managementLocksListByScopeSample.d.ts +2 -0
  73. package/dist-esm/samples-dev/managementLocksListByScopeSample.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/managementLocksListByScopeSample.js +44 -0
  75. package/dist-esm/samples-dev/managementLocksListByScopeSample.js.map +1 -0
  76. package/dist-esm/src/managementLockClient.d.ts.map +1 -1
  77. package/dist-esm/src/managementLockClient.js +21 -3
  78. package/dist-esm/src/managementLockClient.js.map +1 -1
  79. package/dist-esm/src/models/index.d.ts +84 -0
  80. package/dist-esm/src/models/index.d.ts.map +1 -1
  81. package/dist-esm/src/models/index.js +8 -0
  82. package/dist-esm/src/models/index.js.map +1 -1
  83. package/dist-esm/src/models/mappers.d.ts +4 -0
  84. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  85. package/dist-esm/src/models/mappers.js +144 -0
  86. package/dist-esm/src/models/mappers.js.map +1 -1
  87. package/dist-esm/src/models/parameters.js +1 -1
  88. package/dist-esm/src/operations/authorizationOperations.js +6 -0
  89. package/dist-esm/src/operations/authorizationOperations.js.map +1 -1
  90. package/dist-esm/src/operations/managementLocks.js +80 -4
  91. package/dist-esm/src/operations/managementLocks.js.map +1 -1
  92. package/package.json +26 -10
  93. package/review/arm-locks.api.md +46 -0
  94. package/rollup.config.js +6 -72
  95. package/src/managementLockClient.ts +28 -3
  96. package/src/models/index.ts +90 -0
  97. package/src/models/mappers.ts +148 -0
  98. package/src/models/parameters.ts +1 -1
  99. package/src/operations/authorizationOperations.ts +6 -0
  100. package/src/operations/managementLocks.ts +80 -4
  101. package/tsconfig.json +23 -5
  102. package/types/arm-locks.d.ts +90 -0
  103. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,15 +1,19 @@
1
1
  # Release History
2
-
3
- ## 2.0.1 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
2
+
3
+ ## 2.1.0 (2022-04-18)
4
+
5
+ **Features**
6
+
7
+ - Added Interface ErrorAdditionalInfo
8
+ - Added Interface ErrorDetail
9
+ - Added Interface ErrorResponse
10
+ - Added Interface SystemData
11
+ - Added Type Alias CreatedByType
12
+ - Interface ManagementLockObject has a new optional parameter systemData
13
+ - Added Enum KnownCreatedByType
14
+ - Bug fix
15
+
16
+
13
17
  ## 2.0.0 (2021-12-07)
14
18
 
15
19
  The package of @azure/arm-locks is using our next generation design principles since version 2.0.0, which contains breaking changes.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Microsoft
3
+ Copyright (c) 2022 Microsoft
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -16,6 +16,8 @@ Azure resources can be locked to prevent other users in your organization from d
16
16
  - [LTS versions of Node.js](https://nodejs.org/about/releases/)
17
17
  - Latest versions of Safari, Chrome, Edge and Firefox.
18
18
 
19
+ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
20
+
19
21
  ### Prerequisites
20
22
 
21
23
  - An [Azure subscription][azure_sub].
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
49
51
  ```javascript
50
52
  const { ManagementLockClient } = require("@azure/arm-locks");
51
53
  const { DefaultAzureCredential } = require("@azure/identity");
54
+ // For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
55
+
52
56
  const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
57
  const client = new ManagementLockClient(new DefaultAzureCredential(), subscriptionId);
58
+
59
+ // For client-side applications running in the browser, use this code instead:
60
+ // const credential = new InteractiveBrowserCredential({
61
+ // tenantId: "<YOUR_TENANT_ID>",
62
+ // clientId: "<YOUR_CLIENT_ID>"
63
+ // });
64
+ // const client = new ManagementLockClient(credential, subscriptionId);
54
65
  ```
55
66
 
56
67
 
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var coreClient = require('@azure/core-client');
6
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
6
7
  var tslib = require('tslib');
7
8
 
8
9
  function _interopNamespace(e) {
@@ -24,6 +25,7 @@ function _interopNamespace(e) {
24
25
  }
25
26
 
26
27
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
27
29
 
28
30
  /*
29
31
  * Copyright (c) Microsoft Corporation.
@@ -39,6 +41,14 @@ exports.KnownLockLevel = void 0;
39
41
  KnownLockLevel["CanNotDelete"] = "CanNotDelete";
40
42
  KnownLockLevel["ReadOnly"] = "ReadOnly";
41
43
  })(exports.KnownLockLevel || (exports.KnownLockLevel = {}));
44
+ /** Known values of {@link CreatedByType} that the service accepts. */
45
+ exports.KnownCreatedByType = void 0;
46
+ (function (KnownCreatedByType) {
47
+ KnownCreatedByType["User"] = "User";
48
+ KnownCreatedByType["Application"] = "Application";
49
+ KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
50
+ KnownCreatedByType["Key"] = "Key";
51
+ })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
42
52
 
43
53
  /*
44
54
  * Copyright (c) Microsoft Corporation.
@@ -120,6 +130,99 @@ const OperationDisplay = {
120
130
  }
121
131
  }
122
132
  };
133
+ const ErrorResponse = {
134
+ type: {
135
+ name: "Composite",
136
+ className: "ErrorResponse",
137
+ modelProperties: {
138
+ error: {
139
+ serializedName: "error",
140
+ type: {
141
+ name: "Composite",
142
+ className: "ErrorDetail"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ };
148
+ const ErrorDetail = {
149
+ type: {
150
+ name: "Composite",
151
+ className: "ErrorDetail",
152
+ modelProperties: {
153
+ code: {
154
+ serializedName: "code",
155
+ readOnly: true,
156
+ type: {
157
+ name: "String"
158
+ }
159
+ },
160
+ message: {
161
+ serializedName: "message",
162
+ readOnly: true,
163
+ type: {
164
+ name: "String"
165
+ }
166
+ },
167
+ target: {
168
+ serializedName: "target",
169
+ readOnly: true,
170
+ type: {
171
+ name: "String"
172
+ }
173
+ },
174
+ details: {
175
+ serializedName: "details",
176
+ readOnly: true,
177
+ type: {
178
+ name: "Sequence",
179
+ element: {
180
+ type: {
181
+ name: "Composite",
182
+ className: "ErrorDetail"
183
+ }
184
+ }
185
+ }
186
+ },
187
+ additionalInfo: {
188
+ serializedName: "additionalInfo",
189
+ readOnly: true,
190
+ type: {
191
+ name: "Sequence",
192
+ element: {
193
+ type: {
194
+ name: "Composite",
195
+ className: "ErrorAdditionalInfo"
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ };
203
+ const ErrorAdditionalInfo = {
204
+ type: {
205
+ name: "Composite",
206
+ className: "ErrorAdditionalInfo",
207
+ modelProperties: {
208
+ type: {
209
+ serializedName: "type",
210
+ readOnly: true,
211
+ type: {
212
+ name: "String"
213
+ }
214
+ },
215
+ info: {
216
+ serializedName: "info",
217
+ readOnly: true,
218
+ type: {
219
+ name: "Dictionary",
220
+ value: { type: { name: "any" } }
221
+ }
222
+ }
223
+ }
224
+ }
225
+ };
123
226
  const ManagementLockObject = {
124
227
  type: {
125
228
  name: "Composite",
@@ -146,6 +249,13 @@ const ManagementLockObject = {
146
249
  name: "String"
147
250
  }
148
251
  },
252
+ systemData: {
253
+ serializedName: "systemData",
254
+ type: {
255
+ name: "Composite",
256
+ className: "SystemData"
257
+ }
258
+ },
149
259
  level: {
150
260
  serializedName: "properties.level",
151
261
  required: true,
@@ -188,6 +298,50 @@ const ManagementLockOwner = {
188
298
  }
189
299
  }
190
300
  };
301
+ const SystemData = {
302
+ type: {
303
+ name: "Composite",
304
+ className: "SystemData",
305
+ modelProperties: {
306
+ createdBy: {
307
+ serializedName: "createdBy",
308
+ type: {
309
+ name: "String"
310
+ }
311
+ },
312
+ createdByType: {
313
+ serializedName: "createdByType",
314
+ type: {
315
+ name: "String"
316
+ }
317
+ },
318
+ createdAt: {
319
+ serializedName: "createdAt",
320
+ type: {
321
+ name: "DateTime"
322
+ }
323
+ },
324
+ lastModifiedBy: {
325
+ serializedName: "lastModifiedBy",
326
+ type: {
327
+ name: "String"
328
+ }
329
+ },
330
+ lastModifiedByType: {
331
+ serializedName: "lastModifiedByType",
332
+ type: {
333
+ name: "String"
334
+ }
335
+ },
336
+ lastModifiedAt: {
337
+ serializedName: "lastModifiedAt",
338
+ type: {
339
+ name: "DateTime"
340
+ }
341
+ }
342
+ }
343
+ }
344
+ };
191
345
  const ManagementLockListResult = {
192
346
  type: {
193
347
  name: "Composite",
@@ -220,8 +374,12 @@ var Mappers = /*#__PURE__*/Object.freeze({
220
374
  OperationListResult: OperationListResult,
221
375
  Operation: Operation,
222
376
  OperationDisplay: OperationDisplay,
377
+ ErrorResponse: ErrorResponse,
378
+ ErrorDetail: ErrorDetail,
379
+ ErrorAdditionalInfo: ErrorAdditionalInfo,
223
380
  ManagementLockObject: ManagementLockObject,
224
381
  ManagementLockOwner: ManagementLockOwner,
382
+ SystemData: SystemData,
225
383
  ManagementLockListResult: ManagementLockListResult
226
384
  });
227
385
 
@@ -257,7 +415,7 @@ const $host = {
257
415
  const apiVersion = {
258
416
  parameterPath: "apiVersion",
259
417
  mapper: {
260
- defaultValue: "2016-09-01",
418
+ defaultValue: "2020-05-01",
261
419
  isConstant: true,
262
420
  serializedName: "api-version",
263
421
  type: {
@@ -477,6 +635,9 @@ const listOperationSpec = {
477
635
  responses: {
478
636
  200: {
479
637
  bodyMapper: OperationListResult
638
+ },
639
+ default: {
640
+ bodyMapper: ErrorResponse
480
641
  }
481
642
  },
482
643
  queryParameters: [apiVersion],
@@ -490,6 +651,9 @@ const listNextOperationSpec = {
490
651
  responses: {
491
652
  200: {
492
653
  bodyMapper: OperationListResult
654
+ },
655
+ default: {
656
+ bodyMapper: ErrorResponse
493
657
  }
494
658
  },
495
659
  queryParameters: [apiVersion],
@@ -1002,6 +1166,9 @@ const createOrUpdateAtResourceGroupLevelOperationSpec = {
1002
1166
  },
1003
1167
  201: {
1004
1168
  bodyMapper: ManagementLockObject
1169
+ },
1170
+ default: {
1171
+ bodyMapper: ErrorResponse
1005
1172
  }
1006
1173
  },
1007
1174
  requestBody: parameters,
@@ -1019,7 +1186,13 @@ const createOrUpdateAtResourceGroupLevelOperationSpec = {
1019
1186
  const deleteAtResourceGroupLevelOperationSpec = {
1020
1187
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}",
1021
1188
  httpMethod: "DELETE",
1022
- responses: { 200: {}, 204: {} },
1189
+ responses: {
1190
+ 200: {},
1191
+ 204: {},
1192
+ default: {
1193
+ bodyMapper: ErrorResponse
1194
+ }
1195
+ },
1023
1196
  queryParameters: [apiVersion],
1024
1197
  urlParameters: [
1025
1198
  $host,
@@ -1027,6 +1200,7 @@ const deleteAtResourceGroupLevelOperationSpec = {
1027
1200
  lockName,
1028
1201
  subscriptionId
1029
1202
  ],
1203
+ headerParameters: [accept],
1030
1204
  serializer
1031
1205
  };
1032
1206
  const getAtResourceGroupLevelOperationSpec = {
@@ -1035,6 +1209,9 @@ const getAtResourceGroupLevelOperationSpec = {
1035
1209
  responses: {
1036
1210
  200: {
1037
1211
  bodyMapper: ManagementLockObject
1212
+ },
1213
+ default: {
1214
+ bodyMapper: ErrorResponse
1038
1215
  }
1039
1216
  },
1040
1217
  queryParameters: [apiVersion],
@@ -1056,6 +1233,9 @@ const createOrUpdateByScopeOperationSpec = {
1056
1233
  },
1057
1234
  201: {
1058
1235
  bodyMapper: ManagementLockObject
1236
+ },
1237
+ default: {
1238
+ bodyMapper: ErrorResponse
1059
1239
  }
1060
1240
  },
1061
1241
  requestBody: parameters,
@@ -1068,9 +1248,16 @@ const createOrUpdateByScopeOperationSpec = {
1068
1248
  const deleteByScopeOperationSpec = {
1069
1249
  path: "/{scope}/providers/Microsoft.Authorization/locks/{lockName}",
1070
1250
  httpMethod: "DELETE",
1071
- responses: { 200: {}, 204: {} },
1251
+ responses: {
1252
+ 200: {},
1253
+ 204: {},
1254
+ default: {
1255
+ bodyMapper: ErrorResponse
1256
+ }
1257
+ },
1072
1258
  queryParameters: [apiVersion],
1073
1259
  urlParameters: [$host, lockName, scope],
1260
+ headerParameters: [accept],
1074
1261
  serializer
1075
1262
  };
1076
1263
  const getByScopeOperationSpec = {
@@ -1079,6 +1266,9 @@ const getByScopeOperationSpec = {
1079
1266
  responses: {
1080
1267
  200: {
1081
1268
  bodyMapper: ManagementLockObject
1269
+ },
1270
+ default: {
1271
+ bodyMapper: ErrorResponse
1082
1272
  }
1083
1273
  },
1084
1274
  queryParameters: [apiVersion],
@@ -1095,6 +1285,9 @@ const createOrUpdateAtResourceLevelOperationSpec = {
1095
1285
  },
1096
1286
  201: {
1097
1287
  bodyMapper: ManagementLockObject
1288
+ },
1289
+ default: {
1290
+ bodyMapper: ErrorResponse
1098
1291
  }
1099
1292
  },
1100
1293
  requestBody: parameters,
@@ -1116,7 +1309,13 @@ const createOrUpdateAtResourceLevelOperationSpec = {
1116
1309
  const deleteAtResourceLevelOperationSpec = {
1117
1310
  path: "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}",
1118
1311
  httpMethod: "DELETE",
1119
- responses: { 200: {}, 204: {} },
1312
+ responses: {
1313
+ 200: {},
1314
+ 204: {},
1315
+ default: {
1316
+ bodyMapper: ErrorResponse
1317
+ }
1318
+ },
1120
1319
  queryParameters: [apiVersion],
1121
1320
  urlParameters: [
1122
1321
  $host,
@@ -1128,6 +1327,7 @@ const deleteAtResourceLevelOperationSpec = {
1128
1327
  resourceType,
1129
1328
  resourceName
1130
1329
  ],
1330
+ headerParameters: [accept],
1131
1331
  serializer
1132
1332
  };
1133
1333
  const getAtResourceLevelOperationSpec = {
@@ -1136,6 +1336,9 @@ const getAtResourceLevelOperationSpec = {
1136
1336
  responses: {
1137
1337
  200: {
1138
1338
  bodyMapper: ManagementLockObject
1339
+ },
1340
+ default: {
1341
+ bodyMapper: ErrorResponse
1139
1342
  }
1140
1343
  },
1141
1344
  queryParameters: [apiVersion],
@@ -1161,6 +1364,9 @@ const createOrUpdateAtSubscriptionLevelOperationSpec = {
1161
1364
  },
1162
1365
  201: {
1163
1366
  bodyMapper: ManagementLockObject
1367
+ },
1368
+ default: {
1369
+ bodyMapper: ErrorResponse
1164
1370
  }
1165
1371
  },
1166
1372
  requestBody: parameters,
@@ -1177,13 +1383,20 @@ const createOrUpdateAtSubscriptionLevelOperationSpec = {
1177
1383
  const deleteAtSubscriptionLevelOperationSpec = {
1178
1384
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}",
1179
1385
  httpMethod: "DELETE",
1180
- responses: { 200: {}, 204: {} },
1386
+ responses: {
1387
+ 200: {},
1388
+ 204: {},
1389
+ default: {
1390
+ bodyMapper: ErrorResponse
1391
+ }
1392
+ },
1181
1393
  queryParameters: [apiVersion],
1182
1394
  urlParameters: [
1183
1395
  $host,
1184
1396
  lockName,
1185
1397
  subscriptionId
1186
1398
  ],
1399
+ headerParameters: [accept],
1187
1400
  serializer
1188
1401
  };
1189
1402
  const getAtSubscriptionLevelOperationSpec = {
@@ -1192,6 +1405,9 @@ const getAtSubscriptionLevelOperationSpec = {
1192
1405
  responses: {
1193
1406
  200: {
1194
1407
  bodyMapper: ManagementLockObject
1408
+ },
1409
+ default: {
1410
+ bodyMapper: ErrorResponse
1195
1411
  }
1196
1412
  },
1197
1413
  queryParameters: [apiVersion],
@@ -1209,6 +1425,9 @@ const listAtResourceGroupLevelOperationSpec = {
1209
1425
  responses: {
1210
1426
  200: {
1211
1427
  bodyMapper: ManagementLockListResult
1428
+ },
1429
+ default: {
1430
+ bodyMapper: ErrorResponse
1212
1431
  }
1213
1432
  },
1214
1433
  queryParameters: [apiVersion, filter],
@@ -1226,6 +1445,9 @@ const listAtResourceLevelOperationSpec = {
1226
1445
  responses: {
1227
1446
  200: {
1228
1447
  bodyMapper: ManagementLockListResult
1448
+ },
1449
+ default: {
1450
+ bodyMapper: ErrorResponse
1229
1451
  }
1230
1452
  },
1231
1453
  queryParameters: [apiVersion, filter],
@@ -1247,6 +1469,9 @@ const listAtSubscriptionLevelOperationSpec = {
1247
1469
  responses: {
1248
1470
  200: {
1249
1471
  bodyMapper: ManagementLockListResult
1472
+ },
1473
+ default: {
1474
+ bodyMapper: ErrorResponse
1250
1475
  }
1251
1476
  },
1252
1477
  queryParameters: [apiVersion, filter],
@@ -1260,6 +1485,9 @@ const listByScopeOperationSpec = {
1260
1485
  responses: {
1261
1486
  200: {
1262
1487
  bodyMapper: ManagementLockListResult
1488
+ },
1489
+ default: {
1490
+ bodyMapper: ErrorResponse
1263
1491
  }
1264
1492
  },
1265
1493
  queryParameters: [apiVersion, filter],
@@ -1273,6 +1501,9 @@ const listAtResourceGroupLevelNextOperationSpec = {
1273
1501
  responses: {
1274
1502
  200: {
1275
1503
  bodyMapper: ManagementLockListResult
1504
+ },
1505
+ default: {
1506
+ bodyMapper: ErrorResponse
1276
1507
  }
1277
1508
  },
1278
1509
  queryParameters: [apiVersion, filter],
@@ -1291,6 +1522,9 @@ const listAtResourceLevelNextOperationSpec = {
1291
1522
  responses: {
1292
1523
  200: {
1293
1524
  bodyMapper: ManagementLockListResult
1525
+ },
1526
+ default: {
1527
+ bodyMapper: ErrorResponse
1294
1528
  }
1295
1529
  },
1296
1530
  queryParameters: [apiVersion, filter],
@@ -1313,6 +1547,9 @@ const listAtSubscriptionLevelNextOperationSpec = {
1313
1547
  responses: {
1314
1548
  200: {
1315
1549
  bodyMapper: ManagementLockListResult
1550
+ },
1551
+ default: {
1552
+ bodyMapper: ErrorResponse
1316
1553
  }
1317
1554
  },
1318
1555
  queryParameters: [apiVersion, filter],
@@ -1330,6 +1567,9 @@ const listByScopeNextOperationSpec = {
1330
1567
  responses: {
1331
1568
  200: {
1332
1569
  bodyMapper: ManagementLockListResult
1570
+ },
1571
+ default: {
1572
+ bodyMapper: ErrorResponse
1333
1573
  }
1334
1574
  },
1335
1575
  queryParameters: [apiVersion, filter],
@@ -1353,6 +1593,7 @@ class ManagementLockClient extends coreClient__namespace.ServiceClient {
1353
1593
  * @param options The parameter options
1354
1594
  */
1355
1595
  constructor(credentials, subscriptionId, options) {
1596
+ var _a, _b;
1356
1597
  if (credentials === undefined) {
1357
1598
  throw new Error("'credentials' cannot be null");
1358
1599
  }
@@ -1367,7 +1608,7 @@ class ManagementLockClient extends coreClient__namespace.ServiceClient {
1367
1608
  requestContentType: "application/json; charset=utf-8",
1368
1609
  credential: credentials
1369
1610
  };
1370
- const packageDetails = `azsdk-js-arm-locks/2.0.0`;
1611
+ const packageDetails = `azsdk-js-arm-locks/2.1.0`;
1371
1612
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1372
1613
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1373
1614
  : `${packageDetails}`;
@@ -1376,13 +1617,29 @@ class ManagementLockClient extends coreClient__namespace.ServiceClient {
1376
1617
  }
1377
1618
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1378
1619
  userAgentPrefix
1379
- }, baseUri: options.endpoint || "https://management.azure.com" });
1620
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1380
1621
  super(optionsWithDefaults);
1622
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1623
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1624
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1625
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1626
+ if (!bearerTokenAuthenticationPolicyFound) {
1627
+ this.pipeline.removePolicy({
1628
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1629
+ });
1630
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1631
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
1632
+ challengeCallbacks: {
1633
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1634
+ }
1635
+ }));
1636
+ }
1637
+ }
1381
1638
  // Parameter assignments
1382
1639
  this.subscriptionId = subscriptionId;
1383
1640
  // Assigning values to Constant parameters
1384
1641
  this.$host = options.$host || "https://management.azure.com";
1385
- this.apiVersion = options.apiVersion || "2016-09-01";
1642
+ this.apiVersion = options.apiVersion || "2020-05-01";
1386
1643
  this.authorizationOperations = new AuthorizationOperationsImpl(this);
1387
1644
  this.managementLocks = new ManagementLocksImpl(this);
1388
1645
  }