@azure/arm-databricks 3.0.0-alpha.20221128.1 → 3.0.0-alpha.20221129.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 (51) hide show
  1. package/CHANGELOG.md +3 -13
  2. package/dist/index.js +231 -60
  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/src/azureDatabricksManagementClient.d.ts +2 -0
  7. package/dist-esm/src/azureDatabricksManagementClient.d.ts.map +1 -1
  8. package/dist-esm/src/azureDatabricksManagementClient.js +48 -17
  9. package/dist-esm/src/azureDatabricksManagementClient.js.map +1 -1
  10. package/dist-esm/src/index.d.ts +1 -0
  11. package/dist-esm/src/index.d.ts.map +1 -1
  12. package/dist-esm/src/index.js +1 -0
  13. package/dist-esm/src/index.js.map +1 -1
  14. package/dist-esm/src/models/index.d.ts +48 -6
  15. package/dist-esm/src/models/index.d.ts.map +1 -1
  16. package/dist-esm/src/models/index.js +42 -0
  17. package/dist-esm/src/models/index.js.map +1 -1
  18. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  19. package/dist-esm/src/operations/operations.js +19 -7
  20. package/dist-esm/src/operations/operations.js.map +1 -1
  21. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  22. package/dist-esm/src/operations/privateEndpointConnections.js +19 -7
  23. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  24. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -1
  25. package/dist-esm/src/operations/privateLinkResources.js +19 -7
  26. package/dist-esm/src/operations/privateLinkResources.js.map +1 -1
  27. package/dist-esm/src/operations/vNetPeering.d.ts.map +1 -1
  28. package/dist-esm/src/operations/vNetPeering.js +19 -7
  29. package/dist-esm/src/operations/vNetPeering.js.map +1 -1
  30. package/dist-esm/src/operations/workspaces.d.ts.map +1 -1
  31. package/dist-esm/src/operations/workspaces.js +37 -14
  32. package/dist-esm/src/operations/workspaces.js.map +1 -1
  33. package/dist-esm/src/pagingHelper.d.ts +13 -0
  34. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  35. package/dist-esm/src/pagingHelper.js +32 -0
  36. package/dist-esm/src/pagingHelper.js.map +1 -0
  37. package/dist-esm/test/databricks_examples.d.ts.map +1 -1
  38. package/dist-esm/test/databricks_examples.js +16 -18
  39. package/dist-esm/test/databricks_examples.js.map +1 -1
  40. package/package.json +12 -8
  41. package/review/arm-databricks.api.md +20 -59
  42. package/src/azureDatabricksManagementClient.ts +59 -19
  43. package/src/index.ts +1 -0
  44. package/src/models/index.ts +48 -6
  45. package/src/operations/operations.ts +21 -8
  46. package/src/operations/privateEndpointConnections.ts +26 -8
  47. package/src/operations/privateLinkResources.ts +26 -8
  48. package/src/operations/vNetPeering.ts +27 -13
  49. package/src/operations/workspaces.ts +46 -17
  50. package/src/pagingHelper.ts +39 -0
  51. package/types/arm-databricks.d.ts +59 -6
package/CHANGELOG.md CHANGED
@@ -1,18 +1,8 @@
1
1
  # Release History
2
+
3
+ ## 3.0.0-beta.4 (2022-11-21)
2
4
 
3
- ## 3.0.0-beta.4 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
13
- ## 3.0.0-beta.3 (2022-04-15)
14
-
15
- The package of @azure/arm-databricks is using our next generation design principles since version 3.0.0-beta.3, which contains breaking changes.
5
+ The package of @azure/arm-databricks is using our next generation design principles since version 3.0.0-beta.4, which contains breaking changes.
16
6
 
17
7
  To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
18
8
 
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
  var coreLro = require('@azure/core-lro');
9
9
 
