@azure/arm-batch 7.1.2-alpha.20220427.2 → 7.2.1-alpha.20220721.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 (92) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/dist/index.js +400 -106
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/samples-dev/applicationCreateSample.js +1 -1
  7. package/dist-esm/samples-dev/applicationDeleteSample.js +1 -1
  8. package/dist-esm/samples-dev/applicationGetSample.js +1 -1
  9. package/dist-esm/samples-dev/applicationListSample.js +1 -1
  10. package/dist-esm/samples-dev/applicationPackageActivateSample.js +1 -1
  11. package/dist-esm/samples-dev/applicationPackageCreateSample.js +1 -1
  12. package/dist-esm/samples-dev/applicationPackageDeleteSample.js +1 -1
  13. package/dist-esm/samples-dev/applicationPackageGetSample.js +1 -1
  14. package/dist-esm/samples-dev/applicationPackageListSample.js +1 -1
  15. package/dist-esm/samples-dev/applicationUpdateSample.js +1 -1
  16. package/dist-esm/samples-dev/batchAccountCreateSample.js +5 -5
  17. package/dist-esm/samples-dev/batchAccountDeleteSample.js +1 -1
  18. package/dist-esm/samples-dev/batchAccountGetDetectorSample.js +1 -1
  19. package/dist-esm/samples-dev/batchAccountGetKeysSample.js +1 -1
  20. package/dist-esm/samples-dev/batchAccountGetSample.js +2 -2
  21. package/dist-esm/samples-dev/batchAccountListByResourceGroupSample.js +1 -1
  22. package/dist-esm/samples-dev/batchAccountListDetectorsSample.js +1 -1
  23. package/dist-esm/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.js +3 -3
  24. package/dist-esm/samples-dev/batchAccountListSample.js +1 -1
  25. package/dist-esm/samples-dev/batchAccountRegenerateKeySample.js +1 -1
  26. package/dist-esm/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.js +1 -1
  27. package/dist-esm/samples-dev/batchAccountUpdateSample.js +1 -1
  28. package/dist-esm/samples-dev/certificateCancelDeletionSample.js +1 -1
  29. package/dist-esm/samples-dev/certificateCreateSample.js +3 -3
  30. package/dist-esm/samples-dev/certificateDeleteSample.js +1 -1
  31. package/dist-esm/samples-dev/certificateGetSample.js +2 -2
  32. package/dist-esm/samples-dev/certificateListByBatchAccountSample.js +2 -2
  33. package/dist-esm/samples-dev/certificateUpdateSample.js +1 -1
  34. package/dist-esm/samples-dev/locationCheckNameAvailabilitySample.js +2 -2
  35. package/dist-esm/samples-dev/locationGetQuotasSample.js +1 -1
  36. package/dist-esm/samples-dev/locationListSupportedCloudServiceSkusSample.js +1 -1
  37. package/dist-esm/samples-dev/locationListSupportedVirtualMachineSkusSample.js +1 -1
  38. package/dist-esm/samples-dev/operationsListSample.js +1 -1
  39. package/dist-esm/samples-dev/poolCreateSample.js +9 -9
  40. package/dist-esm/samples-dev/poolDeleteSample.js +1 -1
  41. package/dist-esm/samples-dev/poolDisableAutoScaleSample.js +1 -1
  42. package/dist-esm/samples-dev/poolGetSample.js +2 -2
  43. package/dist-esm/samples-dev/poolListByBatchAccountSample.js +2 -2
  44. package/dist-esm/samples-dev/poolStopResizeSample.js +1 -1
  45. package/dist-esm/samples-dev/poolUpdateSample.js +4 -4
  46. package/dist-esm/samples-dev/privateEndpointConnectionDeleteSample.d.ts +2 -0
  47. package/dist-esm/samples-dev/privateEndpointConnectionDeleteSample.d.ts.map +1 -0
  48. package/dist-esm/samples-dev/privateEndpointConnectionDeleteSample.js +32 -0
  49. package/dist-esm/samples-dev/privateEndpointConnectionDeleteSample.js.map +1 -0
  50. package/dist-esm/samples-dev/privateEndpointConnectionGetSample.js +1 -1
  51. package/dist-esm/samples-dev/privateEndpointConnectionListByBatchAccountSample.js +1 -1
  52. package/dist-esm/samples-dev/privateEndpointConnectionUpdateSample.js +1 -1
  53. package/dist-esm/samples-dev/privateLinkResourceGetSample.js +2 -2
  54. package/dist-esm/samples-dev/privateLinkResourceGetSample.js.map +1 -1
  55. package/dist-esm/samples-dev/privateLinkResourceListByBatchAccountSample.js +1 -1
  56. package/dist-esm/src/batchManagementClient.d.ts +2 -0
  57. package/dist-esm/src/batchManagementClient.d.ts.map +1 -1
  58. package/dist-esm/src/batchManagementClient.js +48 -2
  59. package/dist-esm/src/batchManagementClient.js.map +1 -1
  60. package/dist-esm/src/models/index.d.ts +92 -35
  61. package/dist-esm/src/models/index.d.ts.map +1 -1
  62. package/dist-esm/src/models/mappers.d.ts +4 -0
  63. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  64. package/dist-esm/src/models/mappers.js +146 -2
  65. package/dist-esm/src/models/mappers.js.map +1 -1
  66. package/dist-esm/src/models/parameters.js +1 -1
  67. package/dist-esm/src/operations/batchAccountOperations.d.ts +2 -2
  68. package/dist-esm/src/operations/batchAccountOperations.d.ts.map +1 -1
  69. package/dist-esm/src/operations/batchAccountOperations.js +100 -92
  70. package/dist-esm/src/operations/batchAccountOperations.js.map +1 -1
  71. package/dist-esm/src/operations/privateEndpointConnectionOperations.d.ts +19 -1
  72. package/dist-esm/src/operations/privateEndpointConnectionOperations.d.ts.map +1 -1
  73. package/dist-esm/src/operations/privateEndpointConnectionOperations.js +92 -0
  74. package/dist-esm/src/operations/privateEndpointConnectionOperations.js.map +1 -1
  75. package/dist-esm/src/operationsInterfaces/batchAccountOperations.d.ts +1 -1
  76. package/dist-esm/src/operationsInterfaces/batchAccountOperations.d.ts.map +1 -1
  77. package/dist-esm/src/operationsInterfaces/privateEndpointConnectionOperations.d.ts +19 -1
  78. package/dist-esm/src/operationsInterfaces/privateEndpointConnectionOperations.d.ts.map +1 -1
  79. package/dist-esm/test/batch_examples.d.ts.map +1 -1
  80. package/dist-esm/test/batch_examples.js +20 -22
  81. package/dist-esm/test/batch_examples.js.map +1 -1
  82. package/package.json +10 -7
  83. package/review/arm-batch.api.md +113 -69
  84. package/src/batchManagementClient.ts +60 -2
  85. package/src/models/index.ts +104 -36
  86. package/src/models/mappers.ts +153 -2
  87. package/src/models/parameters.ts +1 -1
  88. package/src/operations/batchAccountOperations.ts +184 -122
  89. package/src/operations/privateEndpointConnectionOperations.ts +134 -0
  90. package/src/operationsInterfaces/batchAccountOperations.ts +9 -4
  91. package/src/operationsInterfaces/privateEndpointConnectionOperations.ts +36 -1
  92. package/types/arm-batch.d.ts +120 -36
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var coreClient = require('@azure/core-client');
6
5
  var tslib = require('tslib');
