@azure/arm-connectedvmware 1.0.0-beta.1 → 1.0.0-beta.2

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 (221) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/dist/index.js +415 -175
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/clustersCreateSample.js +11 -3
  8. package/dist-esm/samples-dev/clustersCreateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/clustersDeleteSample.js +11 -3
  10. package/dist-esm/samples-dev/clustersDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/clustersGetSample.js +11 -3
  12. package/dist-esm/samples-dev/clustersGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/clustersListByResourceGroupSample.js +11 -3
  14. package/dist-esm/samples-dev/clustersListByResourceGroupSample.js.map +1 -1
  15. package/dist-esm/samples-dev/clustersListSample.js +10 -2
  16. package/dist-esm/samples-dev/clustersListSample.js.map +1 -1
  17. package/dist-esm/samples-dev/clustersUpdateSample.js +11 -3
  18. package/dist-esm/samples-dev/clustersUpdateSample.js.map +1 -1
  19. package/dist-esm/samples-dev/datastoresCreateSample.js +11 -3
  20. package/dist-esm/samples-dev/datastoresCreateSample.js.map +1 -1
  21. package/dist-esm/samples-dev/datastoresDeleteSample.js +11 -3
  22. package/dist-esm/samples-dev/datastoresDeleteSample.js.map +1 -1
  23. package/dist-esm/samples-dev/datastoresGetSample.js +11 -3
  24. package/dist-esm/samples-dev/datastoresGetSample.js.map +1 -1
  25. package/dist-esm/samples-dev/datastoresListByResourceGroupSample.js +11 -3
  26. package/dist-esm/samples-dev/datastoresListByResourceGroupSample.js.map +1 -1
  27. package/dist-esm/samples-dev/datastoresListSample.js +10 -2
  28. package/dist-esm/samples-dev/datastoresListSample.js.map +1 -1
  29. package/dist-esm/samples-dev/datastoresUpdateSample.js +11 -3
  30. package/dist-esm/samples-dev/datastoresUpdateSample.js.map +1 -1
  31. package/dist-esm/samples-dev/guestAgentsCreateSample.js +11 -3
  32. package/dist-esm/samples-dev/guestAgentsCreateSample.js.map +1 -1
  33. package/dist-esm/samples-dev/guestAgentsDeleteSample.js +11 -3
  34. package/dist-esm/samples-dev/guestAgentsDeleteSample.js.map +1 -1
  35. package/dist-esm/samples-dev/guestAgentsGetSample.js +11 -3
  36. package/dist-esm/samples-dev/guestAgentsGetSample.js.map +1 -1
  37. package/dist-esm/samples-dev/guestAgentsListByVMSample.js +11 -3
  38. package/dist-esm/samples-dev/guestAgentsListByVMSample.js.map +1 -1
  39. package/dist-esm/samples-dev/hostsCreateSample.js +11 -3
  40. package/dist-esm/samples-dev/hostsCreateSample.js.map +1 -1
  41. package/dist-esm/samples-dev/hostsDeleteSample.js +11 -3
  42. package/dist-esm/samples-dev/hostsDeleteSample.js.map +1 -1
  43. package/dist-esm/samples-dev/hostsGetSample.js +11 -3
  44. package/dist-esm/samples-dev/hostsGetSample.js.map +1 -1
  45. package/dist-esm/samples-dev/hostsListByResourceGroupSample.js +11 -3
  46. package/dist-esm/samples-dev/hostsListByResourceGroupSample.js.map +1 -1
  47. package/dist-esm/samples-dev/hostsListSample.js +10 -2
  48. package/dist-esm/samples-dev/hostsListSample.js.map +1 -1
  49. package/dist-esm/samples-dev/hostsUpdateSample.js +11 -3
  50. package/dist-esm/samples-dev/hostsUpdateSample.js.map +1 -1
  51. package/dist-esm/samples-dev/hybridIdentityMetadataCreateSample.js +11 -3
  52. package/dist-esm/samples-dev/hybridIdentityMetadataCreateSample.js.map +1 -1
  53. package/dist-esm/samples-dev/hybridIdentityMetadataDeleteSample.js +11 -3
  54. package/dist-esm/samples-dev/hybridIdentityMetadataDeleteSample.js.map +1 -1
  55. package/dist-esm/samples-dev/hybridIdentityMetadataGetSample.js +11 -3
  56. package/dist-esm/samples-dev/hybridIdentityMetadataGetSample.js.map +1 -1
  57. package/dist-esm/samples-dev/hybridIdentityMetadataListByVMSample.js +11 -3
  58. package/dist-esm/samples-dev/hybridIdentityMetadataListByVMSample.js.map +1 -1
  59. package/dist-esm/samples-dev/inventoryItemsCreateSample.js +11 -3
  60. package/dist-esm/samples-dev/inventoryItemsCreateSample.js.map +1 -1
  61. package/dist-esm/samples-dev/inventoryItemsDeleteSample.js +11 -3
  62. package/dist-esm/samples-dev/inventoryItemsDeleteSample.js.map +1 -1
  63. package/dist-esm/samples-dev/inventoryItemsGetSample.js +11 -3
  64. package/dist-esm/samples-dev/inventoryItemsGetSample.js.map +1 -1
  65. package/dist-esm/samples-dev/inventoryItemsListByVCenterSample.js +11 -3
  66. package/dist-esm/samples-dev/inventoryItemsListByVCenterSample.js.map +1 -1
  67. package/dist-esm/samples-dev/machineExtensionsCreateOrUpdateSample.js +10 -3
  68. package/dist-esm/samples-dev/machineExtensionsCreateOrUpdateSample.js.map +1 -1
  69. package/dist-esm/samples-dev/machineExtensionsDeleteSample.js +10 -3
  70. package/dist-esm/samples-dev/machineExtensionsDeleteSample.js.map +1 -1
  71. package/dist-esm/samples-dev/machineExtensionsGetSample.js +10 -3
  72. package/dist-esm/samples-dev/machineExtensionsGetSample.js.map +1 -1
  73. package/dist-esm/samples-dev/machineExtensionsListSample.js +10 -3
  74. package/dist-esm/samples-dev/machineExtensionsListSample.js.map +1 -1
  75. package/dist-esm/samples-dev/machineExtensionsUpdateSample.js +10 -3
  76. package/dist-esm/samples-dev/machineExtensionsUpdateSample.js.map +1 -1
  77. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  78. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  79. package/dist-esm/samples-dev/resourcePoolsCreateSample.js +11 -3
  80. package/dist-esm/samples-dev/resourcePoolsCreateSample.js.map +1 -1
  81. package/dist-esm/samples-dev/resourcePoolsDeleteSample.js +11 -3
  82. package/dist-esm/samples-dev/resourcePoolsDeleteSample.js.map +1 -1
  83. package/dist-esm/samples-dev/resourcePoolsGetSample.js +11 -3
  84. package/dist-esm/samples-dev/resourcePoolsGetSample.js.map +1 -1
  85. package/dist-esm/samples-dev/resourcePoolsListByResourceGroupSample.js +11 -3
  86. package/dist-esm/samples-dev/resourcePoolsListByResourceGroupSample.js.map +1 -1
  87. package/dist-esm/samples-dev/resourcePoolsListSample.js +10 -2
  88. package/dist-esm/samples-dev/resourcePoolsListSample.js.map +1 -1
  89. package/dist-esm/samples-dev/resourcePoolsUpdateSample.js +11 -3
  90. package/dist-esm/samples-dev/resourcePoolsUpdateSample.js.map +1 -1
  91. package/dist-esm/samples-dev/vCentersCreateSample.js +11 -3
  92. package/dist-esm/samples-dev/vCentersCreateSample.js.map +1 -1
  93. package/dist-esm/samples-dev/vCentersDeleteSample.js +11 -3
  94. package/dist-esm/samples-dev/vCentersDeleteSample.js.map +1 -1
  95. package/dist-esm/samples-dev/vCentersGetSample.js +11 -3
  96. package/dist-esm/samples-dev/vCentersGetSample.js.map +1 -1
  97. package/dist-esm/samples-dev/vCentersListByResourceGroupSample.js +11 -3
  98. package/dist-esm/samples-dev/vCentersListByResourceGroupSample.js.map +1 -1
  99. package/dist-esm/samples-dev/vCentersListSample.js +10 -2
  100. package/dist-esm/samples-dev/vCentersListSample.js.map +1 -1
  101. package/dist-esm/samples-dev/vCentersUpdateSample.js +11 -3
  102. package/dist-esm/samples-dev/vCentersUpdateSample.js.map +1 -1
  103. package/dist-esm/samples-dev/virtualMachineTemplatesCreateSample.js +11 -3
  104. package/dist-esm/samples-dev/virtualMachineTemplatesCreateSample.js.map +1 -1
  105. package/dist-esm/samples-dev/virtualMachineTemplatesDeleteSample.js +11 -3
  106. package/dist-esm/samples-dev/virtualMachineTemplatesDeleteSample.js.map +1 -1
  107. package/dist-esm/samples-dev/virtualMachineTemplatesGetSample.js +11 -3
  108. package/dist-esm/samples-dev/virtualMachineTemplatesGetSample.js.map +1 -1
  109. package/dist-esm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.js +11 -3
  110. package/dist-esm/samples-dev/virtualMachineTemplatesListByResourceGroupSample.js.map +1 -1
  111. package/dist-esm/samples-dev/virtualMachineTemplatesListSample.js +10 -2
  112. package/dist-esm/samples-dev/virtualMachineTemplatesListSample.js.map +1 -1
  113. package/dist-esm/samples-dev/virtualMachineTemplatesUpdateSample.js +11 -3
  114. package/dist-esm/samples-dev/virtualMachineTemplatesUpdateSample.js.map +1 -1
  115. package/dist-esm/samples-dev/virtualMachinesAssessPatchesSample.js +10 -3
  116. package/dist-esm/samples-dev/virtualMachinesAssessPatchesSample.js.map +1 -1
  117. package/dist-esm/samples-dev/virtualMachinesCreateSample.js +11 -3
  118. package/dist-esm/samples-dev/virtualMachinesCreateSample.js.map +1 -1
  119. package/dist-esm/samples-dev/virtualMachinesDeleteSample.js +11 -3
  120. package/dist-esm/samples-dev/virtualMachinesDeleteSample.js.map +1 -1
  121. package/dist-esm/samples-dev/virtualMachinesGetSample.js +11 -3
  122. package/dist-esm/samples-dev/virtualMachinesGetSample.js.map +1 -1
  123. package/dist-esm/samples-dev/virtualMachinesInstallPatchesSample.js +10 -3
  124. package/dist-esm/samples-dev/virtualMachinesInstallPatchesSample.js.map +1 -1
  125. package/dist-esm/samples-dev/virtualMachinesListByResourceGroupSample.js +11 -3
  126. package/dist-esm/samples-dev/virtualMachinesListByResourceGroupSample.js.map +1 -1
  127. package/dist-esm/samples-dev/virtualMachinesListSample.js +10 -2
  128. package/dist-esm/samples-dev/virtualMachinesListSample.js.map +1 -1
  129. package/dist-esm/samples-dev/virtualMachinesRestartSample.js +11 -3
  130. package/dist-esm/samples-dev/virtualMachinesRestartSample.js.map +1 -1
  131. package/dist-esm/samples-dev/virtualMachinesStartSample.js +11 -3
  132. package/dist-esm/samples-dev/virtualMachinesStartSample.js.map +1 -1
  133. package/dist-esm/samples-dev/virtualMachinesStopSample.js +11 -3
  134. package/dist-esm/samples-dev/virtualMachinesStopSample.js.map +1 -1
  135. package/dist-esm/samples-dev/virtualMachinesUpdateSample.js +11 -3
  136. package/dist-esm/samples-dev/virtualMachinesUpdateSample.js.map +1 -1
  137. package/dist-esm/samples-dev/virtualNetworksCreateSample.js +11 -3
  138. package/dist-esm/samples-dev/virtualNetworksCreateSample.js.map +1 -1
  139. package/dist-esm/samples-dev/virtualNetworksDeleteSample.js +11 -3
  140. package/dist-esm/samples-dev/virtualNetworksDeleteSample.js.map +1 -1
  141. package/dist-esm/samples-dev/virtualNetworksGetSample.js +11 -3
  142. package/dist-esm/samples-dev/virtualNetworksGetSample.js.map +1 -1
  143. package/dist-esm/samples-dev/virtualNetworksListByResourceGroupSample.js +11 -3
  144. package/dist-esm/samples-dev/virtualNetworksListByResourceGroupSample.js.map +1 -1
  145. package/dist-esm/samples-dev/virtualNetworksListSample.js +10 -2
  146. package/dist-esm/samples-dev/virtualNetworksListSample.js.map +1 -1
  147. package/dist-esm/samples-dev/virtualNetworksUpdateSample.js +11 -3
  148. package/dist-esm/samples-dev/virtualNetworksUpdateSample.js.map +1 -1
  149. package/dist-esm/src/azureArcVMwareManagementServiceAPI.d.ts.map +1 -1
  150. package/dist-esm/src/azureArcVMwareManagementServiceAPI.js +4 -7
  151. package/dist-esm/src/azureArcVMwareManagementServiceAPI.js.map +1 -1
  152. package/dist-esm/src/index.d.ts +1 -0
  153. package/dist-esm/src/index.d.ts.map +1 -1
  154. package/dist-esm/src/index.js +1 -0
  155. package/dist-esm/src/index.js.map +1 -1
  156. package/dist-esm/src/models/index.d.ts +0 -2
  157. package/dist-esm/src/models/index.d.ts.map +1 -1
  158. package/dist-esm/src/operations/clusters.d.ts.map +1 -1
  159. package/dist-esm/src/operations/clusters.js +37 -16
  160. package/dist-esm/src/operations/clusters.js.map +1 -1
  161. package/dist-esm/src/operations/datastores.d.ts.map +1 -1
  162. package/dist-esm/src/operations/datastores.js +37 -16
  163. package/dist-esm/src/operations/datastores.js.map +1 -1
  164. package/dist-esm/src/operations/guestAgents.d.ts.map +1 -1
  165. package/dist-esm/src/operations/guestAgents.js +19 -8
  166. package/dist-esm/src/operations/guestAgents.js.map +1 -1
  167. package/dist-esm/src/operations/hosts.d.ts.map +1 -1
  168. package/dist-esm/src/operations/hosts.js +37 -16
  169. package/dist-esm/src/operations/hosts.js.map +1 -1
  170. package/dist-esm/src/operations/hybridIdentityMetadataOperations.d.ts.map +1 -1
  171. package/dist-esm/src/operations/hybridIdentityMetadataOperations.js +19 -8
  172. package/dist-esm/src/operations/hybridIdentityMetadataOperations.js.map +1 -1
  173. package/dist-esm/src/operations/inventoryItems.d.ts.map +1 -1
  174. package/dist-esm/src/operations/inventoryItems.js +19 -8
  175. package/dist-esm/src/operations/inventoryItems.js.map +1 -1
  176. package/dist-esm/src/operations/machineExtensions.d.ts.map +1 -1
  177. package/dist-esm/src/operations/machineExtensions.js +19 -8
  178. package/dist-esm/src/operations/machineExtensions.js.map +1 -1
  179. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  180. package/dist-esm/src/operations/operations.js +19 -8
  181. package/dist-esm/src/operations/operations.js.map +1 -1
  182. package/dist-esm/src/operations/resourcePools.d.ts.map +1 -1
  183. package/dist-esm/src/operations/resourcePools.js +37 -16
  184. package/dist-esm/src/operations/resourcePools.js.map +1 -1
  185. package/dist-esm/src/operations/vCenters.d.ts.map +1 -1
  186. package/dist-esm/src/operations/vCenters.js +37 -16
  187. package/dist-esm/src/operations/vCenters.js.map +1 -1
  188. package/dist-esm/src/operations/virtualMachineTemplates.d.ts.map +1 -1
  189. package/dist-esm/src/operations/virtualMachineTemplates.js +37 -16
  190. package/dist-esm/src/operations/virtualMachineTemplates.js.map +1 -1
  191. package/dist-esm/src/operations/virtualMachines.d.ts.map +1 -1
  192. package/dist-esm/src/operations/virtualMachines.js +37 -16
  193. package/dist-esm/src/operations/virtualMachines.js.map +1 -1
  194. package/dist-esm/src/operations/virtualNetworks.d.ts.map +1 -1
  195. package/dist-esm/src/operations/virtualNetworks.js +37 -16
  196. package/dist-esm/src/operations/virtualNetworks.js.map +1 -1
  197. package/dist-esm/src/pagingHelper.d.ts +13 -0
  198. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  199. package/dist-esm/src/pagingHelper.js +32 -0
  200. package/dist-esm/src/pagingHelper.js.map +1 -0
  201. package/package.json +8 -6
  202. package/review/arm-connectedvmware.api.md +3 -1
  203. package/src/azureArcVMwareManagementServiceAPI.ts +5 -6
  204. package/src/index.ts +1 -0
  205. package/src/models/index.ts +1 -4
  206. package/src/operations/clusters.ts +46 -19
  207. package/src/operations/datastores.ts +46 -19
  208. package/src/operations/guestAgents.ts +27 -14
  209. package/src/operations/hosts.ts +46 -19
  210. package/src/operations/hybridIdentityMetadataOperations.ts +27 -14
  211. package/src/operations/inventoryItems.ts +27 -14
  212. package/src/operations/machineExtensions.ts +22 -10
  213. package/src/operations/operations.ts +21 -9
  214. package/src/operations/resourcePools.ts +46 -19
  215. package/src/operations/vCenters.ts +46 -19
  216. package/src/operations/virtualMachineTemplates.ts +46 -19
  217. package/src/operations/virtualMachines.ts +46 -19
  218. package/src/operations/virtualNetworks.ts +46 -19
  219. package/src/pagingHelper.ts +39 -0
  220. package/types/arm-connectedvmware.d.ts +9 -2
  221. package/types/tsdoc-metadata.json +1 -1
