@azure/arm-domainservices 4.0.2-alpha.20221102.1 → 4.1.0-alpha.20221123.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -11
  2. package/dist/index.js +206 -54
  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/domainServicesResourceProvider.d.ts +2 -0
  7. package/dist-esm/src/domainServicesResourceProvider.d.ts.map +1 -1
  8. package/dist-esm/src/domainServicesResourceProvider.js +49 -18
  9. package/dist-esm/src/domainServicesResourceProvider.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 +38 -4
  15. package/dist-esm/src/models/index.d.ts.map +1 -1
  16. package/dist-esm/src/models/index.js +34 -0
  17. package/dist-esm/src/models/index.js.map +1 -1
  18. package/dist-esm/src/operations/domainServiceOperations.d.ts.map +1 -1
  19. package/dist-esm/src/operations/domainServiceOperations.js +19 -7
  20. package/dist-esm/src/operations/domainServiceOperations.js.map +1 -1
  21. package/dist-esm/src/operations/domainServices.d.ts.map +1 -1
  22. package/dist-esm/src/operations/domainServices.js +37 -14
  23. package/dist-esm/src/operations/domainServices.js.map +1 -1
  24. package/dist-esm/src/operations/ouContainerOperationGrp.d.ts.map +1 -1
  25. package/dist-esm/src/operations/ouContainerOperationGrp.js +19 -7
  26. package/dist-esm/src/operations/ouContainerOperationGrp.js.map +1 -1
  27. package/dist-esm/src/operations/ouContainerOperations.d.ts.map +1 -1
  28. package/dist-esm/src/operations/ouContainerOperations.js +19 -7
  29. package/dist-esm/src/operations/ouContainerOperations.js.map +1 -1
  30. package/dist-esm/src/pagingHelper.d.ts +13 -0
  31. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  32. package/dist-esm/src/pagingHelper.js +32 -0
  33. package/dist-esm/src/pagingHelper.js.map +1 -0
  34. package/dist-esm/test/sampleTest.js +11 -13
  35. package/dist-esm/test/sampleTest.js.map +1 -1
  36. package/package.json +12 -8
  37. package/review/arm-domainservices.api.md +23 -54
  38. package/src/domainServicesResourceProvider.ts +60 -20
  39. package/src/index.ts +1 -0
  40. package/src/models/index.ts +38 -4
  41. package/src/operations/domainServiceOperations.ts +21 -8
  42. package/src/operations/domainServices.ts +45 -16
  43. package/src/operations/ouContainerOperationGrp.ts +22 -12
  44. package/src/operations/ouContainerOperations.ts +21 -8
  45. package/src/pagingHelper.ts +39 -0
  46. package/types/arm-domainservices.d.ts +49 -4
package/CHANGELOG.md CHANGED
@@ -1,15 +1,12 @@
1
1
  # Release History
2
-
3
- ## 4.0.2 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
2
+
3
+ ## 4.1.0 (2022-11-22)
4
+
5
+ **Features**
6
+
7
+ - Added Interface DomainService
8
+ - Added Interface OuContainer
9
+
13
10
  ## 4.0.1 (2022-04-18)
14
11
 
15
12
  **features**
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,91 +70,125 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
38
70
  /** Known values of {@link Ldaps} that the service accepts. */
39
71
  exports.KnownLdaps = void 0;
40
72
  (function (KnownLdaps) {
73
+ /** Enabled */
41
74
  KnownLdaps["Enabled"] = "Enabled";
75
+ /** Disabled */
42
76
  KnownLdaps["Disabled"] = "Disabled";
43
77
  })(exports.KnownLdaps || (exports.KnownLdaps = {}));
44
78
  /** Known values of {@link ExternalAccess} that the service accepts. */
45
79
  exports.KnownExternalAccess = void 0;
46
80
  (function (KnownExternalAccess) {
81
+ /** Enabled */
47
82
  KnownExternalAccess["Enabled"] = "Enabled";
83
+ /** Disabled */
48
84
  KnownExternalAccess["Disabled"] = "Disabled";
49
85
  })(exports.KnownExternalAccess || (exports.KnownExternalAccess = {}));
50
86
  /** Known values of {@link NtlmV1} that the service accepts. */
51
87
  exports.KnownNtlmV1 = void 0;
52
88
  (function (KnownNtlmV1) {
89
+ /** Enabled */
53
90
  KnownNtlmV1["Enabled"] = "Enabled";
91
+ /** Disabled */
54
92
  KnownNtlmV1["Disabled"] = "Disabled";
55
93
  })(exports.KnownNtlmV1 || (exports.KnownNtlmV1 = {}));