6
+ var coreClient = require('@azure/core-client');
7
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
7
8
  var coreLro = require('@azure/core-lro');
8
9
 
9
10
  function _interopNamespace(e) {
@@ -25,6 +26,7 @@ function _interopNamespace(e) {
25
26
  }
26
27
 
27
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
28
30
 
29
31
  /*
30
32
  * Copyright (c) Microsoft Corporation.
@@ -88,6 +90,13 @@ const BatchAccountCreateParameters = {
88
90
  allowedValues: ["Enabled", "Disabled"]
89
91
  }
90
92
  },
93
+ networkProfile: {
94
+ serializedName: "properties.networkProfile",
95
+ type: {
96
+ name: "Composite",
97
+ className: "NetworkProfile"
98
+ }
99
+ },
91
100
  encryption: {
92
101
  serializedName: "properties.encryption",
93
102
  type: {
@@ -177,6 +186,79 @@ const KeyVaultReference = {
177
186
  }
178
187
  }
179
188
  };
189
+ const NetworkProfile = {
190
+ type: {
191
+ name: "Composite",
192
+ className: "NetworkProfile",
193
+ modelProperties: {
194
+ accountAccess: {
195
+ serializedName: "accountAccess",
196
+ type: {
197
+ name: "Composite",
198
+ className: "EndpointAccessProfile"
199
+ }
200
+ },
201
+ nodeManagementAccess: {
202
+ serializedName: "nodeManagementAccess",
203
+ type: {
204
+ name: "Composite",
205
+ className: "EndpointAccessProfile"
206
+ }
207
+ }
208
+ }
209
+ }
210
+ };
211
+ const EndpointAccessProfile = {
212
+ type: {
213
+ name: "Composite",
214
+ className: "EndpointAccessProfile",
215
+ modelProperties: {
216
+ defaultAction: {
217
+ serializedName: "defaultAction",
218
+ required: true,
219
+ type: {
220
+ name: "Enum",
221
+ allowedValues: ["Allow", "Deny"]
222
+ }
223
+ },
224
+ ipRules: {
225
+ serializedName: "ipRules",
226
+ type: {
227
+ name: "Sequence",
228
+ element: {
229
+ type: {
230
+ name: "Composite",
231
+ className: "IPRule"
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+ };
239
+ const IPRule = {
240
+ type: {
241
+ name: "Composite",
242
+ className: "IPRule",
243
+ modelProperties: {
244
+ action: {
245
+ defaultValue: "Allow",
246
+ isConstant: true,
247
+ serializedName: "action",
248
+ type: {
249
+ name: "String"
250
+ }
251
+ },
252
+ value: {
253
+ serializedName: "value",
254
+ required: true,
255
+ type: {
256
+ name: "String"
257
+ }
258
+ }
259
+ }
260
+ }
261
+ };
180
262
  const EncryptionProperties = {
181
263
  type: {
182
264
  name: "Composite",
@@ -518,6 +600,21 @@ const BatchAccountUpdateParameters = {
518
600
  }
519
601
  }
520
602
  }
603
+ },
604
+ publicNetworkAccess: {
605
+ defaultValue: "Enabled",
606
+ serializedName: "properties.publicNetworkAccess",
607
+ type: {
608
+ name: "Enum",
609
+ allowedValues: ["Enabled", "Disabled"]
610
+ }
611
+ },
612
+ networkProfile: {
613
+ serializedName: "properties.networkProfile",
614
+ type: {
615
+ name: "Composite",
616
+ className: "NetworkProfile"
617
+ }
521
618
  }
522
619
  }
523
620
  }
@@ -2693,7 +2790,14 @@ const PrivateEndpointConnection = {
2693
2790
  readOnly: true,
2694
2791
  type: {
2695
2792
  name: "Enum",
2696
- allowedValues: ["Succeeded", "Updating", "Failed"]
2793
+ allowedValues: [
2794
+ "Creating",
2795
+ "Updating",
2796
+ "Deleting",
2797
+ "Succeeded",
2798
+ "Failed",
2799
+ "Cancelled"
2800
+ ]
2697
2801
  }
2698
2802
  }, privateEndpoint: {
2699
2803
  serializedName: "properties.privateEndpoint",
@@ -2701,6 +2805,17 @@ const PrivateEndpointConnection = {
2701
2805
  name: "Composite",
2702
2806
  className: "PrivateEndpoint"
2703
2807
  }
2808
+ }, groupIds: {
2809
+ serializedName: "properties.groupIds",
2810
+ readOnly: true,
2811
+ type: {
2812
+ name: "Sequence",
2813
+ element: {
2814
+ type: {
2815
+ name: "String"
2816
+ }
2817
+ }
2818
+ }
2704
2819
  }, privateLinkServiceConnectionState: {
2705
2820
  serializedName: "properties.privateLinkServiceConnectionState",
2706
2821
  type: {
@@ -3118,6 +3233,12 @@ const BatchAccount = {
3118
3233
  type: {
3119
3234
  name: "String"
3120
3235
  }
3236
+ }, nodeManagementEndpoint: {
3237
+ serializedName: "properties.nodeManagementEndpoint",
3238
+ readOnly: true,
3239
+ type: {
3240
+ name: "String"
3241
+ }
3121
3242
  }, provisioningState: {
3122
3243
  serializedName: "properties.provisioningState",
3123
3244
  readOnly: true,
@@ -3148,12 +3269,17 @@ const BatchAccount = {
3148
3269
  }, publicNetworkAccess: {
3149
3270
  defaultValue: "Enabled",
3150
3271
  serializedName: "properties.publicNetworkAccess",
3151
- readOnly: true,
3152
3272
  nullable: true,
3153
3273
  type: {
3154
3274
  name: "Enum",
3155
3275
  allowedValues: ["Enabled", "Disabled"]
3156
3276
  }
3277
+ }, networkProfile: {
3278
+ serializedName: "properties.networkProfile",
3279
+ type: {
3280
+ name: "Composite",
3281
+ className: "NetworkProfile"
3282
+ }
3157
3283
  }, privateEndpointConnections: {
3158
3284
  serializedName: "properties.privateEndpointConnections",
3159
3285
  readOnly: true,
@@ -3438,6 +3564,26 @@ const PrivateEndpointConnectionUpdateHeaders = {
3438
3564
  }
3439
3565
  }
3440
3566
  };
3567
+ const PrivateEndpointConnectionDeleteHeaders = {
3568
+ type: {
3569
+ name: "Composite",
3570
+ className: "PrivateEndpointConnectionDeleteHeaders",
3571
+ modelProperties: {
3572
+ location: {
3573
+ serializedName: "location",
3574
+ type: {
3575
+ name: "String"
3576
+ }
3577
+ },
3578
+ retryAfter: {
3579
+ serializedName: "retry-after",
3580
+ type: {
3581
+ name: "Number"
3582
+ }
3583
+ }
3584
+ }
3585
+ }
3586
+ };
3441
3587
  const PoolCreateHeaders = {
3442
3588
  type: {
3443
3589
  name: "Composite",
@@ -3535,6 +3681,9 @@ var Mappers = /*#__PURE__*/Object.freeze({
3535
3681
  AutoStorageBaseProperties: AutoStorageBaseProperties,
3536
3682
  ComputeNodeIdentityReference: ComputeNodeIdentityReference,
3537
3683
  KeyVaultReference: KeyVaultReference,
3684
+ NetworkProfile: NetworkProfile,
3685
+ EndpointAccessProfile: EndpointAccessProfile,
3686
+ IPRule: IPRule,
3538
3687
  EncryptionProperties: EncryptionProperties,
3539
3688
  KeyVaultProperties: KeyVaultProperties,
3540
3689
  BatchAccountIdentity: BatchAccountIdentity,
@@ -3637,6 +3786,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
3637
3786
  CertificateGetHeaders: CertificateGetHeaders,
3638
3787
  CertificateCancelDeletionHeaders: CertificateCancelDeletionHeaders,
3639
3788
  PrivateEndpointConnectionUpdateHeaders: PrivateEndpointConnectionUpdateHeaders,
3789
+ PrivateEndpointConnectionDeleteHeaders: PrivateEndpointConnectionDeleteHeaders,
3640
3790
  PoolCreateHeaders: PoolCreateHeaders,
3641
3791
  PoolUpdateHeaders: PoolUpdateHeaders,
3642
3792
  PoolDeleteHeaders: PoolDeleteHeaders,
@@ -3717,7 +3867,7 @@ const accountName = {
3717
3867
  const apiVersion = {
3718
3868
  parameterPath: "apiVersion",
3719
3869
  mapper: {
3720
- defaultValue: "2022-01-01",
3870
+ defaultValue: "2022-06-01",
3721
3871
  isConstant: true,
3722
3872
  serializedName: "api-version",
3723
3873
  type: {
@@ -4017,7 +4167,7 @@ class BatchAccountOperationsImpl {
4017
4167
  },
4018
4168
  byPage: () => {
4019
4169
  return this.listPagingPage(options);
4020
- },
4170
+ }
4021
4171
  };
4022
4172
  }
4023
4173
  listPagingPage(options) {
@@ -4066,7 +4216,7 @@ class BatchAccountOperationsImpl {
4066
4216
  },
4067
4217
  byPage: () => {
4068
4218
  return this.listByResourceGroupPagingPage(resourceGroupName, options);
4069
- },
4219
+ }
4070
4220
  };
4071
4221
  }
4072
4222
  listByResourceGroupPagingPage(resourceGroupName, options) {
@@ -4116,7 +4266,7 @@ class BatchAccountOperationsImpl {
4116
4266
  },
4117
4267
  byPage: () => {
4118
4268
  return this.listDetectorsPagingPage(resourceGroupName, accountName, options);
4119
- },
4269
+ }
4120
4270
  };
4121
4271
  }