@@ -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 { Datastores } 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
  Datastore,
19
20
  DatastoresListNextOptionalParams,
20
21
  DatastoresListOptionalParams,
22
+ DatastoresListResponse,
21
23
  DatastoresListByResourceGroupNextOptionalParams,
22
24
  DatastoresListByResourceGroupOptionalParams,
25
+ DatastoresListByResourceGroupResponse,
23
26
  DatastoresCreateOptionalParams,
24
27
  DatastoresCreateResponse,
25
28
  DatastoresGetOptionalParams,
@@ -27,8 +30,6 @@ import {
27
30
  DatastoresUpdateOptionalParams,
28
31
  DatastoresUpdateResponse,
29
32
  DatastoresDeleteOptionalParams,
30
- DatastoresListResponse,
31
- DatastoresListByResourceGroupResponse,
32
33
  DatastoresListNextResponse,
33
34
  DatastoresListByResourceGroupNextResponse
34
35
  } from "../models";
@@ -61,22 +62,34 @@ export class DatastoresImpl implements Datastores {
61
62
  [Symbol.asyncIterator]() {
62
63
  return this;
63
64
  },
64
- byPage: () => {
65
- return this.listPagingPage(options);
65
+ byPage: (settings?: PageSettings) => {
66
+ if (settings?.maxPageSize) {
67
+ throw new Error("maxPageSize is not supported by this operation.");
68
+ }
69
+ return this.listPagingPage(options, settings);
66
70
  }
67
71
  };
68
72
  }
