@azure/arm-redisenterprisecache 2.1.1-alpha.20221213.1 → 2.2.0

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 (59) hide show
  1. package/CHANGELOG.md +12 -10
  2. package/dist/index.js +245 -49
  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/index.d.ts +1 -0
  7. package/dist-esm/src/index.d.ts.map +1 -1
  8. package/dist-esm/src/index.js +1 -0
  9. package/dist-esm/src/index.js.map +1 -1
  10. package/dist-esm/src/models/index.d.ts +73 -11
  11. package/dist-esm/src/models/index.d.ts.map +1 -1
  12. package/dist-esm/src/models/index.js +61 -0
  13. package/dist-esm/src/models/index.js.map +1 -1
  14. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  15. package/dist-esm/src/models/parameters.js +6 -0
  16. package/dist-esm/src/models/parameters.js.map +1 -1
  17. package/dist-esm/src/operations/databases.d.ts.map +1 -1
  18. package/dist-esm/src/operations/databases.js +19 -8
  19. package/dist-esm/src/operations/databases.js.map +1 -1
  20. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  21. package/dist-esm/src/operations/operations.js +19 -8
  22. package/dist-esm/src/operations/operations.js.map +1 -1
  23. package/dist-esm/src/operations/operationsStatus.d.ts +2 -2
  24. package/dist-esm/src/operations/operationsStatus.js +2 -2
  25. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  26. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  27. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  28. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -1
  29. package/dist-esm/src/operations/privateLinkResources.js +8 -4
  30. package/dist-esm/src/operations/privateLinkResources.js.map +1 -1
  31. package/dist-esm/src/operations/redisEnterprise.d.ts.map +1 -1
  32. package/dist-esm/src/operations/redisEnterprise.js +37 -16
  33. package/dist-esm/src/operations/redisEnterprise.js.map +1 -1
  34. package/dist-esm/src/operationsInterfaces/operationsStatus.d.ts +2 -2
  35. package/dist-esm/src/pagingHelper.d.ts +13 -0
  36. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  37. package/dist-esm/src/pagingHelper.js +32 -0
  38. package/dist-esm/src/pagingHelper.js.map +1 -0
  39. package/dist-esm/src/redisEnterpriseManagementClient.d.ts +2 -0
  40. package/dist-esm/src/redisEnterpriseManagementClient.d.ts.map +1 -1
  41. package/dist-esm/src/redisEnterpriseManagementClient.js +54 -6
  42. package/dist-esm/src/redisEnterpriseManagementClient.js.map +1 -1
  43. package/dist-esm/test/sampleTest.js +11 -13
  44. package/dist-esm/test/sampleTest.js.map +1 -1
  45. package/package.json +14 -10
  46. package/review/arm-redisenterprisecache.api.md +26 -83
  47. package/src/index.ts +1 -0
  48. package/src/models/index.ts +72 -11
  49. package/src/models/parameters.ts +6 -0
  50. package/src/operations/databases.ts +26 -13
  51. package/src/operations/operations.ts +21 -9
  52. package/src/operations/operationsStatus.ts +2 -2
  53. package/src/operations/privateEndpointConnections.ts +15 -5
  54. package/src/operations/privateLinkResources.ts +11 -9
  55. package/src/operations/redisEnterprise.ts +46 -19
  56. package/src/operationsInterfaces/operationsStatus.ts +2 -2
  57. package/src/pagingHelper.ts +39 -0
  58. package/src/redisEnterpriseManagementClient.ts +69 -5
  59. package/types/arm-redisenterprisecache.d.ts +86 -13
package/CHANGELOG.md CHANGED
@@ -1,15 +1,17 @@
1
1
  # Release History
2
+
3
+ ## 2.2.0 (2022-12-07)
4
+
5
+ **Features**
2
6
 
3
- ## 2.1.1 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
7
+ - Added Interface Cluster
8
+ - Added Interface Database
9
+ - Added Interface PrivateEndpointConnection
10
+ - Added Interface PrivateLinkResource
11
+ - Added Interface ProxyResource
12
+ - Added Interface TrackedResource
13
+
14
+
13
15
  ## 2.1.0 (2022-04-11)
14
16
 
15
17
  **Features**
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,39 @@ function _interopNamespace(e) {
25
26
  }
26
27
 