56
94
  /** Known values of {@link TlsV1} that the service accepts. */
57
95
  exports.KnownTlsV1 = void 0;
58
96
  (function (KnownTlsV1) {
97
+ /** Enabled */
59
98
  KnownTlsV1["Enabled"] = "Enabled";
99
+ /** Disabled */
60
100
  KnownTlsV1["Disabled"] = "Disabled";
61
101
  })(exports.KnownTlsV1 || (exports.KnownTlsV1 = {}));
62
102
  /** Known values of {@link SyncNtlmPasswords} that the service accepts. */
63
103
  exports.KnownSyncNtlmPasswords = void 0;
64
104
  (function (KnownSyncNtlmPasswords) {
105
+ /** Enabled */
65
106
  KnownSyncNtlmPasswords["Enabled"] = "Enabled";
107
+ /** Disabled */
66
108
  KnownSyncNtlmPasswords["Disabled"] = "Disabled";
67
109
  })(exports.KnownSyncNtlmPasswords || (exports.KnownSyncNtlmPasswords = {}));
68
110
  /** Known values of {@link SyncKerberosPasswords} that the service accepts. */
69
111
  exports.KnownSyncKerberosPasswords = void 0;
70
112
  (function (KnownSyncKerberosPasswords) {
113
+ /** Enabled */
71
114
  KnownSyncKerberosPasswords["Enabled"] = "Enabled";
115
+ /** Disabled */
72
116
  KnownSyncKerberosPasswords["Disabled"] = "Disabled";
73
117
  })(exports.KnownSyncKerberosPasswords || (exports.KnownSyncKerberosPasswords = {}));
74
118
  /** Known values of {@link SyncOnPremPasswords} that the service accepts. */
75
119
  exports.KnownSyncOnPremPasswords = void 0;
76
120
  (function (KnownSyncOnPremPasswords) {
121
+ /** Enabled */
77
122
  KnownSyncOnPremPasswords["Enabled"] = "Enabled";
123
+ /** Disabled */
78
124
  KnownSyncOnPremPasswords["Disabled"] = "Disabled";
79
125
  })(exports.KnownSyncOnPremPasswords || (exports.KnownSyncOnPremPasswords = {}));
80
126
  /** Known values of {@link KerberosRc4Encryption} that the service accepts. */
81
127
  exports.KnownKerberosRc4Encryption = void 0;
82
128
  (function (KnownKerberosRc4Encryption) {
129
+ /** Enabled */
83
130
  KnownKerberosRc4Encryption["Enabled"] = "Enabled";
131
+ /** Disabled */
84
132
  KnownKerberosRc4Encryption["Disabled"] = "Disabled";
85
133
  })(exports.KnownKerberosRc4Encryption || (exports.KnownKerberosRc4Encryption = {}));
86
134
  /** Known values of {@link KerberosArmoring} that the service accepts. */
87
135
  exports.KnownKerberosArmoring = void 0;
88
136
  (function (KnownKerberosArmoring) {
137
+ /** Enabled */
89
138
  KnownKerberosArmoring["Enabled"] = "Enabled";
139
+ /** Disabled */
90
140
  KnownKerberosArmoring["Disabled"] = "Disabled";
91
141
  })(exports.KnownKerberosArmoring || (exports.KnownKerberosArmoring = {}));
92
142
  /** Known values of {@link FilteredSync} that the service accepts. */
93
143
  exports.KnownFilteredSync = void 0;
94
144
  (function (KnownFilteredSync) {
145
+ /** Enabled */
95
146
  KnownFilteredSync["Enabled"] = "Enabled";
147
+ /** Disabled */
96
148
  KnownFilteredSync["Disabled"] = "Disabled";
97
149
  })(exports.KnownFilteredSync || (exports.KnownFilteredSync = {}));
98
150
  /** Known values of {@link NotifyGlobalAdmins} that the service accepts. */
99
151
  exports.KnownNotifyGlobalAdmins = void 0;
100
152
  (function (KnownNotifyGlobalAdmins) {
153
+ /** Enabled */
101
154
  KnownNotifyGlobalAdmins["Enabled"] = "Enabled";
155
+ /** Disabled */
102
156
  KnownNotifyGlobalAdmins["Disabled"] = "Disabled";
103
157
  })(exports.KnownNotifyGlobalAdmins || (exports.KnownNotifyGlobalAdmins = {}));
104
158
  /** Known values of {@link NotifyDcAdmins} that the service accepts. */