4122
4272
  listDetectorsPagingPage(resourceGroupName, accountName, options) {
@@ -4155,7 +4305,7 @@ class BatchAccountOperationsImpl {
4155
4305
  * you must make sure your network allows outbound access to these endpoints. Failure to allow access
4156
4306
  * to these endpoints may cause Batch to mark the affected nodes as unusable. For more information
4157
4307
  * about creating a pool inside of a virtual network, see
4158
- * https://docs.microsoft.com/azure/batch/batch-virtual-network.
4308
+ * https://docs.microsoft.com/azure/batch/batch-virtual-network
4159
4309
  * @param resourceGroupName The name of the resource group that contains the Batch account.
4160
4310
  * @param accountName The name of the Batch account.
4161
4311
  * @param options The options parameters.
@@ -4171,7 +4321,7 @@ class BatchAccountOperationsImpl {
4171
4321
  },
4172
4322
  byPage: () => {
4173
4323
  return this.listOutboundNetworkDependenciesEndpointsPagingPage(resourceGroupName, accountName, options);
4174
- },
4324
+ }
4175
4325
  };
4176
4326
  }
4177
4327
  listOutboundNetworkDependenciesEndpointsPagingPage(resourceGroupName, accountName, options) {
@@ -4235,15 +4385,15 @@ class BatchAccountOperationsImpl {
4235
4385
  rawResponse: {
4236
4386
  statusCode: currentRawResponse.status,
4237
4387
  body: currentRawResponse.parsedBody,
4238
- headers: currentRawResponse.headers.toJSON(),
4239
- },
4388
+ headers: currentRawResponse.headers.toJSON()
4389
+ }
4240
4390
  };
