@azure/arm-databox 5.0.0-beta.2 → 5.0.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 +2 -2
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/index.js +973 -182
- 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/samples-dev/jobsBookShipmentPickUpSample.js +12 -5
- package/dist-esm/samples-dev/jobsBookShipmentPickUpSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsCancelSample.js +12 -5
- package/dist-esm/samples-dev/jobsCancelSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsCreateSample.js +93 -86
- package/dist-esm/samples-dev/jobsCreateSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsDeleteSample.js +12 -5
- package/dist-esm/samples-dev/jobsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsGetSample.js +32 -25
- package/dist-esm/samples-dev/jobsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsListByResourceGroupSample.js +23 -9
- package/dist-esm/samples-dev/jobsListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsListCredentialsSample.js +24 -10
- package/dist-esm/samples-dev/jobsListCredentialsSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsListSample.js +22 -8
- package/dist-esm/samples-dev/jobsListSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsMarkDevicesShippedSample.js +16 -6
- package/dist-esm/samples-dev/jobsMarkDevicesShippedSample.js.map +1 -1
- package/dist-esm/samples-dev/jobsUpdateSample.js +39 -32
- package/dist-esm/samples-dev/jobsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/mitigateSample.js +16 -6
- package/dist-esm/samples-dev/mitigateSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +23 -8
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/serviceListAvailableSkusByResourceGroupSample.js +24 -10
- package/dist-esm/samples-dev/serviceListAvailableSkusByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/serviceRegionConfigurationByResourceGroupSample.js +11 -4
- package/dist-esm/samples-dev/serviceRegionConfigurationByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/serviceRegionConfigurationSample.js +10 -3
- package/dist-esm/samples-dev/serviceRegionConfigurationSample.js.map +1 -1
- package/dist-esm/samples-dev/serviceValidateAddressSample.js +17 -10
- package/dist-esm/samples-dev/serviceValidateAddressSample.js.map +1 -1
- package/dist-esm/samples-dev/serviceValidateInputsByResourceGroupSample.js +20 -13
- package/dist-esm/samples-dev/serviceValidateInputsByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/serviceValidateInputsSample.js +19 -12
- package/dist-esm/samples-dev/serviceValidateInputsSample.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 +50 -19
- 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/lroImpl.d.ts +6 -11
- package/dist-esm/src/lroImpl.d.ts.map +1 -1
- package/dist-esm/src/lroImpl.js +12 -20
- package/dist-esm/src/lroImpl.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +479 -145
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +69 -1
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +11 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +614 -46
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.js +1 -1
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/jobs.d.ts +4 -4
- package/dist-esm/src/operations/jobs.d.ts.map +1 -1
- package/dist-esm/src/operations/jobs.js +107 -49
- 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 +31 -13
- 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 +31 -13
- package/dist-esm/src/operations/service.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/jobs.d.ts +4 -4
- package/dist-esm/src/operationsInterfaces/jobs.d.ts.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/databox_operations_test.spec.d.ts +4 -0
- package/dist-esm/test/databox_operations_test.spec.d.ts.map +1 -0
- package/dist-esm/test/databox_operations_test.spec.js +78 -0
- package/dist-esm/test/databox_operations_test.spec.js.map +1 -0
- package/package.json +21 -16
- package/review/arm-databox.api.md +255 -189
- package/src/dataBoxManagementClient.ts +61 -21
- package/src/index.ts +1 -0
- package/src/lroImpl.ts +31 -23
- package/src/models/index.ts +468 -98
- package/src/models/mappers.ts +634 -42
- package/src/models/parameters.ts +1 -1
- package/src/operations/jobs.ts +96 -57
- package/src/operations/operations.ts +21 -9
- package/src/operations/service.ts +27 -14
- package/src/operationsInterfaces/jobs.ts +4 -4
- package/src/pagingHelper.ts +39 -0
- package/types/arm-databox.d.ts +457 -99
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/test/sampleTest.d.ts +0 -2
- package/dist-esm/test/sampleTest.d.ts.map +0 -1
- package/dist-esm/test/sampleTest.js +0 -40
- package/dist-esm/test/sampleTest.js.map +0 -1
package/src/models/parameters.ts
CHANGED
|
@@ -51,7 +51,7 @@ export const $host: OperationURLParameter = {
|
|
|
51
51
|
export const apiVersion: OperationQueryParameter = {
|
|
52
52
|
parameterPath: "apiVersion",
|
|
53
53
|
mapper: {
|
|
54
|
-
defaultValue: "
|
|
54
|
+
defaultValue: "2022-12-01",
|
|
55
55
|
isConstant: true,
|
|
56
56
|
serializedName: "api-version",
|
|
57
57
|
type: {
|
package/src/operations/jobs.ts
CHANGED
|
@@ -6,26 +6,32 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Jobs } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
13
14
|
import * as Parameters from "../models/parameters";
|
|
14
15
|
import { DataBoxManagementClient } from "../dataBoxManagementClient";
|
|
15
|
-
import {
|
|
16
|
-
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
17
22
|
import {
|
|
18
23
|
JobResource,
|
|
19
24
|
JobsListNextOptionalParams,
|
|
20
25
|
JobsListOptionalParams,
|
|
26
|
+
JobsListResponse,
|
|
21
27
|
JobsListByResourceGroupNextOptionalParams,
|
|
22
28
|
JobsListByResourceGroupOptionalParams,
|
|
29
|
+
JobsListByResourceGroupResponse,
|
|
23
30
|
UnencryptedCredentials,
|
|
24
31
|
JobsListCredentialsOptionalParams,
|
|
25
|
-
|
|
32
|
+
JobsListCredentialsResponse,
|
|
26
33
|
MarkDevicesShippedRequest,
|
|
27
34
|
JobsMarkDevicesShippedOptionalParams,
|
|
28
|
-
JobsListByResourceGroupResponse,
|
|
29
35
|
JobsGetOptionalParams,
|
|
30
36
|
JobsGetResponse,
|
|
31
37
|
JobsCreateOptionalParams,
|
|
@@ -39,7 +45,6 @@ import {
|
|
|
39
45
|
JobsBookShipmentPickUpResponse,
|
|
40
46
|
CancellationReason,
|
|
41
47
|
JobsCancelOptionalParams,
|
|
42
|
-
JobsListCredentialsResponse,
|
|
43
48
|
JobsListNextResponse,
|
|
44
49
|
JobsListByResourceGroupNextResponse
|
|
45
50
|
} from "../models";
|
|
@@ -72,22 +77,34 @@ export class JobsImpl implements Jobs {
|
|
|
72
77
|
[Symbol.asyncIterator]() {
|
|
73
78
|
return this;
|
|
74
79
|
},
|
|
75
|
-
byPage: () => {
|
|
76
|
-
|
|
80
|
+
byPage: (settings?: PageSettings) => {
|
|
81
|
+
if (settings?.maxPageSize) {
|
|
82
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
83
|
+
}
|
|
84
|
+
return this.listPagingPage(options, settings);
|
|
77
85
|
}
|
|
78
86
|
};
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
private async *listPagingPage(
|
|
82
|
-
options?: JobsListOptionalParams
|
|
90
|
+
options?: JobsListOptionalParams,
|
|
91
|
+
settings?: PageSettings
|
|
83
92
|
): AsyncIterableIterator<JobResource[]> {
|
|
84
|
-
let result
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
let result: JobsListResponse;
|
|
94
|
+
let continuationToken = settings?.continuationToken;
|
|
95
|
+
if (!continuationToken) {
|
|
96
|
+
result = await this._list(options);
|
|
97
|
+
let page = result.value || [];
|
|
98
|
+
continuationToken = result.nextLink;
|
|
99
|
+
setContinuationToken(page, continuationToken);
|
|
100
|
+
yield page;
|
|
101
|
+
}
|
|
87
102
|
while (continuationToken) {
|
|
88
103
|
result = await this._listNext(continuationToken, options);
|
|
89
104
|
continuationToken = result.nextLink;
|
|
90
|
-
|
|
105
|
+
let page = result.value || [];
|
|
106
|
+
setContinuationToken(page, continuationToken);
|
|
107
|
+
yield page;
|
|
91
108
|
}
|
|
92
109
|
}
|
|
93
110
|
|
|
@@ -116,19 +133,33 @@ export class JobsImpl implements Jobs {
|
|
|
116
133
|
[Symbol.asyncIterator]() {
|
|
117
134
|
return this;
|
|
118
135
|
},
|
|
119
|
-
byPage: () => {
|
|
120
|
-
|
|
136
|
+
byPage: (settings?: PageSettings) => {
|
|
137
|
+
if (settings?.maxPageSize) {
|
|
138
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
139
|
+
}
|
|
140
|
+
return this.listByResourceGroupPagingPage(
|
|
141
|
+
resourceGroupName,
|
|
142
|
+
options,
|
|
143
|
+
settings
|
|
144
|
+
);
|
|
121
145
|
}
|
|
122
146
|
};
|
|
123
147
|
}
|
|
124
148
|
|
|
125
149
|
private async *listByResourceGroupPagingPage(
|
|
126
150
|
resourceGroupName: string,
|
|
127
|
-
options?: JobsListByResourceGroupOptionalParams
|
|
151
|
+
options?: JobsListByResourceGroupOptionalParams,
|
|
152
|
+
settings?: PageSettings
|
|
128
153
|
): AsyncIterableIterator<JobResource[]> {
|
|
129
|
-
let result
|
|
130
|
-
|
|
131
|
-
|
|
154
|
+
let result: JobsListByResourceGroupResponse;
|
|
155
|
+
let continuationToken = settings?.continuationToken;
|
|
156
|
+
if (!continuationToken) {
|
|
157
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
158
|
+
let page = result.value || [];
|
|
159
|
+
continuationToken = result.nextLink;
|
|
160
|
+
setContinuationToken(page, continuationToken);
|
|
161
|
+
yield page;
|
|
162
|
+
}
|
|
132
163
|
while (continuationToken) {
|
|
133
164
|
result = await this._listByResourceGroupNext(
|
|
134
165
|
resourceGroupName,
|
|
@@ -136,7 +167,9 @@ export class JobsImpl implements Jobs {
|
|
|
136
167
|
options
|
|
137
168
|
);
|
|
138
169
|
continuationToken = result.nextLink;
|
|
139
|
-
|
|
170
|
+
let page = result.value || [];
|
|
171
|
+
setContinuationToken(page, continuationToken);
|
|
172
|
+
yield page;
|
|
140
173
|
}
|
|
141
174
|
}
|
|
142
175
|
|
|
@@ -176,11 +209,15 @@ export class JobsImpl implements Jobs {
|
|
|
176
209
|
[Symbol.asyncIterator]() {
|
|
177
210
|
return this;
|
|
178
211
|
},
|
|
179
|
-
byPage: () => {
|
|
212
|
+
byPage: (settings?: PageSettings) => {
|
|
213
|
+
if (settings?.maxPageSize) {
|
|
214
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
215
|
+
}
|
|
180
216
|
return this.listCredentialsPagingPage(
|
|
181
217
|
resourceGroupName,
|
|
182
218
|
jobName,
|
|
183
|
-
options
|
|
219
|
+
options,
|
|
220
|
+
settings
|
|
184
221
|
);
|
|
185
222
|
}
|
|
186
223
|
};
|
|
@@ -189,13 +226,11 @@ export class JobsImpl implements Jobs {
|
|
|
189
226
|
private async *listCredentialsPagingPage(
|
|
190
227
|
resourceGroupName: string,
|
|
191
228
|
jobName: string,
|
|
192
|
-
options?: JobsListCredentialsOptionalParams
|
|
229
|
+
options?: JobsListCredentialsOptionalParams,
|
|
230
|
+
_settings?: PageSettings
|
|
193
231
|
): AsyncIterableIterator<UnencryptedCredentials[]> {
|
|
194
|
-
let result
|
|
195
|
-
|
|
196
|
-
jobName,
|
|
197
|
-
options
|
|
198
|
-
);
|
|
232
|
+
let result: JobsListCredentialsResponse;
|
|
233
|
+
result = await this._listCredentials(resourceGroupName, jobName, options);
|
|
199
234
|
yield result.value || [];
|
|
200
235
|
}
|
|
201
236
|
|
|
@@ -289,7 +324,7 @@ export class JobsImpl implements Jobs {
|
|
|
289
324
|
jobResource: JobResource,
|
|
290
325
|
options?: JobsCreateOptionalParams
|
|
291
326
|
): Promise<
|
|
292
|
-
|
|
327
|
+
SimplePollerLike<OperationState<JobsCreateResponse>, JobsCreateResponse>
|
|
293
328
|
> {
|
|
294
329
|
const directSendOperation = async (
|
|
295
330
|
args: coreClient.OperationArguments,
|
|
@@ -297,7 +332,7 @@ export class JobsImpl implements Jobs {
|
|
|
297
332
|
): Promise<JobsCreateResponse> => {
|
|
298
333
|
return this.client.sendOperationRequest(args, spec);
|
|
299
334
|
};
|
|
300
|
-
const
|
|
335
|
+
const sendOperationFn = async (
|
|
301
336
|
args: coreClient.OperationArguments,
|
|
302
337
|
spec: coreClient.OperationSpec
|
|
303
338
|
) => {
|
|
@@ -330,13 +365,16 @@ export class JobsImpl implements Jobs {
|
|
|
330
365
|
};
|
|
331
366
|
};
|
|
332
367
|
|
|
333
|
-
const lro =
|
|
334
|
-
|
|
335
|
-
{ resourceGroupName, jobName, jobResource, options },
|
|
336
|
-
createOperationSpec
|
|
337
|
-
);
|
|
338
|
-
const poller =
|
|
339
|
-
|
|
368
|
+
const lro = createLroSpec({
|
|
369
|
+
sendOperationFn,
|
|
370
|
+
args: { resourceGroupName, jobName, jobResource, options },
|
|
371
|
+
spec: createOperationSpec
|
|
372
|
+
});
|
|
373
|
+
const poller = await createHttpPoller<
|
|
374
|
+
JobsCreateResponse,
|
|
375
|
+
OperationState<JobsCreateResponse>
|
|
376
|
+
>(lro, {
|
|
377
|
+
restoreFrom: options?.resumeFrom,
|
|
340
378
|
intervalInMs: options?.updateIntervalInMs
|
|
341
379
|
});
|
|
342
380
|
await poller.poll();
|
|
@@ -378,14 +416,14 @@ export class JobsImpl implements Jobs {
|
|
|
378
416
|
resourceGroupName: string,
|
|
379
417
|
jobName: string,
|
|
380
418
|
options?: JobsDeleteOptionalParams
|
|
381
|
-
): Promise<
|
|
419
|
+
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
|
382
420
|
const directSendOperation = async (
|
|
383
421
|
args: coreClient.OperationArguments,
|
|
384
422
|
spec: coreClient.OperationSpec
|
|
385
423
|
): Promise<void> => {
|
|
386
424
|
return this.client.sendOperationRequest(args, spec);
|
|
387
425
|
};
|
|
388
|
-
const
|
|
426
|
+
const sendOperationFn = async (
|
|
389
427
|
args: coreClient.OperationArguments,
|
|
390
428
|
spec: coreClient.OperationSpec
|
|
391
429
|
) => {
|
|
@@ -418,13 +456,13 @@ export class JobsImpl implements Jobs {
|
|
|
418
456
|
};
|
|
419
457
|
};
|
|
420
458
|
|
|
421
|
-
const lro =
|
|
422
|
-
|
|
423
|
-
{ resourceGroupName, jobName, options },
|
|
424
|
-
deleteOperationSpec
|
|
425
|
-
);
|
|
426
|
-
const poller =
|
|
427
|
-
|
|
459
|
+
const lro = createLroSpec({
|
|
460
|
+
sendOperationFn,
|
|
461
|
+
args: { resourceGroupName, jobName, options },
|
|
462
|
+
spec: deleteOperationSpec
|
|
463
|
+
});
|
|
464
|
+
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
|
465
|
+
restoreFrom: options?.resumeFrom,
|
|
428
466
|
intervalInMs: options?.updateIntervalInMs
|
|
429
467
|
});
|
|
430
468
|
await poller.poll();
|
|
@@ -461,7 +499,7 @@ export class JobsImpl implements Jobs {
|
|
|
461
499
|
jobResourceUpdateParameter: JobResourceUpdateParameter,
|
|
462
500
|
options?: JobsUpdateOptionalParams
|
|
463
501
|
): Promise<
|
|
464
|
-
|
|
502
|
+
SimplePollerLike<OperationState<JobsUpdateResponse>, JobsUpdateResponse>
|
|
465
503
|
> {
|
|
466
504
|
const directSendOperation = async (
|
|
467
505
|
args: coreClient.OperationArguments,
|
|
@@ -469,7 +507,7 @@ export class JobsImpl implements Jobs {
|
|
|
469
507
|
): Promise<JobsUpdateResponse> => {
|
|
470
508
|
return this.client.sendOperationRequest(args, spec);
|
|
471
509
|
};
|
|
472
|
-
const
|
|
510
|
+
const sendOperationFn = async (
|
|
473
511
|
args: coreClient.OperationArguments,
|
|
474
512
|
spec: coreClient.OperationSpec
|
|
475
513
|
) => {
|
|
@@ -502,13 +540,16 @@ export class JobsImpl implements Jobs {
|
|
|
502
540
|
};
|
|
503
541
|
};
|
|
504
542
|
|
|
505
|
-
const lro =
|
|
506
|
-
|
|
507
|
-
{ resourceGroupName, jobName, jobResourceUpdateParameter, options },
|
|
508
|
-
updateOperationSpec
|
|
509
|
-
);
|
|
510
|
-
const poller =
|
|
511
|
-
|
|
543
|
+
const lro = createLroSpec({
|
|
544
|
+
sendOperationFn,
|
|
545
|
+
args: { resourceGroupName, jobName, jobResourceUpdateParameter, options },
|
|
546
|
+
spec: updateOperationSpec
|
|
547
|
+
});
|
|
548
|
+
const poller = await createHttpPoller<
|
|
549
|
+
JobsUpdateResponse,
|
|
550
|
+
OperationState<JobsUpdateResponse>
|
|
551
|
+
>(lro, {
|
|
552
|
+
restoreFrom: options?.resumeFrom,
|
|
512
553
|
intervalInMs: options?.updateIntervalInMs
|
|
513
554
|
});
|
|
514
555
|
await poller.poll();
|
|
@@ -884,7 +925,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
884
925
|
bodyMapper: Mappers.ApiError
|
|
885
926
|
}
|
|
886
927
|
},
|
|
887
|
-
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
888
928
|
urlParameters: [
|
|
889
929
|
Parameters.$host,
|
|
890
930
|
Parameters.nextLink,
|
|
@@ -904,7 +944,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
904
944
|
bodyMapper: Mappers.ApiError
|
|
905
945
|
}
|
|
906
946
|
},
|
|
907
|
-
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
908
947
|
urlParameters: [
|
|
909
948
|
Parameters.$host,
|
|
910
949
|
Parameters.nextLink,
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Operations } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
|
|
|
48
49
|
[Symbol.asyncIterator]() {
|
|
49
50
|
return this;
|
|
50
51
|
},
|
|
51
|
-
byPage: () => {
|
|
52
|
-
|
|
52
|
+
byPage: (settings?: PageSettings) => {
|
|
53
|
+
if (settings?.maxPageSize) {
|
|
54
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
55
|
+
}
|
|
56
|
+
return this.listPagingPage(options, settings);
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
private async *listPagingPage(
|
|
58
|
-
options?: OperationsListOptionalParams
|
|
62
|
+
options?: OperationsListOptionalParams,
|
|
63
|
+
settings?: PageSettings
|
|
59
64
|
): AsyncIterableIterator<Operation[]> {
|
|
60
|
-
let result
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
let result: OperationsListResponse;
|
|
66
|
+
let continuationToken = settings?.continuationToken;
|
|
67
|
+
if (!continuationToken) {
|
|
68
|
+
result = await this._list(options);
|
|
69
|
+
let page = result.value || [];
|
|
70
|
+
continuationToken = result.nextLink;
|
|
71
|
+
setContinuationToken(page, continuationToken);
|
|
72
|
+
yield page;
|
|
73
|
+
}
|
|
63
74
|
while (continuationToken) {
|
|
64
75
|
result = await this._listNext(continuationToken, options);
|
|
65
76
|
continuationToken = result.nextLink;
|
|
66
|
-
|
|
77
|
+
let page = result.value || [];
|
|
78
|
+
setContinuationToken(page, continuationToken);
|
|
79
|
+
yield page;
|
|
67
80
|
}
|
|
68
81
|
}
|
|
69
82
|
|
|
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
130
143
|
bodyMapper: Mappers.ApiError
|
|
131
144
|
}
|
|
132
145
|
},
|
|
133
|
-
queryParameters: [Parameters.apiVersion],
|
|
134
146
|
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
135
147
|
headerParameters: [Parameters.accept],
|
|
136
148
|
serializer
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { Service } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -74,12 +75,16 @@ export class ServiceImpl implements Service {
|
|
|
74
75
|
[Symbol.asyncIterator]() {
|
|
75
76
|
return this;
|
|
76
77
|
},
|
|
77
|
-
byPage: () => {
|
|
78
|
+
byPage: (settings?: PageSettings) => {
|
|
79
|
+
if (settings?.maxPageSize) {
|
|
80
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
81
|
+
}
|
|
78
82
|
return this.listAvailableSkusByResourceGroupPagingPage(
|
|
79
83
|
resourceGroupName,
|
|
80
84
|
location,
|
|
81
85
|
availableSkuRequest,
|
|
82
|
-
options
|
|
86
|
+
options,
|
|
87
|
+
settings
|
|
83
88
|
);
|
|
84
89
|
}
|
|
85
90
|
};
|
|
@@ -89,16 +94,23 @@ export class ServiceImpl implements Service {
|
|
|
89
94
|
resourceGroupName: string,
|
|
90
95
|
location: string,
|
|
91
96
|
availableSkuRequest: AvailableSkuRequest,
|
|
92
|
-
options?: ServiceListAvailableSkusByResourceGroupOptionalParams
|
|
97
|
+
options?: ServiceListAvailableSkusByResourceGroupOptionalParams,
|
|
98
|
+
settings?: PageSettings
|
|
93
99
|
): AsyncIterableIterator<SkuInformation[]> {
|
|
94
|
-
let result
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
let result: ServiceListAvailableSkusByResourceGroupResponse;
|
|
101
|
+
let continuationToken = settings?.continuationToken;
|
|
102
|
+
if (!continuationToken) {
|
|
103
|
+
result = await this._listAvailableSkusByResourceGroup(
|
|
104
|
+
resourceGroupName,
|
|
105
|
+
location,
|
|
106
|
+
availableSkuRequest,
|
|
107
|
+
options
|
|
108
|
+
);
|
|
109
|
+
let page = result.value || [];
|
|
110
|
+
continuationToken = result.nextLink;
|
|
111
|
+
setContinuationToken(page, continuationToken);
|
|
112
|
+
yield page;
|
|
113
|
+
}
|
|
102
114
|
while (continuationToken) {
|
|
103
115
|
result = await this._listAvailableSkusByResourceGroupNext(
|
|
104
116
|
resourceGroupName,
|
|
@@ -108,7 +120,9 @@ export class ServiceImpl implements Service {
|
|
|
108
120
|
options
|
|
109
121
|
);
|
|
110
122
|
continuationToken = result.nextLink;
|
|
111
|
-
|
|
123
|
+
let page = result.value || [];
|
|
124
|
+
setContinuationToken(page, continuationToken);
|
|
125
|
+
yield page;
|
|
112
126
|
}
|
|
113
127
|
}
|
|
114
128
|
|
|
@@ -416,7 +430,6 @@ const listAvailableSkusByResourceGroupNextOperationSpec: coreClient.OperationSpe
|
|
|
416
430
|
bodyMapper: Mappers.ApiError
|
|
417
431
|
}
|
|
418
432
|
},
|
|
419
|
-
queryParameters: [Parameters.apiVersion],
|
|
420
433
|
urlParameters: [
|
|
421
434
|
Parameters.$host,
|
|
422
435
|
Parameters.nextLink,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
-
import {
|
|
10
|
+
import { SimplePollerLike, OperationState } from "@azure/core-lro";
|
|
11
11
|
import {
|
|
12
12
|
JobResource,
|
|
13
13
|
JobsListOptionalParams,
|
|
@@ -103,7 +103,7 @@ export interface Jobs {
|
|
|
103
103
|
jobResource: JobResource,
|
|
104
104
|
options?: JobsCreateOptionalParams
|
|
105
105
|
): Promise<
|
|
106
|
-
|
|
106
|
+
SimplePollerLike<OperationState<JobsCreateResponse>, JobsCreateResponse>
|
|
107
107
|
>;
|
|
108
108
|
/**
|
|
109
109
|
* Creates a new job with the specified parameters. Existing job cannot be updated with this API and
|
|
@@ -131,7 +131,7 @@ export interface Jobs {
|
|
|
131
131
|
resourceGroupName: string,
|
|
132
132
|
jobName: string,
|
|
133
133
|
options?: JobsDeleteOptionalParams
|
|
134
|
-
): Promise<
|
|
134
|
+
): Promise<SimplePollerLike<OperationState<void>, void>>;
|
|
135
135
|
/**
|
|
136
136
|
* Deletes a job.
|
|
137
137
|
* @param resourceGroupName The Resource Group Name
|
|
@@ -158,7 +158,7 @@ export interface Jobs {
|
|
|
158
158
|
jobResourceUpdateParameter: JobResourceUpdateParameter,
|
|
159
159
|
options?: JobsUpdateOptionalParams
|
|
160
160
|
): Promise<
|
|
161
|
-
|
|
161
|
+
SimplePollerLike<OperationState<JobsUpdateResponse>, JobsUpdateResponse>
|
|
162
162
|
>;
|
|
163
163
|
/**
|
|
164
164
|
* Updates the properties of an existing job.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface PageInfo {
|
|
10
|
+
continuationToken?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const pageMap = new WeakMap<object, PageInfo>();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Given the last `.value` produced by the `byPage` iterator,
|
|
17
|
+
* returns a continuation token that can be used to begin paging from
|
|
18
|
+
* that point later.
|
|
19
|
+
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
|
20
|
+
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
21
|
+
*/
|
|
22
|
+
export function getContinuationToken(page: unknown): string | undefined {
|
|
23
|
+
if (typeof page !== "object" || page === null) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return pageMap.get(page)?.continuationToken;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setContinuationToken(
|
|
30
|
+
page: unknown,
|
|
31
|
+
continuationToken: string | undefined
|
|
32
|
+
): void {
|
|
33
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
37
|
+
pageInfo.continuationToken = continuationToken;
|
|
38
|
+
pageMap.set(page, pageInfo);
|
|
39
|
+
}
|