@azure/arm-advisor 3.0.4-alpha.20221102.1 → 3.1.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.
- package/CHANGELOG.md +9 -11
- package/dist/index.js +205 -46
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/src/advisorManagementClient.d.ts +2 -0
- package/dist-esm/src/advisorManagementClient.d.ts.map +1 -1
- package/dist-esm/src/advisorManagementClient.js +54 -6
- package/dist-esm/src/advisorManagementClient.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +25 -6
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +19 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/configurations.d.ts.map +1 -1
- package/dist-esm/src/operations/configurations.js +27 -11
- package/dist-esm/src/operations/configurations.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -7
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/recommendationMetadata.d.ts.map +1 -1
- package/dist-esm/src/operations/recommendationMetadata.js +19 -7
- package/dist-esm/src/operations/recommendationMetadata.js.map +1 -1
- package/dist-esm/src/operations/recommendations.d.ts.map +1 -1
- package/dist-esm/src/operations/recommendations.js +19 -7
- package/dist-esm/src/operations/recommendations.js.map +1 -1
- package/dist-esm/src/operations/suppressions.d.ts.map +1 -1
- package/dist-esm/src/operations/suppressions.js +19 -7
- package/dist-esm/src/operations/suppressions.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/sampleTest.js +11 -13
- package/dist-esm/test/sampleTest.js.map +1 -1
- package/package.json +14 -10
- package/review/arm-advisor.api.md +28 -44
- package/src/advisorManagementClient.ts +69 -6
- package/src/index.ts +1 -0
- package/src/models/index.ts +25 -6
- package/src/operations/configurations.ts +36 -14
- package/src/operations/operations.ts +21 -8
- package/src/operations/recommendationMetadata.ts +22 -9
- package/src/operations/recommendations.ts +22 -9
- package/src/operations/suppressions.ts +22 -9
- package/src/pagingHelper.ts +39 -0
- package/types/arm-advisor.d.ts +36 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# Release History
|
|
2
|
-
|
|
3
|
-
## 3.0
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Other Changes
|
|
12
|
-
|
|
2
|
+
|
|
3
|
+
## 3.1.0 (2022-11-14)
|
|
4
|
+
|
|
5
|
+
**Features**
|
|
6
|
+
|
|
7
|
+
- Added Interface ConfigData
|
|
8
|
+
- Added Interface ResourceRecommendationBase
|
|
9
|
+
- Added Interface SuppressionContract
|
|
10
|
+
|
|
13
11
|
## 3.0.3 (2022-10-08)
|
|
14
12
|
|
|
15
13
|
**Bugs Fixed**
|
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
|
|
|
8
9
|
function _interopNamespace(e) {
|
|
9
10
|
if (e && e.__esModule) return e;
|
|
@@ -24,6 +25,39 @@ function _interopNamespace(e) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
28
|
+
var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* Copyright (c) Microsoft Corporation.
|
|
32
|
+
* Licensed under the MIT License.
|
|
33
|
+
*
|
|
34
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
35
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
36
|
+
*/
|
|
37
|
+
const pageMap = new WeakMap();
|
|
38
|
+
/**
|
|
39
|
+
* Given a result page from a pageable operation, returns a
|
|
40
|
+
* continuation token that can be used to begin paging from
|
|
41
|
+
* that point later.
|
|
42
|
+
* @param page A result object from calling .byPage() on a paged operation.
|
|
43
|
+
* @returns The continuation token that can be passed into byPage().
|
|
44
|
+
*/
|
|
45
|
+
function getContinuationToken(page) {
|
|
46
|
+
var _a;
|
|
47
|
+
if (typeof page !== "object" || page === null) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
|
|
51
|
+
}
|
|
52
|
+
function setContinuationToken(page, continuationToken) {
|
|
53
|
+
var _a;
|
|
54
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
58
|
+
pageInfo.continuationToken = continuationToken;
|
|
59
|
+
pageMap.set(page, pageInfo);
|
|
60
|
+
}
|
|
27
61
|
|
|
28
62
|
/*
|
|
29
63
|
* Copyright (c) Microsoft Corporation.
|
|
@@ -35,48 +69,67 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
|
35
69
|
/** Known values of {@link Scenario} that the service accepts. */
|
|
36
70
|
exports.KnownScenario = void 0;
|
|
37
71
|
(function (KnownScenario) {
|
|
72
|
+
/** Alerts */
|
|
38
73
|
KnownScenario["Alerts"] = "Alerts";
|
|
39
74
|
})(exports.KnownScenario || (exports.KnownScenario = {}));
|
|
40
75
|
/** Known values of {@link CpuThreshold} that the service accepts. */
|
|
41
76
|
exports.KnownCpuThreshold = void 0;
|
|
42
77
|
(function (KnownCpuThreshold) {
|
|
78
|
+
/** Five */
|
|
43
79
|
KnownCpuThreshold["Five"] = "5";
|
|
80
|
+
/** Ten */
|
|
44
81
|
KnownCpuThreshold["Ten"] = "10";
|
|
82
|
+
/** Fifteen */
|
|
45
83
|
KnownCpuThreshold["Fifteen"] = "15";
|
|
84
|
+
/** Twenty */
|
|
46
85
|
KnownCpuThreshold["Twenty"] = "20";
|
|
47
86
|
})(exports.KnownCpuThreshold || (exports.KnownCpuThreshold = {}));
|
|
48
87
|
/** Known values of {@link Category} that the service accepts. */
|
|
49
88
|
exports.KnownCategory = void 0;
|
|
50
89
|
(function (KnownCategory) {
|
|
90
|
+
/** HighAvailability */
|
|
51
91
|
KnownCategory["HighAvailability"] = "HighAvailability";
|
|
92
|
+
/** Security */
|
|
52
93
|
KnownCategory["Security"] = "Security";
|
|
94
|
+
/** Performance */
|
|
53
95
|
KnownCategory["Performance"] = "Performance";
|
|
96
|
+
/** Cost */
|
|
54
97
|
KnownCategory["Cost"] = "Cost";
|
|
98
|
+
/** OperationalExcellence */
|
|
55
99
|
KnownCategory["OperationalExcellence"] = "OperationalExcellence";
|
|
56
100
|
})(exports.KnownCategory || (exports.KnownCategory = {}));
|
|
57
101
|
/** Known values of {@link DigestConfigState} that the service accepts. */
|
|
58
102
|
exports.KnownDigestConfigState = void 0;
|
|
59
103
|
(function (KnownDigestConfigState) {
|
|
104
|
+
/** Active */
|
|
60
105
|
KnownDigestConfigState["Active"] = "Active";
|
|
106
|
+
/** Disabled */
|
|
61
107
|
KnownDigestConfigState["Disabled"] = "Disabled";
|
|
62
108
|
})(exports.KnownDigestConfigState || (exports.KnownDigestConfigState = {}));
|
|
63
109
|
/** Known values of {@link ConfigurationName} that the service accepts. */
|
|
64
110
|
exports.KnownConfigurationName = void 0;
|
|
65
111
|
(function (KnownConfigurationName) {
|
|
112
|
+
/** Default */
|
|
66
113
|
KnownConfigurationName["Default"] = "default";
|
|
67
114
|
})(exports.KnownConfigurationName || (exports.KnownConfigurationName = {}));
|
|
68
115
|
/** Known values of {@link Impact} that the service accepts. */
|
|
69
116
|
exports.KnownImpact = void 0;
|
|
70
117
|
(function (KnownImpact) {
|
|
118
|
+
/** High */
|
|
71
119
|
KnownImpact["High"] = "High";
|
|
120
|
+
/** Medium */
|
|
72
121
|
KnownImpact["Medium"] = "Medium";
|
|
122
|
+
/** Low */
|
|
73
123
|
KnownImpact["Low"] = "Low";
|
|
74
124
|
})(exports.KnownImpact || (exports.KnownImpact = {}));
|
|
75
125
|
/** Known values of {@link Risk} that the service accepts. */
|
|
76
126
|
exports.KnownRisk = void 0;
|
|
77
127
|
(function (KnownRisk) {
|
|
128
|
+
/** Error */
|
|
78
129
|
KnownRisk["Error"] = "Error";
|
|
130
|
+
/** Warning */
|
|
79
131
|
KnownRisk["Warning"] = "Warning";
|
|
132
|
+
/** None */
|
|
80
133
|
KnownRisk["None"] = "None";
|
|
81
134
|
})(exports.KnownRisk || (exports.KnownRisk = {}));
|
|
82
135
|
|
|
@@ -950,20 +1003,31 @@ class RecommendationMetadataImpl {
|
|
|
950
1003
|
[Symbol.asyncIterator]() {
|
|
951
1004
|
return this;
|
|
952
1005
|
},
|
|
953
|
-
byPage: () => {
|
|
954
|
-
|
|
1006
|
+
byPage: (settings) => {
|
|
1007
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1008
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
1009
|
+
}
|
|
1010
|
+
return this.listPagingPage(options, settings);
|
|
955
1011
|
}
|
|
956
1012
|
};
|
|
957
1013
|
}
|
|
958
|
-
listPagingPage(options) {
|
|
1014
|
+
listPagingPage(options, settings) {
|
|
959
1015
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
960
|
-
let result
|
|
961
|
-
|
|
962
|
-
|
|
1016
|
+
let result;
|
|
1017
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1018
|
+
if (!continuationToken) {
|
|
1019
|
+
result = yield tslib.__await(this._list(options));
|
|
1020
|
+
let page = result.value || [];
|
|
1021
|
+
continuationToken = result.nextLink;
|
|
1022
|
+
setContinuationToken(page, continuationToken);
|
|
1023
|
+
yield yield tslib.__await(page);
|
|
1024
|
+
}
|
|
963
1025
|
while (continuationToken) {
|
|
964
1026
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
965
1027
|
continuationToken = result.nextLink;
|
|
966
|
-
|
|
1028
|
+
let page = result.value || [];
|
|
1029
|
+
setContinuationToken(page, continuationToken);
|
|
1030
|
+
yield yield tslib.__await(page);
|
|
967
1031
|
}
|
|
968
1032
|
});
|
|
969
1033
|
}
|
|
@@ -1094,20 +1158,31 @@ class ConfigurationsImpl {
|
|
|
1094
1158
|
[Symbol.asyncIterator]() {
|
|
1095
1159
|
return this;
|
|
1096
1160
|
},
|
|
1097
|
-
byPage: () => {
|
|
1098
|
-
|
|
1161
|
+
byPage: (settings) => {
|
|
1162
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1163
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
1164
|
+
}
|
|
1165
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
|
1099
1166
|
}
|
|
1100
1167
|
};
|
|
1101
1168
|
}
|
|
1102
|
-
listBySubscriptionPagingPage(options) {
|
|
1169
|
+
listBySubscriptionPagingPage(options, settings) {
|
|
1103
1170
|
return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
|
|
1104
|
-
let result
|
|
1105
|
-
|
|
1106
|
-
|
|
1171
|
+
let result;
|
|
1172
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1173
|
+
if (!continuationToken) {
|
|
1174
|
+
result = yield tslib.__await(this._listBySubscription(options));
|
|
1175
|
+
let page = result.value || [];
|
|
1176
|
+
continuationToken = result.nextLink;
|
|
1177
|
+
setContinuationToken(page, continuationToken);
|
|
1178
|
+
yield yield tslib.__await(page);
|
|
1179
|
+
}
|
|
1107
1180
|
while (continuationToken) {
|
|
1108
1181
|
result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
|
|
1109
1182
|
continuationToken = result.nextLink;
|
|
1110
|
-
|
|
1183
|
+
let page = result.value || [];
|
|
1184
|
+
setContinuationToken(page, continuationToken);
|
|
1185
|
+
yield yield tslib.__await(page);
|
|
1111
1186
|
}
|
|
1112
1187
|
});
|
|
1113
1188
|
}
|
|
@@ -1143,14 +1218,18 @@ class ConfigurationsImpl {
|
|
|
1143
1218
|
[Symbol.asyncIterator]() {
|
|
1144
1219
|
return this;
|
|
1145
1220
|
},
|
|
1146
|
-
byPage: () => {
|
|
1147
|
-
|
|
1221
|
+
byPage: (settings) => {
|
|
1222
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1223
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
1224
|
+
}
|
|
1225
|
+
return this.listByResourceGroupPagingPage(resourceGroup, options, settings);
|
|
1148
1226
|
}
|
|
1149
1227
|
};
|
|
1150
1228
|
}
|
|
1151
|
-
listByResourceGroupPagingPage(resourceGroup, options) {
|
|
1229
|
+
listByResourceGroupPagingPage(resourceGroup, options, _settings) {
|
|
1152
1230
|
return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
|
|
1153
|
-
let result
|
|
1231
|
+
let result;
|
|
1232
|
+
result = yield tslib.__await(this._listByResourceGroup(resourceGroup, options));
|
|
1154
1233
|
yield yield tslib.__await(result.value || []);
|
|
1155
1234
|
});
|
|
1156
1235
|
}
|
|
@@ -1351,20 +1430,31 @@ class RecommendationsImpl {
|
|
|
1351
1430
|
[Symbol.asyncIterator]() {
|
|
1352
1431
|
return this;
|
|
1353
1432
|
},
|
|
1354
|
-
byPage: () => {
|
|
1355
|
-
|
|
1433
|
+
byPage: (settings) => {
|
|
1434
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1435
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
1436
|
+
}
|
|
1437
|
+
return this.listPagingPage(options, settings);
|
|
1356
1438
|
}
|
|
1357
1439
|
};
|
|
1358
1440
|
}
|
|
1359
|
-
listPagingPage(options) {
|
|
1441
|
+
listPagingPage(options, settings) {
|
|
1360
1442
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
1361
|
-
let result
|
|
1362
|
-
|
|
1363
|
-
|
|
1443
|
+
let result;
|
|
1444
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1445
|
+
if (!continuationToken) {
|
|
1446
|
+
result = yield tslib.__await(this._list(options));
|
|
1447
|
+
let page = result.value || [];
|
|
1448
|
+
continuationToken = result.nextLink;
|
|
1449
|
+
setContinuationToken(page, continuationToken);
|
|
1450
|
+
yield yield tslib.__await(page);
|
|
1451
|
+
}
|
|
1364
1452
|
while (continuationToken) {
|
|
1365
1453
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
1366
1454
|
continuationToken = result.nextLink;
|
|
1367
|
-
|
|
1455
|
+
let page = result.value || [];
|
|
1456
|
+
setContinuationToken(page, continuationToken);
|
|
1457
|
+
yield yield tslib.__await(page);
|
|
1368
1458
|
}
|
|
1369
1459
|
});
|
|
1370
1460
|
}
|
|
@@ -1566,20 +1656,31 @@ class OperationsImpl {
|
|
|
1566
1656
|
[Symbol.asyncIterator]() {
|
|
1567
1657
|
return this;
|
|
1568
1658
|
},
|
|
1569
|
-
byPage: () => {
|
|
1570
|
-
|
|
1659
|
+
byPage: (settings) => {
|
|
1660
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1661
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
1662
|
+
}
|
|
1663
|
+
return this.listPagingPage(options, settings);
|
|
1571
1664
|
}
|
|
1572
1665
|
};
|
|
1573
1666
|
}
|
|
1574
|
-
listPagingPage(options) {
|
|
1667
|
+
listPagingPage(options, settings) {
|
|
1575
1668
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
1576
|
-
let result
|
|
1577
|
-
|
|
1578
|
-
|
|
1669
|
+
let result;
|
|
1670
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1671
|
+
if (!continuationToken) {
|
|
1672
|
+
result = yield tslib.__await(this._list(options));
|
|
1673
|
+
let page = result.value || [];
|
|
1674
|
+
continuationToken = result.nextLink;
|
|
1675
|
+
setContinuationToken(page, continuationToken);
|
|
1676
|
+
yield yield tslib.__await(page);
|
|
1677
|
+
}
|
|
1579
1678
|
while (continuationToken) {
|
|
1580
1679
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
1581
1680
|
continuationToken = result.nextLink;
|
|
1582
|
-
|
|
1681
|
+
let page = result.value || [];
|
|
1682
|
+
setContinuationToken(page, continuationToken);
|
|
1683
|
+
yield yield tslib.__await(page);
|
|
1583
1684
|
}
|
|
1584
1685
|
});
|
|
1585
1686
|
}
|
|
@@ -1683,20 +1784,31 @@ class SuppressionsImpl {
|
|
|
1683
1784
|
[Symbol.asyncIterator]() {
|
|
1684
1785
|
return this;
|
|
1685
1786
|
},
|
|
1686
|
-
byPage: () => {
|
|
1687
|
-
|
|
1787
|
+
byPage: (settings) => {
|
|
1788
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1789
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
1790
|
+
}
|
|
1791
|
+
return this.listPagingPage(options, settings);
|
|
1688
1792
|
}
|
|
1689
1793
|
};
|
|
1690
1794
|
}
|
|
1691
|
-
listPagingPage(options) {
|
|
1795
|
+
listPagingPage(options, settings) {
|
|
1692
1796
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
1693
|
-
let result
|
|
1694
|
-
|
|
1695
|
-
|
|
1797
|
+
let result;
|
|
1798
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1799
|
+
if (!continuationToken) {
|
|
1800
|
+
result = yield tslib.__await(this._list(options));
|
|
1801
|
+
let page = result.value || [];
|
|
1802
|
+
continuationToken = result.nextLink;
|
|
1803
|
+
setContinuationToken(page, continuationToken);
|
|
1804
|
+
yield yield tslib.__await(page);
|
|
1805
|
+
}
|
|
1696
1806
|
while (continuationToken) {
|
|
1697
1807
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
1698
1808
|
continuationToken = result.nextLink;
|
|
1699
|
-
|
|
1809
|
+
let page = result.value || [];
|
|
1810
|
+
setContinuationToken(page, continuationToken);
|
|
1811
|
+
yield yield tslib.__await(page);
|
|
1700
1812
|
}
|
|
1701
1813
|
});
|
|
1702
1814
|
}
|
|
@@ -1905,7 +2017,7 @@ class AdvisorManagementClient extends coreClient__namespace.ServiceClient {
|
|
|
1905
2017
|
* @param options The parameter options
|
|
1906
2018
|
*/
|
|
1907
2019
|
constructor(credentials, subscriptionId, options) {
|
|
1908
|
-
var _a, _b;
|
|
2020
|
+
var _a, _b, _c;
|
|
1909
2021
|
if (credentials === undefined) {
|
|
1910
2022
|
throw new Error("'credentials' cannot be null");
|
|
1911
2023
|
}
|
|
@@ -1920,17 +2032,35 @@ class AdvisorManagementClient extends coreClient__namespace.ServiceClient {
|
|
|
1920
2032
|
requestContentType: "application/json; charset=utf-8",
|
|
1921
2033
|
credential: credentials
|
|
1922
2034
|
};
|
|
1923
|
-
const packageDetails = `azsdk-js-arm-advisor/3.0
|
|
2035
|
+
const packageDetails = `azsdk-js-arm-advisor/3.1.0`;
|
|
1924
2036
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
1925
2037
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
1926
2038
|
: `${packageDetails}`;
|
|
1927
|
-
if (!options.credentialScopes) {
|
|
1928
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
1929
|
-
}
|
|
1930
2039
|
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
1931
2040
|
userAgentPrefix
|
|
1932
|
-
},
|
|
2041
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
|
|
1933
2042
|
super(optionsWithDefaults);
|
|
2043
|
+
let bearerTokenAuthenticationPolicyFound = false;
|
|
2044
|
+
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
|
2045
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
2046
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
2047
|
+
coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
|
|
2048
|
+
}
|
|
2049
|
+
if (!options ||
|
|
2050
|
+
!options.pipeline ||
|
|
2051
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
2052
|
+
!bearerTokenAuthenticationPolicyFound) {
|
|
2053
|
+
this.pipeline.removePolicy({
|
|
2054
|
+
name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
|
|
2055
|
+
});
|
|
2056
|
+
this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
|
|
2057
|
+
credential: credentials,
|
|
2058
|
+
scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
|
|
2059
|
+
challengeCallbacks: {
|
|
2060
|
+
authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
|
|
2061
|
+
}
|
|
2062
|
+
}));
|
|
2063
|
+
}
|
|
1934
2064
|
// Parameter assignments
|
|
1935
2065
|
this.subscriptionId = subscriptionId;
|
|
1936
2066
|
// Assigning values to Constant parameters
|
|
@@ -1941,8 +2071,37 @@ class AdvisorManagementClient extends coreClient__namespace.ServiceClient {
|
|
|
1941
2071
|
this.recommendations = new RecommendationsImpl(this);
|
|
1942
2072
|
this.operations = new OperationsImpl(this);
|
|
1943
2073
|
this.suppressions = new SuppressionsImpl(this);
|
|
2074
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
2075
|
+
}
|
|
2076
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
2077
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
2078
|
+
if (!apiVersion) {
|
|
2079
|
+
return;
|
|
2080
|
+
}
|
|
2081
|
+
const apiVersionPolicy = {
|
|
2082
|
+
name: "CustomApiVersionPolicy",
|
|
2083
|
+
sendRequest(request, next) {
|
|
2084
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
2085
|
+
const param = request.url.split("?");
|
|
2086
|
+
if (param.length > 1) {
|
|
2087
|
+
const newParams = param[1].split("&").map((item) => {
|
|
2088
|
+
if (item.indexOf("api-version") > -1) {
|
|
2089
|
+
return "api-version=" + apiVersion;
|
|
2090
|
+
}
|
|
2091
|
+
else {
|
|
2092
|
+
return item;
|
|
2093
|
+
}
|
|
2094
|
+
});
|
|
2095
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
2096
|
+
}
|
|
2097
|
+
return next(request);
|
|
2098
|
+
});
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
1944
2102
|
}
|
|
1945
2103
|
}
|
|
1946
2104
|
|
|
1947
2105
|
exports.AdvisorManagementClient = AdvisorManagementClient;
|
|
2106
|
+
exports.getContinuationToken = getContinuationToken;
|
|
1948
2107
|
//# sourceMappingURL=index.js.map
|