105
159
  exports.KnownNotifyDcAdmins = void 0;
106
160
  (function (KnownNotifyDcAdmins) {
161
+ /** Enabled */
107
162
  KnownNotifyDcAdmins["Enabled"] = "Enabled";
163
+ /** Disabled */
108
164
  KnownNotifyDcAdmins["Disabled"] = "Disabled";
109
165
  })(exports.KnownNotifyDcAdmins || (exports.KnownNotifyDcAdmins = {}));
110
166
  /** Known values of {@link Status} that the service accepts. */
111
167
  exports.KnownStatus = void 0;
112
168
  (function (KnownStatus) {
169
+ /** None */
113
170
  KnownStatus["None"] = "None";
171
+ /** Running */
114
172
  KnownStatus["Running"] = "Running";
173
+ /** OK */
115
174
  KnownStatus["OK"] = "OK";
175
+ /** Failure */
116
176
  KnownStatus["Failure"] = "Failure";
177
+ /** Warning */
117
178
  KnownStatus["Warning"] = "Warning";
179
+ /** Skipped */
118
180
  KnownStatus["Skipped"] = "Skipped";
119
181
  })(exports.KnownStatus || (exports.KnownStatus = {}));
120
182
  /** Known values of {@link CreatedByType} that the service accepts. */
121
183
  exports.KnownCreatedByType = void 0;
122
184
  (function (KnownCreatedByType) {
185
+ /** User */
123
186
  KnownCreatedByType["User"] = "User";
187
+ /** Application */
124
188
  KnownCreatedByType["Application"] = "Application";
189
+ /** ManagedIdentity */
125
190
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
191
+ /** Key */
126
192
  KnownCreatedByType["Key"] = "Key";
127
193
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
128
194
 
@@ -1316,20 +1382,31 @@ class DomainServiceOperationsImpl {
1316
1382
  [Symbol.asyncIterator]() {
1317
1383
  return this;
1318
1384
  },
1319
- byPage: () => {
1320
- return this.listPagingPage(options);
1385
+ byPage: (settings) => {
1386
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1387
+ throw new Error("maxPageSize is not supported by this operation.");
1388
+ }
1389
+ return this.listPagingPage(options, settings);
1321
1390
  }
1322
1391
  };
1323
1392
  }
1324
- listPagingPage(options) {
1393
+ listPagingPage(options, settings) {
1325
1394
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1326
- let result = yield tslib.__await(this._list(options));
1327
- yield yield tslib.__await(result.value || []);
1328
- let continuationToken = result.nextLink;
1395
+ let result;
1396
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1397
+ if (!continuationToken) {
1398
+ result = yield tslib.__await(this._list(options));
1399
+ let page = result.value || [];
1400
+ continuationToken = result.nextLink;
1401
+ setContinuationToken(page, continuationToken);
1402
+ yield yield tslib.__await(page);
1403
+ }
1329
1404
  while (continuationToken) {
1330
1405
  result = yield tslib.__await(this._listNext(continuationToken, options));
1331
1406
  continuationToken = result.nextLink;
1332
- yield yield tslib.__await(result.value || []);
1407
+ let page = result.value || [];
1408
+ setContinuationToken(page, continuationToken);
1409
+ yield yield tslib.__await(page);
1333
1410
  }
1334
1411
  });
1335
1412
  }
@@ -1461,20 +1538,31 @@ class DomainServicesImpl {
1461
1538
  [Symbol.asyncIterator]() {
1462
1539
  return this;
1463
1540
  },
1464
- byPage: () => {
1465
- return this.listPagingPage(options);
1541
+ byPage: (settings) => {
1542
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1543
+ throw new Error("maxPageSize is not supported by this operation.");
1544
+ }
1545
+ return this.listPagingPage(options, settings);
1466
1546
  }
1467
1547
  };
1468
1548
  }
1469
- listPagingPage(options) {
1549
+ listPagingPage(options, settings) {
1470
1550
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1471
- let result = yield tslib.__await(this._list(options));
1472
- yield yield tslib.__await(result.value || []);
1473
- let continuationToken = result.nextLink;
1551
+ let result;
1552
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1553
+ if (!continuationToken) {
1554
+ result = yield tslib.__await(this._list(options));
1555
+ let page = result.value || [];
1556
+ continuationToken = result.nextLink;
1557
+ setContinuationToken(page, continuationToken);
1558
+ yield yield tslib.__await(page);
1559
+ }
1474
1560
  while (continuationToken) {
1475
1561
  result = yield tslib.__await(this._listNext(continuationToken, options));
1476
1562
  continuationToken = result.nextLink;
1477
- yield yield tslib.__await(result.value || []);
1563
+ let page = result.value || [];
1564
+ setContinuationToken(page, continuationToken);
1565
+ yield yield tslib.__await(page);
1478
1566
  }
1479
1567
  });