69
73
 
70
74
  private async *listPagingPage(
71
- options?: DatastoresListOptionalParams
75
+ options?: DatastoresListOptionalParams,
76
+ settings?: PageSettings
72
77
  ): AsyncIterableIterator<Datastore[]> {
73
- let result = await this._list(options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
78
+ let result: DatastoresListResponse;
79
+ let continuationToken = settings?.continuationToken;
80
+ if (!continuationToken) {
81
+ result = await this._list(options);
82
+ let page = result.value || [];
83
+ continuationToken = result.nextLink;
84
+ setContinuationToken(page, continuationToken);
85
+ yield page;
86
+ }
76
87
  while (continuationToken) {
77
88
  result = await this._listNext(continuationToken, options);
78
89
  continuationToken = result.nextLink;
79
- yield result.value || [];
90
+ let page = result.value || [];
91
+ setContinuationToken(page, continuationToken);
92
+ yield page;
80
93
  }
81
94
  }
82
95
 
@@ -105,19 +118,33 @@ export class DatastoresImpl implements Datastores {
105
118
  [Symbol.asyncIterator]() {
106
119
  return this;
107
120
  },
108
- byPage: () => {
109
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
121
+ byPage: (settings?: PageSettings) => {
122
+ if (settings?.maxPageSize) {
123
+ throw new Error("maxPageSize is not supported by this operation.");
124
+ }
125
+ return this.listByResourceGroupPagingPage(
126
+ resourceGroupName,
127
+ options,
128
+ settings
129
+ );
110
130
  }
111
131
  };
112
132
  }
113
133
 
114
134
  private async *listByResourceGroupPagingPage(
115
135
  resourceGroupName: string,
116
- options?: DatastoresListByResourceGroupOptionalParams
136
+ options?: DatastoresListByResourceGroupOptionalParams,
137
+ settings?: PageSettings
117
138
  ): AsyncIterableIterator<Datastore[]> {
118
- let result = await this._listByResourceGroup(resourceGroupName, options);
119
- yield result.value || [];
120
- let continuationToken = result.nextLink;
139
+ let result: DatastoresListByResourceGroupResponse;
140
+ let continuationToken = settings?.continuationToken;
141
+ if (!continuationToken) {
142
+ result = await this._listByResourceGroup(resourceGroupName, options);
143
+ let page = result.value || [];
144
+ continuationToken = result.nextLink;
145
+ setContinuationToken(page, continuationToken);
146
+ yield page;
147
+ }
121
148
  while (continuationToken) {
122
149
  result = await this._listByResourceGroupNext(
123
150
  resourceGroupName,
@@ -125,7 +152,9 @@ export class DatastoresImpl implements Datastores {
125
152
  options
126
153
  );
127
154
  continuationToken = result.nextLink;
128
- yield result.value || [];
155
+ let page = result.value || [];
156
+ setContinuationToken(page, continuationToken);
157
+ yield page;
129
158
  }
130
159
  }
131
160
 
@@ -556,7 +585,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
556
585
  bodyMapper: Mappers.ErrorResponse
557
586
  }
558
587
  },