4241
4391
  });
4242
4392
  const lro = new LroImpl(sendOperation, { resourceGroupName, accountName, parameters, options }, createOperationSpec$4);
4243
4393
  const poller = new coreLro.LroEngine(lro, {
4244
4394
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
4245
4395
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
4246
- lroResourceLocationConfig: "location",
4396
+ lroResourceLocationConfig: "location"
4247
4397
  });
4248
4398
  yield poller.poll();
4249
4399
  return poller;
@@ -4302,15 +4452,15 @@ class BatchAccountOperationsImpl {
4302
4452
  rawResponse: {
4303
4453
  statusCode: currentRawResponse.status,
4304
4454
  body: currentRawResponse.parsedBody,
4305
- headers: currentRawResponse.headers.toJSON(),
4306
- },
4455
+ headers: currentRawResponse.headers.toJSON()
4456
+ }
4307
4457
  };
4308
4458
  });
4309
- const lro = new LroImpl(sendOperation, { resourceGroupName, accountName, options }, deleteOperationSpec$4);
4459
+ const lro = new LroImpl(sendOperation, { resourceGroupName, accountName, options }, deleteOperationSpec$5);
4310
4460
  const poller = new coreLro.LroEngine(lro, {
4311
4461
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
4312
4462
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
4313
- lroResourceLocationConfig: "location",
4463
+ lroResourceLocationConfig: "location"
4314
4464
  });
4315
4465
  yield poller.poll();
4316
4466
  return poller;
@@ -4412,7 +4562,7 @@ class BatchAccountOperationsImpl {
4412
4562
  * you must make sure your network allows outbound access to these endpoints. Failure to allow access
4413
4563
  * to these endpoints may cause Batch to mark the affected nodes as unusable. For more information
4414
4564
  * about creating a pool inside of a virtual network, see
4415
- * https://docs.microsoft.com/azure/batch/batch-virtual-network.
4565
+ * https://docs.microsoft.com/azure/batch/batch-virtual-network
4416
4566
  * @param resourceGroupName The name of the resource group that contains the Batch account.
4417
4567
  * @param accountName The name of the Batch account.
4418
4568
  * @param options The options parameters.
@@ -4466,20 +4616,20 @@ const createOperationSpec$4 = {
4466
4616
  httpMethod: "PUT",
4467
4617
  responses: {
4468
4618
  200: {
4469
- bodyMapper: BatchAccount,
4619
+ bodyMapper: BatchAccount
4470
4620
  },
4471
4621
  201: {
4472
- bodyMapper: BatchAccount,
4622
+ bodyMapper: BatchAccount
4473
4623
  },
4474
4624
  202: {
4475
- bodyMapper: BatchAccount,
4625
+ bodyMapper: BatchAccount
4476
4626
  },
4477
4627
  204: {
4478
- bodyMapper: BatchAccount,
4628
+ bodyMapper: BatchAccount
4479
4629
  },
4480
4630
  default: {
4481
- bodyMapper: CloudError,
4482
- },
4631
+ bodyMapper: CloudError
4632
+ }
4483
4633
  },
4484
4634
  requestBody: parameters,
4485
4635
  queryParameters: [apiVersion],
@@ -4487,22 +4637,22 @@ const createOperationSpec$4 = {
4487
4637
  $host,
4488
4638
  resourceGroupName,
4489
4639
  accountName,
4490
- subscriptionId,
4640
+ subscriptionId
4491
4641
  ],
4492
4642
  headerParameters: [contentType, accept],
4493
4643
  mediaType: "json",
4494
- serializer: serializer$8,
4644
+ serializer: serializer$8
4495
4645
  };
4496
4646
  const updateOperationSpec$4 = {
4497
4647
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
4498
4648
  httpMethod: "PATCH",
4499
4649
  responses: {
4500
4650
  200: {
4501
- bodyMapper: BatchAccount,
4651
+ bodyMapper: BatchAccount
4502
4652
  },
4503
4653
  default: {
4504
- bodyMapper: CloudError,
4505
- },
4654
+ bodyMapper: CloudError
4655
+ }
4506
4656
  },
4507
4657
  requestBody: parameters1,
4508
4658
  queryParameters: [apiVersion],
@@ -4510,13 +4660,13 @@ const updateOperationSpec$4 = {
4510
4660
  $host,
4511
4661
  resourceGroupName,
4512
4662
  subscriptionId,
4513
- accountName1,
4663
+ accountName1
4514
4664
  ],
4515
4665
  headerParameters: [contentType, accept],
4516
4666
  mediaType: "json",
