@azure/arm-machinelearning 2.1.0 → 2.1.1

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/index.js +521 -197
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/src/azureMachineLearningWorkspaces.d.ts.map +1 -1
  7. package/dist-esm/src/azureMachineLearningWorkspaces.js +4 -7
  8. package/dist-esm/src/azureMachineLearningWorkspaces.js.map +1 -1
  9. package/dist-esm/src/index.d.ts +1 -0
  10. package/dist-esm/src/index.d.ts.map +1 -1
  11. package/dist-esm/src/index.js +1 -0
  12. package/dist-esm/src/index.js.map +1 -1
  13. package/dist-esm/src/models/index.d.ts.map +1 -1
  14. package/dist-esm/src/operations/batchDeployments.d.ts.map +1 -1
  15. package/dist-esm/src/operations/batchDeployments.js +19 -7
  16. package/dist-esm/src/operations/batchDeployments.js.map +1 -1
  17. package/dist-esm/src/operations/batchEndpoints.d.ts.map +1 -1
  18. package/dist-esm/src/operations/batchEndpoints.js +19 -7
  19. package/dist-esm/src/operations/batchEndpoints.js.map +1 -1
  20. package/dist-esm/src/operations/codeContainers.d.ts.map +1 -1
  21. package/dist-esm/src/operations/codeContainers.js +19 -7
  22. package/dist-esm/src/operations/codeContainers.js.map +1 -1
  23. package/dist-esm/src/operations/codeVersions.d.ts.map +1 -1
  24. package/dist-esm/src/operations/codeVersions.js +19 -7
  25. package/dist-esm/src/operations/codeVersions.js.map +1 -1
  26. package/dist-esm/src/operations/componentContainers.d.ts.map +1 -1
  27. package/dist-esm/src/operations/componentContainers.js +19 -7
  28. package/dist-esm/src/operations/componentContainers.js.map +1 -1
  29. package/dist-esm/src/operations/componentVersions.d.ts.map +1 -1
  30. package/dist-esm/src/operations/componentVersions.js +19 -7
  31. package/dist-esm/src/operations/componentVersions.js.map +1 -1
  32. package/dist-esm/src/operations/computeOperations.d.ts.map +1 -1
  33. package/dist-esm/src/operations/computeOperations.js +37 -14
  34. package/dist-esm/src/operations/computeOperations.js.map +1 -1
  35. package/dist-esm/src/operations/dataContainers.d.ts.map +1 -1
  36. package/dist-esm/src/operations/dataContainers.js +19 -7
  37. package/dist-esm/src/operations/dataContainers.js.map +1 -1
  38. package/dist-esm/src/operations/dataVersions.d.ts.map +1 -1
  39. package/dist-esm/src/operations/dataVersions.js +19 -7
  40. package/dist-esm/src/operations/dataVersions.js.map +1 -1
  41. package/dist-esm/src/operations/datastores.d.ts.map +1 -1
  42. package/dist-esm/src/operations/datastores.js +19 -7
  43. package/dist-esm/src/operations/datastores.js.map +1 -1
  44. package/dist-esm/src/operations/environmentContainers.d.ts.map +1 -1
  45. package/dist-esm/src/operations/environmentContainers.js +19 -7
  46. package/dist-esm/src/operations/environmentContainers.js.map +1 -1
  47. package/dist-esm/src/operations/environmentVersions.d.ts.map +1 -1
  48. package/dist-esm/src/operations/environmentVersions.js +19 -7
  49. package/dist-esm/src/operations/environmentVersions.js.map +1 -1
  50. package/dist-esm/src/operations/jobs.d.ts.map +1 -1
  51. package/dist-esm/src/operations/jobs.js +19 -7
  52. package/dist-esm/src/operations/jobs.js.map +1 -1
  53. package/dist-esm/src/operations/modelContainers.d.ts.map +1 -1
  54. package/dist-esm/src/operations/modelContainers.js +19 -7
  55. package/dist-esm/src/operations/modelContainers.js.map +1 -1
  56. package/dist-esm/src/operations/modelVersions.d.ts.map +1 -1
  57. package/dist-esm/src/operations/modelVersions.js +19 -7
  58. package/dist-esm/src/operations/modelVersions.js.map +1 -1
  59. package/dist-esm/src/operations/onlineDeployments.d.ts.map +1 -1
  60. package/dist-esm/src/operations/onlineDeployments.js +37 -14
  61. package/dist-esm/src/operations/onlineDeployments.js.map +1 -1
  62. package/dist-esm/src/operations/onlineEndpoints.d.ts.map +1 -1
  63. package/dist-esm/src/operations/onlineEndpoints.js +19 -7
  64. package/dist-esm/src/operations/onlineEndpoints.js.map +1 -1
  65. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  66. package/dist-esm/src/operations/operations.js +8 -4
  67. package/dist-esm/src/operations/operations.js.map +1 -1
  68. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  69. package/dist-esm/src/operations/privateEndpointConnections.js +8 -4
  70. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  71. package/dist-esm/src/operations/quotas.d.ts.map +1 -1
  72. package/dist-esm/src/operations/quotas.js +19 -7
  73. package/dist-esm/src/operations/quotas.js.map +1 -1
  74. package/dist-esm/src/operations/schedules.d.ts.map +1 -1
  75. package/dist-esm/src/operations/schedules.js +19 -7
  76. package/dist-esm/src/operations/schedules.js.map +1 -1
  77. package/dist-esm/src/operations/usages.d.ts.map +1 -1
  78. package/dist-esm/src/operations/usages.js +19 -7
  79. package/dist-esm/src/operations/usages.js.map +1 -1
  80. package/dist-esm/src/operations/workspaceConnections.d.ts.map +1 -1
  81. package/dist-esm/src/operations/workspaceConnections.js +19 -7
  82. package/dist-esm/src/operations/workspaceConnections.js.map +1 -1
  83. package/dist-esm/src/operations/workspaceFeatures.d.ts.map +1 -1
  84. package/dist-esm/src/operations/workspaceFeatures.js +19 -7
  85. package/dist-esm/src/operations/workspaceFeatures.js.map +1 -1
  86. package/dist-esm/src/operations/workspaces.d.ts.map +1 -1
  87. package/dist-esm/src/operations/workspaces.js +37 -14
  88. package/dist-esm/src/operations/workspaces.js.map +1 -1
  89. package/dist-esm/src/pagingHelper.d.ts +13 -0
  90. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  91. package/dist-esm/src/pagingHelper.js +32 -0
  92. package/dist-esm/src/pagingHelper.js.map +1 -0
  93. package/package.json +3 -3
  94. package/review/arm-machinelearning.api.md +3 -0
  95. package/src/azureMachineLearningWorkspaces.ts +5 -6
  96. package/src/index.ts +1 -0
  97. package/src/models/index.ts +135 -135
  98. package/src/operations/batchDeployments.ts +27 -13
  99. package/src/operations/batchEndpoints.ts +26 -8
  100. package/src/operations/codeContainers.ts +26 -8
  101. package/src/operations/codeVersions.ts +27 -13
  102. package/src/operations/componentContainers.ts +26 -8
  103. package/src/operations/componentVersions.ts +27 -13
  104. package/src/operations/computeOperations.ts +53 -22
  105. package/src/operations/dataContainers.ts +26 -8
  106. package/src/operations/dataVersions.ts +27 -13
  107. package/src/operations/datastores.ts +26 -8
  108. package/src/operations/environmentContainers.ts +26 -8
  109. package/src/operations/environmentVersions.ts +27 -13
  110. package/src/operations/jobs.ts +26 -8
  111. package/src/operations/modelContainers.ts +26 -8
  112. package/src/operations/modelVersions.ts +27 -13
  113. package/src/operations/onlineDeployments.ts +55 -28
  114. package/src/operations/onlineEndpoints.ts +26 -8
  115. package/src/operations/operations.ts +10 -5
  116. package/src/operations/privateEndpointConnections.ts +15 -5
  117. package/src/operations/quotas.ts +22 -9
  118. package/src/operations/schedules.ts +26 -8
  119. package/src/operations/usages.ts +21 -8
  120. package/src/operations/workspaceConnections.ts +27 -9
  121. package/src/operations/workspaceFeatures.ts +26 -8
  122. package/src/operations/workspaces.ts +46 -17
  123. package/src/pagingHelper.ts +39 -0
  124. package/types/arm-machinelearning.d.ts +9 -0
  125. package/types/tsdoc-metadata.json +1 -1