559
- queryParameters: [Parameters.apiVersion],
560
588
  urlParameters: [
561
589
  Parameters.$host,
562
590
  Parameters.nextLink,
@@ -576,7 +604,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
576
604
  bodyMapper: Mappers.ErrorResponse
577
605
  }
578
606
  },
579
- queryParameters: [Parameters.apiVersion],
580
607
  urlParameters: [
581
608
  Parameters.$host,
582
609
  Parameters.nextLink,
@@ -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 { GuestAgents } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,12 +19,12 @@ import {
18
19
  GuestAgent,
19
20
  GuestAgentsListByVmNextOptionalParams,
20
21
  GuestAgentsListByVmOptionalParams,
22
+ GuestAgentsListByVmResponse,
21
23
  GuestAgentsCreateOptionalParams,
22
24
  GuestAgentsCreateResponse,
23
25
  GuestAgentsGetOptionalParams,
24
26
  GuestAgentsGetResponse,
25
27
  GuestAgentsDeleteOptionalParams,
26
- GuestAgentsListByVmResponse,
27
28
  GuestAgentsListByVmNextResponse
28
29
  } from "../models";
29
30
 
@@ -63,11 +64,15 @@ export class GuestAgentsImpl implements GuestAgents {
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.listByVmPagingPage(
68
72
  resourceGroupName,
69
73
  virtualMachineName,
70
- options
74
+ options,
75
+ settings
71
76
  );
72
77
  }
73
78
  };