27
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
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 the last `.value` produced by the `byPage` iterator,
41
+ * returns a continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
44
+ * @returns The continuation token that can be passed into byPage() during future calls.
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
+ }
28
62
 
29
63
  /*
30
64
  * Copyright (c) Microsoft Corporation.
@@ -36,118 +70,179 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
36
70
  /** Known values of {@link Origin} that the service accepts. */
37
71
  exports.KnownOrigin = void 0;
38
72
  (function (KnownOrigin) {
73
+ /** User */
39
74
  KnownOrigin["User"] = "user";
75
+ /** System */
40
76
  KnownOrigin["System"] = "system";
77
+ /** UserSystem */
41
78
  KnownOrigin["UserSystem"] = "user,system";
42
79
  })(exports.KnownOrigin || (exports.KnownOrigin = {}));
43
80
  /** Known values of {@link ActionType} that the service accepts. */
44
81
  exports.KnownActionType = void 0;
45
82
  (function (KnownActionType) {
83
+ /** Internal */
46
84
  KnownActionType["Internal"] = "Internal";
47
85
  })(exports.KnownActionType || (exports.KnownActionType = {}));
48
86
  /** Known values of {@link SkuName} that the service accepts. */
49
87
  exports.KnownSkuName = void 0;
50
88
  (function (KnownSkuName) {
89
+ /** EnterpriseE10 */
51
90
  KnownSkuName["EnterpriseE10"] = "Enterprise_E10";
91
+ /** EnterpriseE20 */
52
92
  KnownSkuName["EnterpriseE20"] = "Enterprise_E20";
93
+ /** EnterpriseE50 */
53
94
  KnownSkuName["EnterpriseE50"] = "Enterprise_E50";
95
+ /** EnterpriseE100 */
54
96
  KnownSkuName["EnterpriseE100"] = "Enterprise_E100";
97
+ /** EnterpriseFlashF300 */
55
98
  KnownSkuName["EnterpriseFlashF300"] = "EnterpriseFlash_F300";
99
+ /** EnterpriseFlashF700 */
56
100
  KnownSkuName["EnterpriseFlashF700"] = "EnterpriseFlash_F700";
101
+ /** EnterpriseFlashF1500 */
57
102
  KnownSkuName["EnterpriseFlashF1500"] = "EnterpriseFlash_F1500";
58
103
  })(exports.KnownSkuName || (exports.KnownSkuName = {}));
59
104
  /** Known values of {@link TlsVersion} that the service accepts. */
60
105
  exports.KnownTlsVersion = void 0;
61
106
  (function (KnownTlsVersion) {
107
+ /** One0 */
62
108
  KnownTlsVersion["One0"] = "1.0";
109
+ /** One1 */
63
110
  KnownTlsVersion["One1"] = "1.1";
111
+ /** One2 */
64
112
  KnownTlsVersion["One2"] = "1.2";
65
113
  })(exports.KnownTlsVersion || (exports.KnownTlsVersion = {}));
66
114
  /** Known values of {@link ProvisioningState} that the service accepts. */
67
115
  exports.KnownProvisioningState = void 0;
68
116
  (function (KnownProvisioningState) {
117
+ /** Succeeded */
69
118
  KnownProvisioningState["Succeeded"] = "Succeeded";
119
+ /** Failed */
70
120
  KnownProvisioningState["Failed"] = "Failed";
121
+ /** Canceled */
71
122
  KnownProvisioningState["Canceled"] = "Canceled";
123
+ /** Creating */
72
124
  KnownProvisioningState["Creating"] = "Creating";
125
+ /** Updating */
73
126
  KnownProvisioningState["Updating"] = "Updating";
127
+ /** Deleting */
74
128
  KnownProvisioningState["Deleting"] = "Deleting";
75
129
  })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
76
130
  /** Known values of {@link ResourceState} that the service accepts. */
77
131
  exports.KnownResourceState = void 0;