1480
1568
  }
@@ -1512,20 +1600,31 @@ class DomainServicesImpl {
1512
1600
  [Symbol.asyncIterator]() {
1513
1601
  return this;
1514
1602
  },
1515
- byPage: () => {
1516
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1603
+ byPage: (settings) => {
1604
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1605
+ throw new Error("maxPageSize is not supported by this operation.");
1606
+ }
1607
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1517
1608
  }
1518
1609
  };
1519
1610
  }
1520
- listByResourceGroupPagingPage(resourceGroupName, options) {
1611
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1521
1612
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1522
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1523
- yield yield tslib.__await(result.value || []);
1524
- let continuationToken = result.nextLink;
1613
+ let result;
1614
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1615
+ if (!continuationToken) {
1616
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1617
+ let page = result.value || [];
1618
+ continuationToken = result.nextLink;
1619
+ setContinuationToken(page, continuationToken);
1620
+ yield yield tslib.__await(page);
1621
+ }
1525
1622
  while (continuationToken) {
1526
1623
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1527
1624
  continuationToken = result.nextLink;
1528
- yield yield tslib.__await(result.value || []);
1625
+ let page = result.value || [];
1626
+ setContinuationToken(page, continuationToken);
1627
+ yield yield tslib.__await(page);
1529
1628
  }
1530
1629
  });
1531
1630
  }
@@ -1980,20 +2079,31 @@ class OuContainerOperationsImpl {
1980
2079
  [Symbol.asyncIterator]() {
1981
2080
  return this;
1982
2081
  },
1983
- byPage: () => {
1984
- return this.listPagingPage(options);
2082
+ byPage: (settings) => {
2083
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2084
+ throw new Error("maxPageSize is not supported by this operation.");
2085
+ }
2086
+ return this.listPagingPage(options, settings);
1985
2087
  }
1986
2088
  };
1987
2089
  }
1988
- listPagingPage(options) {
2090
+ listPagingPage(options, settings) {
1989
2091
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1990
- let result = yield tslib.__await(this._list(options));
1991
- yield yield tslib.__await(result.value || []);
1992
- let continuationToken = result.nextLink;
2092
+ let result;
2093
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2094
+ if (!continuationToken) {
2095
+ result = yield tslib.__await(this._list(options));
2096
+ let page = result.value || [];
2097
+ continuationToken = result.nextLink;
2098
+ setContinuationToken(page, continuationToken);
2099
+ yield yield tslib.__await(page);
2100
+ }
1993
2101
  while (continuationToken) {
1994
2102
  result = yield tslib.__await(this._listNext(continuationToken, options));
1995
2103
  continuationToken = result.nextLink;
1996
- yield yield tslib.__await(result.value || []);
2104
+ let page = result.value || [];
2105
+ setContinuationToken(page, continuationToken);
2106
+ yield yield tslib.__await(page);
1997
2107
  }
1998
2108
  });
1999
2109
  }
@@ -2099,20 +2209,31 @@ class OuContainerOperationGrpImpl {
2099
2209
  [Symbol.asyncIterator]() {
2100
2210
  return this;
2101
2211
  },
2102
- byPage: () => {
2103
- return this.listPagingPage(resourceGroupName, domainServiceName, options);
2212
+ byPage: (settings) => {
2213
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2214
+ throw new Error("maxPageSize is not supported by this operation.");
2215
+ }
2216
+ return this.listPagingPage(resourceGroupName, domainServiceName, options, settings);
2104
2217
  }
2105
2218
  };
2106
2219
  }
2107
- listPagingPage(resourceGroupName, domainServiceName, options) {
2220
+ listPagingPage(resourceGroupName, domainServiceName, options, settings) {
2108
2221
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2109
- let result = yield tslib.__await(this._list(resourceGroupName, domainServiceName, options));
2110
- yield yield tslib.__await(result.value || []);
2111
- let continuationToken = result.nextLink;
2222
+ let result;
2223
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2224
+ if (!continuationToken) {
2225
+ result = yield tslib.__await(this._list(resourceGroupName, domainServiceName, options));
2226
+ let page = result.value || [];
2227
+ continuationToken = result.nextLink;
2228
+ setContinuationToken(page, continuationToken);
2229
+ yield yield tslib.__await(page);
2230
+ }
2112
2231
  while (continuationToken) {
2113
2232
  result = yield tslib.__await(this._listNext(resourceGroupName, domainServiceName, continuationToken, options));
2114
2233
  continuationToken = result.nextLink;
2115
- yield yield tslib.__await(result.value || []);
2234
+ let page = result.value || [];
2235
+ setContinuationToken(page, continuationToken);
2236
+ yield yield tslib.__await(page);
2116
2237
  }
2117
2238
  });