@@ -76,15 +81,22 @@ export class GuestAgentsImpl implements GuestAgents {
76
81
  private async *listByVmPagingPage(
77
82
  resourceGroupName: string,
78
83
  virtualMachineName: string,
79
- options?: GuestAgentsListByVmOptionalParams
84
+ options?: GuestAgentsListByVmOptionalParams,
85
+ settings?: PageSettings
80
86
  ): AsyncIterableIterator<GuestAgent[]> {
81
- let result = await this._listByVm(
82
- resourceGroupName,
83
- virtualMachineName,
84
- options
85
- );
86
- yield result.value || [];
87
- let continuationToken = result.nextLink;
87
+ let result: GuestAgentsListByVmResponse;
88
+ let continuationToken = settings?.continuationToken;
89
+ if (!continuationToken) {
90
+ result = await this._listByVm(
91
+ resourceGroupName,
92
+ virtualMachineName,
93
+ options
94
+ );
95
+ let page = result.value || [];
96
+ continuationToken = result.nextLink;
97
+ setContinuationToken(page, continuationToken);
98
+ yield page;
99
+ }
88
100
  while (continuationToken) {
89
101
  result = await this._listByVmNext(
90
102
  resourceGroupName,
@@ -93,7 +105,9 @@ export class GuestAgentsImpl implements GuestAgents {
93
105
  options
94
106
  );
95
107
  continuationToken = result.nextLink;
96
- yield result.value || [];
108
+ let page = result.value || [];
109
+ setContinuationToken(page, continuationToken);
110
+ yield page;
97
111
  }
98
112
  }
99
113
 
@@ -463,7 +477,6 @@ const listByVmNextOperationSpec: coreClient.OperationSpec = {
463
477
  bodyMapper: Mappers.ErrorResponse
464
478
  }
465
479
  },
466
- queryParameters: [Parameters.apiVersion],
467
480
  urlParameters: [
468
481
  Parameters.$host,
469
482
  Parameters.nextLink,
@@ -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 { Hosts } 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
  Host,
19
20
  HostsListNextOptionalParams,
20
21
  HostsListOptionalParams,
22
+ HostsListResponse,
21
23
  HostsListByResourceGroupNextOptionalParams,
22
24
  HostsListByResourceGroupOptionalParams,
25
+ HostsListByResourceGroupResponse,
23
26
  HostsCreateOptionalParams,
24
27
  HostsCreateResponse,
25
28
  HostsGetOptionalParams,
@@ -27,8 +30,6 @@ import {
27
30
  HostsUpdateOptionalParams,
28
31
  HostsUpdateResponse,
29
32
  HostsDeleteOptionalParams,
30
- HostsListResponse,
31
- HostsListByResourceGroupResponse,
32
33
  HostsListNextResponse,
33
34
  HostsListByResourceGroupNextResponse
34
35
  } from "../models";
@@ -61,22 +62,34 @@ export class HostsImpl implements Hosts {
61
62
  [Symbol.asyncIterator]() {
62
63
  return this;
63
64
  },
64
- byPage: () => {
65
- return this.listPagingPage(options);
65
+ byPage: (settings?: PageSettings) => {
66
+ if (settings?.maxPageSize) {
67
+ throw new Error("maxPageSize is not supported by this operation.");
68
+ }
69
+ return this.listPagingPage(options, settings);
66
70
  }
67
71
  };
68
72
  }
69
73
 
70
74
  private async *listPagingPage(
71
- options?: HostsListOptionalParams
75
+ options?: HostsListOptionalParams,
76
+ settings?: PageSettings
72
77
  ): AsyncIterableIterator<Host[]> {
73
- let result = await this._list(options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
78
+ let result: HostsListResponse;
79
+ let continuationToken = settings?.continuationToken;
80
+ if (!continuationToken) {
81
+ result = await this._list(options);
82
+ let page = result.value || [];
83
+ continuationToken = result.nextLink;
84
+ setContinuationToken(page, continuationToken);
85
+ yield page;
86
+ }
76
87
  while (continuationToken) {
77
88
  result = await this._listNext(continuationToken, options);
78
89
  continuationToken = result.nextLink;
79
- yield result.value || [];
90
+ let page = result.value || [];
91
+ setContinuationToken(page, continuationToken);
92
+ yield page;
80
93
  }
81
94
  }
82
95
 
@@ -105,19 +118,33 @@ export class HostsImpl implements Hosts {
105
118
  [Symbol.asyncIterator]() {
106
119
  return this;
107
120
  },
108
- byPage: () => {
109
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
121
+ byPage: (settings?: PageSettings) => {
122
+ if (settings?.maxPageSize) {
123
+ throw new Error("maxPageSize is not supported by this operation.");
124
+ }
125
+ return this.listByResourceGroupPagingPage(
126
+ resourceGroupName,
127
+ options,
128
+ settings
129
+ );
110
130
  }
111
131
  };
112
132
  }
113
133
 
114
134
  private async *listByResourceGroupPagingPage(
115
135
  resourceGroupName: string,
116
- options?: HostsListByResourceGroupOptionalParams
136
+ options?: HostsListByResourceGroupOptionalParams,
137
+ settings?: PageSettings
117
138
  ): AsyncIterableIterator<Host[]> {
118
- let result = await this._listByResourceGroup(resourceGroupName, options);
119
- yield result.value || [];
120
- let continuationToken = result.nextLink;
139
+ let result: HostsListByResourceGroupResponse;
140
+ let continuationToken = settings?.continuationToken;
141
+ if (!continuationToken) {
142
+ result = await this._listByResourceGroup(resourceGroupName, options);
143
+ let page = result.value || [];
144
+ continuationToken = result.nextLink;
145
+ setContinuationToken(page, continuationToken);
146
+ yield page;
147
+ }
121
148
  while (continuationToken) {
122
149
  result = await this._listByResourceGroupNext(
123
150
  resourceGroupName,
@@ -125,7 +152,9 @@ export class HostsImpl implements Hosts {
125
152
  options
126
153
  );
127
154
  continuationToken = result.nextLink;
128
- yield result.value || [];
155
+ let page = result.value || [];
156
+ setContinuationToken(page, continuationToken);
157
+ yield page;
129
158
  }
130
159
  }
131
160
 
@@ -543,7 +572,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
543
572
  bodyMapper: Mappers.ErrorResponse
544
573
  }
545
574
  },
546
- queryParameters: [Parameters.apiVersion],
547
575
  urlParameters: [
548
576
  Parameters.$host,
549
577
  Parameters.nextLink,
@@ -563,7 +591,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
563
591
  bodyMapper: Mappers.ErrorResponse
564
592
  }
565
593
  },
566
- queryParameters: [Parameters.apiVersion],
567
594
  urlParameters: [
568
595
  Parameters.$host,
569
596
  Parameters.nextLink,
@@ -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 { HybridIdentityMetadataOperations } 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
  HybridIdentityMetadata,
17
18
  HybridIdentityMetadataListByVmNextOptionalParams,
18
19
  HybridIdentityMetadataListByVmOptionalParams,
20
+ HybridIdentityMetadataListByVmResponse,
19
21
  HybridIdentityMetadataCreateOptionalParams,
20
22
  HybridIdentityMetadataCreateResponse,
21
23
  HybridIdentityMetadataGetOptionalParams,
22
24
  HybridIdentityMetadataGetResponse,
23
25
  HybridIdentityMetadataDeleteOptionalParams,
24
- HybridIdentityMetadataListByVmResponse,
25
26
  HybridIdentityMetadataListByVmNextResponse
26
27
  } from "../models";
27
28
 
@@ -62,11 +63,15 @@ export class HybridIdentityMetadataOperationsImpl
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
66
70
  return this.listByVmPagingPage(
67
71
  resourceGroupName,
68
72
  virtualMachineName,
69
- options
73
+ options,
74
+ settings
70
75
  );
71
76
  }