10
10
  function _interopNamespace(e) {
@@ -28,6 +28,38 @@ function _interopNamespace(e) {
28
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
29
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
30
 
31
+ /*
32
+ * Copyright (c) Microsoft Corporation.
33
+ * Licensed under the MIT License.
34
+ *
35
+ * Code generated by Microsoft (R) AutoRest Code Generator.
36
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
37
+ */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given a result page from a pageable operation, returns a
41
+ * continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page A result object from calling .byPage() on a paged operation.
44
+ * @returns The continuation token that can be passed into byPage().
45
+ */
46
+ function getContinuationToken(page) {
47
+ var _a;
48
+ if (typeof page !== "object" || page === null) {
49
+ return undefined;
50
+ }
51
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
52
+ }
53
+ function setContinuationToken(page, continuationToken) {
54
+ var _a;
55
+ if (typeof page !== "object" || page === null || !continuationToken) {
56
+ return;
57
+ }
58
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
59
+ pageInfo.continuationToken = continuationToken;
60
+ pageMap.set(page, pageInfo);
61
+ }
62
+
31
63
  /*
32
64
  * Copyright (c) Microsoft Corporation.
33
65
  * Licensed under the MIT License.
@@ -38,87 +70,129 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
38
70
  /** Known values of {@link CustomParameterType} that the service accepts. */
39
71
  exports.KnownCustomParameterType = void 0;
40
72
  (function (KnownCustomParameterType) {
73
+ /** Bool */
41
74
  KnownCustomParameterType["Bool"] = "Bool";
75
+ /** Object */
42
76
  KnownCustomParameterType["Object"] = "Object";
77
+ /** String */
43
78
  KnownCustomParameterType["String"] = "String";
44
79
  })(exports.KnownCustomParameterType || (exports.KnownCustomParameterType = {}));
45
80
  /** Known values of {@link KeySource} that the service accepts. */
46
81
  exports.KnownKeySource = void 0;
47
82
  (function (KnownKeySource) {
83
+ /** Default */
48
84
  KnownKeySource["Default"] = "Default";
85
+ /** MicrosoftKeyvault */
49
86
  KnownKeySource["MicrosoftKeyvault"] = "Microsoft.Keyvault";
50
87
  })(exports.KnownKeySource || (exports.KnownKeySource = {}));
51
88
  /** Known values of {@link ProvisioningState} that the service accepts. */
52
89
  exports.KnownProvisioningState = void 0;
53
90
  (function (KnownProvisioningState) {
91
+ /** Accepted */
54
92
  KnownProvisioningState["Accepted"] = "Accepted";
93
+ /** Running */
55
94
  KnownProvisioningState["Running"] = "Running";
95
+ /** Ready */
56
96
  KnownProvisioningState["Ready"] = "Ready";
97
+ /** Creating */
57
98
  KnownProvisioningState["Creating"] = "Creating";
99
+ /** Created */
58
100
  KnownProvisioningState["Created"] = "Created";
101
+ /** Deleting */
59
102
  KnownProvisioningState["Deleting"] = "Deleting";
103
+ /** Deleted */
60
104
  KnownProvisioningState["Deleted"] = "Deleted";
105
+ /** Canceled */
61
106
  KnownProvisioningState["Canceled"] = "Canceled";
107
+ /** Failed */
62
108
  KnownProvisioningState["Failed"] = "Failed";
109
+ /** Succeeded */
63
110
  KnownProvisioningState["Succeeded"] = "Succeeded";
111
+ /** Updating */
64
112
  KnownProvisioningState["Updating"] = "Updating";
65
113
  })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
66
114
  /** Known values of {@link EncryptionKeySource} that the service accepts. */
67
115
  exports.KnownEncryptionKeySource = void 0;
68
116
  (function (KnownEncryptionKeySource) {
117
+ /** MicrosoftKeyvault */
69
118
  KnownEncryptionKeySource["MicrosoftKeyvault"] = "Microsoft.Keyvault";
70
119
  })(exports.KnownEncryptionKeySource || (exports.KnownEncryptionKeySource = {}));
71
120
  /** Known values of {@link PrivateLinkServiceConnectionStatus} that the service accepts. */
72
121
  exports.KnownPrivateLinkServiceConnectionStatus = void 0;
73
122
  (function (KnownPrivateLinkServiceConnectionStatus) {
123
+ /** Pending */
74
124
  KnownPrivateLinkServiceConnectionStatus["Pending"] = "Pending";
125
+ /** Approved */
75
126
  KnownPrivateLinkServiceConnectionStatus["Approved"] = "Approved";
127
+ /** Rejected */
76
128
  KnownPrivateLinkServiceConnectionStatus["Rejected"] = "Rejected";
129
+ /** Disconnected */
77
130
  KnownPrivateLinkServiceConnectionStatus["Disconnected"] = "Disconnected";
78
131
  })(exports.KnownPrivateLinkServiceConnectionStatus || (exports.KnownPrivateLinkServiceConnectionStatus = {}));
79
132
  /** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */
80
133
  exports.KnownPrivateEndpointConnectionProvisioningState = void 0;
81
134
  (function (KnownPrivateEndpointConnectionProvisioningState) {
135
+ /** Succeeded */
82
136
  KnownPrivateEndpointConnectionProvisioningState["Succeeded"] = "Succeeded";
137
+ /** Creating */
83
138
  KnownPrivateEndpointConnectionProvisioningState["Creating"] = "Creating";
139
+ /** Updating */
84
140
  KnownPrivateEndpointConnectionProvisioningState["Updating"] = "Updating";
141
+ /** Deleting */
85
142
  KnownPrivateEndpointConnectionProvisioningState["Deleting"] = "Deleting";
143
+ /** Failed */
86
144
  KnownPrivateEndpointConnectionProvisioningState["Failed"] = "Failed";
87
145
  })(exports.KnownPrivateEndpointConnectionProvisioningState || (exports.KnownPrivateEndpointConnectionProvisioningState = {}));
88
146
  /** Known values of {@link PublicNetworkAccess} that the service accepts. */
89
147
  exports.KnownPublicNetworkAccess = void 0;
90
148
  (function (KnownPublicNetworkAccess) {
149
+ /** Enabled */
91
150
  KnownPublicNetworkAccess["Enabled"] = "Enabled";
151
+ /** Disabled */
92
152
  KnownPublicNetworkAccess["Disabled"] = "Disabled";
93
153
  })(exports.KnownPublicNetworkAccess || (exports.KnownPublicNetworkAccess = {}));
94
154
  /** Known values of {@link RequiredNsgRules} that the service accepts. */
95
155
  exports.KnownRequiredNsgRules = void 0;
96
156
  (function (KnownRequiredNsgRules) {
157
+ /** AllRules */
97
158
  KnownRequiredNsgRules["AllRules"] = "AllRules";
159
+ /** NoAzureDatabricksRules */
98
160
  KnownRequiredNsgRules["NoAzureDatabricksRules"] = "NoAzureDatabricksRules";
161
+ /** NoAzureServiceRules */
99
162
  KnownRequiredNsgRules["NoAzureServiceRules"] = "NoAzureServiceRules";
100
163
  })(exports.KnownRequiredNsgRules || (exports.KnownRequiredNsgRules = {}));
101
164
  /** Known values of {@link CreatedByType} that the service accepts. */
102
165
  exports.KnownCreatedByType = void 0;
103
166
  (function (KnownCreatedByType) {
167
+ /** User */
104
168
  KnownCreatedByType["User"] = "User";
169
+ /** Application */
105
170
  KnownCreatedByType["Application"] = "Application";
171
+ /** ManagedIdentity */
106
172
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
173
+ /** Key */
107
174
  KnownCreatedByType["Key"] = "Key";
108
175
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
109
176
  /** Known values of {@link PeeringState} that the service accepts. */
110
177
  exports.KnownPeeringState = void 0;
111
178
  (function (KnownPeeringState) {
179
+ /** Initiated */
112
180
  KnownPeeringState["Initiated"] = "Initiated";
181
+ /** Connected */
113
182
  KnownPeeringState["Connected"] = "Connected";
183
+ /** Disconnected */
114
184
  KnownPeeringState["Disconnected"] = "Disconnected";
115
185
  })(exports.KnownPeeringState || (exports.KnownPeeringState = {}));
116
186
  /** Known values of {@link PeeringProvisioningState} that the service accepts. */
117
187
  exports.KnownPeeringProvisioningState = void 0;
118
188
  (function (KnownPeeringProvisioningState) {
189
+ /** Succeeded */
119
190
  KnownPeeringProvisioningState["Succeeded"] = "Succeeded";
191
+ /** Updating */
120
192
  KnownPeeringProvisioningState["Updating"] = "Updating";
193
+ /** Deleting */
121
194
  KnownPeeringProvisioningState["Deleting"] = "Deleting";
195
+ /** Failed */
122
196
  KnownPeeringProvisioningState["Failed"] = "Failed";
123
197
  })(exports.KnownPeeringProvisioningState || (exports.KnownPeeringProvisioningState = {}));
124
198
 
@@ -1673,20 +1747,31 @@ class WorkspacesImpl {
1673
1747
  [Symbol.asyncIterator]() {
1674
1748
  return this;
1675
1749
  },
1676
- byPage: () => {
1677
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1750
+ byPage: (settings) => {
1751
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1752
+ throw new Error("maxPageSize is not supported by this operation.");
1753
+ }
1754
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1678
1755
  }
1679
1756
  };
1680
1757
  }
1681
- listByResourceGroupPagingPage(resourceGroupName, options) {
1758
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1682
1759
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1683
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1684
- yield yield tslib.__await(result.value || []);
1685
- let continuationToken = result.nextLink;
1760
+ let result;
1761
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1762
+ if (!continuationToken) {
1763
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1764
+ let page = result.value || [];
1765
+ continuationToken = result.nextLink;
1766
+ setContinuationToken(page, continuationToken);
1767
+ yield yield tslib.__await(page);
1768
+ }
1686
1769
  while (continuationToken) {
1687
1770
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1688
1771
  continuationToken = result.nextLink;
1689
- yield yield tslib.__await(result.value || []);
1772
+ let page = result.value || [];
1773
+ setContinuationToken(page, continuationToken);
1774
+ yield yield tslib.__await(page);
1690
1775
  }
1691
1776
  });
1692
1777
  }
@@ -1721,20 +1806,31 @@ class WorkspacesImpl {
1721
1806
  [Symbol.asyncIterator]() {
1722
1807
  return this;
1723
1808
  },
1724
- byPage: () => {
1725
- return this.listBySubscriptionPagingPage(options);
1809
+ byPage: (settings) => {
1810
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1811
+ throw new Error("maxPageSize is not supported by this operation.");
1812
+ }
1813
+ return this.listBySubscriptionPagingPage(options, settings);
1726
1814
  }
1727
1815
  };
1728
1816
  }
