@azure/arm-datamigration 3.0.0-beta.2 → 3.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 +630 -110
- 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 +49 -18
- 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 +14 -10
- package/review/arm-datamigration.api.md +564 -872
- package/src/dataMigrationManagementClient.ts +60 -20
- 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/files.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 { Files } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -71,12 +72,16 @@ export class FilesImpl implements Files {
|
|
71
72
|
[Symbol.asyncIterator]() {
|
72
73
|
return this;
|
73
74
|
},
|
74
|
-
byPage: () => {
|
75
|
+
byPage: (settings?: PageSettings) => {
|
76
|
+
if (settings?.maxPageSize) {
|
77
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
78
|
+
}
|
75
79
|
return this.listPagingPage(
|
76
80
|
groupName,
|
77
81
|
serviceName,
|
78
82
|
projectName,
|
79
|
-
options
|
83
|
+
options,
|
84
|
+
settings
|
80
85
|
);
|
81
86
|
}
|
82
87
|
};
|
@@ -86,11 +91,18 @@ export class FilesImpl implements Files {
|
|
86
91
|
groupName: string,
|
87
92
|
serviceName: string,
|
88
93
|
projectName: string,
|
89
|
-
options?: FilesListOptionalParams
|
94
|
+
options?: FilesListOptionalParams,
|
95
|
+
settings?: PageSettings
|
90
96
|
): AsyncIterableIterator<ProjectFile[]> {
|
91
|
-
let result
|
92
|
-
|
93
|
-
|
97
|
+
let result: FilesListResponse;
|
98
|
+
let continuationToken = settings?.continuationToken;
|
99
|
+
if (!continuationToken) {
|
100
|
+
result = await this._list(groupName, serviceName, projectName, options);
|
101
|
+
let page = result.value || [];
|
102
|
+
continuationToken = result.nextLink;
|
103
|
+
setContinuationToken(page, continuationToken);
|
104
|
+
yield page;
|
105
|
+
}
|
94
106
|
while (continuationToken) {
|
95
107
|
result = await this._listNext(
|
96
108
|
groupName,
|
@@ -100,7 +112,9 @@ export class FilesImpl implements Files {
|
|
100
112
|
options
|
101
113
|
);
|
102
114
|
continuationToken = result.nextLink;
|
103
|
-
|
115
|
+
let page = result.value || [];
|
116
|
+
setContinuationToken(page, continuationToken);
|
117
|
+
yield page;
|
104
118
|
}
|
105
119
|
}
|
106
120
|
|
@@ -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<OperationsDefinition[]> {
|
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
|
|
@@ -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 { Projects } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -60,8 +61,11 @@ export class ProjectsImpl implements Projects {
|
|
60
61
|
[Symbol.asyncIterator]() {
|
61
62
|
return this;
|
62
63
|
},
|
63
|
-
byPage: () => {
|
64
|
-
|
64
|
+
byPage: (settings?: PageSettings) => {
|
65
|
+
if (settings?.maxPageSize) {
|
66
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
67
|
+
}
|
68
|
+
return this.listPagingPage(groupName, serviceName, options, settings);
|
65
69
|
}
|
66
70
|
};
|
67
71
|
}
|
@@ -69,11 +73,18 @@ export class ProjectsImpl implements Projects {
|
|
69
73
|
private async *listPagingPage(
|
70
74
|
groupName: string,
|
71
75
|
serviceName: string,
|
72
|
-
options?: ProjectsListOptionalParams
|
76
|
+
options?: ProjectsListOptionalParams,
|
77
|
+
settings?: PageSettings
|
73
78
|
): AsyncIterableIterator<Project[]> {
|
74
|
-
let result
|
75
|
-
|
76
|
-
|
79
|
+
let result: ProjectsListResponse;
|
80
|
+
let continuationToken = settings?.continuationToken;
|
81
|
+
if (!continuationToken) {
|
82
|
+
result = await this._list(groupName, serviceName, options);
|
83
|
+
let page = result.value || [];
|
84
|
+
continuationToken = result.nextLink;
|
85
|
+
setContinuationToken(page, continuationToken);
|
86
|
+
yield page;
|
87
|
+
}
|
77
88
|
while (continuationToken) {
|
78
89
|
result = await this._listNext(
|
79
90
|
groupName,
|
@@ -82,7 +93,9 @@ export class ProjectsImpl implements Projects {
|
|
82
93
|
options
|
83
94
|
);
|
84
95
|
continuationToken = result.nextLink;
|
85
|
-
|
96
|
+
let page = result.value || [];
|
97
|
+
setContinuationToken(page, continuationToken);
|
98
|
+
yield page;
|
86
99
|
}
|
87
100
|
}
|
88
101
|
|
@@ -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 { ResourceSkus } 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 ResourceSkusImpl implements ResourceSkus {
|
|
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.listSkusPagingPage(options, settings);
|
53
57
|
}
|
54
58
|
};
|
55
59
|
}
|
56
60
|
|
57
61
|
private async *listSkusPagingPage(
|
58
|
-
options?: ResourceSkusListSkusOptionalParams
|
62
|
+
options?: ResourceSkusListSkusOptionalParams,
|
63
|
+
settings?: PageSettings
|
59
64
|
): AsyncIterableIterator<ResourceSku[]> {
|
60
|
-
let result
|
61
|
-
|
62
|
-
|
65
|
+
let result: ResourceSkusListSkusResponse;
|
66
|
+
let continuationToken = settings?.continuationToken;
|
67
|
+
if (!continuationToken) {
|
68
|
+
result = await this._listSkus(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._listSkusNext(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
|
|
@@ -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 { ServiceTasks } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -63,8 +64,11 @@ export class ServiceTasksImpl implements ServiceTasks {
|
|
63
64
|
[Symbol.asyncIterator]() {
|
64
65
|
return this;
|
65
66
|
},
|
66
|
-
byPage: () => {
|
67
|
-
|
67
|
+
byPage: (settings?: PageSettings) => {
|
68
|
+
if (settings?.maxPageSize) {
|
69
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
70
|
+
}
|
71
|
+
return this.listPagingPage(groupName, serviceName, options, settings);
|
68
72
|
}
|
69
73
|
};
|
70
74
|
}
|
@@ -72,11 +76,18 @@ export class ServiceTasksImpl implements ServiceTasks {
|
|
72
76
|
private async *listPagingPage(
|
73
77
|
groupName: string,
|
74
78
|
serviceName: string,
|
75
|
-
options?: ServiceTasksListOptionalParams
|
79
|
+
options?: ServiceTasksListOptionalParams,
|
80
|
+
settings?: PageSettings
|
76
81
|
): AsyncIterableIterator<ProjectTask[]> {
|
77
|
-
let result
|
78
|
-
|
79
|
-
|
82
|
+
let result: ServiceTasksListResponse;
|
83
|
+
let continuationToken = settings?.continuationToken;
|
84
|
+
if (!continuationToken) {
|
85
|
+
result = await this._list(groupName, serviceName, options);
|
86
|
+
let page = result.value || [];
|
87
|
+
continuationToken = result.nextLink;
|
88
|
+
setContinuationToken(page, continuationToken);
|
89
|
+
yield page;
|
90
|
+
}
|
80
91
|
while (continuationToken) {
|
81
92
|
result = await this._listNext(
|
82
93
|
groupName,
|
@@ -85,7 +96,9 @@ export class ServiceTasksImpl implements ServiceTasks {
|
|
85
96
|
options
|
86
97
|
);
|
87
98
|
continuationToken = result.nextLink;
|
88
|
-
|
99
|
+
let page = result.value || [];
|
100
|
+
setContinuationToken(page, continuationToken);
|
101
|
+
yield page;
|
89
102
|
}
|
90
103
|
}
|
91
104
|
|
@@ -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 { Services } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -18,11 +19,14 @@ import {
|
|
18
19
|
AvailableServiceSku,
|
19
20
|
ServicesListSkusNextOptionalParams,
|
20
21
|
ServicesListSkusOptionalParams,
|
22
|
+
ServicesListSkusResponse,
|
21
23
|
DataMigrationService,
|
22
24
|
ServicesListByResourceGroupNextOptionalParams,
|
23
25
|
ServicesListByResourceGroupOptionalParams,
|
26
|
+
ServicesListByResourceGroupResponse,
|
24
27
|
ServicesListNextOptionalParams,
|
25
28
|
ServicesListOptionalParams,
|
29
|
+
ServicesListResponse,
|
26
30
|
ServicesCreateOrUpdateOptionalParams,
|
27
31
|
ServicesCreateOrUpdateResponse,
|
28
32
|
ServicesGetOptionalParams,
|
@@ -34,12 +38,9 @@ import {
|
|
34
38
|
ServicesCheckStatusResponse,
|
35
39
|
ServicesStartOptionalParams,
|
36
40
|
ServicesStopOptionalParams,
|
37
|
-
ServicesListSkusResponse,
|
38
41
|
NameAvailabilityRequest,
|
39
42
|
ServicesCheckChildrenNameAvailabilityOptionalParams,
|
40
43
|
ServicesCheckChildrenNameAvailabilityResponse,
|
41
|
-
ServicesListByResourceGroupResponse,
|
42
|
-
ServicesListResponse,
|
43
44
|
ServicesCheckNameAvailabilityOptionalParams,
|
44
45
|
ServicesCheckNameAvailabilityResponse,
|
45
46
|
ServicesListSkusNextResponse,
|
@@ -80,8 +81,16 @@ export class ServicesImpl implements Services {
|
|
80
81
|
[Symbol.asyncIterator]() {
|
81
82
|
return this;
|
82
83
|
},
|
83
|
-
byPage: () => {
|
84
|
-
|
84
|
+
byPage: (settings?: PageSettings) => {
|
85
|
+
if (settings?.maxPageSize) {
|
86
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
87
|
+
}
|
88
|
+
return this.listSkusPagingPage(
|
89
|
+
groupName,
|
90
|
+
serviceName,
|
91
|
+
options,
|
92
|
+
settings
|
93
|
+
);
|
85
94
|
}
|
86
95
|
};
|
87
96
|
}
|
@@ -89,11 +98,18 @@ export class ServicesImpl implements Services {
|
|
89
98
|
private async *listSkusPagingPage(
|
90
99
|
groupName: string,
|
91
100
|
serviceName: string,
|
92
|
-
options?: ServicesListSkusOptionalParams
|
101
|
+
options?: ServicesListSkusOptionalParams,
|
102
|
+
settings?: PageSettings
|
93
103
|
): AsyncIterableIterator<AvailableServiceSku[]> {
|
94
|
-
let result
|
95
|
-
|
96
|
-
|
104
|
+
let result: ServicesListSkusResponse;
|
105
|
+
let continuationToken = settings?.continuationToken;
|
106
|
+
if (!continuationToken) {
|
107
|
+
result = await this._listSkus(groupName, serviceName, options);
|
108
|
+
let page = result.value || [];
|
109
|
+
continuationToken = result.nextLink;
|
110
|
+
setContinuationToken(page, continuationToken);
|
111
|
+
yield page;
|
112
|
+
}
|
97
113
|
while (continuationToken) {
|
98
114
|
result = await this._listSkusNext(
|
99
115
|
groupName,
|
@@ -102,7 +118,9 @@ export class ServicesImpl implements Services {
|
|
102
118
|
options
|
103
119
|
);
|
104
120
|
continuationToken = result.nextLink;
|
105
|
-
|
121
|
+
let page = result.value || [];
|
122
|
+
setContinuationToken(page, continuationToken);
|
123
|
+
yield page;
|
106
124
|
}
|
107
125
|
}
|
108
126
|
|
@@ -138,19 +156,29 @@ export class ServicesImpl implements Services {
|
|
138
156
|
[Symbol.asyncIterator]() {
|
139
157
|
return this;
|
140
158
|
},
|
141
|
-
byPage: () => {
|
142
|
-
|
159
|
+
byPage: (settings?: PageSettings) => {
|
160
|
+
if (settings?.maxPageSize) {
|
161
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
162
|
+
}
|
163
|
+
return this.listByResourceGroupPagingPage(groupName, options, settings);
|
143
164
|
}
|
144
165
|
};
|
145
166
|
}
|
146
167
|
|
147
168
|
private async *listByResourceGroupPagingPage(
|
148
169
|
groupName: string,
|
149
|
-
options?: ServicesListByResourceGroupOptionalParams
|
170
|
+
options?: ServicesListByResourceGroupOptionalParams,
|
171
|
+
settings?: PageSettings
|
150
172
|
): AsyncIterableIterator<DataMigrationService[]> {
|
151
|
-
let result
|
152
|
-
|
153
|
-
|
173
|
+
let result: ServicesListByResourceGroupResponse;
|
174
|
+
let continuationToken = settings?.continuationToken;
|
175
|
+
if (!continuationToken) {
|
176
|
+
result = await this._listByResourceGroup(groupName, options);
|
177
|
+
let page = result.value || [];
|
178
|
+
continuationToken = result.nextLink;
|
179
|
+
setContinuationToken(page, continuationToken);
|
180
|
+
yield page;
|
181
|
+
}
|
154
182
|
while (continuationToken) {
|
155
183
|
result = await this._listByResourceGroupNext(
|
156
184
|
groupName,
|
@@ -158,7 +186,9 @@ export class ServicesImpl implements Services {
|
|
158
186
|
options
|
159
187
|
);
|
160
188
|
continuationToken = result.nextLink;
|
161
|
-
|
189
|
+
let page = result.value || [];
|
190
|
+
setContinuationToken(page, continuationToken);
|
191
|
+
yield page;
|
162
192
|
}
|
163
193
|
}
|
164
194
|
|
@@ -190,22 +220,34 @@ export class ServicesImpl implements Services {
|
|
190
220
|
[Symbol.asyncIterator]() {
|
191
221
|
return this;
|
192
222
|
},
|
193
|
-
byPage: () => {
|
194
|
-
|
223
|
+
byPage: (settings?: PageSettings) => {
|
224
|
+
if (settings?.maxPageSize) {
|
225
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
226
|
+
}
|
227
|
+
return this.listPagingPage(options, settings);
|
195
228
|
}
|
196
229
|
};
|
197
230
|
}
|
198
231
|
|
199
232
|
private async *listPagingPage(
|
200
|
-
options?: ServicesListOptionalParams
|
233
|
+
options?: ServicesListOptionalParams,
|
234
|
+
settings?: PageSettings
|
201
235
|
): AsyncIterableIterator<DataMigrationService[]> {
|
202
|
-
let result
|
203
|
-
|
204
|
-
|
236
|
+
let result: ServicesListResponse;
|
237
|
+
let continuationToken = settings?.continuationToken;
|
238
|
+
if (!continuationToken) {
|
239
|
+
result = await this._list(options);
|
240
|
+
let page = result.value || [];
|
241
|
+
continuationToken = result.nextLink;
|
242
|
+
setContinuationToken(page, continuationToken);
|
243
|
+
yield page;
|
244
|
+
}
|
205
245
|
while (continuationToken) {
|
206
246
|
result = await this._listNext(continuationToken, options);
|
207
247
|
continuationToken = result.nextLink;
|
208
|
-
|
248
|
+
let page = result.value || [];
|
249
|
+
setContinuationToken(page, continuationToken);
|
250
|
+
yield page;
|
209
251
|
}
|
210
252
|
}
|
211
253
|
|
@@ -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 { SqlMigrationServices } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -18,11 +19,14 @@ import {
|
|
18
19
|
SqlMigrationService,
|
19
20
|
SqlMigrationServicesListByResourceGroupNextOptionalParams,
|
20
21
|
SqlMigrationServicesListByResourceGroupOptionalParams,
|
22
|
+
SqlMigrationServicesListByResourceGroupResponse,
|
21
23
|
DatabaseMigration,
|
22
24
|
SqlMigrationServicesListMigrationsNextOptionalParams,
|
23
25
|
SqlMigrationServicesListMigrationsOptionalParams,
|
26
|
+
SqlMigrationServicesListMigrationsResponse,
|
24
27
|
SqlMigrationServicesListBySubscriptionNextOptionalParams,
|
25
28
|
SqlMigrationServicesListBySubscriptionOptionalParams,
|
29
|
+
SqlMigrationServicesListBySubscriptionResponse,
|
26
30
|
SqlMigrationServicesGetOptionalParams,
|
27
31
|
SqlMigrationServicesGetResponse,
|
28
32
|
SqlMigrationServicesCreateOrUpdateOptionalParams,
|
@@ -31,7 +35,6 @@ import {
|
|
31
35
|
SqlMigrationServiceUpdate,
|
32
36
|
SqlMigrationServicesUpdateOptionalParams,
|
33
37
|
SqlMigrationServicesUpdateResponse,
|
34
|
-
SqlMigrationServicesListByResourceGroupResponse,
|
35
38
|
SqlMigrationServicesListAuthKeysOptionalParams,
|
36
39
|
SqlMigrationServicesListAuthKeysResponse,
|
37
40
|
RegenAuthKeys,
|
@@ -40,10 +43,8 @@ import {
|
|
40
43
|
DeleteNode,
|
41
44
|
SqlMigrationServicesDeleteNodeOptionalParams,
|
42
45
|
SqlMigrationServicesDeleteNodeResponse,
|
43
|
-
SqlMigrationServicesListMigrationsResponse,
|
44
46
|
SqlMigrationServicesListMonitoringDataOptionalParams,
|
45
47
|
SqlMigrationServicesListMonitoringDataResponse,
|
46
|
-
SqlMigrationServicesListBySubscriptionResponse,
|
47
48
|
SqlMigrationServicesListByResourceGroupNextResponse,
|
48
49
|
SqlMigrationServicesListMigrationsNextResponse,
|
49
50
|
SqlMigrationServicesListBySubscriptionNextResponse
|
@@ -80,19 +81,33 @@ export class SqlMigrationServicesImpl implements SqlMigrationServices {
|
|
80
81
|
[Symbol.asyncIterator]() {
|
81
82
|
return this;
|
82
83
|
},
|
83
|
-
byPage: () => {
|
84
|
-
|
84
|
+
byPage: (settings?: PageSettings) => {
|
85
|
+
if (settings?.maxPageSize) {
|
86
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
87
|
+
}
|
88
|
+
return this.listByResourceGroupPagingPage(
|
89
|
+
resourceGroupName,
|
90
|
+
options,
|
91
|
+
settings
|
92
|
+
);
|
85
93
|
}
|
86
94
|
};
|
87
95
|
}
|
88
96
|
|
89
97
|
private async *listByResourceGroupPagingPage(
|
90
98
|
resourceGroupName: string,
|
91
|
-
options?: SqlMigrationServicesListByResourceGroupOptionalParams
|
99
|
+
options?: SqlMigrationServicesListByResourceGroupOptionalParams,
|
100
|
+
settings?: PageSettings
|
92
101
|
): AsyncIterableIterator<SqlMigrationService[]> {
|
93
|
-
let result
|
94
|
-
|
95
|
-
|
102
|
+
let result: SqlMigrationServicesListByResourceGroupResponse;
|
103
|
+
let continuationToken = settings?.continuationToken;
|
104
|
+
if (!continuationToken) {
|
105
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
106
|
+
let page = result.value || [];
|
107
|
+
continuationToken = result.nextLink;
|
108
|
+
setContinuationToken(page, continuationToken);
|
109
|
+
yield page;
|
110
|
+
}
|
96
111
|
while (continuationToken) {
|
97
112
|
result = await this._listByResourceGroupNext(
|
98
113
|
resourceGroupName,
|
@@ -100,7 +115,9 @@ export class SqlMigrationServicesImpl implements SqlMigrationServices {
|
|
100
115
|
options
|
101
116
|
);
|
102
117
|
continuationToken = result.nextLink;
|
103
|
-
|
118
|
+
let page = result.value || [];
|
119
|
+
setContinuationToken(page, continuationToken);
|
120
|
+
yield page;
|
104
121
|
}
|
105
122
|
}
|
106
123
|
|
@@ -140,11 +157,15 @@ export class SqlMigrationServicesImpl implements SqlMigrationServices {
|
|
140
157
|
[Symbol.asyncIterator]() {
|
141
158
|
return this;
|
142
159
|
},
|
143
|
-
byPage: () => {
|
160
|
+
byPage: (settings?: PageSettings) => {
|
161
|
+
if (settings?.maxPageSize) {
|
162
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
163
|
+
}
|
144
164
|
return this.listMigrationsPagingPage(
|
145
165
|
resourceGroupName,
|
146
166
|
sqlMigrationServiceName,
|
147
|
-
options
|
167
|
+
options,
|
168
|
+
settings
|
148
169
|
);
|
149
170
|
}
|
150
171
|
};
|
@@ -153,15 +174,22 @@ export class SqlMigrationServicesImpl implements SqlMigrationServices {
|
|
153
174
|
private async *listMigrationsPagingPage(
|
154
175
|
resourceGroupName: string,
|
155
176
|
sqlMigrationServiceName: string,
|
156
|
-
options?: SqlMigrationServicesListMigrationsOptionalParams
|
177
|
+
options?: SqlMigrationServicesListMigrationsOptionalParams,
|
178
|
+
settings?: PageSettings
|
157
179
|
): AsyncIterableIterator<DatabaseMigration[]> {
|
158
|
-
let result
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
180
|
+
let result: SqlMigrationServicesListMigrationsResponse;
|
181
|
+
let continuationToken = settings?.continuationToken;
|
182
|
+
if (!continuationToken) {
|
183
|
+
result = await this._listMigrations(
|
184
|
+
resourceGroupName,
|
185
|
+
sqlMigrationServiceName,
|
186
|
+
options
|
187
|
+
);
|
188
|
+
let page = result.value || [];
|
189
|
+
continuationToken = result.nextLink;
|
190
|
+
setContinuationToken(page, continuationToken);
|
191
|
+
yield page;
|
192
|
+
}
|
165
193
|
while (continuationToken) {
|
166
194
|
result = await this._listMigrationsNext(
|
167
195
|
resourceGroupName,
|
@@ -170,7 +198,9 @@ export class SqlMigrationServicesImpl implements SqlMigrationServices {
|
|
170
198
|
options
|
171
199
|
);
|
172
200
|
continuationToken = result.nextLink;
|
173
|
-
|
201
|
+
let page = result.value || [];
|
202
|
+
setContinuationToken(page, continuationToken);
|
203
|
+
yield page;
|
174
204
|
}
|
175
205
|
}
|
176
206
|
|
@@ -203,22 +233,34 @@ export class SqlMigrationServicesImpl implements SqlMigrationServices {
|
|
203
233
|
[Symbol.asyncIterator]() {
|
204
234
|
return this;
|
205
235
|
},
|
206
|
-
byPage: () => {
|
207
|
-
|
236
|
+
byPage: (settings?: PageSettings) => {
|
237
|
+
if (settings?.maxPageSize) {
|
238
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
239
|
+
}
|
240
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
208
241
|
}
|
209
242
|
};
|
210
243
|
}
|
211
244
|
|
212
245
|
private async *listBySubscriptionPagingPage(
|
213
|
-
options?: SqlMigrationServicesListBySubscriptionOptionalParams
|
246
|
+
options?: SqlMigrationServicesListBySubscriptionOptionalParams,
|
247
|
+
settings?: PageSettings
|
214
248
|
): AsyncIterableIterator<SqlMigrationService[]> {
|
215
|
-
let result
|
216
|
-
|
217
|
-
|
249
|
+
let result: SqlMigrationServicesListBySubscriptionResponse;
|
250
|
+
let continuationToken = settings?.continuationToken;
|
251
|
+
if (!continuationToken) {
|
252
|
+
result = await this._listBySubscription(options);
|
253
|
+
let page = result.value || [];
|
254
|
+
continuationToken = result.nextLink;
|
255
|
+
setContinuationToken(page, continuationToken);
|
256
|
+
yield page;
|
257
|
+
}
|
218
258
|
while (continuationToken) {
|
219
259
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
220
260
|
continuationToken = result.nextLink;
|
221
|
-
|
261
|
+
let page = result.value || [];
|
262
|
+
setContinuationToken(page, continuationToken);
|
263
|
+
yield page;
|
222
264
|
}
|
223
265
|
}
|
224
266
|
|