72
77
  };
@@ -75,15 +80,22 @@ export class HybridIdentityMetadataOperationsImpl
75
80
  private async *listByVmPagingPage(
76
81
  resourceGroupName: string,
77
82
  virtualMachineName: string,
78
- options?: HybridIdentityMetadataListByVmOptionalParams
83
+ options?: HybridIdentityMetadataListByVmOptionalParams,
84
+ settings?: PageSettings
79
85
  ): AsyncIterableIterator<HybridIdentityMetadata[]> {
80
- let result = await this._listByVm(
81
- resourceGroupName,
82
- virtualMachineName,
83
- options
84
- );
85
- yield result.value || [];
86
- let continuationToken = result.nextLink;
86
+ let result: HybridIdentityMetadataListByVmResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._listByVm(
90
+ resourceGroupName,
91
+ virtualMachineName,
92
+ options
93
+ );
94
+ let page = result.value || [];
95
+ continuationToken = result.nextLink;
96
+ setContinuationToken(page, continuationToken);
97
+ yield page;
98
+ }
87
99
  while (continuationToken) {
88
100
  result = await this._listByVmNext(
89
101
  resourceGroupName,
@@ -92,7 +104,9 @@ export class HybridIdentityMetadataOperationsImpl
92
104
  options
93
105
  );
94
106
  continuationToken = result.nextLink;
95
- yield result.value || [];
107
+ let page = result.value || [];
108
+ setContinuationToken(page, continuationToken);
109
+ yield page;
96
110
  }