78
132
  (function (KnownResourceState) {
133
+ /** Running */
79
134
  KnownResourceState["Running"] = "Running";
135
+ /** Creating */
80
136
  KnownResourceState["Creating"] = "Creating";
137
+ /** CreateFailed */
81
138
  KnownResourceState["CreateFailed"] = "CreateFailed";
139
+ /** Updating */
82
140
  KnownResourceState["Updating"] = "Updating";
141
+ /** UpdateFailed */
83
142
  KnownResourceState["UpdateFailed"] = "UpdateFailed";
143
+ /** Deleting */
84
144
  KnownResourceState["Deleting"] = "Deleting";
145
+ /** DeleteFailed */
85
146
  KnownResourceState["DeleteFailed"] = "DeleteFailed";
147
+ /** Enabling */
86
148
  KnownResourceState["Enabling"] = "Enabling";
149
+ /** EnableFailed */
87
150
  KnownResourceState["EnableFailed"] = "EnableFailed";
151
+ /** Disabling */
88
152
  KnownResourceState["Disabling"] = "Disabling";
153
+ /** DisableFailed */
89
154
  KnownResourceState["DisableFailed"] = "DisableFailed";
155
+ /** Disabled */
90
156
  KnownResourceState["Disabled"] = "Disabled";
91
157
  })(exports.KnownResourceState || (exports.KnownResourceState = {}));
92
158
  /** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */
93
159
  exports.KnownPrivateEndpointServiceConnectionStatus = void 0;
94
160
  (function (KnownPrivateEndpointServiceConnectionStatus) {
161
+ /** Pending */
95
162
  KnownPrivateEndpointServiceConnectionStatus["Pending"] = "Pending";
163
+ /** Approved */
96
164
  KnownPrivateEndpointServiceConnectionStatus["Approved"] = "Approved";
165
+ /** Rejected */
97
166
  KnownPrivateEndpointServiceConnectionStatus["Rejected"] = "Rejected";
98
167
  })(exports.KnownPrivateEndpointServiceConnectionStatus || (exports.KnownPrivateEndpointServiceConnectionStatus = {}));
99
168
  /** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */
100
169
  exports.KnownPrivateEndpointConnectionProvisioningState = void 0;
101
170
  (function (KnownPrivateEndpointConnectionProvisioningState) {
171
+ /** Succeeded */
102
172
  KnownPrivateEndpointConnectionProvisioningState["Succeeded"] = "Succeeded";
173
+ /** Creating */
103
174
  KnownPrivateEndpointConnectionProvisioningState["Creating"] = "Creating";
175
+ /** Deleting */
104
176
  KnownPrivateEndpointConnectionProvisioningState["Deleting"] = "Deleting";
177
+ /** Failed */
105
178
  KnownPrivateEndpointConnectionProvisioningState["Failed"] = "Failed";
106
179
  })(exports.KnownPrivateEndpointConnectionProvisioningState || (exports.KnownPrivateEndpointConnectionProvisioningState = {}));
107
180
  /** Known values of {@link Protocol} that the service accepts. */
108
181
  exports.KnownProtocol = void 0;
109
182
  (function (KnownProtocol) {
183
+ /** Encrypted */
110
184
  KnownProtocol["Encrypted"] = "Encrypted";
185
+ /** Plaintext */
111
186
  KnownProtocol["Plaintext"] = "Plaintext";
112
187
  })(exports.KnownProtocol || (exports.KnownProtocol = {}));
113
188
  /** Known values of {@link ClusteringPolicy} that the service accepts. */
114
189
  exports.KnownClusteringPolicy = void 0;
115
190
  (function (KnownClusteringPolicy) {
191
+ /** EnterpriseCluster */
116
192
  KnownClusteringPolicy["EnterpriseCluster"] = "EnterpriseCluster";
193
+ /** OSSCluster */
117
194
  KnownClusteringPolicy["OSSCluster"] = "OSSCluster";
118
195
  })(exports.KnownClusteringPolicy || (exports.KnownClusteringPolicy = {}));
119
196
  /** Known values of {@link EvictionPolicy} that the service accepts. */
120
197
  exports.KnownEvictionPolicy = void 0;
121
198
  (function (KnownEvictionPolicy) {
199
+ /** AllKeysLFU */
122
200
  KnownEvictionPolicy["AllKeysLFU"] = "AllKeysLFU";
201
+ /** AllKeysLRU */
123
202
  KnownEvictionPolicy["AllKeysLRU"] = "AllKeysLRU";
203
+ /** AllKeysRandom */
124
204
  KnownEvictionPolicy["AllKeysRandom"] = "AllKeysRandom";
205
+ /** VolatileLRU */
125
206
  KnownEvictionPolicy["VolatileLRU"] = "VolatileLRU";
207
+ /** VolatileLFU */
126
208
  KnownEvictionPolicy["VolatileLFU"] = "VolatileLFU";
209
+ /** VolatileTTL */
127
210
  KnownEvictionPolicy["VolatileTTL"] = "VolatileTTL";
211
+ /** VolatileRandom */
128
212
  KnownEvictionPolicy["VolatileRandom"] = "VolatileRandom";
213
+ /** NoEviction */
129
214
  KnownEvictionPolicy["NoEviction"] = "NoEviction";
130
215
  })(exports.KnownEvictionPolicy || (exports.KnownEvictionPolicy = {}));