@@ -6,7 +6,7 @@
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
10
  import { PrivateEndpointConnections } from "../operationsInterfaces";
11
11
  import * as coreClient from "@azure/core-client";
12
12
  import * as Mappers from "../models/mappers";
@@ -56,8 +56,16 @@ export class PrivateEndpointConnectionsImpl
56
56
  [Symbol.asyncIterator]() {
57
57
  return this;
58
58
  },
59
- byPage: () => {
60
- return this.listPagingPage(resourceGroupName, workspaceName, options);
59
+ byPage: (settings?: PageSettings) => {
60
+ if (settings?.maxPageSize) {
61
+ throw new Error("maxPageSize is not supported by this operation.");
62
+ }
63
+ return this.listPagingPage(
64
+ resourceGroupName,
65
+ workspaceName,
66
+ options,
67
+ settings
68
+ );
61
69
  }
62
70
  };
63
71
  }
@@ -65,9 +73,11 @@ export class PrivateEndpointConnectionsImpl
65
73
  private async *listPagingPage(
66
74
  resourceGroupName: string,
67
75
  workspaceName: string,
68
- options?: PrivateEndpointConnectionsListOptionalParams
76
+ options?: PrivateEndpointConnectionsListOptionalParams,
77
+ _settings?: PageSettings
69
78
  ): AsyncIterableIterator<PrivateEndpointConnection[]> {
70
- let result = await this._list(resourceGroupName, workspaceName, options);
79
+ let result: PrivateEndpointConnectionsListResponse;
80
+ result = await this._list(resourceGroupName, workspaceName, options);
71
81
  yield result.value || [];
72
82
  }
