@azure/arm-databox 5.0.0-beta.2 → 5.0.0-beta.3
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 +2 -2
- package/README.md +1 -1
- package/dist/index.js +212 -51
- 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/dataBoxManagementClient.d.ts +2 -0
- package/dist-esm/src/dataBoxManagementClient.d.ts.map +1 -1
- package/dist-esm/src/dataBoxManagementClient.js +49 -18
- package/dist-esm/src/dataBoxManagementClient.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 +118 -68
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +50 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/jobs.d.ts.map +1 -1
- package/dist-esm/src/operations/jobs.js +45 -18
- package/dist-esm/src/operations/jobs.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/service.d.ts.map +1 -1
- package/dist-esm/src/operations/service.js +19 -7
- package/dist-esm/src/operations/service.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-databox.api.md +132 -179
- package/src/dataBoxManagementClient.ts +60 -20
- package/src/index.ts +1 -0
- package/src/models/index.ts +132 -68
- package/src/operations/jobs.ts +57 -26
- package/src/operations/operations.ts +21 -8
- package/src/operations/service.ts +27 -13
- package/src/pagingHelper.ts +39 -0
- package/types/arm-databox.d.ts +129 -68
- package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
-
## 5.0.0-beta.
|
|
3
|
+
## 5.0.0-beta.3 (2022-11-18)
|
|
4
4
|
|
|
5
|
-
The package of @azure/arm-databox is using our next generation design principles since version 5.0.0-beta.
|
|
5
|
+
The package of @azure/arm-databox is using our next generation design principles since version 5.0.0-beta.3, which contains breaking changes.
|
|
6
6
|
|
|
7
7
|
To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
|
|
8
8
|
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
|
|
|
13
13
|
|
|
14
14
|
### Currently supported environments
|
|
15
15
|
|
|
16
|
-
- [LTS versions of Node.js](https://
|
|
16
|
+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
17
17
|
- Latest versions of Safari, Chrome, Edge and Firefox.
|
|
18
18
|
|
|
19
19
|
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
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.
|
|
@@ -104,55 +136,105 @@ exports.KnownNotificationStageName = void 0;
|
|
|
104
136
|
/** Known values of {@link DataCenterCode} that the service accepts. */
|
|
105
137
|
exports.KnownDataCenterCode = void 0;
|
|
106
138
|
(function (KnownDataCenterCode) {
|
|
139
|
+
/** Invalid */
|
|
107
140
|
KnownDataCenterCode["Invalid"] = "Invalid";
|
|
141
|
+
/** BY2 */
|
|
108
142
|
KnownDataCenterCode["BY2"] = "BY2";
|
|
143
|
+
/** BY1 */
|
|
109
144
|
KnownDataCenterCode["BY1"] = "BY1";
|
|
145
|
+
/** ORK70 */
|
|
110
146
|
KnownDataCenterCode["ORK70"] = "ORK70";
|
|
147
|
+
/** AM2 */
|
|
111
148
|
KnownDataCenterCode["AM2"] = "AM2";
|
|
149
|
+
/** AMS20 */
|
|
112
150
|
KnownDataCenterCode["AMS20"] = "AMS20";
|
|
151
|
+
/** BY21 */
|
|
113
152
|
KnownDataCenterCode["BY21"] = "BY21";
|
|
153
|
+
/** BY24 */
|
|
114
154
|
KnownDataCenterCode["BY24"] = "BY24";
|
|
155
|
+
/** MWH01 */
|
|
115
156
|
KnownDataCenterCode["MWH01"] = "MWH01";
|
|
157
|
+
/** AMS06 */
|
|
116
158
|
KnownDataCenterCode["AMS06"] = "AMS06";
|
|
159
|
+
/** SSE90 */
|
|
117
160
|
KnownDataCenterCode["SSE90"] = "SSE90";
|
|
161
|
+
/** SYD03 */
|
|
118
162
|
KnownDataCenterCode["SYD03"] = "SYD03";
|
|
163
|
+
/** SYD23 */
|
|
119
164
|
KnownDataCenterCode["SYD23"] = "SYD23";
|
|
165
|
+
/** CBR20 */
|
|
120
166
|
KnownDataCenterCode["CBR20"] = "CBR20";
|
|
167
|
+
/** YTO20 */
|
|
121
168
|
KnownDataCenterCode["YTO20"] = "YTO20";
|
|
169
|
+
/** CWL20 */
|
|
122
170
|
KnownDataCenterCode["CWL20"] = "CWL20";
|
|
171
|
+
/** LON24 */
|
|
123
172
|
KnownDataCenterCode["LON24"] = "LON24";
|
|
173
|
+
/** BOM01 */
|
|
124
174
|
KnownDataCenterCode["BOM01"] = "BOM01";
|
|
175
|
+
/** BL20 */
|
|
125
176
|
KnownDataCenterCode["BL20"] = "BL20";
|
|
177
|
+
/** BL7 */
|
|
126
178
|
KnownDataCenterCode["BL7"] = "BL7";
|
|
179
|
+
/** SEL20 */
|
|
127
180
|
KnownDataCenterCode["SEL20"] = "SEL20";
|
|
181
|
+
/** TYO01 */
|
|
128
182
|
KnownDataCenterCode["TYO01"] = "TYO01";
|
|
183
|
+
/** BN1 */
|
|
129
184
|
KnownDataCenterCode["BN1"] = "BN1";
|
|
185
|
+
/** SN5 */
|
|
130
186
|
KnownDataCenterCode["SN5"] = "SN5";
|
|
187
|
+
/** CYS04 */
|
|
131
188
|
KnownDataCenterCode["CYS04"] = "CYS04";
|
|
189
|
+
/** TYO22 */
|
|
132
190
|
KnownDataCenterCode["TYO22"] = "TYO22";
|
|
191
|
+
/** YTO21 */
|
|
133
192
|
KnownDataCenterCode["YTO21"] = "YTO21";
|
|
193
|
+
/** YQB20 */
|
|
134
194
|
KnownDataCenterCode["YQB20"] = "YQB20";
|
|
195
|
+
/** FRA22 */
|
|
135
196
|
KnownDataCenterCode["FRA22"] = "FRA22";
|
|
197
|
+
/** MAA01 */
|
|
136
198
|
KnownDataCenterCode["MAA01"] = "MAA01";
|
|
199
|
+
/** CPQ02 */
|
|
137
200
|
KnownDataCenterCode["CPQ02"] = "CPQ02";
|
|
201
|
+
/** CPQ20 */
|
|
138
202
|
KnownDataCenterCode["CPQ20"] = "CPQ20";
|
|
203
|
+
/** SIN20 */
|
|
139
204
|
KnownDataCenterCode["SIN20"] = "SIN20";
|
|
205
|
+
/** HKG20 */
|
|
140
206
|
KnownDataCenterCode["HKG20"] = "HKG20";
|
|
207
|
+
/** SG2 */
|
|
141
208
|
KnownDataCenterCode["SG2"] = "SG2";
|
|
209
|
+
/** MEL23 */
|
|
142
210
|
KnownDataCenterCode["MEL23"] = "MEL23";
|
|
211
|
+
/** SEL21 */
|
|
143
212
|
KnownDataCenterCode["SEL21"] = "SEL21";
|
|
213
|
+
/** OSA20 */
|
|
144
214
|
KnownDataCenterCode["OSA20"] = "OSA20";
|
|
215
|
+
/** SHA03 */
|
|
145
216
|
KnownDataCenterCode["SHA03"] = "SHA03";
|
|
217
|
+
/** BJB */
|
|
146
218
|
KnownDataCenterCode["BJB"] = "BJB";
|
|
219
|
+
/** JNB22 */
|
|
147
220
|
KnownDataCenterCode["JNB22"] = "JNB22";
|
|
221
|
+
/** JNB21 */
|
|
148
222
|
KnownDataCenterCode["JNB21"] = "JNB21";
|
|
223
|
+
/** MNZ21 */
|
|
149
224
|
KnownDataCenterCode["MNZ21"] = "MNZ21";
|
|
225
|
+
/** SN8 */
|
|
150
226
|
KnownDataCenterCode["SN8"] = "SN8";
|
|
227
|
+
/** AUH20 */
|
|
151
228
|
KnownDataCenterCode["AUH20"] = "AUH20";
|
|
229
|
+
/** ZRH20 */
|
|
152
230
|
KnownDataCenterCode["ZRH20"] = "ZRH20";
|
|
231
|
+
/** PUS20 */
|
|
153
232
|
KnownDataCenterCode["PUS20"] = "PUS20";
|
|
233
|
+
/** AdHoc */
|
|
154
234
|
KnownDataCenterCode["AdHoc"] = "AdHoc";
|
|
235
|
+
/** CH1 */
|
|
155
236
|
KnownDataCenterCode["CH1"] = "CH1";
|
|
237
|
+
/** DSM05 */
|
|
156
238
|
KnownDataCenterCode["DSM05"] = "DSM05";
|
|
157
239
|
})(exports.KnownDataCenterCode || (exports.KnownDataCenterCode = {}));
|
|
158
240
|
/** Known values of {@link CopyStatus} that the service accepts. */
|
|
@@ -4435,20 +4517,31 @@ class OperationsImpl {
|
|
|
4435
4517
|
[Symbol.asyncIterator]() {
|
|
4436
4518
|
return this;
|
|
4437
4519
|
},
|
|
4438
|
-
byPage: () => {
|
|
4439
|
-
|
|
4520
|
+
byPage: (settings) => {
|
|
4521
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
4522
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
4523
|
+
}
|
|
4524
|
+
return this.listPagingPage(options, settings);
|
|
4440
4525
|
}
|
|
4441
4526
|
};
|
|
4442
4527
|
}
|
|
4443
|
-
listPagingPage(options) {
|
|
4528
|
+
listPagingPage(options, settings) {
|
|
4444
4529
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
4445
|
-
let result
|
|
4446
|
-
|
|
4447
|
-
|
|
4530
|
+
let result;
|
|
4531
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
4532
|
+
if (!continuationToken) {
|
|
4533
|
+
result = yield tslib.__await(this._list(options));
|
|
4534
|
+
let page = result.value || [];
|
|
4535
|
+
continuationToken = result.nextLink;
|
|
4536
|
+
setContinuationToken(page, continuationToken);
|
|
4537
|
+
yield yield tslib.__await(page);
|
|
4538
|
+
}
|
|
4448
4539
|
while (continuationToken) {
|
|
4449
4540
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
4450
4541
|
continuationToken = result.nextLink;
|
|
4451
|
-
|
|
4542
|
+
let page = result.value || [];
|
|
4543
|
+
setContinuationToken(page, continuationToken);
|
|
4544
|
+
yield yield tslib.__await(page);
|
|
4452
4545
|
}
|
|
4453
4546
|
});
|
|
4454
4547
|
}
|
|
@@ -4579,20 +4672,31 @@ class JobsImpl {
|
|
|
4579
4672
|
[Symbol.asyncIterator]() {
|
|
4580
4673
|
return this;
|
|
4581
4674
|
},
|
|
4582
|
-
byPage: () => {
|
|
4583
|
-
|
|
4675
|
+
byPage: (settings) => {
|
|
4676
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
4677
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
4678
|
+
}
|
|
4679
|
+
return this.listPagingPage(options, settings);
|
|
4584
4680
|
}
|
|
4585
4681
|
};
|
|
4586
4682
|
}
|
|
4587
|
-
listPagingPage(options) {
|
|
4683
|
+
listPagingPage(options, settings) {
|
|
4588
4684
|
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
4589
|
-
let result
|
|
4590
|
-
|
|
4591
|
-
|
|
4685
|
+
let result;
|
|
4686
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
4687
|
+
if (!continuationToken) {
|
|
4688
|
+
result = yield tslib.__await(this._list(options));
|
|
4689
|
+
let page = result.value || [];
|
|
4690
|
+
continuationToken = result.nextLink;
|
|
4691
|
+
setContinuationToken(page, continuationToken);
|
|
4692
|
+
yield yield tslib.__await(page);
|
|
4693
|
+
}
|
|
4592
4694
|
while (continuationToken) {
|
|
4593
4695
|
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
4594
4696
|
continuationToken = result.nextLink;
|
|
4595
|
-
|
|
4697
|
+
let page = result.value || [];
|
|
4698
|
+
setContinuationToken(page, continuationToken);
|
|
4699
|
+
yield yield tslib.__await(page);
|
|
4596
4700
|
}
|
|
4597
4701
|
});
|
|
4598
4702
|
}
|
|
@@ -4628,20 +4732,31 @@ class JobsImpl {
|
|
|
4628
4732
|
[Symbol.asyncIterator]() {
|
|
4629
4733
|
return this;
|
|
4630
4734
|
},
|
|
4631
|
-
byPage: () => {
|
|
4632
|
-
|
|
4735
|
+
byPage: (settings) => {
|
|
4736
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
4737
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
4738
|
+
}
|
|
4739
|
+
return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
|
|
4633
4740
|
}
|
|
4634
4741
|
};
|
|
4635
4742
|
}
|
|
4636
|
-
listByResourceGroupPagingPage(resourceGroupName, options) {
|
|
4743
|
+
listByResourceGroupPagingPage(resourceGroupName, options, settings) {
|
|
4637
4744
|
return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
|
|
4638
|
-
let result
|
|
4639
|
-
|
|
4640
|
-
|
|
4745
|
+
let result;
|
|
4746
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
4747
|
+
if (!continuationToken) {
|
|
4748
|
+
result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
|
|
4749
|
+
let page = result.value || [];
|
|
4750
|
+
continuationToken = result.nextLink;
|
|
4751
|
+
setContinuationToken(page, continuationToken);
|
|
4752
|
+
yield yield tslib.__await(page);
|
|
4753
|
+
}
|
|
4641
4754
|
while (continuationToken) {
|
|
4642
4755
|
result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
|
|
4643
4756
|
continuationToken = result.nextLink;
|
|
4644
|
-
|
|
4757
|
+
let page = result.value || [];
|
|
4758
|
+
setContinuationToken(page, continuationToken);
|
|
4759
|
+
yield yield tslib.__await(page);
|
|
4645
4760
|
}
|
|
4646
4761
|
});
|
|
4647
4762
|
}
|
|
@@ -4679,14 +4794,18 @@ class JobsImpl {
|
|
|
4679
4794
|
[Symbol.asyncIterator]() {
|
|
4680
4795
|
return this;
|
|
4681
4796
|
},
|
|
4682
|
-
byPage: () => {
|
|
4683
|
-
|
|
4797
|
+
byPage: (settings) => {
|
|
4798
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
4799
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
4800
|
+
}
|
|
4801
|
+
return this.listCredentialsPagingPage(resourceGroupName, jobName, options, settings);
|
|
4684
4802
|
}
|
|
4685
4803
|
};
|
|
4686
4804
|
}
|
|
4687
|
-
listCredentialsPagingPage(resourceGroupName, jobName, options) {
|
|
4805
|
+
listCredentialsPagingPage(resourceGroupName, jobName, options, _settings) {
|
|
4688
4806
|
return tslib.__asyncGenerator(this, arguments, function* listCredentialsPagingPage_1() {
|
|
4689
|
-
let result
|
|
4807
|
+
let result;
|
|
4808
|
+
result = yield tslib.__await(this._listCredentials(resourceGroupName, jobName, options));
|
|
4690
4809
|
yield yield tslib.__await(result.value || []);
|
|
4691
4810
|
});
|
|
4692
4811
|
}
|
|
@@ -5270,20 +5389,31 @@ class ServiceImpl {
|
|
|
5270
5389
|
[Symbol.asyncIterator]() {
|
|
5271
5390
|
return this;
|
|
5272
5391
|
},
|
|
5273
|
-
byPage: () => {
|
|
5274
|
-
|
|
5392
|
+
byPage: (settings) => {
|
|
5393
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
5394
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
5395
|
+
}
|
|
5396
|
+
return this.listAvailableSkusByResourceGroupPagingPage(resourceGroupName, location, availableSkuRequest, options, settings);
|
|
5275
5397
|
}
|
|
5276
5398
|
};
|
|
5277
5399
|
}
|
|
5278
|
-
listAvailableSkusByResourceGroupPagingPage(resourceGroupName, location, availableSkuRequest, options) {
|
|
5400
|
+
listAvailableSkusByResourceGroupPagingPage(resourceGroupName, location, availableSkuRequest, options, settings) {
|
|
5279
5401
|
return tslib.__asyncGenerator(this, arguments, function* listAvailableSkusByResourceGroupPagingPage_1() {
|
|
5280
|
-
let result
|
|
5281
|
-
|
|
5282
|
-
|
|
5402
|
+
let result;
|
|
5403
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
5404
|
+
if (!continuationToken) {
|
|
5405
|
+
result = yield tslib.__await(this._listAvailableSkusByResourceGroup(resourceGroupName, location, availableSkuRequest, options));
|
|
5406
|
+
let page = result.value || [];
|
|
5407
|
+
continuationToken = result.nextLink;
|
|
5408
|
+
setContinuationToken(page, continuationToken);
|
|
5409
|
+
yield yield tslib.__await(page);
|
|
5410
|
+
}
|
|
5283
5411
|
while (continuationToken) {
|
|
5284
5412
|
result = yield tslib.__await(this._listAvailableSkusByResourceGroupNext(resourceGroupName, location, availableSkuRequest, continuationToken, options));
|
|
5285
5413
|
continuationToken = result.nextLink;
|
|
5286
|
-
|
|
5414
|
+
let page = result.value || [];
|
|
5415
|
+
setContinuationToken(page, continuationToken);
|
|
5416
|
+
yield yield tslib.__await(page);
|
|
5287
5417
|
}
|
|
5288
5418
|
});
|
|
5289
5419
|
}
|
|
@@ -5554,7 +5684,7 @@ class DataBoxManagementClient extends coreClient__namespace.ServiceClient {
|
|
|
5554
5684
|
* @param options The parameter options
|
|
5555
5685
|
*/
|
|
5556
5686
|
constructor(credentials, subscriptionId, options) {
|
|
5557
|
-
var _a, _b;
|
|
5687
|
+
var _a, _b, _c;
|
|
5558
5688
|
if (credentials === undefined) {
|
|
5559
5689
|
throw new Error("'credentials' cannot be null");
|
|
5560
5690
|
}
|
|
@@ -5569,32 +5699,34 @@ class DataBoxManagementClient extends coreClient__namespace.ServiceClient {
|
|
|
5569
5699
|
requestContentType: "application/json; charset=utf-8",
|
|
5570
5700
|
credential: credentials
|
|
5571
5701
|
};
|
|
5572
|
-
const packageDetails = `azsdk-js-arm-databox/5.0.0-beta.
|
|
5702
|
+
const packageDetails = `azsdk-js-arm-databox/5.0.0-beta.3`;
|
|
5573
5703
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
5574
5704
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
5575
5705
|
: `${packageDetails}`;
|
|
5576
|
-
if (!options.credentialScopes) {
|
|
5577
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
5578
|
-
}
|
|
5579
5706
|
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
5580
5707
|
userAgentPrefix
|
|
5581
|
-
},
|
|
5708
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
|
|
5582
5709
|
super(optionsWithDefaults);
|
|
5710
|
+
let bearerTokenAuthenticationPolicyFound = false;
|
|
5583
5711
|
if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
|
|
5584
5712
|
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
5585
|
-
|
|
5713
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
5586
5714
|
coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5715
|
+
}
|
|
5716
|
+
if (!options ||
|
|
5717
|
+
!options.pipeline ||
|
|
5718
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
5719
|
+
!bearerTokenAuthenticationPolicyFound) {
|
|
5720
|
+
this.pipeline.removePolicy({
|
|
5721
|
+
name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
|
|
5722
|
+
});
|
|
5723
|
+
this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
|
|
5724
|
+
credential: credentials,
|
|
5725
|
+
scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
|
|
5726
|
+
challengeCallbacks: {
|
|
5727
|
+
authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
|
|
5728
|
+
}
|
|
5729
|
+
}));
|
|
5598
5730
|
}
|
|
5599
5731
|
// Parameter assignments
|
|
5600
5732
|
this.subscriptionId = subscriptionId;
|
|
@@ -5604,6 +5736,34 @@ class DataBoxManagementClient extends coreClient__namespace.ServiceClient {
|
|
|
5604
5736
|
this.operations = new OperationsImpl(this);
|
|
5605
5737
|
this.jobs = new JobsImpl(this);
|
|
5606
5738
|
this.service = new ServiceImpl(this);
|
|
5739
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
5740
|
+
}
|
|
5741
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
5742
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
5743
|
+
if (!apiVersion) {
|
|
5744
|
+
return;
|
|
5745
|
+
}
|
|
5746
|
+
const apiVersionPolicy = {
|
|
5747
|
+
name: "CustomApiVersionPolicy",
|
|
5748
|
+
sendRequest(request, next) {
|
|
5749
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
5750
|
+
const param = request.url.split("?");
|
|
5751
|
+
if (param.length > 1) {
|
|
5752
|
+
const newParams = param[1].split("&").map((item) => {
|
|
5753
|
+
if (item.indexOf("api-version") > -1) {
|
|
5754
|
+
return "api-version=" + apiVersion;
|
|
5755
|
+
}
|
|
5756
|
+
else {
|
|
5757
|
+
return item;
|
|
5758
|
+
}
|
|
5759
|
+
});
|
|
5760
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
5761
|
+
}
|
|
5762
|
+
return next(request);
|
|
5763
|
+
});
|
|
5764
|
+
}
|
|
5765
|
+
};
|
|
5766
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
5607
5767
|
}
|
|
5608
5768
|
/**
|
|
5609
5769
|
* Request to mitigate for a given job
|
|
@@ -5642,4 +5802,5 @@ const mitigateOperationSpec = {
|
|
|
5642
5802
|
};
|
|
5643
5803
|
|
|
5644
5804
|
exports.DataBoxManagementClient = DataBoxManagementClient;
|
|
5805
|
+
exports.getContinuationToken = getContinuationToken;
|
|
5645
5806
|
//# sourceMappingURL=index.js.map
|