Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support modular paging #1996

Merged
merged 71 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
df26e39
Re-generate to support the paging feature
MaryGao Aug 29, 2023
46a92cd
Update the page return type
MaryGao Aug 29, 2023
b9873b0
Refactor code
MaryGao Aug 29, 2023
ea2c7bc
Update the comments
MaryGao Aug 29, 2023
9fcd40a
Update the cadl-ranch version
MaryGao Aug 29, 2023
9642e55
Update the test cases and re-gen smoke testing
MaryGao Aug 29, 2023
18987a0
update paths
MaryGao Aug 29, 2023
e8be6ad
Regenerate rlc codes in int testing
MaryGao Aug 29, 2023
d4371cd
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Sep 8, 2023
8039014
Update the changes
MaryGao Sep 8, 2023
62bae6e
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Sep 14, 2023
a835f80
Fix the build error
MaryGao Sep 14, 2023
38cc90c
Update the page utils
MaryGao Sep 14, 2023
84b2a3d
Update the generation
MaryGao Sep 14, 2023
8df91b2
update the generated paging
MaryGao Sep 14, 2023
a35c600
Generate the smoke testing
MaryGao Sep 14, 2023
be9beb8
Fix the load testing issues
MaryGao Sep 14, 2023
8036a36
update the comments
MaryGao Sep 14, 2023
13c7892
Merge branch 'main' into support-modular-paging2
MaryGao Nov 7, 2023
aaf4eec
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Nov 8, 2023
52ea227
Rebuild and update the build issue
MaryGao Nov 8, 2023
960263f
Update the ranch version
MaryGao Nov 8, 2023
e7ba9ce
Merge branch 'main' into support-modular-paging2
MaryGao Nov 14, 2023
0c267e6
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Nov 14, 2023
068b10b
Refactor the paging codes
MaryGao Nov 15, 2023
28afe21
Update paging types
MaryGao Nov 15, 2023
33363f2
Update the batch generations
MaryGao Nov 15, 2023
a9c5b48
Update the codegen
MaryGao Nov 15, 2023
ea4b6aa
Re-generate the batch modular
MaryGao Nov 15, 2023
a10c6d3
Re-generate the integration testings
MaryGao Nov 15, 2023
e6c9c53
Update the integrate for paging
MaryGao Nov 15, 2023
04f6e24
Fix lint issues
MaryGao Nov 15, 2023
931cf4d
Fix lint issues
MaryGao Nov 15, 2023
448846d
Update the paging for smoke testings
MaryGao Nov 15, 2023
917e9bc
Refactor code
MaryGao Nov 15, 2023
37d5626
Refactor code
MaryGao Nov 15, 2023
963d5df
Refactor code
MaryGao Nov 15, 2023
494e616
Update packages/typespec-ts/test/commands/cadl-ranch-list.ts
MaryGao Nov 15, 2023
fa6c1de
Update packages/typespec-ts/test/commands/cadl-ranch-list.ts
MaryGao Nov 15, 2023
27c25d4
Update packages/typespec-ts/test/commands/cadl-ranch-list.ts
MaryGao Nov 15, 2023
e3fd177
Update packages/typespec-ts/test/commands/cadl-ranch-list.ts
MaryGao Nov 15, 2023
ee3b29a
Add comments for interface
MaryGao Nov 16, 2023
5dfb203
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Nov 16, 2023
dfd18ea
Resolve comments
MaryGao Nov 16, 2023
d7877c3
Update the modular paging regen
MaryGao Nov 16, 2023
7f6c9ab
Update the helpers and regenerate codes
MaryGao Nov 20, 2023
fa5c2fb
Remove useless types in pagings
MaryGao Nov 20, 2023
bd42574
Remove useless types in pagings
MaryGao Nov 20, 2023
4e95ced
Regen for paging in load testing modular
MaryGao Nov 20, 2023
c090215
Merge branch 'main' into support-modular-paging2
MaryGao Nov 20, 2023
e2aa5d9
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Nov 21, 2023
c7f7b7e
Regenerate the pagings not reference core's one
MaryGao Nov 21, 2023
e090a70
Update the paging cases in widget_dpg.api
MaryGao Nov 21, 2023
f8cf5a3
Resolve some comments
MaryGao Nov 21, 2023
677c526
Resolve some comments
MaryGao Nov 21, 2023
40dfbf1
Resolve some comments
MaryGao Nov 21, 2023
d39aa9e
Regenerate the paging helpers
MaryGao Nov 21, 2023
416064b
Report warning if no items defined
MaryGao Nov 21, 2023
e650d4b
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Nov 22, 2023
56c43ba
Resolve conflicts
MaryGao Nov 22, 2023
ec6444b
Update the changes
MaryGao Nov 22, 2023
08843fb
Update the extension TPageSettings extends PageSettings
MaryGao Nov 22, 2023
fd1b1ee
Update the no need export
MaryGao Nov 22, 2023
cf997fc
Remove useless comments
MaryGao Nov 22, 2023
1af1421
Regenerate the codes
MaryGao Nov 22, 2023
2539366
Update packages/typespec-test/test/contentsafety_modular/generated/ty…
MaryGao Nov 23, 2023
b002b3b
Update packages/typespec-test/test/contentsafety_modular/generated/ty…
MaryGao Nov 23, 2023
7d13c24
Regenerate codes to resolve comments
MaryGao Nov 23, 2023
0a4a75e
Merge remote-tracking branch 'origin/main' into support-modular-paging2
MaryGao Nov 27, 2023
88d3ffd
Re-generate the paging modular sdk
MaryGao Nov 27, 2023
09696c0
Add paging cases in modular
MaryGao Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,22 @@ export class BatchClient {
getTaskFile(jobId: string, taskId: string, filePath: string, options?: GetTaskFileOptions): Promise<Uint8Array>;
getTaskFileProperties(jobId: string, taskId: string, filePath: string, options?: GetTaskFilePropertiesOptions): Promise<void>;
jobScheduleExists(jobScheduleId: string, options?: JobScheduleExistsOptions): Promise<void>;
listApplications(options?: ListApplicationsOptions): Promise<ApplicationListResult>;
listCertificates(options?: ListCertificatesOptions): Promise<CertificateListResult>;
listJobPreparationAndReleaseTaskStatus(jobId: string, options?: ListJobPreparationAndReleaseTaskStatusOptions): Promise<BatchJobListPreparationAndReleaseTaskStatusResult>;
listJobs(options?: ListJobsOptions): Promise<BatchJobListResult>;
listJobSchedules(options?: ListJobSchedulesOptions): Promise<BatchJobScheduleListResult>;
listJobsFromSchedule(jobScheduleId: string, options?: ListJobsFromScheduleOptions): Promise<BatchJobListResult>;
listNodeExtensions(poolId: string, nodeId: string, options?: ListNodeExtensionsOptions): Promise<NodeVMExtensionList>;
listNodeFiles(poolId: string, nodeId: string, options?: ListNodeFilesOptions): Promise<NodeFileListResult>;
listNodes(poolId: string, options?: ListNodesOptions): Promise<BatchNodeListResult>;
listPoolNodeCounts(options?: ListPoolNodeCountsOptions): Promise<PoolNodeCountsListResult>;
listPools(options?: ListPoolsOptions): Promise<BatchPoolListResult>;
listPoolUsageMetrics(options?: ListPoolUsageMetricsOptions): Promise<PoolListUsageMetricsResult>;
listApplications(options?: ListApplicationsOptions): PagedAsyncIterableIterator<BatchApplication>;
listCertificates(options?: ListCertificatesOptions): PagedAsyncIterableIterator<BatchCertificate>;
listJobPreparationAndReleaseTaskStatus(jobId: string, options?: ListJobPreparationAndReleaseTaskStatusOptions): PagedAsyncIterableIterator<JobPreparationAndReleaseTaskExecutionInformation>;
listJobs(options?: ListJobsOptions): PagedAsyncIterableIterator<BatchJob>;
listJobSchedules(options?: ListJobSchedulesOptions): PagedAsyncIterableIterator<BatchJobSchedule>;
listJobsFromSchedule(jobScheduleId: string, options?: ListJobsFromScheduleOptions): PagedAsyncIterableIterator<BatchJob>;
listNodeExtensions(poolId: string, nodeId: string, options?: ListNodeExtensionsOptions): PagedAsyncIterableIterator<NodeVMExtension>;
listNodeFiles(poolId: string, nodeId: string, options?: ListNodeFilesOptions): PagedAsyncIterableIterator<NodeFile>;
listNodes(poolId: string, options?: ListNodesOptions): PagedAsyncIterableIterator<BatchNode>;
listPoolNodeCounts(options?: ListPoolNodeCountsOptions): PagedAsyncIterableIterator<PoolNodeCounts>;
listPools(options?: ListPoolsOptions): PagedAsyncIterableIterator<BatchPool>;
listPoolUsageMetrics(options?: ListPoolUsageMetricsOptions): PagedAsyncIterableIterator<PoolUsageMetrics>;
listSubTasks(jobId: string, taskId: string, options?: ListSubTasksOptions): Promise<BatchTaskListSubtasksResult>;
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
listSupportedImages(options?: ListSupportedImagesOptions): Promise<AccountListSupportedImagesResult>;
listTaskFiles(jobId: string, taskId: string, options?: ListTaskFilesOptions): Promise<NodeFileListResult>;
listTasks(jobId: string, options?: ListTasksOptions): Promise<BatchTaskListResult>;
listSupportedImages(options?: ListSupportedImagesOptions): PagedAsyncIterableIterator<ImageInformation>;
listTaskFiles(jobId: string, taskId: string, options?: ListTaskFilesOptions): PagedAsyncIterableIterator<NodeFile>;
listTasks(jobId: string, options?: ListTasksOptions): PagedAsyncIterableIterator<BatchTask>;
readonly pipeline: Pipeline;
poolExists(poolId: string, options?: PoolExistsOptions): Promise<void>;
reactivateTask(jobId: string, taskId: string, options?: ReactivateTaskOptions): Promise<void>;
Expand Down Expand Up @@ -693,6 +693,11 @@ export type ContainerType = string;
// @public
export type ContainerWorkingDirectory = string;

// @public
export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
continuationToken?: string;
};