131
216
  /** Known values of {@link AofFrequency} that the service accepts. */
132
217
  exports.KnownAofFrequency = void 0;
133
218
  (function (KnownAofFrequency) {
219
+ /** OneS */
134
220
  KnownAofFrequency["OneS"] = "1s";
221
+ /** Always */
135
222
  KnownAofFrequency["Always"] = "always";
136
223
  })(exports.KnownAofFrequency || (exports.KnownAofFrequency = {}));
137
224
  /** Known values of {@link RdbFrequency} that the service accepts. */
138
225
  exports.KnownRdbFrequency = void 0;
139
226
  (function (KnownRdbFrequency) {
227
+ /** OneH */
140
228
  KnownRdbFrequency["OneH"] = "1h";
229
+ /** SixH */
141
230
  KnownRdbFrequency["SixH"] = "6h";
231
+ /** TwelveH */
142
232
  KnownRdbFrequency["TwelveH"] = "12h";
143
233
  })(exports.KnownRdbFrequency || (exports.KnownRdbFrequency = {}));
144
234
  /** Known values of {@link LinkState} that the service accepts. */
145
235
  exports.KnownLinkState = void 0;
146
236
  (function (KnownLinkState) {
237
+ /** Linked */
147
238
  KnownLinkState["Linked"] = "Linked";
239
+ /** Linking */
148
240
  KnownLinkState["Linking"] = "Linking";
241
+ /** Unlinking */
149
242
  KnownLinkState["Unlinking"] = "Unlinking";
243
+ /** LinkFailed */
150
244
  KnownLinkState["LinkFailed"] = "LinkFailed";
245
+ /** UnlinkFailed */
151
246
  KnownLinkState["UnlinkFailed"] = "UnlinkFailed";
152
247
  })(exports.KnownLinkState || (exports.KnownLinkState = {}));
153
248
 