4517
- serializer: serializer$8,
4667
+ serializer: serializer$8
4518
4668
  };
4519
- const deleteOperationSpec$4 = {
4669
+ const deleteOperationSpec$5 = {
4520
4670
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
4521
4671
  httpMethod: "DELETE",
4522
4672
  responses: {
@@ -4525,71 +4675,75 @@ const deleteOperationSpec$4 = {
4525
4675
  202: {},
4526
4676
  204: {},
4527
4677
  default: {
4528
- bodyMapper: CloudError,
4529
- },
4678
+ bodyMapper: CloudError
4679
+ }
4530
4680
  },
4531
4681
  queryParameters: [apiVersion],
4532
4682
  urlParameters: [
4533
4683
  $host,
4534
4684
  resourceGroupName,
4535
4685
  subscriptionId,
4536
- accountName1,
4686
+ accountName1
4537
4687
  ],
4538
4688
  headerParameters: [accept],
4539
- serializer: serializer$8,
4689
+ serializer: serializer$8
4540
4690
  };
4541
4691
  const getOperationSpec$6 = {
4542
4692
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
4543
4693
  httpMethod: "GET",
4544
4694
  responses: {
4545
4695
  200: {
4546
- bodyMapper: BatchAccount,
4696
+ bodyMapper: BatchAccount
4547
4697
  },
4548
4698
  default: {
4549
- bodyMapper: CloudError,
4550
- },
4699
+ bodyMapper: CloudError
4700
+ }
4551
4701
  },
4552
4702
  queryParameters: [apiVersion],
4553
4703
  urlParameters: [
4554
4704
  $host,
4555
4705
  resourceGroupName,
4556
4706
  subscriptionId,
4557
- accountName1,
4707
+ accountName1
4558
4708
  ],
4559
4709
  headerParameters: [accept],
4560
- serializer: serializer$8,
4710
+ serializer: serializer$8
4561
4711
  };
4562
4712
  const listOperationSpec$3 = {
4563
4713
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts",
4564
4714
  httpMethod: "GET",
4565
4715
  responses: {
4566
4716
  200: {
4567
- bodyMapper: BatchAccountListResult,
4717
+ bodyMapper: BatchAccountListResult
4568
4718
  },
4569
4719
  default: {
4570
- bodyMapper: CloudError,
4571
- },
4720
+ bodyMapper: CloudError
4721
+ }
4572
4722
  },
4573
4723
  queryParameters: [apiVersion],
4574
4724
  urlParameters: [$host, subscriptionId],
4575
4725
  headerParameters: [accept],
4576
- serializer: serializer$8,
4726
+ serializer: serializer$8
4577
4727
  };
4578
4728
  const listByResourceGroupOperationSpec = {
4579
4729
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts",
4580
4730
  httpMethod: "GET",
4581
4731
  responses: {
4582
4732
  200: {
4583
- bodyMapper: BatchAccountListResult,
4733
+ bodyMapper: BatchAccountListResult
4584
4734
  },
4585
4735
  default: {
4586
- bodyMapper: CloudError,
4587
- },
4736
+ bodyMapper: CloudError
4737
+ }
4588
4738
  },
4589
4739
  queryParameters: [apiVersion],
4590
- urlParameters: [$host, resourceGroupName, subscriptionId],
4740
+ urlParameters: [
4741
+ $host,
4742
+ resourceGroupName,
4743
+ subscriptionId
4744
+ ],
4591
4745
  headerParameters: [accept],
4592
- serializer: serializer$8,
4746
+ serializer: serializer$8
4593
4747
  };
4594
4748
  const synchronizeAutoStorageKeysOperationSpec = {
4595
4749
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys",
@@ -4597,29 +4751,29 @@ const synchronizeAutoStorageKeysOperationSpec = {
4597
4751
  responses: {
4598
4752
  204: {},
4599
4753
  default: {
4600
- bodyMapper: CloudError,
4601
- },
4754
+ bodyMapper: CloudError
4755
+ }
4602
4756
  },
4603
4757
  queryParameters: [apiVersion],
4604
4758
  urlParameters: [
4605
4759
  $host,
4606
4760
  resourceGroupName,
4607
4761
  subscriptionId,
4608
- accountName1,
4762
+ accountName1
4609
4763
  ],
4610
4764
  headerParameters: [accept],
4611
- serializer: serializer$8,
4765
+ serializer: serializer$8
4612
4766
  };
4613
4767
  const regenerateKeyOperationSpec = {
4614
4768
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys",
4615
4769
  httpMethod: "POST",
4616
4770
  responses: {
4617
4771
  200: {
4618
- bodyMapper: BatchAccountKeys,
4772
+ bodyMapper: BatchAccountKeys
4619
4773
  },
4620
4774
  default: {
4621
- bodyMapper: CloudError,
4622
- },
4775
+ bodyMapper: CloudError
4776
+ }
4623
4777
  },
4624
4778
  requestBody: parameters2,
4625
4779
  queryParameters: [apiVersion],
@@ -4627,64 +4781,64 @@ const regenerateKeyOperationSpec = {
4627
4781
  $host,
4628
4782
  resourceGroupName,
4629
4783
  subscriptionId,
4630
- accountName1,
4784
+ accountName1
4631
4785
  ],
4632
4786
  headerParameters: [contentType, accept],
4633
4787
  mediaType: "json",
4634
- serializer: serializer$8,
4788
+ serializer: serializer$8
4635
4789
  };
4636
4790
  const getKeysOperationSpec = {
4637
4791
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys",
4638
4792
  httpMethod: "POST",
4639
4793
  responses: {
4640
4794
  200: {
4641
- bodyMapper: BatchAccountKeys,
4795
+ bodyMapper: BatchAccountKeys
4642
4796
  },
4643
4797
  default: {
4644
- bodyMapper: CloudError,
4645
- },
4798
+ bodyMapper: CloudError
4799
+ }
4646
4800
  },