// @public (undocumented)
export interface CreateCertificateOptions extends OperationOptions {
contentType?: string;
Expand Down Expand Up @@ -1645,6 +1650,18 @@ export interface OutputFileUploadOptions {
uploadCondition: OutputFileUploadCondition;
}

// @public
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
next(): Promise<IteratorResult<TElement>>;
}

// @public
export interface PageSettings {
continuationToken?: string;
}

// @public
export interface PoolEndpointConfiguration {
inboundNATPools: InboundNATPool[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import { TokenCredential } from "@azure/core-auth";
import { Pipeline } from "@azure/core-rest-pipeline";
import {
ApplicationListResult,
BatchApplication,
PoolListUsageMetricsResult,
PoolUsageMetrics,
BatchPoolCreateOptions,
BatchPoolListResult,
BatchPool,
AutoScaleRun,
BatchPoolUpdateOptions,
Expand All @@ -17,29 +15,25 @@ import {
BatchPoolResizeOptions,
BatchPoolReplaceOptions,
NodeRemoveOptions,
AccountListSupportedImagesResult,
PoolNodeCountsListResult,
ImageInformation,
PoolNodeCounts,
BatchJob,
BatchJobUpdateOptions,
BatchJobDisableOptions,
BatchJobTerminateOptions,
BatchJobCreateOptions,
BatchJobListResult,
BatchJobListPreparationAndReleaseTaskStatusResult,
JobPreparationAndReleaseTaskExecutionInformation,
TaskCountsResult,
BatchCertificate,
CertificateListResult,
BatchJobSchedule,
BatchJobScheduleUpdateOptions,
BatchJobScheduleCreateOptions,
BatchJobScheduleListResult,
BatchTaskCreateOptions,
BatchTaskListResult,
BatchTask,
BatchTaskCollection,
TaskAddCollectionResult,
BatchTaskListSubtasksResult,
NodeFileListResult,
NodeFile,
BatchNodeUserCreateOptions,
BatchNodeUserUpdateOptions,
BatchNode,
Expand All @@ -49,9 +43,7 @@ import {
BatchNodeRemoteLoginSettingsResult,
UploadBatchServiceLogsOptions,
UploadBatchServiceLogsResult,
BatchNodeListResult,
NodeVMExtension,
NodeVMExtensionList,
} from "./models/models.js";
import {
ListApplicationsOptions,
Expand Down Expand Up @@ -131,6 +123,7 @@ import {
GetNodeFilePropertiesOptions,
ListNodeFilesOptions,
} from "./models/options.js";
import { PagedAsyncIterableIterator } from "./models/pagingTypes.js";
import {
createBatch,
BatchClientOptions,
Expand Down Expand Up @@ -239,7 +232,7 @@ export class BatchClient {
*/
listApplications(
options: ListApplicationsOptions = { requestOptions: {} }
): Promise<ApplicationListResult> {
): PagedAsyncIterableIterator<BatchApplication> {
return listApplications(this._client, options);
}

Expand Down Expand Up @@ -267,7 +260,7 @@ export class BatchClient {
*/
listPoolUsageMetrics(
options: ListPoolUsageMetricsOptions = { requestOptions: {} }
): Promise<PoolListUsageMetricsResult> {
): PagedAsyncIterableIterator<PoolUsageMetrics> {
return listPoolUsageMetrics(this._client, options);
}

Expand All @@ -286,7 +279,7 @@ export class BatchClient {
/** Lists all of the Pools in the specified Account. */
listPools(
options: ListPoolsOptions = { requestOptions: {} }
): Promise<BatchPoolListResult> {
): PagedAsyncIterableIterator<BatchPool> {
return listPools(this._client, options);
}

Expand Down Expand Up @@ -439,7 +432,7 @@ export class BatchClient {
/** Lists all Virtual Machine Images supported by the Azure Batch service. */
listSupportedImages(
options: ListSupportedImagesOptions = { requestOptions: {} }
): Promise<AccountListSupportedImagesResult> {
): PagedAsyncIterableIterator<ImageInformation> {
return listSupportedImages(this._client, options);
}

Expand All @@ -450,7 +443,7 @@ export class BatchClient {
*/
listPoolNodeCounts(
options: ListPoolNodeCountsOptions = { requestOptions: {} }
): Promise<PoolNodeCountsListResult> {
): PagedAsyncIterableIterator<PoolNodeCounts> {
return listPoolNodeCounts(this._client, options);
}

Expand Down Expand Up @@ -575,15 +568,15 @@ export class BatchClient {
/** Lists all of the Jobs in the specified Account. */
listJobs(
options: ListJobsOptions = { requestOptions: {} }
): Promise<BatchJobListResult> {
): PagedAsyncIterableIterator<BatchJob> {
return listJobs(this._client, options);
}

/** Lists the Jobs that have been created under the specified Job Schedule. */
listJobsFromSchedule(
jobScheduleId: string,
options: ListJobsFromScheduleOptions = { requestOptions: {} }
): Promise<BatchJobListResult> {
): PagedAsyncIterableIterator<BatchJob> {
return listJobsFromSchedule(this._client, jobScheduleId, options);
}

Expand All @@ -600,7 +593,7 @@ export class BatchClient {
options: ListJobPreparationAndReleaseTaskStatusOptions = {
requestOptions: {},
}
): Promise<BatchJobListPreparationAndReleaseTaskStatusResult> {
): PagedAsyncIterableIterator<JobPreparationAndReleaseTaskExecutionInformation> {
return listJobPreparationAndReleaseTaskStatus(this._client, jobId, options);
}

Expand Down Expand Up @@ -628,7 +621,7 @@ export class BatchClient {
/** Lists all of the Certificates that have been added to the specified Account. */
listCertificates(
options: ListCertificatesOptions = { requestOptions: {} }
): Promise<CertificateListResult> {
): PagedAsyncIterableIterator<BatchCertificate> {
return listCertificates(this._client, options);
}

Expand Down Expand Up @@ -787,7 +780,7 @@ export class BatchClient {
/** Lists all of the Job Schedules in the specified Account. */
listJobSchedules(
options: ListJobSchedulesOptions = { requestOptions: {} }
): Promise<BatchJobScheduleListResult> {
): PagedAsyncIterableIterator<BatchJobSchedule> {
return listJobSchedules(this._client, options);
}

Expand All @@ -812,7 +805,7 @@ export class BatchClient {
listTasks(
jobId: string,
options: ListTasksOptions = { requestOptions: {} }
): Promise<BatchTaskListResult> {
): PagedAsyncIterableIterator<BatchTask> {
return listTasks(this._client, jobId, options);
}

Expand Down Expand Up @@ -958,7 +951,7 @@ export class BatchClient {
jobId: string,
taskId: string,
options: ListTaskFilesOptions = { requestOptions: {} }
): Promise<NodeFileListResult> {
): PagedAsyncIterableIterator<NodeFile> {
return listTaskFiles(this._client, jobId, taskId, options);
}

Expand Down Expand Up @@ -1117,7 +1110,7 @@ export class BatchClient {
listNodes(
poolId: string,
options: ListNodesOptions = { requestOptions: {} }
): Promise<BatchNodeListResult> {
): PagedAsyncIterableIterator<BatchNode> {
return listNodes(this._client, poolId, options);
}

Expand All @@ -1142,7 +1135,7 @@ export class BatchClient {
poolId: string,
nodeId: string,
options: ListNodeExtensionsOptions = { requestOptions: {} }
): Promise<NodeVMExtensionList> {
): PagedAsyncIterableIterator<NodeVMExtension> {
return listNodeExtensions(this._client, poolId, nodeId, options);
}

Expand Down Expand Up @@ -1187,7 +1180,7 @@ export class BatchClient {
poolId: string,
nodeId: string,
options: ListNodeFilesOptions = { requestOptions: {} }
): Promise<NodeFileListResult> {
): PagedAsyncIterableIterator<NodeFile> {
return listNodeFiles(this._client, poolId, nodeId, options);
}
}
Loading
Loading