@azure/arm-education 1.0.0-beta.1 → 1.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 +25 -0
- package/LICENSE +1 -1
- package/README.md +4 -3
- package/dist/index.js +233 -79
- 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/grantsGetSample.js +9 -2
- package/dist-esm/samples-dev/grantsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/grantsListAllSample.js +9 -2
- package/dist-esm/samples-dev/grantsListAllSample.js.map +1 -1
- package/dist-esm/samples-dev/grantsListSample.js +9 -2
- package/dist-esm/samples-dev/grantsListSample.js.map +1 -1
- package/dist-esm/samples-dev/joinRequestsApproveSample.js +8 -1
- package/dist-esm/samples-dev/joinRequestsApproveSample.js.map +1 -1
- package/dist-esm/samples-dev/joinRequestsDenySample.js +8 -1
- package/dist-esm/samples-dev/joinRequestsDenySample.js.map +1 -1
- package/dist-esm/samples-dev/joinRequestsGetSample.js +8 -1
- package/dist-esm/samples-dev/joinRequestsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/joinRequestsListSample.js +8 -1
- package/dist-esm/samples-dev/joinRequestsListSample.js.map +1 -1
- package/dist-esm/samples-dev/labsCreateOrUpdateSample.js +8 -1
- package/dist-esm/samples-dev/labsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/labsDeleteSample.js +8 -1
- package/dist-esm/samples-dev/labsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/labsGenerateInviteCodeSample.js +8 -1
- package/dist-esm/samples-dev/labsGenerateInviteCodeSample.js.map +1 -1
- package/dist-esm/samples-dev/labsGetSample.js +9 -2
- package/dist-esm/samples-dev/labsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/labsListAllSample.js +9 -2
- package/dist-esm/samples-dev/labsListAllSample.js.map +1 -1
- package/dist-esm/samples-dev/labsListSample.js +9 -2
- package/dist-esm/samples-dev/labsListSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +8 -1
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/redeemInvitationCodeSample.js +8 -1
- package/dist-esm/samples-dev/redeemInvitationCodeSample.js.map +1 -1
- package/dist-esm/samples-dev/studentLabsGetSample.js +8 -1
- package/dist-esm/samples-dev/studentLabsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/studentLabsListAllSample.js +8 -1
- package/dist-esm/samples-dev/studentLabsListAllSample.js.map +1 -1
- package/dist-esm/samples-dev/studentsCreateOrUpdateSample.js +8 -1
- package/dist-esm/samples-dev/studentsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/studentsDeleteSample.js +8 -1
- package/dist-esm/samples-dev/studentsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/studentsGetSample.js +8 -1
- package/dist-esm/samples-dev/studentsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/studentsListSample.js +8 -1
- package/dist-esm/samples-dev/studentsListSample.js.map +1 -1
- package/dist-esm/src/educationManagementClient.d.ts +2 -0
- package/dist-esm/src/educationManagementClient.d.ts.map +1 -1
- package/dist-esm/src/educationManagementClient.js +49 -18
- package/dist-esm/src/educationManagementClient.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 +38 -26
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +25 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/operations/grants.d.ts.map +1 -1
- package/dist-esm/src/operations/grants.js +37 -16
- package/dist-esm/src/operations/grants.js.map +1 -1
- package/dist-esm/src/operations/joinRequests.d.ts.map +1 -1
- package/dist-esm/src/operations/joinRequests.js +19 -8
- package/dist-esm/src/operations/joinRequests.js.map +1 -1
- package/dist-esm/src/operations/labs.d.ts.map +1 -1
- package/dist-esm/src/operations/labs.js +37 -20
- package/dist-esm/src/operations/labs.js.map +1 -1
- package/dist-esm/src/operations/studentLabs.d.ts.map +1 -1
- package/dist-esm/src/operations/studentLabs.js +19 -8
- package/dist-esm/src/operations/studentLabs.js.map +1 -1
- package/dist-esm/src/operations/students.d.ts.map +1 -1
- package/dist-esm/src/operations/students.js +19 -8
- package/dist-esm/src/operations/students.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 +17 -12
- package/review/arm-education.api.md +35 -61
- package/src/educationManagementClient.ts +60 -20
- package/src/index.ts +1 -0
- package/src/models/index.ts +44 -38
- package/src/operations/grants.ts +46 -22
- package/src/operations/joinRequests.ts +27 -14
- package/src/operations/labs.ts +52 -31
- package/src/operations/studentLabs.ts +21 -9
- package/src/operations/students.ts +27 -14
- package/src/pagingHelper.ts +39 -0
- package/types/arm-education.d.ts +49 -26
- package/types/tsdoc-metadata.json +1 -1
package/src/operations/grants.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 { Grants } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -16,9 +17,9 @@ import {
|
|
|
16
17
|
GrantDetails,
|
|
17
18
|
GrantsListAllNextOptionalParams,
|
|
18
19
|
GrantsListAllOptionalParams,
|
|
20
|
+
GrantsListAllResponse,
|
|
19
21
|
GrantsListNextOptionalParams,
|
|
20
22
|
GrantsListOptionalParams,
|
|
21
|
-
GrantsListAllResponse,
|
|
22
23
|
GrantsListResponse,
|
|
23
24
|
GrantsGetOptionalParams,
|
|
24
25
|
GrantsGetResponse,
|
|
@@ -54,22 +55,34 @@ export class GrantsImpl implements Grants {
|
|
|
54
55
|
[Symbol.asyncIterator]() {
|
|
55
56
|
return this;
|
|
56
57
|
},
|
|
57
|
-
byPage: () => {
|
|
58
|
-
|
|
58
|
+
byPage: (settings?: PageSettings) => {
|
|
59
|
+
if (settings?.maxPageSize) {
|
|
60
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
61
|
+
}
|
|
62
|
+
return this.listAllPagingPage(options, settings);
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
private async *listAllPagingPage(
|
|
64
|
-
options?: GrantsListAllOptionalParams
|
|
68
|
+
options?: GrantsListAllOptionalParams,
|
|
69
|
+
settings?: PageSettings
|
|
65
70
|
): AsyncIterableIterator<GrantDetails[]> {
|
|
66
|
-
let result
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
let result: GrantsListAllResponse;
|
|
72
|
+
let continuationToken = settings?.continuationToken;
|
|
73
|
+
if (!continuationToken) {
|
|
74
|
+
result = await this._listAll(options);
|
|
75
|
+
let page = result.value || [];
|
|
76
|
+
continuationToken = result.nextLink;
|
|
77
|
+
setContinuationToken(page, continuationToken);
|
|
78
|
+
yield page;
|
|
79
|
+
}
|
|
69
80
|
while (continuationToken) {
|
|
70
81
|
result = await this._listAllNext(continuationToken, options);
|
|
71
82
|
continuationToken = result.nextLink;
|
|
72
|
-
|
|
83
|
+
let page = result.value || [];
|
|
84
|
+
setContinuationToken(page, continuationToken);
|
|
85
|
+
yield page;
|
|
73
86
|
}
|
|
74
87
|
}
|
|
75
88
|
|
|
@@ -104,11 +117,15 @@ export class GrantsImpl implements Grants {
|
|
|
104
117
|
[Symbol.asyncIterator]() {
|
|
105
118
|
return this;
|
|
106
119
|
},
|
|
107
|
-
byPage: () => {
|
|
120
|
+
byPage: (settings?: PageSettings) => {
|
|
121
|
+
if (settings?.maxPageSize) {
|
|
122
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
123
|
+
}
|
|
108
124
|
return this.listPagingPage(
|
|
109
125
|
billingAccountName,
|
|
110
126
|
billingProfileName,
|
|
111
|
-
options
|
|
127
|
+
options,
|
|
128
|
+
settings
|
|
112
129
|
);
|
|
113
130
|
}
|
|
114
131
|
};
|
|
@@ -117,15 +134,22 @@ export class GrantsImpl implements Grants {
|
|
|
117
134
|
private async *listPagingPage(
|
|
118
135
|
billingAccountName: string,
|
|
119
136
|
billingProfileName: string,
|
|
120
|
-
options?: GrantsListOptionalParams
|
|
137
|
+
options?: GrantsListOptionalParams,
|
|
138
|
+
settings?: PageSettings
|
|
121
139
|
): AsyncIterableIterator<GrantDetails[]> {
|
|
122
|
-
let result
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
140
|
+
let result: GrantsListResponse;
|
|
141
|
+
let continuationToken = settings?.continuationToken;
|
|
142
|
+
if (!continuationToken) {
|
|
143
|
+
result = await this._list(
|
|
144
|
+
billingAccountName,
|
|
145
|
+
billingProfileName,
|
|
146
|
+
options
|
|
147
|
+
);
|
|
148
|
+
let page = result.value || [];
|
|
149
|
+
continuationToken = result.nextLink;
|
|
150
|
+
setContinuationToken(page, continuationToken);
|
|
151
|
+
yield page;
|
|
152
|
+
}
|
|
129
153
|
while (continuationToken) {
|
|
130
154
|
result = await this._listNext(
|
|
131
155
|
billingAccountName,
|
|
@@ -134,7 +158,9 @@ export class GrantsImpl implements Grants {
|
|
|
134
158
|
options
|
|
135
159
|
);
|
|
136
160
|
continuationToken = result.nextLink;
|
|
137
|
-
|
|
161
|
+
let page = result.value || [];
|
|
162
|
+
setContinuationToken(page, continuationToken);
|
|
163
|
+
yield page;
|
|
138
164
|
}
|
|
139
165
|
}
|
|
140
166
|
|
|
@@ -302,7 +328,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = {
|
|
|
302
328
|
bodyMapper: Mappers.ErrorResponseBody
|
|
303
329
|
}
|
|
304
330
|
},
|
|
305
|
-
queryParameters: [Parameters.apiVersion, Parameters.includeAllocatedBudget],
|
|
306
331
|
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
307
332
|
headerParameters: [Parameters.accept],
|
|
308
333
|
serializer
|
|
@@ -318,7 +343,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
318
343
|
bodyMapper: Mappers.ErrorResponseBody
|
|
319
344
|
}
|
|
320
345
|
},
|
|
321
|
-
queryParameters: [Parameters.apiVersion, Parameters.includeAllocatedBudget],
|
|
322
346
|
urlParameters: [
|
|
323
347
|
Parameters.$host,
|
|
324
348
|
Parameters.billingAccountName,
|
|
@@ -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 { JoinRequests } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -63,12 +64,16 @@ export class JoinRequestsImpl implements JoinRequests {
|
|
|
63
64
|
[Symbol.asyncIterator]() {
|
|
64
65
|
return this;
|
|
65
66
|
},
|
|
66
|
-
byPage: () => {
|
|
67
|
+
byPage: (settings?: PageSettings) => {
|
|
68
|
+
if (settings?.maxPageSize) {
|
|
69
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
70
|
+
}
|
|
67
71
|
return this.listPagingPage(
|
|
68
72
|
billingAccountName,
|
|
69
73
|
billingProfileName,
|
|
70
74
|
invoiceSectionName,
|
|
71
|
-
options
|
|
75
|
+
options,
|
|
76
|
+
settings
|
|
72
77
|
);
|
|
73
78
|
}
|
|
74
79
|
};
|
|
@@ -78,16 +83,23 @@ export class JoinRequestsImpl implements JoinRequests {
|
|
|
78
83
|
billingAccountName: string,
|
|
79
84
|
billingProfileName: string,
|
|
80
85
|
invoiceSectionName: string,
|
|
81
|
-
options?: JoinRequestsListOptionalParams
|
|
86
|
+
options?: JoinRequestsListOptionalParams,
|
|
87
|
+
settings?: PageSettings
|
|
82
88
|
): AsyncIterableIterator<JoinRequestDetails[]> {
|
|
83
|
-
let result
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
let result: JoinRequestsListResponse;
|
|
90
|
+
let continuationToken = settings?.continuationToken;
|
|
91
|
+
if (!continuationToken) {
|
|
92
|
+
result = await this._list(
|
|
93
|
+
billingAccountName,
|
|
94
|
+
billingProfileName,
|
|
95
|
+
invoiceSectionName,
|
|
96
|
+
options
|
|
97
|
+
);
|
|
98
|
+
let page = result.value || [];
|
|
99
|
+
continuationToken = result.nextLink;
|
|
100
|
+
setContinuationToken(page, continuationToken);
|
|
101
|
+
yield page;
|
|
102
|
+
}
|
|
91
103
|
while (continuationToken) {
|
|
92
104
|
result = await this._listNext(
|
|
93
105
|
billingAccountName,
|
|
@@ -97,7 +109,9 @@ export class JoinRequestsImpl implements JoinRequests {
|
|
|
97
109
|
options
|
|
98
110
|
);
|
|
99
111
|
continuationToken = result.nextLink;
|
|
100
|
-
|
|
112
|
+
let page = result.value || [];
|
|
113
|
+
setContinuationToken(page, continuationToken);
|
|
114
|
+
yield page;
|
|
101
115
|
}
|
|
102
116
|
}
|
|
103
117
|
|
|
@@ -345,7 +359,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
345
359
|
bodyMapper: Mappers.ErrorResponseBody
|
|
346
360
|
}
|
|
347
361
|
},
|
|
348
|
-
queryParameters: [Parameters.apiVersion, Parameters.includeDenied],
|
|
349
362
|
urlParameters: [
|
|
350
363
|
Parameters.$host,
|
|
351
364
|
Parameters.billingAccountName,
|
package/src/operations/labs.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 { Labs } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -16,9 +17,9 @@ import {
|
|
|
16
17
|
LabDetails,
|
|
17
18
|
LabsListAllNextOptionalParams,
|
|
18
19
|
LabsListAllOptionalParams,
|
|
20
|
+
LabsListAllResponse,
|
|
19
21
|
LabsListNextOptionalParams,
|
|
20
22
|
LabsListOptionalParams,
|
|
21
|
-
LabsListAllResponse,
|
|
22
23
|
LabsListResponse,
|
|
23
24
|
LabsGetOptionalParams,
|
|
24
25
|
LabsGetResponse,
|
|
@@ -68,11 +69,15 @@ export class LabsImpl implements Labs {
|
|
|
68
69
|
[Symbol.asyncIterator]() {
|
|
69
70
|
return this;
|
|
70
71
|
},
|
|
71
|
-
byPage: () => {
|
|
72
|
+
byPage: (settings?: PageSettings) => {
|
|
73
|
+
if (settings?.maxPageSize) {
|
|
74
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
75
|
+
}
|
|
72
76
|
return this.listAllPagingPage(
|
|
73
77
|
billingAccountName,
|
|
74
78
|
billingProfileName,
|
|
75
|
-
options
|
|
79
|
+
options,
|
|
80
|
+
settings
|
|
76
81
|
);
|
|
77
82
|
}
|
|
78
83
|
};
|
|
@@ -81,15 +86,22 @@ export class LabsImpl implements Labs {
|
|
|
81
86
|
private async *listAllPagingPage(
|
|
82
87
|
billingAccountName: string,
|
|
83
88
|
billingProfileName: string,
|
|
84
|
-
options?: LabsListAllOptionalParams
|
|
89
|
+
options?: LabsListAllOptionalParams,
|
|
90
|
+
settings?: PageSettings
|
|
85
91
|
): AsyncIterableIterator<LabDetails[]> {
|
|
86
|
-
let result
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
let result: LabsListAllResponse;
|
|
93
|
+
let continuationToken = settings?.continuationToken;
|
|
94
|
+
if (!continuationToken) {
|
|
95
|
+
result = await this._listAll(
|
|
96
|
+
billingAccountName,
|
|
97
|
+
billingProfileName,
|
|
98
|
+
options
|
|
99
|
+
);
|
|
100
|
+
let page = result.value || [];
|
|
101
|
+
continuationToken = result.nextLink;
|
|
102
|
+
setContinuationToken(page, continuationToken);
|
|
103
|
+
yield page;
|
|
104
|
+
}
|
|
93
105
|
while (continuationToken) {
|
|
94
106
|
result = await this._listAllNext(
|
|
95
107
|
billingAccountName,
|
|
@@ -98,7 +110,9 @@ export class LabsImpl implements Labs {
|
|
|
98
110
|
options
|
|
99
111
|
);
|
|
100
112
|
continuationToken = result.nextLink;
|
|
101
|
-
|
|
113
|
+
let page = result.value || [];
|
|
114
|
+
setContinuationToken(page, continuationToken);
|
|
115
|
+
yield page;
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
|
|
@@ -143,12 +157,16 @@ export class LabsImpl implements Labs {
|
|
|
143
157
|
[Symbol.asyncIterator]() {
|
|
144
158
|
return this;
|
|
145
159
|
},
|
|
146
|
-
byPage: () => {
|
|
160
|
+
byPage: (settings?: PageSettings) => {
|
|
161
|
+
if (settings?.maxPageSize) {
|
|
162
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
163
|
+
}
|
|
147
164
|
return this.listPagingPage(
|
|
148
165
|
billingAccountName,
|
|
149
166
|
billingProfileName,
|
|
150
167
|
invoiceSectionName,
|
|
151
|
-
options
|
|
168
|
+
options,
|
|
169
|
+
settings
|
|
152
170
|
);
|
|
153
171
|
}
|
|
154
172
|
};
|
|
@@ -158,16 +176,23 @@ export class LabsImpl implements Labs {
|
|
|
158
176
|
billingAccountName: string,
|
|
159
177
|
billingProfileName: string,
|
|
160
178
|
invoiceSectionName: string,
|
|
161
|
-
options?: LabsListOptionalParams
|
|
179
|
+
options?: LabsListOptionalParams,
|
|
180
|
+
settings?: PageSettings
|
|
162
181
|
): AsyncIterableIterator<LabDetails[]> {
|
|
163
|
-
let result
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
182
|
+
let result: LabsListResponse;
|
|
183
|
+
let continuationToken = settings?.continuationToken;
|
|
184
|
+
if (!continuationToken) {
|
|
185
|
+
result = await this._list(
|
|
186
|
+
billingAccountName,
|
|
187
|
+
billingProfileName,
|
|
188
|
+
invoiceSectionName,
|
|
189
|
+
options
|
|
190
|
+
);
|
|
191
|
+
let page = result.value || [];
|
|
192
|
+
continuationToken = result.nextLink;
|
|
193
|
+
setContinuationToken(page, continuationToken);
|
|
194
|
+
yield page;
|
|
195
|
+
}
|
|
171
196
|
while (continuationToken) {
|
|
172
197
|
result = await this._listNext(
|
|
173
198
|
billingAccountName,
|
|
@@ -177,7 +202,9 @@ export class LabsImpl implements Labs {
|
|
|
177
202
|
options
|
|
178
203
|
);
|
|
179
204
|
continuationToken = result.nextLink;
|
|
180
|
-
|
|
205
|
+
let page = result.value || [];
|
|
206
|
+
setContinuationToken(page, continuationToken);
|
|
207
|
+
yield page;
|
|
181
208
|
}
|
|
182
209
|
}
|
|
183
210
|
|
|
@@ -532,11 +559,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = {
|
|
|
532
559
|
bodyMapper: Mappers.ErrorResponseBody
|
|
533
560
|
}
|
|
534
561
|
},
|
|
535
|
-
queryParameters: [
|
|
536
|
-
Parameters.apiVersion,
|
|
537
|
-
Parameters.includeBudget,
|
|
538
|
-
Parameters.includeDeleted
|
|
539
|
-
],
|
|
540
562
|
urlParameters: [
|
|
541
563
|
Parameters.$host,
|
|
542
564
|
Parameters.billingAccountName,
|
|
@@ -557,7 +579,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
557
579
|
bodyMapper: Mappers.ErrorResponseBody
|
|
558
580
|
}
|
|
559
581
|
},
|
|
560
|
-
queryParameters: [Parameters.apiVersion, Parameters.includeBudget],
|
|
561
582
|
urlParameters: [
|
|
562
583
|
Parameters.$host,
|
|
563
584
|
Parameters.billingAccountName,
|
|
@@ -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 { StudentLabs } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -50,22 +51,34 @@ export class StudentLabsImpl implements StudentLabs {
|
|
|
50
51
|
[Symbol.asyncIterator]() {
|
|
51
52
|
return this;
|
|
52
53
|
},
|
|
53
|
-
byPage: () => {
|
|
54
|
-
|
|
54
|
+
byPage: (settings?: PageSettings) => {
|
|
55
|
+
if (settings?.maxPageSize) {
|
|
56
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
57
|
+
}
|
|
58
|
+
return this.listAllPagingPage(options, settings);
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
private async *listAllPagingPage(
|
|
60
|
-
options?: StudentLabsListAllOptionalParams
|
|
64
|
+
options?: StudentLabsListAllOptionalParams,
|
|
65
|
+
settings?: PageSettings
|
|
61
66
|
): AsyncIterableIterator<StudentLabDetails[]> {
|
|
62
|
-
let result
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
let result: StudentLabsListAllResponse;
|
|
68
|
+
let continuationToken = settings?.continuationToken;
|
|
69
|
+
if (!continuationToken) {
|
|
70
|
+
result = await this._listAll(options);
|
|
71
|
+
let page = result.value || [];
|
|
72
|
+
continuationToken = result.nextLink;
|
|
73
|
+
setContinuationToken(page, continuationToken);
|
|
74
|
+
yield page;
|
|
75
|
+
}
|
|
65
76
|
while (continuationToken) {
|
|
66
77
|
result = await this._listAllNext(continuationToken, options);
|
|
67
78
|
continuationToken = result.nextLink;
|
|
68
|
-
|
|
79
|
+
let page = result.value || [];
|
|
80
|
+
setContinuationToken(page, continuationToken);
|
|
81
|
+
yield page;
|
|
69
82
|
}
|
|
70
83
|
}
|
|
71
84
|
|
|
@@ -163,7 +176,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = {
|
|
|
163
176
|
bodyMapper: Mappers.ErrorResponseBody
|
|
164
177
|
}
|
|
165
178
|
},
|
|
166
|
-
queryParameters: [Parameters.apiVersion],
|
|
167
179
|
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
168
180
|
headerParameters: [Parameters.accept],
|
|
169
181
|
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 { Students } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -64,12 +65,16 @@ export class StudentsImpl implements Students {
|
|
|
64
65
|
[Symbol.asyncIterator]() {
|
|
65
66
|
return this;
|
|
66
67
|
},
|
|
67
|
-
byPage: () => {
|
|
68
|
+
byPage: (settings?: PageSettings) => {
|
|
69
|
+
if (settings?.maxPageSize) {
|
|
70
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
71
|
+
}
|
|
68
72
|
return this.listPagingPage(
|
|
69
73
|
billingAccountName,
|
|
70
74
|
billingProfileName,
|
|
71
75
|
invoiceSectionName,
|
|
72
|
-
options
|
|
76
|
+
options,
|
|
77
|
+
settings
|
|
73
78
|
);
|
|
74
79
|
}
|
|
75
80
|
};
|
|
@@ -79,16 +84,23 @@ export class StudentsImpl implements Students {
|
|
|
79
84
|
billingAccountName: string,
|
|
80
85
|
billingProfileName: string,
|
|
81
86
|
invoiceSectionName: string,
|
|
82
|
-
options?: StudentsListOptionalParams
|
|
87
|
+
options?: StudentsListOptionalParams,
|
|
88
|
+
settings?: PageSettings
|
|
83
89
|
): AsyncIterableIterator<StudentDetails[]> {
|
|
84
|
-
let result
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
let result: StudentsListResponse;
|
|
91
|
+
let continuationToken = settings?.continuationToken;
|
|
92
|
+
if (!continuationToken) {
|
|
93
|
+
result = await this._list(
|
|
94
|
+
billingAccountName,
|
|
95
|
+
billingProfileName,
|
|
96
|
+
invoiceSectionName,
|
|
97
|
+
options
|
|
98
|
+
);
|
|
99
|
+
let page = result.value || [];
|
|
100
|
+
continuationToken = result.nextLink;
|
|
101
|
+
setContinuationToken(page, continuationToken);
|
|
102
|
+
yield page;
|
|
103
|
+
}
|
|
92
104
|
while (continuationToken) {
|
|
93
105
|
result = await this._listNext(
|
|
94
106
|
billingAccountName,
|
|
@@ -98,7 +110,9 @@ export class StudentsImpl implements Students {
|
|
|
98
110
|
options
|
|
99
111
|
);
|
|
100
112
|
continuationToken = result.nextLink;
|
|
101
|
-
|
|
113
|
+
let page = result.value || [];
|
|
114
|
+
setContinuationToken(page, continuationToken);
|
|
115
|
+
yield page;
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
|
|
@@ -358,7 +372,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
358
372
|
bodyMapper: Mappers.ErrorResponseBody
|
|
359
373
|
}
|
|
360
374
|
},
|
|
361
|
-
queryParameters: [Parameters.apiVersion, Parameters.includeDeleted],
|
|
362
375
|
urlParameters: [
|
|
363
376
|
Parameters.$host,
|
|
364
377
|
Parameters.billingAccountName,
|
|
@@ -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
|
+
}
|