4647
4801
  queryParameters: [apiVersion],
4648
4802
  urlParameters: [
4649
4803
  $host,
4650
4804
  resourceGroupName,
4651
4805
  subscriptionId,
4652
- accountName1,
4806
+ accountName1
4653
4807
  ],
4654
4808
  headerParameters: [accept],
4655
- serializer: serializer$8,
4809
+ serializer: serializer$8
4656
4810
  };
4657
4811
  const listDetectorsOperationSpec = {
4658
4812
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors",
4659
4813
  httpMethod: "GET",
4660
4814
  responses: {
4661
4815
  200: {
4662
- bodyMapper: DetectorListResult,
4816
+ bodyMapper: DetectorListResult
4663
4817
  },
4664
4818
  default: {
4665
- bodyMapper: CloudError,
4666
- },
4819
+ bodyMapper: CloudError
4820
+ }
4667
4821
  },
4668
4822
  queryParameters: [apiVersion],
4669
4823
  urlParameters: [
4670
4824
  $host,
4671
4825
  resourceGroupName,
4672
4826
  subscriptionId,
4673
- accountName1,
4827
+ accountName1
4674
4828
  ],
4675
4829
  headerParameters: [accept],
4676
- serializer: serializer$8,
4830
+ serializer: serializer$8
4677
4831
  };
4678
4832
  const getDetectorOperationSpec = {
4679
4833
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}",
4680
4834
  httpMethod: "GET",
4681
4835
  responses: {
4682
4836
  200: {
4683
- bodyMapper: DetectorResponse,
4837
+ bodyMapper: DetectorResponse
4684
4838
  },
4685
4839
  default: {
4686
- bodyMapper: CloudError,
4687
- },
4840
+ bodyMapper: CloudError
4841
+ }
4688
4842
  },
4689
4843
  queryParameters: [apiVersion],
4690
4844
  urlParameters: [
@@ -4692,79 +4846,83 @@ const getDetectorOperationSpec = {
4692
4846
  resourceGroupName,
4693
4847
  subscriptionId,
4694
4848
  accountName1,
4695
- detectorId,
4849
+ detectorId
4696
4850
  ],
4697
4851
  headerParameters: [accept],
4698
- serializer: serializer$8,
4852
+ serializer: serializer$8
4699
4853
  };
4700
4854
  const listOutboundNetworkDependenciesEndpointsOperationSpec = {
4701
4855
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints",
4702
4856
  httpMethod: "GET",
4703
4857
  responses: {
4704
4858
  200: {
4705
- bodyMapper: OutboundEnvironmentEndpointCollection,
4859
+ bodyMapper: OutboundEnvironmentEndpointCollection
4706
4860
  },
4707
4861
  default: {
4708
- bodyMapper: CloudError,
4709
- },
4862
+ bodyMapper: CloudError
4863
+ }
4710
4864
  },
4711
4865
  queryParameters: [apiVersion],
4712
4866
  urlParameters: [
4713
4867
  $host,
4714
4868
  resourceGroupName,
4715
4869
  subscriptionId,
4716
- accountName1,
4870
+ accountName1
4717
4871
  ],
4718
4872
  headerParameters: [accept],
4719
- serializer: serializer$8,
4873
+ serializer: serializer$8
4720
4874
  };
4721
4875
  const listNextOperationSpec$3 = {
4722
4876
  path: "{nextLink}",
4723
4877
  httpMethod: "GET",
4724
4878
  responses: {
4725
4879
  200: {
4726
- bodyMapper: BatchAccountListResult,
4880
+ bodyMapper: BatchAccountListResult
4727
4881
  },
4728
4882
  default: {
4729
- bodyMapper: CloudError,
4730
- },
4883
+ bodyMapper: CloudError
4884
+ }
4731
4885
  },
4732
4886
  queryParameters: [apiVersion],
4733
- urlParameters: [$host, subscriptionId, nextLink],
4887
+ urlParameters: [
4888
+ $host,
4889
+ subscriptionId,
4890
+ nextLink
4891
+ ],
4734
4892
  headerParameters: [accept],
4735
- serializer: serializer$8,
4893
+ serializer: serializer$8
4736
4894
  };
4737
4895
  const listByResourceGroupNextOperationSpec = {
4738
4896
  path: "{nextLink}",
4739
4897
  httpMethod: "GET",
4740
4898
  responses: {
4741
4899
  200: {
4742
- bodyMapper: BatchAccountListResult,
4900
+ bodyMapper: BatchAccountListResult
4743
4901
  },
4744
4902
  default: {
4745
- bodyMapper: CloudError,
4746
- },
4903
+ bodyMapper: CloudError
4904
+ }
4747
4905
  },
4748
4906
  queryParameters: [apiVersion],
4749
4907
  urlParameters: [
4750
4908
  $host,
4751
4909
  resourceGroupName,
4752
4910
  subscriptionId,
4753
- nextLink,
4911
+ nextLink
4754
4912
  ],
4755
4913
  headerParameters: [accept],
4756
- serializer: serializer$8,
4914
+ serializer: serializer$8
4757
4915
  };
4758
4916
  const listDetectorsNextOperationSpec = {
4759
4917
  path: "{nextLink}",
4760
4918
  httpMethod: "GET",
4761
4919
  responses: {
4762
4920
  200: {
4763
- bodyMapper: DetectorListResult,
4921
+ bodyMapper: DetectorListResult
4764
4922
  },
4765
4923
  default: {
4766
- bodyMapper: CloudError,
4767
- },
4924
+ bodyMapper: CloudError
4925
+ }
4768
4926
  },
4769
4927
  queryParameters: [apiVersion],
4770
4928
  urlParameters: [
@@ -4772,21 +4930,21 @@ const listDetectorsNextOperationSpec = {
4772
4930
  resourceGroupName,
4773
4931
  subscriptionId,
4774
4932
  accountName1,
4775
- nextLink,
4933
+ nextLink
4776
4934
  ],
4777
4935
  headerParameters: [accept],
4778
- serializer: serializer$8,
4936
+ serializer: serializer$8
4779
4937
  };