@@ -1231,6 +1326,9 @@ const nextLink = {
1231
1326
  const location = {
1232
1327
  parameterPath: "location",
1233
1328
  mapper: {
1329
+ constraints: {
1330
+ MinLength: 1
1331
+ },
1234
1332
  serializedName: "location",
1235
1333
  required: true,
1236
1334
  type: {
@@ -1241,6 +1339,9 @@ const location = {
1241
1339
  const operationId = {
1242
1340
  parameterPath: "operationId",
1243
1341
  mapper: {
1342
+ constraints: {
1343
+ MinLength: 1
1344
+ },
1244
1345
  serializedName: "operationId",
1245
1346
  required: true,
1246
1347
  type: {
@@ -1383,20 +1484,31 @@ class OperationsImpl {
1383
1484
  [Symbol.asyncIterator]() {
1384
1485
  return this;
1385
1486
  },
1386
- byPage: () => {
1387
- return this.listPagingPage(options);
1487
+ byPage: (settings) => {
1488
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1489
+ throw new Error("maxPageSize is not supported by this operation.");
1490
+ }
1491
+ return this.listPagingPage(options, settings);
1388
1492
  }
1389
1493
  };
1390
1494
  }
1391
- listPagingPage(options) {
1495
+ listPagingPage(options, settings) {
1392
1496
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1393
- let result = yield tslib.__await(this._list(options));
1394
- yield yield tslib.__await(result.value || []);
1395
- let continuationToken = result.nextLink;
1497
+ let result;
1498
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1499
+ if (!continuationToken) {
1500
+ result = yield tslib.__await(this._list(options));
1501
+ let page = result.value || [];
1502
+ continuationToken = result.nextLink;
1503
+ setContinuationToken(page, continuationToken);
1504
+ yield yield tslib.__await(page);
1505
+ }
1396
1506
  while (continuationToken) {
1397
1507
  result = yield tslib.__await(this._listNext(continuationToken, options));
1398
1508
  continuationToken = result.nextLink;
1399
- yield yield tslib.__await(result.value || []);
1509
+ let page = result.value || [];
1510
+ setContinuationToken(page, continuationToken);
1511
+ yield yield tslib.__await(page);
1400
1512
  }
1401
1513
  });
1402
1514
  }
@@ -1463,7 +1575,6 @@ const listNextOperationSpec$1 = {
1463
1575
  bodyMapper: ErrorResponse
1464
1576
  }
1465
1577
  },
1466
- queryParameters: [apiVersion],
1467
1578
  urlParameters: [$host, nextLink],
1468
1579
  headerParameters: [accept],
1469
1580
  serializer: serializer$5
@@ -1487,8 +1598,8 @@ class OperationsStatusImpl {
1487
1598
  }
1488
1599
  /**
1489
1600
  * Gets the status of operation.
1490
- * @param location The region the operation is in.
1491
- * @param operationId The operation's unique identifier.
1601
+ * @param location The name of Azure region.
1602
+ * @param operationId The ID of an ongoing async operation.
1492
1603
  * @param options The options parameters.
1493
1604
  */
1494
1605
  get(location, operationId, options) {
@@ -1578,20 +1689,31 @@ class RedisEnterpriseImpl {
1578
1689
  [Symbol.asyncIterator]() {
1579
1690
  return this;
1580
1691
  },
1581
- byPage: () => {
1582
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1692
+ byPage: (settings) => {
1693
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1694
+ throw new Error("maxPageSize is not supported by this operation.");
1695
+ }
1696
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1583
1697
  }
1584
1698
  };
1585
1699
  }
1586
- listByResourceGroupPagingPage(resourceGroupName, options) {
1700
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1587
1701
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1588
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1589
- yield yield tslib.__await(result.value || []);
1590
- let continuationToken = result.nextLink;
1702
+ let result;
1703
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1704
+ if (!continuationToken) {
1705
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1706
+ let page = result.value || [];
1707
+ continuationToken = result.nextLink;
1708
+ setContinuationToken(page, continuationToken);
1709
+ yield yield tslib.__await(page);
1710
+ }
1591
1711
  while (continuationToken) {
1592
1712
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1593
1713
  continuationToken = result.nextLink;
1594
- yield yield tslib.__await(result.value || []);
1714
+ let page = result.value || [];
1715
+ setContinuationToken(page, continuationToken);
1716
+ yield yield tslib.__await(page);
1595
1717
  }
1596
1718
  });
1597
1719
  }
@@ -1626,20 +1748,31 @@ class RedisEnterpriseImpl {
1626
1748
  [Symbol.asyncIterator]() {
1627
1749
  return this;
1628
1750
  },
1629
- byPage: () => {
1630
- return this.listPagingPage(options);
1751
+ byPage: (settings) => {
1752
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1753
+ throw new Error("maxPageSize is not supported by this operation.");
1754
+ }
1755
+ return this.listPagingPage(options, settings);
1631
1756
  }
1632
1757
  };
1633
1758
  }
1634
- listPagingPage(options) {
1759
+ listPagingPage(options, settings) {
1635
1760
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1636
- let result = yield tslib.__await(this._list(options));
1637
- yield yield tslib.__await(result.value || []);
1638
- let continuationToken = result.nextLink;
1761
+ let result;
1762
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1763
+ if (!continuationToken) {
1764
+ result = yield tslib.__await(this._list(options));
1765
+ let page = result.value || [];
1766
+ continuationToken = result.nextLink;
1767
+ setContinuationToken(page, continuationToken);
1768
+ yield yield tslib.__await(page);
1769
+ }
1639
1770
  while (continuationToken) {
1640
1771
  result = yield tslib.__await(this._listNext(continuationToken, options));
1641
1772
  continuationToken = result.nextLink;
1642
- yield yield tslib.__await(result.value || []);
1773
+ let page = result.value || [];
1774
+ setContinuationToken(page, continuationToken);
1775
+ yield yield tslib.__await(page);
1643
1776
  }
1644
1777
  });
1645
1778
  }
@@ -2019,7 +2152,6 @@ const listByResourceGroupNextOperationSpec = {
2019
2152
  bodyMapper: ErrorResponse
2020
2153
  }
2021
2154
  },