1729
- listBySubscriptionPagingPage(options) {
1817
+ listBySubscriptionPagingPage(options, settings) {
1730
1818
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1731
- let result = yield tslib.__await(this._listBySubscription(options));
1732
- yield yield tslib.__await(result.value || []);
1733
- let continuationToken = result.nextLink;
1819
+ let result;
1820
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1821
+ if (!continuationToken) {
1822
+ result = yield tslib.__await(this._listBySubscription(options));
1823
+ let page = result.value || [];
1824
+ continuationToken = result.nextLink;
1825
+ setContinuationToken(page, continuationToken);
1826
+ yield yield tslib.__await(page);
1827
+ }
1734
1828
  while (continuationToken) {
1735
1829
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1736
1830
  continuationToken = result.nextLink;
1737
- yield yield tslib.__await(result.value || []);
1831
+ let page = result.value || [];
1832
+ setContinuationToken(page, continuationToken);
1833
+ yield yield tslib.__await(page);
1738
1834
  }
1739
1835
  });
1740
1836
  }
@@ -2172,20 +2268,31 @@ class OperationsImpl {
2172
2268
  [Symbol.asyncIterator]() {
2173
2269
  return this;
2174
2270
  },
2175
- byPage: () => {
2176
- return this.listPagingPage(options);
2271
+ byPage: (settings) => {
2272
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2273
+ throw new Error("maxPageSize is not supported by this operation.");
2274
+ }
2275
+ return this.listPagingPage(options, settings);
2177
2276
  }
2178
2277
  };