4780
4938
  const listOutboundNetworkDependenciesEndpointsNextOperationSpec = {
4781
4939
  path: "{nextLink}",
4782
4940
  httpMethod: "GET",
4783
4941
  responses: {
4784
4942
  200: {
4785
- bodyMapper: OutboundEnvironmentEndpointCollection,
4943
+ bodyMapper: OutboundEnvironmentEndpointCollection
4786
4944
  },
4787
4945
  default: {
4788
- bodyMapper: CloudError,
4789
- },
4946
+ bodyMapper: CloudError
4947
+ }
4790
4948
  },
4791
4949
  queryParameters: [apiVersion],
4792
4950
  urlParameters: [
@@ -4794,10 +4952,10 @@ const listOutboundNetworkDependenciesEndpointsNextOperationSpec = {
4794
4952
  resourceGroupName,
4795
4953
  subscriptionId,
4796
4954
  accountName1,
4797
- nextLink,
4955
+ nextLink
4798
4956
  ],
4799
4957
  headerParameters: [accept],
4800
- serializer: serializer$8,
4958
+ serializer: serializer$8
4801
4959
  };
4802
4960
 
4803
4961
  /*
@@ -4912,7 +5070,7 @@ class ApplicationPackageOperationsImpl {
4912
5070
  * @param options The options parameters.
4913
5071
  */
4914
5072
  delete(resourceGroupName, accountName, applicationName, versionName, options) {
4915
- return this.client.sendOperationRequest({ resourceGroupName, accountName, applicationName, versionName, options }, deleteOperationSpec$3);
5073
+ return this.client.sendOperationRequest({ resourceGroupName, accountName, applicationName, versionName, options }, deleteOperationSpec$4);
4916
5074
  }
4917
5075
  /**
4918
5076
  * Gets information about the specified application package.
@@ -4999,7 +5157,7 @@ const createOperationSpec$3 = {
4999
5157
  mediaType: "json",
5000
5158
  serializer: serializer$7
5001
5159
  };
5002
- const deleteOperationSpec$3 = {
5160
+ const deleteOperationSpec$4 = {
5003
5161
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}",
5004
5162
  httpMethod: "DELETE",
5005
5163
  responses: {
@@ -5175,7 +5333,7 @@ class ApplicationOperationsImpl {
5175
5333
  * @param options The options parameters.
5176
5334
  */
5177
5335
  delete(resourceGroupName, accountName, applicationName, options) {
5178
- return this.client.sendOperationRequest({ resourceGroupName, accountName, applicationName, options }, deleteOperationSpec$2);
5336
+ return this.client.sendOperationRequest({ resourceGroupName, accountName, applicationName, options }, deleteOperationSpec$3);
5179
5337
  }