73
83
 
@@ -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 { Quotas } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -16,10 +17,10 @@ import {
16
17
  ResourceQuota,
17
18
  QuotasListNextOptionalParams,
18
19
  QuotasListOptionalParams,
20
+ QuotasListResponse,
19
21
  QuotaUpdateParameters,
20
22
  QuotasUpdateOptionalParams,
21
23
  QuotasUpdateResponse,
22
- QuotasListResponse,
23
24
  QuotasListNextResponse
24
25
  } from "../models";
25
26
 
@@ -53,23 +54,35 @@ export class QuotasImpl implements Quotas {
53
54
  [Symbol.asyncIterator]() {
54
55
  return this;
55
56
  },
56
- byPage: () => {
57
- return this.listPagingPage(location, options);
57
+ byPage: (settings?: PageSettings) => {
58
+ if (settings?.maxPageSize) {
59
+ throw new Error("maxPageSize is not supported by this operation.");
60
+ }
61
+ return this.listPagingPage(location, options, settings);
58
62
  }
59
63
  };
60
64
  }
61
65
 
62
66
  private async *listPagingPage(
63
67
  location: string,
64
- options?: QuotasListOptionalParams
68
+ options?: QuotasListOptionalParams,
69
+ settings?: PageSettings
65
70
  ): AsyncIterableIterator<ResourceQuota[]> {
66
- let result = await this._list(location, options);
67
- yield result.value || [];
68
- let continuationToken = result.nextLink;
71
+ let result: QuotasListResponse;
72
+ let continuationToken = settings?.continuationToken;
73
+ if (!continuationToken) {
74
+ result = await this._list(location, 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._listNext(location, continuationToken, options);
71
82
  continuationToken = result.nextLink;
72
- yield result.value || [];
83
+ let page = result.value || [];
84
+ setContinuationToken(page, continuationToken);
85
+ yield page;
73
86
  }
74
87
  }
75
88
 
@@ -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 { Schedules } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -59,8 +60,16 @@ export class SchedulesImpl implements Schedules {
59
60
  [Symbol.asyncIterator]() {
60
61
  return this;
61
62
  },
62
- byPage: () => {
63
- return this.listPagingPage(resourceGroupName, workspaceName, options);
63
+ byPage: (settings?: PageSettings) => {
64
+ if (settings?.maxPageSize) {
65
+ throw new Error("maxPageSize is not supported by this operation.");
66
+ }
67
+ return this.listPagingPage(
68
+ resourceGroupName,
69
+ workspaceName,
70
+ options,
71
+ settings
72
+ );
64
73
  }
65
74
  };
66
75
  }
@@ -68,11 +77,18 @@ export class SchedulesImpl implements Schedules {
68
77
  private async *listPagingPage(
69
78
  resourceGroupName: string,
70
79
  workspaceName: string,
71
- options?: SchedulesListOptionalParams
80
+ options?: SchedulesListOptionalParams,
81
+ settings?: PageSettings
72
82
  ): AsyncIterableIterator<Schedule[]> {
73
- let result = await this._list(resourceGroupName, workspaceName, options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
83
+ let result: SchedulesListResponse;
84
+ let continuationToken = settings?.continuationToken;
85
+ if (!continuationToken) {
86
+ result = await this._list(resourceGroupName, workspaceName, options);
87
+ let page = result.value || [];
88
+ continuationToken = result.nextLink;
89
+ setContinuationToken(page, continuationToken);
90
+ yield page;
91
+ }
76
92
  while (continuationToken) {
77
93
  result = await this._listNext(
78
94
  resourceGroupName,
@@ -81,7 +97,9 @@ export class SchedulesImpl implements Schedules {
81
97
  options
82
98
  );
83
99
  continuationToken = result.nextLink;
84
- yield result.value || [];
100
+ let page = result.value || [];
101
+ setContinuationToken(page, continuationToken);
102
+ yield page;
85
103
  }
86
104
  }
87
105
 
@@ -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
- return this.listPagingPage(location, options);
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<Usage[]> {
64
- let result = await this._list(location, options);
65
- yield result.value || [];
66
- let continuationToken = result.nextLink;
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
- yield result.value || [];
81
+ let page = result.value || [];
82
+ setContinuationToken(page, continuationToken);
83
+ yield page;
71
84
  }
72
85
  }
73
86
 
@@ -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 { WorkspaceConnections } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -16,12 +17,12 @@ import {
16
17
  WorkspaceConnectionPropertiesV2BasicResource,
17
18
  WorkspaceConnectionsListNextOptionalParams,
18
19
  WorkspaceConnectionsListOptionalParams,
20
+ WorkspaceConnectionsListResponse,
19
21
  WorkspaceConnectionsCreateOptionalParams,
20
22
  WorkspaceConnectionsCreateResponse,
21
23
  WorkspaceConnectionsGetOptionalParams,
22
24
  WorkspaceConnectionsGetResponse,
23
25
  WorkspaceConnectionsDeleteOptionalParams,
24
- WorkspaceConnectionsListResponse,
25
26
  WorkspaceConnectionsListNextResponse
26
27
  } from "../models";
27
28
 
@@ -56,8 +57,16 @@ export class WorkspaceConnectionsImpl implements WorkspaceConnections {
56
57
  [Symbol.asyncIterator]() {
57
58
  return this;
58
59
  },
59
- byPage: () => {
60
- return this.listPagingPage(resourceGroupName, workspaceName, options);
60
+ byPage: (settings?: PageSettings) => {
61
+ if (settings?.maxPageSize) {
62
+ throw new Error("maxPageSize is not supported by this operation.");
63
+ }
64
+ return this.listPagingPage(
65
+ resourceGroupName,
66
+ workspaceName,
67
+ options,
68
+ settings
69
+ );
61
70
  }
62
71
  };
63
72
  }
@@ -65,11 +74,18 @@ export class WorkspaceConnectionsImpl implements WorkspaceConnections {
65
74
  private async *listPagingPage(
66
75
  resourceGroupName: string,
67
76
  workspaceName: string,
68
- options?: WorkspaceConnectionsListOptionalParams
77
+ options?: WorkspaceConnectionsListOptionalParams,
78
+ settings?: PageSettings
69
79
  ): AsyncIterableIterator<WorkspaceConnectionPropertiesV2BasicResource[]> {
70
- let result = await this._list(resourceGroupName, workspaceName, options);
71
- yield result.value || [];
72
- let continuationToken = result.nextLink;
80
+ let result: WorkspaceConnectionsListResponse;
81
+ let continuationToken = settings?.continuationToken;
82
+ if (!continuationToken) {
83
+ result = await this._list(resourceGroupName, workspaceName, options);
84
+ let page = result.value || [];
85
+ continuationToken = result.nextLink;
86
+ setContinuationToken(page, continuationToken);
87
+ yield page;
88
+ }
73
89
  while (continuationToken) {
74
90
  result = await this._listNext(
75
91
  resourceGroupName,
@@ -78,7 +94,9 @@ export class WorkspaceConnectionsImpl implements WorkspaceConnections {
78
94
  options
79
95
  );
80
96
  continuationToken = result.nextLink;
81
- yield result.value || [];
97
+ let page = result.value || [];
98
+ setContinuationToken(page, continuationToken);
99
+ yield page;
82
100
  }
83
101
  }
84
102
 
@@ -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 { WorkspaceFeatures } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -52,8 +53,16 @@ export class WorkspaceFeaturesImpl implements WorkspaceFeatures {
52
53
  [Symbol.asyncIterator]() {
53
54
  return this;
54
55
  },
55
- byPage: () => {
56
- return this.listPagingPage(resourceGroupName, workspaceName, options);
56
+ byPage: (settings?: PageSettings) => {
57
+ if (settings?.maxPageSize) {
58
+ throw new Error("maxPageSize is not supported by this operation.");
59
+ }
60
+ return this.listPagingPage(
61
+ resourceGroupName,
62
+ workspaceName,
63
+ options,
64
+ settings
65
+ );
57
66
  }
58
67
  };
59
68
  }
@@ -61,11 +70,18 @@ export class WorkspaceFeaturesImpl implements WorkspaceFeatures {
61
70
  private async *listPagingPage(
62
71
  resourceGroupName: string,
63
72
  workspaceName: string,
64
- options?: WorkspaceFeaturesListOptionalParams
73
+ options?: WorkspaceFeaturesListOptionalParams,
74
+ settings?: PageSettings
65
75
  ): AsyncIterableIterator<AmlUserFeature[]> {
66
- let result = await this._list(resourceGroupName, workspaceName, options);
67
- yield result.value || [];
68
- let continuationToken = result.nextLink;
76
+ let result: WorkspaceFeaturesListResponse;
77
+ let continuationToken = settings?.continuationToken;
78
+ if (!continuationToken) {
79
+ result = await this._list(resourceGroupName, workspaceName, options);
80
+ let page = result.value || [];
81
+ continuationToken = result.nextLink;
82
+ setContinuationToken(page, continuationToken);
83
+ yield page;
84
+ }
69
85
  while (continuationToken) {
70
86
  result = await this._listNext(
71
87
  resourceGroupName,
@@ -74,7 +90,9 @@ export class WorkspaceFeaturesImpl implements WorkspaceFeatures {
74
90
  options
75
91
  );
76
92
  continuationToken = result.nextLink;
77
- yield result.value || [];
93
+ let page = result.value || [];
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
78
96
  }
79
97
  }
80
98
 
@@ -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 { Workspaces } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,8 +19,10 @@ import {
18
19
  Workspace,
19
20
  WorkspacesListByResourceGroupNextOptionalParams,
20
21
  WorkspacesListByResourceGroupOptionalParams,
22
+ WorkspacesListByResourceGroupResponse,
21
23
  WorkspacesListBySubscriptionNextOptionalParams,
22
24
  WorkspacesListBySubscriptionOptionalParams,
25
+ WorkspacesListBySubscriptionResponse,
23
26
  WorkspacesGetOptionalParams,
24
27
  WorkspacesGetResponse,
25
28
  WorkspacesCreateOrUpdateOptionalParams,
@@ -28,13 +31,11 @@ import {
28
31
  WorkspaceUpdateParameters,
29
32
  WorkspacesUpdateOptionalParams,
30
33
  WorkspacesUpdateResponse,
31
- WorkspacesListByResourceGroupResponse,
32
34
  WorkspacesDiagnoseOptionalParams,
33
35
  WorkspacesDiagnoseResponse,
34
36
  WorkspacesListKeysOptionalParams,
35
37
  WorkspacesListKeysResponse,
36
38
  WorkspacesResyncKeysOptionalParams,
37
- WorkspacesListBySubscriptionResponse,
38
39
  WorkspacesListNotebookAccessTokenOptionalParams,
39
40
  WorkspacesListNotebookAccessTokenResponse,
40
41
  WorkspacesPrepareNotebookOptionalParams,
@@ -79,19 +80,33 @@ export class WorkspacesImpl implements Workspaces {
79
80
  [Symbol.asyncIterator]() {
80
81
  return this;
81
82
  },
82
- byPage: () => {
83
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
83
+ byPage: (settings?: PageSettings) => {
84
+ if (settings?.maxPageSize) {
85
+ throw new Error("maxPageSize is not supported by this operation.");
86
+ }
87
+ return this.listByResourceGroupPagingPage(
88
+ resourceGroupName,
89
+ options,
90
+ settings
91
+ );
84
92
  }
85
93
  };
86
94
  }
87
95
 
88
96
  private async *listByResourceGroupPagingPage(
89
97
  resourceGroupName: string,
90
- options?: WorkspacesListByResourceGroupOptionalParams
98
+ options?: WorkspacesListByResourceGroupOptionalParams,
99
+ settings?: PageSettings
91
100
  ): AsyncIterableIterator<Workspace[]> {
92
- let result = await this._listByResourceGroup(resourceGroupName, options);
93
- yield result.value || [];
94
- let continuationToken = result.nextLink;
101
+ let result: WorkspacesListByResourceGroupResponse;
102
+ let continuationToken = settings?.continuationToken;
103
+ if (!continuationToken) {
104
+ result = await this._listByResourceGroup(resourceGroupName, options);
105
+ let page = result.value || [];
106
+ continuationToken = result.nextLink;
107
+ setContinuationToken(page, continuationToken);
108
+ yield page;
109
+ }
95
110
  while (continuationToken) {
96
111
  result = await this._listByResourceGroupNext(
97
112
  resourceGroupName,
@@ -99,7 +114,9 @@ export class WorkspacesImpl implements Workspaces {
99
114
  options
100
115
  );
101
116
  continuationToken = result.nextLink;
102
- yield result.value || [];
117
+ let page = result.value || [];
118
+ setContinuationToken(page, continuationToken);
119
+ yield page;
103
120
  }
104
121
  }
105
122
 
@@ -130,22 +147,34 @@ export class WorkspacesImpl implements Workspaces {
130
147
  [Symbol.asyncIterator]() {
131
148
  return this;
132
149
  },
133
- byPage: () => {
134
- return this.listBySubscriptionPagingPage(options);
150
+ byPage: (settings?: PageSettings) => {
151
+ if (settings?.maxPageSize) {
152
+ throw new Error("maxPageSize is not supported by this operation.");
153
+ }
154
+ return this.listBySubscriptionPagingPage(options, settings);
135
155
  }
136
156
  };
137
157
  }
138
158
 
139
159
  private async *listBySubscriptionPagingPage(
140
- options?: WorkspacesListBySubscriptionOptionalParams
160
+ options?: WorkspacesListBySubscriptionOptionalParams,
161
+ settings?: PageSettings
141
162
  ): AsyncIterableIterator<Workspace[]> {
142
- let result = await this._listBySubscription(options);
143
- yield result.value || [];
144
- let continuationToken = result.nextLink;
163
+ let result: WorkspacesListBySubscriptionResponse;
164
+ let continuationToken = settings?.continuationToken;
165
+ if (!continuationToken) {
166
+ result = await this._listBySubscription(options);
167
+ let page = result.value || [];
168
+ continuationToken = result.nextLink;
169
+ setContinuationToken(page, continuationToken);
170
+ yield page;
171
+ }
145
172
  while (continuationToken) {
146
173
  result = await this._listBySubscriptionNext(continuationToken, options);
147
174
  continuationToken = result.nextLink;
148
- yield result.value || [];
175
+ let page = result.value || [];
176
+ setContinuationToken(page, continuationToken);
177
+ yield page;
149
178
  }
150
179
  }
151
180
 
@@ -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
+ }
@@ -3726,6 +3726,15 @@ export declare interface FqdnEndpointsProperties {
3726
3726
  endpoints?: FqdnEndpoint[];
3727
3727
  }
3728
3728
 
3729
+ /**
3730
+ * Given a result page from a pageable operation, returns a
3731
+ * continuation token that can be used to begin paging from
3732
+ * that point later.
3733
+ * @param page A result object from calling .byPage() on a paged operation.
3734
+ * @returns The continuation token that can be passed into byPage().
3735
+ */
3736
+ export declare function getContinuationToken(page: unknown): string | undefined;
3737
+
3729
3738
  /**
3730
3739
  * Defines values for Goal. \
3731
3740
  * {@link KnownGoal} can be used interchangeably with Goal,
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.33.5"
8
+ "packageVersion": "7.33.6"
9
9
  }
10
10
  ]
11
11
  }