2179
2278
  }
2180
- listPagingPage(options) {
2279
+ listPagingPage(options, settings) {
2181
2280
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2182
- let result = yield tslib.__await(this._list(options));
2183
- yield yield tslib.__await(result.value || []);
2184
- let continuationToken = result.nextLink;
2281
+ let result;
2282
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2283
+ if (!continuationToken) {
2284
+ result = yield tslib.__await(this._list(options));
2285
+ let page = result.value || [];
2286
+ continuationToken = result.nextLink;
2287
+ setContinuationToken(page, continuationToken);
2288
+ yield yield tslib.__await(page);
2289
+ }
2185
2290
  while (continuationToken) {
2186
2291
  result = yield tslib.__await(this._listNext(continuationToken, options));
2187
2292
  continuationToken = result.nextLink;
2188
- yield yield tslib.__await(result.value || []);
2293
+ let page = result.value || [];
2294
+ setContinuationToken(page, continuationToken);
2295
+ yield yield tslib.__await(page);
2189
2296
  }
2190
2297
  });
2191
2298
  }
@@ -2290,20 +2397,31 @@ class PrivateLinkResourcesImpl {
2290
2397
  [Symbol.asyncIterator]() {
2291
2398
  return this;
2292
2399
  },
2293
- byPage: () => {
2294
- return this.listPagingPage(resourceGroupName, workspaceName, options);
2400
+ byPage: (settings) => {
2401
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2402
+ throw new Error("maxPageSize is not supported by this operation.");
2403
+ }
2404
+ return this.listPagingPage(resourceGroupName, workspaceName, options, settings);
2295
2405
  }
2296
2406
  };
