@azure/arm-datamigration 3.0.0-alpha.20221102.1 → 3.0.0-alpha.20221129.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +3 -13
- package/dist/index.js +629 -109
- 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/databaseMigrationsSqlMiCreateOrUpdateSample.js +2 -2
- package/dist-esm/samples-dev/databaseMigrationsSqlMiCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/databaseMigrationsSqlVMCreateOrUpdateSample.js +2 -2
- package/dist-esm/samples-dev/databaseMigrationsSqlVMCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/src/dataMigrationManagementClient.d.ts +2 -0
- package/dist-esm/src/dataMigrationManagementClient.d.ts.map +1 -1
- package/dist-esm/src/dataMigrationManagementClient.js +48 -17
- package/dist-esm/src/dataMigrationManagementClient.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 +556 -240
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +314 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/files.d.ts.map +1 -1
- package/dist-esm/src/operations/files.js +19 -7
- package/dist-esm/src/operations/files.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/projects.d.ts.map +1 -1
- package/dist-esm/src/operations/projects.js +19 -7
- package/dist-esm/src/operations/projects.js.map +1 -1
- package/dist-esm/src/operations/resourceSkus.d.ts.map +1 -1
- package/dist-esm/src/operations/resourceSkus.js +19 -7
- package/dist-esm/src/operations/resourceSkus.js.map +1 -1
- package/dist-esm/src/operations/serviceTasks.d.ts.map +1 -1
- package/dist-esm/src/operations/serviceTasks.js +19 -7
- package/dist-esm/src/operations/serviceTasks.js.map +1 -1
- package/dist-esm/src/operations/services.d.ts.map +1 -1
- package/dist-esm/src/operations/services.js +55 -21
- package/dist-esm/src/operations/services.js.map +1 -1
- package/dist-esm/src/operations/sqlMigrationServices.d.ts.map +1 -1
- package/dist-esm/src/operations/sqlMigrationServices.js +55 -21
- package/dist-esm/src/operations/sqlMigrationServices.js.map +1 -1
- package/dist-esm/src/operations/tasks.d.ts.map +1 -1
- package/dist-esm/src/operations/tasks.js +19 -7
- package/dist-esm/src/operations/tasks.js.map +1 -1
- package/dist-esm/src/operations/usages.d.ts.map +1 -1
- package/dist-esm/src/operations/usages.js +19 -7
- package/dist-esm/src/operations/usages.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 +12 -8
- package/review/arm-datamigration.api.md +564 -872
- package/src/dataMigrationManagementClient.ts +59 -19
- package/src/index.ts +1 -0
- package/src/models/index.ts +646 -246
- package/src/operations/files.ts +22 -8
- package/src/operations/operations.ts +21 -8
- package/src/operations/projects.ts +21 -8
- package/src/operations/resourceSkus.ts +21 -8
- package/src/operations/serviceTasks.ts +21 -8
- package/src/operations/services.ts +67 -25
- package/src/operations/sqlMigrationServices.ts +71 -29
- package/src/operations/tasks.ts +22 -8
- package/src/operations/usages.ts +21 -8
- package/src/pagingHelper.ts +39 -0
- package/types/arm-datamigration.d.ts +567 -240
- package/types/tsdoc-metadata.json +1 -1
package/src/operations/tasks.ts
CHANGED
@@ -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 { Tasks } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -73,12 +74,16 @@ export class TasksImpl implements Tasks {
|
|
73
74
|
[Symbol.asyncIterator]() {
|
74
75
|
return this;
|
75
76
|
},
|
76
|
-
byPage: () => {
|
77
|
+
byPage: (settings?: PageSettings) => {
|
78
|
+
if (settings?.maxPageSize) {
|
79
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
80
|
+
}
|
77
81
|
return this.listPagingPage(
|
78
82
|
groupName,
|
79
83
|
serviceName,
|
80
84
|
projectName,
|
81
|
-
options
|
85
|
+
options,
|
86
|
+
settings
|
82
87
|
);
|
83
88
|
}
|
84
89
|
};
|
@@ -88,11 +93,18 @@ export class TasksImpl implements Tasks {
|
|
88
93
|
groupName: string,
|
89
94
|
serviceName: string,
|
90
95
|
projectName: string,
|
91
|
-
options?: TasksListOptionalParams
|
96
|
+
options?: TasksListOptionalParams,
|
97
|
+
settings?: PageSettings
|
92
98
|
): AsyncIterableIterator<ProjectTask[]> {
|
93
|
-
let result
|
94
|
-
|
95
|
-
|
99
|
+
let result: TasksListResponse;
|
100
|
+
let continuationToken = settings?.continuationToken;
|
101
|
+
if (!continuationToken) {
|
102
|
+
result = await this._list(groupName, serviceName, projectName, options);
|
103
|
+
let page = result.value || [];
|
104
|
+
continuationToken = result.nextLink;
|
105
|
+
setContinuationToken(page, continuationToken);
|
106
|
+
yield page;
|
107
|
+
}
|
96
108
|
while (continuationToken) {
|
97
109
|
result = await this._listNext(
|
98
110
|
groupName,
|
@@ -102,7 +114,9 @@ export class TasksImpl implements Tasks {
|
|
102
114
|
options
|
103
115
|
);
|
104
116
|
continuationToken = result.nextLink;
|
105
|
-
|
117
|
+
let page = result.value || [];
|
118
|
+
setContinuationToken(page, continuationToken);
|
119
|
+
yield page;
|
106
120
|
}
|
107
121
|
}
|
108
122
|
|
package/src/operations/usages.ts
CHANGED
@@ -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 { Usages } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -51,23 +52,35 @@ export class UsagesImpl implements Usages {
|
|
51
52
|
[Symbol.asyncIterator]() {
|
52
53
|
return this;
|
53
54
|
},
|
54
|
-
byPage: () => {
|
55
|
-
|
55
|
+
byPage: (settings?: PageSettings) => {
|
56
|
+
if (settings?.maxPageSize) {
|
57
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
58
|
+
}
|
59
|
+
return this.listPagingPage(location, options, settings);
|
56
60
|
}
|
57
61
|
};
|
58
62
|
}
|
59
63
|
|
60
64
|
private async *listPagingPage(
|
61
65
|
location: string,
|
62
|
-
options?: UsagesListOptionalParams
|
66
|
+
options?: UsagesListOptionalParams,
|
67
|
+
settings?: PageSettings
|
63
68
|
): AsyncIterableIterator<Quota[]> {
|
64
|
-
let result
|
65
|
-
|
66
|
-
|
69
|
+
let result: UsagesListResponse;
|
70
|
+
let continuationToken = settings?.continuationToken;
|
71
|
+
if (!continuationToken) {
|
72
|
+
result = await this._list(location, options);
|
73
|
+
let page = result.value || [];
|
74
|
+
continuationToken = result.nextLink;
|
75
|
+
setContinuationToken(page, continuationToken);
|
76
|
+
yield page;
|
77
|
+
}
|
67
78
|
while (continuationToken) {
|
68
79
|
result = await this._listNext(location, continuationToken, options);
|
69
80
|
continuationToken = result.nextLink;
|
70
|
-
|
81
|
+
let page = result.value || [];
|
82
|
+
setContinuationToken(page, continuationToken);
|
83
|
+
yield page;
|
71
84
|
}
|
72
85
|
}
|
73
86
|
|
@@ -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 a result page from a pageable operation, returns a
|
17
|
+
* continuation token that can be used to begin paging from
|
18
|
+
* that point later.
|
19
|
+
* @param page A result object from calling .byPage() on a paged operation.
|
20
|
+
* @returns The continuation token that can be passed into byPage().
|
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
|
+
}
|