@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 { ResourcePools } 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
  ResourcePool,
19
20
  ResourcePoolsListNextOptionalParams,
20
21
  ResourcePoolsListOptionalParams,
22
+ ResourcePoolsListResponse,
21
23
  ResourcePoolsListByResourceGroupNextOptionalParams,
22
24
  ResourcePoolsListByResourceGroupOptionalParams,
25
+ ResourcePoolsListByResourceGroupResponse,
23
26
  ResourcePoolsCreateOptionalParams,
24
27
  ResourcePoolsCreateResponse,
25
28
  ResourcePoolsGetOptionalParams,
@@ -27,8 +30,6 @@ import {
27
30
  ResourcePoolsUpdateOptionalParams,
28
31
  ResourcePoolsUpdateResponse,
29
32
  ResourcePoolsDeleteOptionalParams,
30
- ResourcePoolsListResponse,
31
- ResourcePoolsListByResourceGroupResponse,
32
33
  ResourcePoolsListNextResponse,
33
34
  ResourcePoolsListByResourceGroupNextResponse
34
35
  } from "../models";
@@ -61,22 +62,34 @@ export class ResourcePoolsImpl implements ResourcePools {
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?: ResourcePoolsListOptionalParams
75
+ options?: ResourcePoolsListOptionalParams,
76
+ settings?: PageSettings
72
77
  ): AsyncIterableIterator<ResourcePool[]> {
73
- let result = await this._list(options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
78
+ let result: ResourcePoolsListResponse;
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 ResourcePoolsImpl implements ResourcePools {
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?: ResourcePoolsListByResourceGroupOptionalParams
136
+ options?: ResourcePoolsListByResourceGroupOptionalParams,
137
+ settings?: PageSettings
117
138
  ): AsyncIterableIterator<ResourcePool[]> {
118
- let result = await this._listByResourceGroup(resourceGroupName, options);
119
- yield result.value || [];
120
- let continuationToken = result.nextLink;
139
+ let result: ResourcePoolsListByResourceGroupResponse;
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 ResourcePoolsImpl implements ResourcePools {
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 { VCenters } 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
  VCenter,
19
20
  VCentersListNextOptionalParams,
20
21
  VCentersListOptionalParams,
22
+ VCentersListResponse,
21
23
  VCentersListByResourceGroupNextOptionalParams,
22
24
  VCentersListByResourceGroupOptionalParams,
25
+ VCentersListByResourceGroupResponse,
23
26
  VCentersCreateOptionalParams,
24
27
  VCentersCreateResponse,
25
28
  VCentersGetOptionalParams,
@@ -27,8 +30,6 @@ import {
27
30
  VCentersUpdateOptionalParams,
28
31
  VCentersUpdateResponse,
29
32
  VCentersDeleteOptionalParams,
30
- VCentersListResponse,
31
- VCentersListByResourceGroupResponse,
32
33
  VCentersListNextResponse,
33
34
  VCentersListByResourceGroupNextResponse
34
35
  } from "../models";
@@ -61,22 +62,34 @@ export class VCentersImpl implements VCenters {
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?: VCentersListOptionalParams
75
+ options?: VCentersListOptionalParams,
76
+ settings?: PageSettings
72
77
  ): AsyncIterableIterator<VCenter[]> {
73
- let result = await this._list(options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
78
+ let result: VCentersListResponse;
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 VCentersImpl implements VCenters {
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?: VCentersListByResourceGroupOptionalParams
136
+ options?: VCentersListByResourceGroupOptionalParams,
137
+ settings?: PageSettings
117
138
  ): AsyncIterableIterator<VCenter[]> {
118
- let result = await this._listByResourceGroup(resourceGroupName, options);
119
- yield result.value || [];
120
- let continuationToken = result.nextLink;
139
+ let result: VCentersListByResourceGroupResponse;
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 VCentersImpl implements VCenters {
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 { VirtualMachineTemplates } 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
  VirtualMachineTemplate,
19
20
  VirtualMachineTemplatesListNextOptionalParams,
20
21
  VirtualMachineTemplatesListOptionalParams,
22
+ VirtualMachineTemplatesListResponse,
21
23
  VirtualMachineTemplatesListByResourceGroupNextOptionalParams,
22
24
  VirtualMachineTemplatesListByResourceGroupOptionalParams,
25
+ VirtualMachineTemplatesListByResourceGroupResponse,
23
26
  VirtualMachineTemplatesCreateOptionalParams,
24
27
  VirtualMachineTemplatesCreateResponse,
25
28
  VirtualMachineTemplatesGetOptionalParams,
@@ -27,8 +30,6 @@ import {
27
30
  VirtualMachineTemplatesUpdateOptionalParams,
28
31
  VirtualMachineTemplatesUpdateResponse,
29
32
  VirtualMachineTemplatesDeleteOptionalParams,
30
- VirtualMachineTemplatesListResponse,
31
- VirtualMachineTemplatesListByResourceGroupResponse,
32
33
  VirtualMachineTemplatesListNextResponse,
33
34
  VirtualMachineTemplatesListByResourceGroupNextResponse
34
35
  } from "../models";
@@ -61,22 +62,34 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
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?: VirtualMachineTemplatesListOptionalParams
75
+ options?: VirtualMachineTemplatesListOptionalParams,
76
+ settings?: PageSettings
72
77
  ): AsyncIterableIterator<VirtualMachineTemplate[]> {
73
- let result = await this._list(options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
78
+ let result: VirtualMachineTemplatesListResponse;
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 VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
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?: VirtualMachineTemplatesListByResourceGroupOptionalParams
136
+ options?: VirtualMachineTemplatesListByResourceGroupOptionalParams,
137
+ settings?: PageSettings
117
138
  ): AsyncIterableIterator<VirtualMachineTemplate[]> {
118
- let result = await this._listByResourceGroup(resourceGroupName, options);
119
- yield result.value || [];
120
- let continuationToken = result.nextLink;
139
+ let result: VirtualMachineTemplatesListByResourceGroupResponse;
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 VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
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 { VirtualMachines } 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
  VirtualMachine,
19
20
  VirtualMachinesListNextOptionalParams,
20
21
  VirtualMachinesListOptionalParams,
22
+ VirtualMachinesListResponse,
21
23
  VirtualMachinesListByResourceGroupNextOptionalParams,
22
24
  VirtualMachinesListByResourceGroupOptionalParams,
25
+ VirtualMachinesListByResourceGroupResponse,
23
26
  VirtualMachinesAssessPatchesOptionalParams,
24
27
  VirtualMachinesAssessPatchesResponse,
25
28
  VirtualMachineInstallPatchesParameters,
@@ -35,8 +38,6 @@ import {
35
38
  VirtualMachinesStopOptionalParams,
36
39
  VirtualMachinesStartOptionalParams,
37
40
  VirtualMachinesRestartOptionalParams,
38
- VirtualMachinesListResponse,
39
- VirtualMachinesListByResourceGroupResponse,
40
41
  VirtualMachinesListNextResponse,
41
42
  VirtualMachinesListByResourceGroupNextResponse
42
43
  } from "../models";
@@ -69,22 +70,34 @@ export class VirtualMachinesImpl implements VirtualMachines {
69
70
  [Symbol.asyncIterator]() {
70
71
  return this;
71
72
  },
72
- byPage: () => {
73
- return this.listPagingPage(options);
73
+ byPage: (settings?: PageSettings) => {
74
+ if (settings?.maxPageSize) {
75
+ throw new Error("maxPageSize is not supported by this operation.");
76
+ }
77
+ return this.listPagingPage(options, settings);
74
78
  }
75
79
  };
76
80
  }
77
81
 
78
82
  private async *listPagingPage(
79
- options?: VirtualMachinesListOptionalParams
83
+ options?: VirtualMachinesListOptionalParams,
84
+ settings?: PageSettings
80
85
  ): AsyncIterableIterator<VirtualMachine[]> {
81
- let result = await this._list(options);
82
- yield result.value || [];
83
- let continuationToken = result.nextLink;
86
+ let result: VirtualMachinesListResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._list(options);
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
84
95
  while (continuationToken) {
85
96
  result = await this._listNext(continuationToken, options);
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
 
@@ -113,19 +126,33 @@ export class VirtualMachinesImpl implements VirtualMachines {
113
126
  [Symbol.asyncIterator]() {
114
127
  return this;
115
128
  },
116
- byPage: () => {
117
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
129
+ byPage: (settings?: PageSettings) => {
130
+ if (settings?.maxPageSize) {
131
+ throw new Error("maxPageSize is not supported by this operation.");
132
+ }
133
+ return this.listByResourceGroupPagingPage(
134
+ resourceGroupName,
135
+ options,
136
+ settings
137
+ );
118
138
  }
119
139
  };
120
140
  }
121
141
 
122
142
  private async *listByResourceGroupPagingPage(
123
143
  resourceGroupName: string,
124
- options?: VirtualMachinesListByResourceGroupOptionalParams
144
+ options?: VirtualMachinesListByResourceGroupOptionalParams,
145
+ settings?: PageSettings
125
146
  ): AsyncIterableIterator<VirtualMachine[]> {
126
- let result = await this._listByResourceGroup(resourceGroupName, options);
127
- yield result.value || [];
128
- let continuationToken = result.nextLink;
147
+ let result: VirtualMachinesListByResourceGroupResponse;
148
+ let continuationToken = settings?.continuationToken;
149
+ if (!continuationToken) {
150
+ result = await this._listByResourceGroup(resourceGroupName, options);
151
+ let page = result.value || [];
152
+ continuationToken = result.nextLink;
153
+ setContinuationToken(page, continuationToken);
154
+ yield page;
155
+ }
129
156
  while (continuationToken) {
130
157
  result = await this._listByResourceGroupNext(
131
158
  resourceGroupName,
@@ -133,7 +160,9 @@ export class VirtualMachinesImpl implements VirtualMachines {
133
160
  options
134
161
  );
135
162
  continuationToken = result.nextLink;
136
- yield result.value || [];
163
+ let page = result.value || [];
164
+ setContinuationToken(page, continuationToken);
165
+ yield page;
137
166
  }
138
167
  }
139
168
 
@@ -1205,7 +1234,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
1205
1234
  bodyMapper: Mappers.ErrorResponse
1206
1235
  }
1207
1236
  },
1208
- queryParameters: [Parameters.apiVersion],
1209
1237
  urlParameters: [
1210
1238
  Parameters.$host,
1211
1239
  Parameters.nextLink,
@@ -1225,7 +1253,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
1225
1253
  bodyMapper: Mappers.ErrorResponse
1226
1254
  }
1227
1255
  },
1228
- queryParameters: [Parameters.apiVersion],
1229
1256
  urlParameters: [
1230
1257
  Parameters.$host,
1231
1258
  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 { VirtualNetworks } 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
  VirtualNetwork,
19
20
  VirtualNetworksListNextOptionalParams,
20
21
  VirtualNetworksListOptionalParams,
22
+ VirtualNetworksListResponse,
21
23
  VirtualNetworksListByResourceGroupNextOptionalParams,
22
24
  VirtualNetworksListByResourceGroupOptionalParams,
25
+ VirtualNetworksListByResourceGroupResponse,
23
26
  VirtualNetworksCreateOptionalParams,
24
27
  VirtualNetworksCreateResponse,
25
28
  VirtualNetworksGetOptionalParams,
@@ -27,8 +30,6 @@ import {
27
30
  VirtualNetworksUpdateOptionalParams,
28
31
  VirtualNetworksUpdateResponse,
29
32
  VirtualNetworksDeleteOptionalParams,
30
- VirtualNetworksListResponse,
31
- VirtualNetworksListByResourceGroupResponse,
32
33
  VirtualNetworksListNextResponse,
33
34
  VirtualNetworksListByResourceGroupNextResponse
34
35
  } from "../models";
@@ -61,22 +62,34 @@ export class VirtualNetworksImpl implements VirtualNetworks {
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?: VirtualNetworksListOptionalParams
75
+ options?: VirtualNetworksListOptionalParams,
76
+ settings?: PageSettings
72
77
  ): AsyncIterableIterator<VirtualNetwork[]> {
73
- let result = await this._list(options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
78
+ let result: VirtualNetworksListResponse;
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 VirtualNetworksImpl implements VirtualNetworks {
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?: VirtualNetworksListByResourceGroupOptionalParams
136
+ options?: VirtualNetworksListByResourceGroupOptionalParams,
137
+ settings?: PageSettings
117
138
  ): AsyncIterableIterator<VirtualNetwork[]> {
118
- let result = await this._listByResourceGroup(resourceGroupName, options);
119
- yield result.value || [];
120
- let continuationToken = result.nextLink;
139
+ let result: VirtualNetworksListByResourceGroupResponse;
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 VirtualNetworksImpl implements VirtualNetworks {
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,