2022
- queryParameters: [apiVersion],
2023
2155
  urlParameters: [
2024
2156
  $host,
2025
2157
  nextLink,
@@ -2040,7 +2172,6 @@ const listNextOperationSpec = {
2040
2172
  bodyMapper: ErrorResponse
2041
2173
  }
2042
2174
  },
2043
- queryParameters: [apiVersion],
2044
2175
  urlParameters: [
2045
2176
  $host,
2046
2177
  nextLink,
@@ -2082,20 +2213,31 @@ class DatabasesImpl {
2082
2213
  [Symbol.asyncIterator]() {
2083
2214
  return this;
2084
2215
  },
2085
- byPage: () => {
2086
- return this.listByClusterPagingPage(resourceGroupName, clusterName, options);
2216
+ byPage: (settings) => {
2217
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2218
+ throw new Error("maxPageSize is not supported by this operation.");
2219
+ }
2220
+ return this.listByClusterPagingPage(resourceGroupName, clusterName, options, settings);
2087
2221
  }
2088
2222
  };
2089
2223
  }
2090
- listByClusterPagingPage(resourceGroupName, clusterName, options) {
2224
+ listByClusterPagingPage(resourceGroupName, clusterName, options, settings) {
2091
2225
  return tslib.__asyncGenerator(this, arguments, function* listByClusterPagingPage_1() {
2092
- let result = yield tslib.__await(this._listByCluster(resourceGroupName, clusterName, options));
2093
- yield yield tslib.__await(result.value || []);
2094
- let continuationToken = result.nextLink;
2226
+ let result;
2227
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2228
+ if (!continuationToken) {
2229
+ result = yield tslib.__await(this._listByCluster(resourceGroupName, clusterName, options));
2230
+ let page = result.value || [];
2231
+ continuationToken = result.nextLink;
2232
+ setContinuationToken(page, continuationToken);
2233
+ yield yield tslib.__await(page);
2234
+ }
2095
2235
  while (continuationToken) {
2096
2236
  result = yield tslib.__await(this._listByClusterNext(resourceGroupName, clusterName, continuationToken, options));
2097
2237
  continuationToken = result.nextLink;
2098
- yield yield tslib.__await(result.value || []);
2238
+ let page = result.value || [];
2239
+ setContinuationToken(page, continuationToken);
2240
+ yield yield tslib.__await(page);
2099
2241
  }
2100
2242
  });
2101
2243
  }
@@ -2822,7 +2964,6 @@ const listByClusterNextOperationSpec = {
2822
2964
  bodyMapper: ErrorResponse
2823
2965
  }
2824
2966
  },
2825
- queryParameters: [apiVersion],
2826
2967
  urlParameters: [
2827
2968
  $host,
2828
2969
  nextLink,
@@ -2866,14 +3007,18 @@ class PrivateEndpointConnectionsImpl {
2866
3007
  [Symbol.asyncIterator]() {
2867
3008
  return this;
2868
3009
  },
2869
- byPage: () => {
2870
- return this.listPagingPage(resourceGroupName, clusterName, options);
3010
+ byPage: (settings) => {
3011
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3012
+ throw new Error("maxPageSize is not supported by this operation.");
3013
+ }
3014
+ return this.listPagingPage(resourceGroupName, clusterName, options, settings);
2871
3015
  }
2872
3016
  };
2873
3017
  }
2874
- listPagingPage(resourceGroupName, clusterName, options) {
3018
+ listPagingPage(resourceGroupName, clusterName, options, _settings) {
2875
3019
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2876
- let result = yield tslib.__await(this._list(resourceGroupName, clusterName, options));
3020
+ let result;
3021
+ result = yield tslib.__await(this._list(resourceGroupName, clusterName, options));
2877
3022
  yield yield tslib.__await(result.value || []);
2878
3023
  });
2879
3024
  }
@@ -3134,14 +3279,18 @@ class PrivateLinkResourcesImpl {
3134
3279
  [Symbol.asyncIterator]() {
3135
3280
  return this;
3136
3281
  },
3137
- byPage: () => {
3138
- return this.listByClusterPagingPage(resourceGroupName, clusterName, options);
3282
+ byPage: (settings) => {
3283
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3284
+ throw new Error("maxPageSize is not supported by this operation.");
3285
+ }
3286
+ return this.listByClusterPagingPage(resourceGroupName, clusterName, options, settings);
3139
3287
  }
3140
3288
  };