97
111
  }
98
112
 
@@ -309,7 +323,6 @@ const listByVmNextOperationSpec: coreClient.OperationSpec = {
309
323
  bodyMapper: Mappers.ErrorResponse
310
324
  }
311
325
  },
312
- queryParameters: [Parameters.apiVersion],
313
326
  urlParameters: [
314
327
  Parameters.$host,
315
328
  Parameters.nextLink,
@@ -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 { InventoryItems } 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
  InventoryItem,
17
18
  InventoryItemsListByVCenterNextOptionalParams,
18
19
  InventoryItemsListByVCenterOptionalParams,
20
+ InventoryItemsListByVCenterResponse,
19
21
  InventoryItemsCreateOptionalParams,
20
22
  InventoryItemsCreateResponse,
21
23
  InventoryItemsGetOptionalParams,
22
24
  InventoryItemsGetResponse,
23
25
  InventoryItemsDeleteOptionalParams,
24
- InventoryItemsListByVCenterResponse,
25
26
  InventoryItemsListByVCenterNextResponse
26
27
  } from "../models";
27
28
 
@@ -61,11 +62,15 @@ export class InventoryItemsImpl implements InventoryItems {
61
62
  [Symbol.asyncIterator]() {
62
63
  return this;
63
64
  },
64
- byPage: () => {
65
+ byPage: (settings?: PageSettings) => {
66
+ if (settings?.maxPageSize) {
67
+ throw new Error("maxPageSize is not supported by this operation.");
68
+ }
65
69
  return this.listByVCenterPagingPage(
66
70
  resourceGroupName,
67
71
  vcenterName,
68
- options
72
+ options,
73
+ settings
69
74
  );
70
75
  }
71
76
  };
@@ -74,15 +79,22 @@ export class InventoryItemsImpl implements InventoryItems {
74
79
  private async *listByVCenterPagingPage(
75
80
  resourceGroupName: string,
76
81
  vcenterName: string,
77
- options?: InventoryItemsListByVCenterOptionalParams
82
+ options?: InventoryItemsListByVCenterOptionalParams,
83
+ settings?: PageSettings
78
84
  ): AsyncIterableIterator<InventoryItem[]> {
79
- let result = await this._listByVCenter(
80
- resourceGroupName,
81
- vcenterName,
82
- options
83
- );
84
- yield result.value || [];
85
- let continuationToken = result.nextLink;
85
+ let result: InventoryItemsListByVCenterResponse;
86
+ let continuationToken = settings?.continuationToken;
87
+ if (!continuationToken) {
88
+ result = await this._listByVCenter(
89
+ resourceGroupName,
90
+ vcenterName,
91
+ options
92
+ );
93
+ let page = result.value || [];
94
+ continuationToken = result.nextLink;
95
+ setContinuationToken(page, continuationToken);
96
+ yield page;
97
+ }
86
98
  while (continuationToken) {
87
99
  result = await this._listByVCenterNext(
88
100
  resourceGroupName,
@@ -91,7 +103,9 @@ export class InventoryItemsImpl implements InventoryItems {
91
103
  options
92
104
  );
93
105
  continuationToken = result.nextLink;
94
- yield result.value || [];
106
+ let page = result.value || [];
107
+ setContinuationToken(page, continuationToken);
108
+ yield page;
95
109
  }
96
110
  }
97
111
 
@@ -308,7 +322,6 @@ const listByVCenterNextOperationSpec: coreClient.OperationSpec = {
308
322
  bodyMapper: Mappers.ErrorResponse
309
323
  }
310
324
  },
311
- queryParameters: [Parameters.apiVersion],
312
325
  urlParameters: [
313
326
  Parameters.$host,
314
327
  Parameters.nextLink,
@@ -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 { MachineExtensions } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,6 +19,7 @@ import {
18
19
  MachineExtension,
19
20
  MachineExtensionsListNextOptionalParams,
20
21
  MachineExtensionsListOptionalParams,
22
+ MachineExtensionsListResponse,
21
23
  MachineExtensionsCreateOrUpdateOptionalParams,
22
24
  MachineExtensionsCreateOrUpdateResponse,
23
25
  MachineExtensionUpdate,
@@ -26,7 +28,6 @@ import {
26
28
  MachineExtensionsDeleteOptionalParams,
27
29
  MachineExtensionsGetOptionalParams,
28
30
  MachineExtensionsGetResponse,
29
- MachineExtensionsListResponse,
30
31
  MachineExtensionsListNextResponse
31
32
  } from "../models";
32
33
 
@@ -62,8 +63,11 @@ export class MachineExtensionsImpl implements MachineExtensions {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listPagingPage(resourceGroupName, name, options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listPagingPage(resourceGroupName, name, options, settings);
67
71
  }
68
72
  };
69
73
  }
@@ -71,11 +75,18 @@ export class MachineExtensionsImpl implements MachineExtensions {
71
75
  private async *listPagingPage(
72
76
  resourceGroupName: string,
73
77
  name: string,
74
- options?: MachineExtensionsListOptionalParams
78
+ options?: MachineExtensionsListOptionalParams,
79
+ settings?: PageSettings
75
80
  ): AsyncIterableIterator<MachineExtension[]> {
76
- let result = await this._list(resourceGroupName, name, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
81
+ let result: MachineExtensionsListResponse;
82
+ let continuationToken = settings?.continuationToken;
83
+ if (!continuationToken) {
84
+ result = await this._list(resourceGroupName, name, options);
85
+ let page = result.value || [];
86
+ continuationToken = result.nextLink;
87
+ setContinuationToken(page, continuationToken);
88
+ yield page;
89
+ }
79
90
  while (continuationToken) {
80
91
  result = await this._listNext(
81
92
  resourceGroupName,
@@ -84,7 +95,9 @@ export class MachineExtensionsImpl implements MachineExtensions {
84
95
  options
85
96
  );
86
97
  continuationToken = result.nextLink;
87
- yield result.value || [];
98
+ let page = result.value || [];
99
+ setContinuationToken(page, continuationToken);
100
+ yield page;
88
101
  }
89
102
  }
90
103
 
@@ -590,7 +603,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
590
603
  bodyMapper: Mappers.ErrorResponse
591
604
  }
592
605
  },
593
- queryParameters: [Parameters.apiVersion, Parameters.expand],
594
606
  urlParameters: [
595
607
  Parameters.$host,
596
608
  Parameters.nextLink,
@@ -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
- return this.listPagingPage(options);
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<Operation[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
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
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
130
143
  bodyMapper: Mappers.ErrorResponse
131
144
  }
132
145
  },
133
- queryParameters: [Parameters.apiVersion],
134
146
  urlParameters: [Parameters.$host, Parameters.nextLink],
135
147
  headerParameters: [Parameters.accept],
136
148
  serializer