5180
5338
  /**
5181
5339
  * Gets information about the specified application.
@@ -5244,7 +5402,7 @@ const createOperationSpec$2 = {
5244
5402
  mediaType: "json",
5245
5403
  serializer: serializer$6
5246
5404
  };
5247
- const deleteOperationSpec$2 = {
5405
+ const deleteOperationSpec$3 = {
5248
5406
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}",
5249
5407
  httpMethod: "DELETE",
5250
5408
  responses: {
@@ -5918,7 +6076,7 @@ class CertificateOperationsImpl {
5918
6076
  }
5919
6077
  };
5920
6078
  });
5921
- const lro = new LroImpl(sendOperation, { resourceGroupName, accountName, certificateName, options }, deleteOperationSpec$1);
6079
+ const lro = new LroImpl(sendOperation, { resourceGroupName, accountName, certificateName, options }, deleteOperationSpec$2);
5922
6080
  const poller = new coreLro.LroEngine(lro, {
5923
6081
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
5924
6082
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
@@ -6070,7 +6228,7 @@ const updateOperationSpec$2 = {
6070
6228
  mediaType: "json",
6071
6229
  serializer: serializer$3
6072
6230
  };
6073
- const deleteOperationSpec$1 = {
6231
+ const deleteOperationSpec$2 = {
6074
6232
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}",
6075
6233
  httpMethod: "DELETE",
6076
6234
  responses: {
@@ -6491,6 +6649,67 @@ class PrivateEndpointConnectionOperationsImpl {
6491
6649
  return poller.pollUntilDone();
6492
6650
  });
6493
6651
  }
6652
+ /**
6653
+ * Deletes the specified private endpoint connection.
6654
+ * @param resourceGroupName The name of the resource group that contains the Batch account.
6655
+ * @param accountName The name of the Batch account.
6656
+ * @param privateEndpointConnectionName The private endpoint connection name. This must be unique
6657
+ * within the account.
6658
+ * @param options The options parameters.
6659
+ */
6660
+ beginDelete(resourceGroupName, accountName, privateEndpointConnectionName, options) {
6661
+ return tslib.__awaiter(this, void 0, void 0, function* () {
6662
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
6663
+ return this.client.sendOperationRequest(args, spec);
6664
+ });
6665
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
6666
+ var _a;
6667
+ let currentRawResponse = undefined;
6668
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
6669
+ const callback = (rawResponse, flatResponse) => {
6670
+ currentRawResponse = rawResponse;
6671
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
6672
+ };
6673
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
6674
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
6675
+ return {
6676
+ flatResponse,
6677
+ rawResponse: {
6678
+ statusCode: currentRawResponse.status,
6679
+ body: currentRawResponse.parsedBody,
6680
+ headers: currentRawResponse.headers.toJSON()
6681
+ }
6682
+ };
6683
+ });
6684
+ const lro = new LroImpl(sendOperation, {
6685
+ resourceGroupName,
6686
+ accountName,
6687
+ privateEndpointConnectionName,
6688
+ options
6689
+ }, deleteOperationSpec$1);
6690
+ const poller = new coreLro.LroEngine(lro, {
6691
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
6692
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
6693
+ lroResourceLocationConfig: "azure-async-operation"
6694
+ });
6695
+ yield poller.poll();
6696
+ return poller;
6697
+ });
6698
+ }
6699
+ /**
6700
+ * Deletes the specified private endpoint connection.
6701
+ * @param resourceGroupName The name of the resource group that contains the Batch account.
6702
+ * @param accountName The name of the Batch account.
6703
+ * @param privateEndpointConnectionName The private endpoint connection name. This must be unique
6704
+ * within the account.
6705
+ * @param options The options parameters.
6706
+ */
6707
+ beginDeleteAndWait(resourceGroupName, accountName, privateEndpointConnectionName, options) {
6708
+ return tslib.__awaiter(this, void 0, void 0, function* () {
6709
+ const poller = yield this.beginDelete(resourceGroupName, accountName, privateEndpointConnectionName, options);
6710
+ return poller.pollUntilDone();
6711
+ });
6712
+ }
6494
6713
  /**
6495
6714
  * ListByBatchAccountNext
6496
6715
  * @param resourceGroupName The name of the resource group that contains the Batch account.
@@ -6584,6 +6803,37 @@ const updateOperationSpec$1 = {
6584
6803
  mediaType: "json",
6585
6804
  serializer: serializer$1
6586
6805
  };
6806
+ const deleteOperationSpec$1 = {
6807
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
6808
+ httpMethod: "DELETE",
6809
+ responses: {
6810
+ 200: {
6811
+ headersMapper: PrivateEndpointConnectionDeleteHeaders
6812
+ },
6813
+ 201: {
6814
+ headersMapper: PrivateEndpointConnectionDeleteHeaders
6815
+ },
6816
+ 202: {
6817
+ headersMapper: PrivateEndpointConnectionDeleteHeaders
6818
+ },
6819
+ 204: {
6820
+ headersMapper: PrivateEndpointConnectionDeleteHeaders
6821
+ },
6822
+ default: {
6823
+ bodyMapper: CloudError
6824
+ }
6825
+ },
6826
+ queryParameters: [apiVersion],
6827
+ urlParameters: [
6828
+ $host,
6829
+ resourceGroupName,
6830
+ subscriptionId,
6831
+ accountName1,
6832
+ privateEndpointConnectionName
6833
+ ],
6834
+ headerParameters: [accept],
6835
+ serializer: serializer$1
6836
+ };
6587
6837
  const listByBatchAccountNextOperationSpec$1 = {
6588
6838
  path: "{nextLink}",
6589
6839
  httpMethod: "GET",
@@ -7044,7 +7294,7 @@ class BatchManagementClient extends coreClient__namespace.ServiceClient {
7044
7294
  requestContentType: "application/json; charset=utf-8",
7045
7295
  credential: credentials
7046
7296
  };
7047
- const packageDetails = `azsdk-js-arm-batch/7.1.2`;
7297
+ const packageDetails = `azsdk-js-arm-batch/7.2.1`;
7048
7298
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
7049
7299
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
7050
7300
  : `${packageDetails}`;
@@ -7055,11 +7305,27 @@ class BatchManagementClient extends coreClient__namespace.ServiceClient {
7055
7305
  userAgentPrefix
7056
7306
  }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
7057
7307
  super(optionsWithDefaults);
7308
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
7309
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
7310
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
7311
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
7312
+ if (!bearerTokenAuthenticationPolicyFound) {
7313
+ this.pipeline.removePolicy({
7314
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
7315
+ });
7316
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
7317
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
7318
+ challengeCallbacks: {
7319
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
7320
+ }
7321
+ }));
7322
+ }
7323
+ }
7058
7324
  // Parameter assignments
7059
7325
  this.subscriptionId = subscriptionId;
7060
7326
  // Assigning values to Constant parameters
7061
7327
  this.$host = options.$host || "https://management.azure.com";
7062
- this.apiVersion = options.apiVersion || "2022-01-01";
7328
+ this.apiVersion = options.apiVersion || "2022-06-01";
7063
7329
  this.batchAccountOperations = new BatchAccountOperationsImpl(this);
7064
7330
  this.applicationPackageOperations = new ApplicationPackageOperationsImpl(this);
7065
7331
  this.applicationOperations = new ApplicationOperationsImpl(this);
@@ -7069,6 +7335,34 @@ class BatchManagementClient extends coreClient__namespace.ServiceClient {
7069
7335
  this.privateLinkResourceOperations = new PrivateLinkResourceOperationsImpl(this);
7070
7336
  this.privateEndpointConnectionOperations = new PrivateEndpointConnectionOperationsImpl(this);
7071
7337
  this.poolOperations = new PoolOperationsImpl(this);
7338
+ this.addCustomApiVersionPolicy(options.apiVersion);
7339
+ }
7340
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
7341
+ addCustomApiVersionPolicy(apiVersion) {
7342
+ if (!apiVersion) {
7343
+ return;
7344
+ }
7345
+ const apiVersionPolicy = {
7346
+ name: "CustomApiVersionPolicy",
7347
+ sendRequest(request, next) {
7348
+ return tslib.__awaiter(this, void 0, void 0, function* () {
7349
+ const param = request.url.split("?");
7350
+ if (param.length > 1) {
7351
+ const newParams = param[1].split("&").map((item) => {
7352
+ if (item.indexOf("api-version") > -1) {
7353
+ return "api-version=" + apiVersion;
7354
+ }
7355
+ else {
7356
+ return item;
7357
+ }
7358
+ });
7359
+ request.url = param[0] + "?" + newParams.join("&");
7360
+ }
7361
+ return next(request);
7362
+ });
7363
+ }
7364
+ };
7365
+ this.pipeline.addPolicy(apiVersionPolicy);
7072
7366
  }
7073
7367
  }
7074
7368