3141
3289
  }
3142
- listByClusterPagingPage(resourceGroupName, clusterName, options) {
3290
+ listByClusterPagingPage(resourceGroupName, clusterName, options, _settings) {
3143
3291
  return tslib.__asyncGenerator(this, arguments, function* listByClusterPagingPage_1() {
3144
- let result = yield tslib.__await(this._listByCluster(resourceGroupName, clusterName, options));
3292
+ let result;
3293
+ result = yield tslib.__await(this._listByCluster(resourceGroupName, clusterName, options));
3145
3294
  yield yield tslib.__await(result.value || []);
3146
3295
  });
3147
3296
  }
@@ -3212,7 +3361,7 @@ class RedisEnterpriseManagementClient extends coreClient__namespace.ServiceClien
3212
3361
  * @param options The parameter options
3213
3362
  */
3214
3363
  constructor(credentials, subscriptionId, options) {
3215
- var _a, _b;
3364
+ var _a, _b, _c;
3216
3365
  if (credentials === undefined) {
3217
3366
  throw new Error("'credentials' cannot be null");
3218
3367
  }
@@ -3227,17 +3376,35 @@ class RedisEnterpriseManagementClient extends coreClient__namespace.ServiceClien
3227
3376
  requestContentType: "application/json; charset=utf-8",
3228
3377
  credential: credentials
3229
3378
  };
3230
- const packageDetails = `azsdk-js-arm-redisenterprisecache/2.1.1`;
3379
+ const packageDetails = `azsdk-js-arm-redisenterprisecache/2.2.0`;
3231
3380
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3232
3381
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3233
3382
  : `${packageDetails}`;
3234
- if (!options.credentialScopes) {
3235
- options.credentialScopes = ["https://management.azure.com/.default"];
3236
- }
3237
3383
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
3238
3384
  userAgentPrefix
3239
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3385
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3240
3386
  super(optionsWithDefaults);
3387
+ let bearerTokenAuthenticationPolicyFound = false;
3388
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
3389
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
3390
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
3391
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
3392
+ }
3393
+ if (!options ||
3394
+ !options.pipeline ||
3395
+ options.pipeline.getOrderedPolicies().length == 0 ||
3396
+ !bearerTokenAuthenticationPolicyFound) {
3397
+ this.pipeline.removePolicy({
3398
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
3399
+ });
3400
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3401
+ credential: credentials,
3402
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
3403
+ challengeCallbacks: {
3404
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3405
+ }
3406
+ }));
3407
+ }
3241
3408
  // Parameter assignments
3242
3409
  this.subscriptionId = subscriptionId;
3243
3410
  // Assigning values to Constant parameters
@@ -3249,8 +3416,37 @@ class RedisEnterpriseManagementClient extends coreClient__namespace.ServiceClien
3249
3416
  this.databases = new DatabasesImpl(this);
3250
3417
  this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
3251
3418
  this.privateLinkResources = new PrivateLinkResourcesImpl(this);
3419
+ this.addCustomApiVersionPolicy(options.apiVersion);
3420
+ }
3421
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
3422
+ addCustomApiVersionPolicy(apiVersion) {
3423
+ if (!apiVersion) {
3424
+ return;
3425
+ }
3426
+ const apiVersionPolicy = {
3427
+ name: "CustomApiVersionPolicy",
3428
+ sendRequest(request, next) {
3429
+ return tslib.__awaiter(this, void 0, void 0, function* () {
3430
+ const param = request.url.split("?");
3431
+ if (param.length > 1) {
3432
+ const newParams = param[1].split("&").map((item) => {
3433
+ if (item.indexOf("api-version") > -1) {
3434
+ return "api-version=" + apiVersion;
3435
+ }
3436
+ else {
3437
+ return item;
3438
+ }
3439
+ });
3440
+ request.url = param[0] + "?" + newParams.join("&");
3441
+ }
3442
+ return next(request);
3443
+ });
3444
+ }
3445
+ };
3446
+ this.pipeline.addPolicy(apiVersionPolicy);
3252
3447
  }
3253
3448
  }
3254
3449
 
3255
3450
  exports.RedisEnterpriseManagementClient = RedisEnterpriseManagementClient;
3451
+ exports.getContinuationToken = getContinuationToken;
3256
3452
  //# sourceMappingURL=index.js.map