2118
2239
  }
@@ -2523,7 +2644,7 @@ class DomainServicesResourceProvider extends coreClient__namespace.ServiceClient
2523
2644
  * @param options The parameter options
2524
2645
  */
2525
2646
  constructor(credentials, subscriptionId, options) {
2526
- var _a, _b;
2647
+ var _a, _b, _c;
2527
2648
  if (credentials === undefined) {
2528
2649
  throw new Error("'credentials' cannot be null");
2529
2650
  }
@@ -2538,32 +2659,34 @@ class DomainServicesResourceProvider extends coreClient__namespace.ServiceClient
2538
2659
  requestContentType: "application/json; charset=utf-8",
2539
2660
  credential: credentials
2540
2661
  };
2541
- const packageDetails = `azsdk-js-arm-domainservices/4.0.2`;
2662
+ const packageDetails = `azsdk-js-arm-domainservices/4.1.0`;
2542
2663
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2543
2664
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2544
2665
  : `${packageDetails}`;
2545
- if (!options.credentialScopes) {
2546
- options.credentialScopes = ["https://management.azure.com/.default"];
2547
- }
2548
2666
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2549
2667
  userAgentPrefix
2550
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2668
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
2551
2669
  super(optionsWithDefaults);
2670
+ let bearerTokenAuthenticationPolicyFound = false;
2552
2671
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2553
2672
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
2554
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2673
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2555
2674
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2556
- if (!bearerTokenAuthenticationPolicyFound) {
2557
- this.pipeline.removePolicy({
2558
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2559
- });
2560
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2561
- scopes: `${optionsWithDefaults.baseUri}/.default`,
2562
- challengeCallbacks: {
2563
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2564
- }
2565
- }));
2566
- }
2675
+ }
2676
+ if (!options ||
2677
+ !options.pipeline ||
2678
+ options.pipeline.getOrderedPolicies().length == 0 ||
2679
+ !bearerTokenAuthenticationPolicyFound) {
2680
+ this.pipeline.removePolicy({
2681
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2682
+ });
2683
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2684
+ credential: credentials,
2685
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2686
+ challengeCallbacks: {
2687
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2688
+ }
2689
+ }));
2567
2690
  }
2568
2691
  // Parameter assignments
2569
2692
  this.subscriptionId = subscriptionId;
@@ -2574,8 +2697,37 @@ class DomainServicesResourceProvider extends coreClient__namespace.ServiceClient
2574
2697
  this.domainServices = new DomainServicesImpl(this);
2575
2698
  this.ouContainerOperations = new OuContainerOperationsImpl(this);
2576
2699
  this.ouContainerOperationGrp = new OuContainerOperationGrpImpl(this);
2700
+ this.addCustomApiVersionPolicy(options.apiVersion);
2701
+ }
2702
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2703
+ addCustomApiVersionPolicy(apiVersion) {
2704
+ if (!apiVersion) {
2705
+ return;
2706
+ }
2707
+ const apiVersionPolicy = {
2708
+ name: "CustomApiVersionPolicy",
2709
+ sendRequest(request, next) {
2710
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2711
+ const param = request.url.split("?");
2712
+ if (param.length > 1) {
2713
+ const newParams = param[1].split("&").map((item) => {
2714
+ if (item.indexOf("api-version") > -1) {
2715
+ return "api-version=" + apiVersion;
2716
+ }
2717
+ else {
2718
+ return item;
2719
+ }
2720
+ });
2721
+ request.url = param[0] + "?" + newParams.join("&");
2722
+ }
2723
+ return next(request);
2724
+ });
2725
+ }
2726
+ };
2727
+ this.pipeline.addPolicy(apiVersionPolicy);
2577
2728
  }
2578
2729
  }
2579
2730
 
2580
2731
  exports.DomainServicesResourceProvider = DomainServicesResourceProvider;
2732
+ exports.getContinuationToken = getContinuationToken;
2581
2733
  //# sourceMappingURL=index.js.map