2297
2407
  }
2298
- listPagingPage(resourceGroupName, workspaceName, options) {
2408
+ listPagingPage(resourceGroupName, workspaceName, options, settings) {
2299
2409
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2300
- let result = yield tslib.__await(this._list(resourceGroupName, workspaceName, options));
2301
- yield yield tslib.__await(result.value || []);
2302
- let continuationToken = result.nextLink;
2410
+ let result;
2411
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2412
+ if (!continuationToken) {
2413
+ result = yield tslib.__await(this._list(resourceGroupName, workspaceName, options));
2414
+ let page = result.value || [];
2415
+ continuationToken = result.nextLink;
2416
+ setContinuationToken(page, continuationToken);
2417
+ yield yield tslib.__await(page);
2418
+ }
2303
2419
  while (continuationToken) {
2304
2420
  result = yield tslib.__await(this._listNext(resourceGroupName, workspaceName, continuationToken, options));
2305
2421
  continuationToken = result.nextLink;
2306
- yield yield tslib.__await(result.value || []);
2422
+ let page = result.value || [];
2423
+ setContinuationToken(page, continuationToken);
2424
+ yield yield tslib.__await(page);
2307
2425
  }
2308
2426
  });
2309
2427
  }
@@ -2455,20 +2573,31 @@ class PrivateEndpointConnectionsImpl {
2455
2573
  [Symbol.asyncIterator]() {
2456
2574
  return this;
2457
2575
  },
2458
- byPage: () => {
2459
- return this.listPagingPage(resourceGroupName, workspaceName, options);
2576
+ byPage: (settings) => {
2577
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2578
+ throw new Error("maxPageSize is not supported by this operation.");
2579
+ }
2580
+ return this.listPagingPage(resourceGroupName, workspaceName, options, settings);
2460
2581
  }
2461
2582
  };
2462
2583
  }
2463
- listPagingPage(resourceGroupName, workspaceName, options) {
2584
+ listPagingPage(resourceGroupName, workspaceName, options, settings) {
2464
2585
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2465
- let result = yield tslib.__await(this._list(resourceGroupName, workspaceName, options));
2466
- yield yield tslib.__await(result.value || []);
2467
- let continuationToken = result.nextLink;
2586
+ let result;
2587
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2588
+ if (!continuationToken) {
2589
+ result = yield tslib.__await(this._list(resourceGroupName, workspaceName, options));
2590
+ let page = result.value || [];
2591
+ continuationToken = result.nextLink;
2592
+ setContinuationToken(page, continuationToken);
2593
+ yield yield tslib.__await(page);
2594
+ }
2468
2595
  while (continuationToken) {
2469
2596
  result = yield tslib.__await(this._listNext(resourceGroupName, workspaceName, continuationToken, options));
2470
2597
  continuationToken = result.nextLink;
2471
- yield yield tslib.__await(result.value || []);
2598
+ let page = result.value || [];
2599
+ setContinuationToken(page, continuationToken);
2600
+ yield yield tslib.__await(page);
2472
2601
  }
2473
2602
  });
2474
2603
  }
@@ -2862,20 +2991,31 @@ class VNetPeeringImpl {
2862
2991
  [Symbol.asyncIterator]() {
2863
2992
  return this;
2864
2993
  },
2865
- byPage: () => {
2866
- return this.listByWorkspacePagingPage(resourceGroupName, workspaceName, options);
2994
+ byPage: (settings) => {
2995
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2996
+ throw new Error("maxPageSize is not supported by this operation.");
2997
+ }
2998
+ return this.listByWorkspacePagingPage(resourceGroupName, workspaceName, options, settings);
2867
2999
  }
2868
3000
  };
2869
3001
  }
2870
- listByWorkspacePagingPage(resourceGroupName, workspaceName, options) {
3002
+ listByWorkspacePagingPage(resourceGroupName, workspaceName, options, settings) {
2871
3003
  return tslib.__asyncGenerator(this, arguments, function* listByWorkspacePagingPage_1() {
2872
- let result = yield tslib.__await(this._listByWorkspace(resourceGroupName, workspaceName, options));
2873
- yield yield tslib.__await(result.value || []);
2874
- let continuationToken = result.nextLink;
3004
+ let result;
3005
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
3006
+ if (!continuationToken) {
3007
+ result = yield tslib.__await(this._listByWorkspace(resourceGroupName, workspaceName, options));
3008
+ let page = result.value || [];
3009
+ continuationToken = result.nextLink;
3010
+ setContinuationToken(page, continuationToken);
3011
+ yield yield tslib.__await(page);
3012
+ }
2875
3013
  while (continuationToken) {
2876
3014
  result = yield tslib.__await(this._listByWorkspaceNext(resourceGroupName, workspaceName, continuationToken, options));
2877
3015
  continuationToken = result.nextLink;
2878
- yield yield tslib.__await(result.value || []);
3016
+ let page = result.value || [];
3017
+ setContinuationToken(page, continuationToken);
3018
+ yield yield tslib.__await(page);
2879
3019
  }
2880
3020
  });
2881
3021
  }
@@ -3181,7 +3321,7 @@ class AzureDatabricksManagementClient extends coreClient__namespace.ServiceClien
3181
3321
  * @param options The parameter options
3182
3322
  */
3183
3323
  constructor(credentials, subscriptionId, options) {
3184
- var _a, _b;
3324
+ var _a, _b, _c;
3185
3325
  if (credentials === undefined) {
3186
3326
  throw new Error("'credentials' cannot be null");
3187
3327
  }
@@ -3200,28 +3340,30 @@ class AzureDatabricksManagementClient extends coreClient__namespace.ServiceClien
3200
3340
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3201
3341
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3202
3342
  : `${packageDetails}`;
3203
- if (!options.credentialScopes) {
3204
- options.credentialScopes = ["https://management.azure.com/.default"];
3205
- }
3206
3343
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
3207
3344
  userAgentPrefix
3208
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3345
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3209
3346
  super(optionsWithDefaults);
3347
+ let bearerTokenAuthenticationPolicyFound = false;
3210
3348
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
3211
3349
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
3212
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
3350
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
3213
3351
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
3214
- if (!bearerTokenAuthenticationPolicyFound) {
3215
- this.pipeline.removePolicy({
3216
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
3217
- });
3218
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3219
- scopes: `${optionsWithDefaults.baseUri}/.default`,
3220
- challengeCallbacks: {
3221
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3222
- }
3223
- }));
3224
- }
3352
+ }
3353
+ if (!options ||
3354
+ !options.pipeline ||
3355
+ options.pipeline.getOrderedPolicies().length == 0 ||
3356
+ !bearerTokenAuthenticationPolicyFound) {
3357
+ this.pipeline.removePolicy({
3358
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
3359
+ });
3360
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3361
+ credential: credentials,
3362
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
3363
+ challengeCallbacks: {
3364
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3365
+ }
3366
+ }));
3225
3367
  }
3226
3368
  // Parameter assignments
3227
3369
  this.subscriptionId = subscriptionId;
@@ -3234,8 +3376,37 @@ class AzureDatabricksManagementClient extends coreClient__namespace.ServiceClien
3234
3376
  this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
3235
3377
  this.outboundNetworkDependenciesEndpoints = new OutboundNetworkDependenciesEndpointsImpl(this);
3236
3378
  this.vNetPeering = new VNetPeeringImpl(this);
3379
+ this.addCustomApiVersionPolicy(options.apiVersion);
3380
+ }
3381
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
3382
+ addCustomApiVersionPolicy(apiVersion) {
3383
+ if (!apiVersion) {
3384
+ return;
3385
+ }
3386
+ const apiVersionPolicy = {
3387
+ name: "CustomApiVersionPolicy",
3388
+ sendRequest(request, next) {
3389
+ return tslib.__awaiter(this, void 0, void 0, function* () {
3390
+ const param = request.url.split("?");
3391
+ if (param.length > 1) {
3392
+ const newParams = param[1].split("&").map((item) => {
3393
+ if (item.indexOf("api-version") > -1) {
3394
+ return "api-version=" + apiVersion;
3395
+ }
3396
+ else {
3397
+ return item;
3398
+ }
3399
+ });
3400
+ request.url = param[0] + "?" + newParams.join("&");
3401
+ }
3402
+ return next(request);
3403
+ });
3404
+ }
3405
+ };
3406
+ this.pipeline.addPolicy(apiVersionPolicy);
3237
3407
  }
3238
3408
  }
3239
3409
 
3240
3410
  exports.AzureDatabricksManagementClient = AzureDatabricksManagementClient;
3411
+ exports.getContinuationToken = getContinuationToken;
3241
3412
  //# sourceMappingURL=index.js.map