@azure/arm-vmwarecloudsimple 3.0.2-alpha.20230127.1 → 3.1.0

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 (141) hide show
  1. package/CHANGELOG.md +27 -10
  2. package/LICENSE +1 -1
  3. package/dist/index.js +311 -168
  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/customizationPoliciesGetSample.js +9 -2
  8. package/dist-esm/samples-dev/customizationPoliciesGetSample.js.map +1 -1
  9. package/dist-esm/samples-dev/customizationPoliciesListSample.js +9 -2
  10. package/dist-esm/samples-dev/customizationPoliciesListSample.js.map +1 -1
  11. package/dist-esm/samples-dev/dedicatedCloudNodesCreateOrUpdateSample.js +10 -3
  12. package/dist-esm/samples-dev/dedicatedCloudNodesCreateOrUpdateSample.js.map +1 -1
  13. package/dist-esm/samples-dev/dedicatedCloudNodesDeleteSample.js +10 -3
  14. package/dist-esm/samples-dev/dedicatedCloudNodesDeleteSample.js.map +1 -1
  15. package/dist-esm/samples-dev/dedicatedCloudNodesGetSample.js +10 -3
  16. package/dist-esm/samples-dev/dedicatedCloudNodesGetSample.js.map +1 -1
  17. package/dist-esm/samples-dev/dedicatedCloudNodesListByResourceGroupSample.js +10 -3
  18. package/dist-esm/samples-dev/dedicatedCloudNodesListByResourceGroupSample.js.map +1 -1
  19. package/dist-esm/samples-dev/dedicatedCloudNodesListBySubscriptionSample.js +9 -2
  20. package/dist-esm/samples-dev/dedicatedCloudNodesListBySubscriptionSample.js.map +1 -1
  21. package/dist-esm/samples-dev/dedicatedCloudNodesUpdateSample.js +10 -3
  22. package/dist-esm/samples-dev/dedicatedCloudNodesUpdateSample.js.map +1 -1
  23. package/dist-esm/samples-dev/dedicatedCloudServicesCreateOrUpdateSample.js +10 -3
  24. package/dist-esm/samples-dev/dedicatedCloudServicesCreateOrUpdateSample.js.map +1 -1
  25. package/dist-esm/samples-dev/dedicatedCloudServicesDeleteSample.js +10 -3
  26. package/dist-esm/samples-dev/dedicatedCloudServicesDeleteSample.js.map +1 -1
  27. package/dist-esm/samples-dev/dedicatedCloudServicesGetSample.js +10 -3
  28. package/dist-esm/samples-dev/dedicatedCloudServicesGetSample.js.map +1 -1
  29. package/dist-esm/samples-dev/dedicatedCloudServicesListByResourceGroupSample.js +10 -3
  30. package/dist-esm/samples-dev/dedicatedCloudServicesListByResourceGroupSample.js.map +1 -1
  31. package/dist-esm/samples-dev/dedicatedCloudServicesListBySubscriptionSample.js +9 -2
  32. package/dist-esm/samples-dev/dedicatedCloudServicesListBySubscriptionSample.js.map +1 -1
  33. package/dist-esm/samples-dev/dedicatedCloudServicesUpdateSample.js +10 -3
  34. package/dist-esm/samples-dev/dedicatedCloudServicesUpdateSample.js.map +1 -1
  35. package/dist-esm/samples-dev/operationsGetSample.js +11 -4
  36. package/dist-esm/samples-dev/operationsGetSample.js.map +1 -1
  37. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  38. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  39. package/dist-esm/samples-dev/privateCloudsGetSample.js +9 -2
  40. package/dist-esm/samples-dev/privateCloudsGetSample.js.map +1 -1
  41. package/dist-esm/samples-dev/privateCloudsListSample.js +9 -2
  42. package/dist-esm/samples-dev/privateCloudsListSample.js.map +1 -1
  43. package/dist-esm/samples-dev/resourcePoolsGetSample.js +9 -2
  44. package/dist-esm/samples-dev/resourcePoolsGetSample.js.map +1 -1
  45. package/dist-esm/samples-dev/resourcePoolsListSample.js +9 -2
  46. package/dist-esm/samples-dev/resourcePoolsListSample.js.map +1 -1
  47. package/dist-esm/samples-dev/skusAvailabilityListSample.js +9 -2
  48. package/dist-esm/samples-dev/skusAvailabilityListSample.js.map +1 -1
  49. package/dist-esm/samples-dev/usagesListSample.js +9 -2
  50. package/dist-esm/samples-dev/usagesListSample.js.map +1 -1
  51. package/dist-esm/samples-dev/virtualMachineTemplatesGetSample.js +9 -2
  52. package/dist-esm/samples-dev/virtualMachineTemplatesGetSample.js.map +1 -1
  53. package/dist-esm/samples-dev/virtualMachineTemplatesListSample.js +9 -2
  54. package/dist-esm/samples-dev/virtualMachineTemplatesListSample.js.map +1 -1
  55. package/dist-esm/samples-dev/virtualMachinesCreateOrUpdateSample.js +10 -3
  56. package/dist-esm/samples-dev/virtualMachinesCreateOrUpdateSample.js.map +1 -1
  57. package/dist-esm/samples-dev/virtualMachinesDeleteSample.js +10 -3
  58. package/dist-esm/samples-dev/virtualMachinesDeleteSample.js.map +1 -1
  59. package/dist-esm/samples-dev/virtualMachinesGetSample.js +10 -3
  60. package/dist-esm/samples-dev/virtualMachinesGetSample.js.map +1 -1
  61. package/dist-esm/samples-dev/virtualMachinesListByResourceGroupSample.js +10 -3
  62. package/dist-esm/samples-dev/virtualMachinesListByResourceGroupSample.js.map +1 -1
  63. package/dist-esm/samples-dev/virtualMachinesListBySubscriptionSample.js +9 -2
  64. package/dist-esm/samples-dev/virtualMachinesListBySubscriptionSample.js.map +1 -1
  65. package/dist-esm/samples-dev/virtualMachinesStartSample.js +10 -3
  66. package/dist-esm/samples-dev/virtualMachinesStartSample.js.map +1 -1
  67. package/dist-esm/samples-dev/virtualMachinesStopSample.js +13 -6
  68. package/dist-esm/samples-dev/virtualMachinesStopSample.js.map +1 -1
  69. package/dist-esm/samples-dev/virtualMachinesUpdateSample.js +10 -3
  70. package/dist-esm/samples-dev/virtualMachinesUpdateSample.js.map +1 -1
  71. package/dist-esm/samples-dev/virtualNetworksGetSample.js +9 -2
  72. package/dist-esm/samples-dev/virtualNetworksGetSample.js.map +1 -1
  73. package/dist-esm/samples-dev/virtualNetworksListSample.js +9 -2
  74. package/dist-esm/samples-dev/virtualNetworksListSample.js.map +1 -1
  75. package/dist-esm/src/index.d.ts +1 -0
  76. package/dist-esm/src/index.d.ts.map +1 -1
  77. package/dist-esm/src/index.js +1 -0
  78. package/dist-esm/src/index.js.map +1 -1
  79. package/dist-esm/src/models/index.d.ts +0 -42
  80. package/dist-esm/src/models/index.d.ts.map +1 -1
  81. package/dist-esm/src/operations/customizationPolicies.d.ts.map +1 -1
  82. package/dist-esm/src/operations/customizationPolicies.js +19 -8
  83. package/dist-esm/src/operations/customizationPolicies.js.map +1 -1
  84. package/dist-esm/src/operations/dedicatedCloudNodes.d.ts.map +1 -1
  85. package/dist-esm/src/operations/dedicatedCloudNodes.js +37 -26
  86. package/dist-esm/src/operations/dedicatedCloudNodes.js.map +1 -1
  87. package/dist-esm/src/operations/dedicatedCloudServices.d.ts.map +1 -1
  88. package/dist-esm/src/operations/dedicatedCloudServices.js +37 -26
  89. package/dist-esm/src/operations/dedicatedCloudServices.js.map +1 -1
  90. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  91. package/dist-esm/src/operations/operations.js +19 -8
  92. package/dist-esm/src/operations/operations.js.map +1 -1
  93. package/dist-esm/src/operations/privateClouds.d.ts.map +1 -1
  94. package/dist-esm/src/operations/privateClouds.js +19 -8
  95. package/dist-esm/src/operations/privateClouds.js.map +1 -1
  96. package/dist-esm/src/operations/resourcePools.d.ts.map +1 -1
  97. package/dist-esm/src/operations/resourcePools.js +19 -8
  98. package/dist-esm/src/operations/resourcePools.js.map +1 -1
  99. package/dist-esm/src/operations/skusAvailability.d.ts.map +1 -1
  100. package/dist-esm/src/operations/skusAvailability.js +19 -8
  101. package/dist-esm/src/operations/skusAvailability.js.map +1 -1
  102. package/dist-esm/src/operations/usages.d.ts.map +1 -1
  103. package/dist-esm/src/operations/usages.js +19 -8
  104. package/dist-esm/src/operations/usages.js.map +1 -1
  105. package/dist-esm/src/operations/virtualMachineTemplates.d.ts +0 -1
  106. package/dist-esm/src/operations/virtualMachineTemplates.d.ts.map +1 -1
  107. package/dist-esm/src/operations/virtualMachineTemplates.js +22 -12
  108. package/dist-esm/src/operations/virtualMachineTemplates.js.map +1 -1
  109. package/dist-esm/src/operations/virtualMachines.d.ts.map +1 -1
  110. package/dist-esm/src/operations/virtualMachines.js +37 -26
  111. package/dist-esm/src/operations/virtualMachines.js.map +1 -1
  112. package/dist-esm/src/operations/virtualNetworks.d.ts +0 -1
  113. package/dist-esm/src/operations/virtualNetworks.d.ts.map +1 -1
  114. package/dist-esm/src/operations/virtualNetworks.js +22 -12
  115. package/dist-esm/src/operations/virtualNetworks.js.map +1 -1
  116. package/dist-esm/src/pagingHelper.d.ts +13 -0
  117. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  118. package/dist-esm/src/pagingHelper.js +32 -0
  119. package/dist-esm/src/pagingHelper.js.map +1 -0
  120. package/dist-esm/src/vMwareCloudSimple.d.ts.map +1 -1
  121. package/dist-esm/src/vMwareCloudSimple.js +20 -18
  122. package/dist-esm/src/vMwareCloudSimple.js.map +1 -1
  123. package/package.json +7 -5
  124. package/review/arm-vmwarecloudsimple.api.md +3 -21
  125. package/src/index.ts +1 -0
  126. package/src/models/index.ts +9 -60
  127. package/src/operations/customizationPolicies.ts +21 -9
  128. package/src/operations/dedicatedCloudNodes.ts +45 -28
  129. package/src/operations/dedicatedCloudServices.ts +45 -28
  130. package/src/operations/operations.ts +21 -9
  131. package/src/operations/privateClouds.ts +21 -9
  132. package/src/operations/resourcePools.ts +21 -9
  133. package/src/operations/skusAvailability.ts +21 -9
  134. package/src/operations/usages.ts +21 -9
  135. package/src/operations/virtualMachineTemplates.ts +28 -13
  136. package/src/operations/virtualMachines.ts +45 -28
  137. package/src/operations/virtualNetworks.ts +28 -13
  138. package/src/pagingHelper.ts +39 -0
  139. package/src/vMwareCloudSimple.ts +26 -20
  140. package/types/arm-vmwarecloudsimple.d.ts +9 -42
  141. 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 { SkusAvailability } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -50,23 +51,35 @@ export class SkusAvailabilityImpl implements SkusAvailability {
50
51
  [Symbol.asyncIterator]() {
51
52
  return this;
52
53
  },
53
- byPage: () => {
54
- return this.listPagingPage(regionId, options);
54
+ byPage: (settings?: PageSettings) => {
55
+ if (settings?.maxPageSize) {
56
+ throw new Error("maxPageSize is not supported by this operation.");
57
+ }
58
+ return this.listPagingPage(regionId, options, settings);
55
59
  }
56
60
  };
57
61
  }
58
62
 
59
63
  private async *listPagingPage(
60
64
  regionId: string,
61
- options?: SkusAvailabilityListOptionalParams
65
+ options?: SkusAvailabilityListOptionalParams,
66
+ settings?: PageSettings
62
67
  ): AsyncIterableIterator<SkuAvailability[]> {
63
- let result = await this._list(regionId, options);
64
- yield result.value || [];
65
- let continuationToken = result.nextLink;
68
+ let result: SkusAvailabilityListResponse;
69
+ let continuationToken = settings?.continuationToken;
70
+ if (!continuationToken) {
71
+ result = await this._list(regionId, options);
72
+ let page = result.value || [];
73
+ continuationToken = result.nextLink;
74
+ setContinuationToken(page, continuationToken);
75
+ yield page;
76
+ }
66
77
  while (continuationToken) {
67
78
  result = await this._listNext(regionId, continuationToken, options);
68
79
  continuationToken = result.nextLink;
69
- yield result.value || [];
80
+ let page = result.value || [];
81
+ setContinuationToken(page, continuationToken);
82
+ yield page;
70
83
  }
71
84
  }
72
85
 
@@ -146,7 +159,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
146
159
  bodyMapper: Mappers.CsrpError
147
160
  }
148
161
  },
149
- queryParameters: [Parameters.apiVersion, Parameters.skuId],
150
162
  urlParameters: [
151
163
  Parameters.$host,
152
164
  Parameters.subscriptionId,
@@ -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";
@@ -50,23 +51,35 @@ export class UsagesImpl implements Usages {
50
51
  [Symbol.asyncIterator]() {
51
52
  return this;
52
53
  },
53
- byPage: () => {
54
- return this.listPagingPage(regionId, options);
54
+ byPage: (settings?: PageSettings) => {
55
+ if (settings?.maxPageSize) {
56
+ throw new Error("maxPageSize is not supported by this operation.");
57
+ }
58
+ return this.listPagingPage(regionId, options, settings);
55
59
  }
56
60
  };
57
61
  }
58
62
 
59
63
  private async *listPagingPage(
60
64
  regionId: string,
61
- options?: UsagesListOptionalParams
65
+ options?: UsagesListOptionalParams,
66
+ settings?: PageSettings
62
67
  ): AsyncIterableIterator<Usage[]> {
63
- let result = await this._list(regionId, options);
64
- yield result.value || [];
65
- let continuationToken = result.nextLink;
68
+ let result: UsagesListResponse;
69
+ let continuationToken = settings?.continuationToken;
70
+ if (!continuationToken) {
71
+ result = await this._list(regionId, options);
72
+ let page = result.value || [];
73
+ continuationToken = result.nextLink;
74
+ setContinuationToken(page, continuationToken);
75
+ yield page;
76
+ }
66
77
  while (continuationToken) {
67
78
  result = await this._listNext(regionId, continuationToken, options);
68
79
  continuationToken = result.nextLink;
69
- yield result.value || [];
80
+ let page = result.value || [];
81
+ setContinuationToken(page, continuationToken);
82
+ yield page;
70
83
  }
71
84
  }
72
85
 
@@ -146,7 +159,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
146
159
  bodyMapper: Mappers.CsrpError
147
160
  }
148
161
  },
149
- queryParameters: [Parameters.apiVersion, Parameters.filter],
150
162
  urlParameters: [
151
163
  Parameters.$host,
152
164
  Parameters.subscriptionId,
@@ -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";
@@ -61,8 +62,17 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
61
62
  [Symbol.asyncIterator]() {
62
63
  return this;
63
64
  },
64
- byPage: () => {
65
- return this.listPagingPage(pcName, regionId, resourcePoolName, 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(
70
+ pcName,
71
+ regionId,
72
+ resourcePoolName,
73
+ options,
74
+ settings
75
+ );
66
76
  }
67
77
  };
68
78
  }
@@ -71,21 +81,29 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
71
81
  pcName: string,
72
82
  regionId: string,
73
83
  resourcePoolName: string,
74
- options?: VirtualMachineTemplatesListOptionalParams
84
+ options?: VirtualMachineTemplatesListOptionalParams,
85
+ settings?: PageSettings
75
86
  ): AsyncIterableIterator<VirtualMachineTemplate[]> {
76
- let result = await this._list(pcName, regionId, resourcePoolName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
87
+ let result: VirtualMachineTemplatesListResponse;
88
+ let continuationToken = settings?.continuationToken;
89
+ if (!continuationToken) {
90
+ result = await this._list(pcName, regionId, resourcePoolName, options);
91
+ let page = result.value || [];
92
+ continuationToken = result.nextLink;
93
+ setContinuationToken(page, continuationToken);
94
+ yield page;
95
+ }
79
96
  while (continuationToken) {
80
97
  result = await this._listNext(
81
98
  pcName,
82
99
  regionId,
83
- resourcePoolName,
84
100
  continuationToken,
85
101
  options
86
102
  );
87
103
  continuationToken = result.nextLink;
88
- yield result.value || [];
104
+ let page = result.value || [];
105
+ setContinuationToken(page, continuationToken);
106
+ yield page;
89
107
  }
90
108
  }
91
109
 
@@ -147,19 +165,17 @@ export class VirtualMachineTemplatesImpl implements VirtualMachineTemplates {
147
165
  * ListNext
148
166
  * @param pcName The private cloud name
149
167
  * @param regionId The region Id (westus, eastus)
150
- * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates
151
168
  * @param nextLink The nextLink from the previous successful call to the List method.
152
169
  * @param options The options parameters.
153
170
  */
154
171
  private _listNext(
155
172
  pcName: string,
156
173
  regionId: string,
157
- resourcePoolName: string,
158
174
  nextLink: string,
159
175
  options?: VirtualMachineTemplatesListNextOptionalParams
160
176
  ): Promise<VirtualMachineTemplatesListNextResponse> {
161
177
  return this.client.sendOperationRequest(
162
- { pcName, regionId, resourcePoolName, nextLink, options },
178
+ { pcName, regionId, nextLink, options },
163
179
  listNextOperationSpec
164
180
  );
165
181
  }
@@ -223,7 +239,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
223
239
  bodyMapper: Mappers.CsrpError
224
240
  }
225
241
  },
226
- queryParameters: [Parameters.apiVersion, Parameters.resourcePoolName1],
227
242
  urlParameters: [
228
243
  Parameters.$host,
229
244
  Parameters.subscriptionId,
@@ -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,9 +19,9 @@ import {
18
19
  VirtualMachine,
19
20
  VirtualMachinesListBySubscriptionNextOptionalParams,
20
21
  VirtualMachinesListBySubscriptionOptionalParams,
22
+ VirtualMachinesListBySubscriptionResponse,
21
23
  VirtualMachinesListByResourceGroupNextOptionalParams,
22
24
  VirtualMachinesListByResourceGroupOptionalParams,
23
- VirtualMachinesListBySubscriptionResponse,
24
25
  VirtualMachinesListByResourceGroupResponse,
25
26
  VirtualMachinesGetOptionalParams,
26
27
  VirtualMachinesGetResponse,
@@ -65,22 +66,34 @@ export class VirtualMachinesImpl implements VirtualMachines {
65
66
  [Symbol.asyncIterator]() {
66
67
  return this;
67
68
  },
68
- byPage: () => {
69
- return this.listBySubscriptionPagingPage(options);
69
+ byPage: (settings?: PageSettings) => {
70
+ if (settings?.maxPageSize) {
71
+ throw new Error("maxPageSize is not supported by this operation.");
72
+ }
73
+ return this.listBySubscriptionPagingPage(options, settings);
70
74
  }
71
75
  };
72
76
  }
73
77
 
74
78
  private async *listBySubscriptionPagingPage(
75
- options?: VirtualMachinesListBySubscriptionOptionalParams
79
+ options?: VirtualMachinesListBySubscriptionOptionalParams,
80
+ settings?: PageSettings
76
81
  ): AsyncIterableIterator<VirtualMachine[]> {
77
- let result = await this._listBySubscription(options);
78
- yield result.value || [];
79
- let continuationToken = result.nextLink;
82
+ let result: VirtualMachinesListBySubscriptionResponse;
83
+ let continuationToken = settings?.continuationToken;
84
+ if (!continuationToken) {
85
+ result = await this._listBySubscription(options);
86
+ let page = result.value || [];
87
+ continuationToken = result.nextLink;
88
+ setContinuationToken(page, continuationToken);
89
+ yield page;
90
+ }
80
91
  while (continuationToken) {
81
92
  result = await this._listBySubscriptionNext(continuationToken, options);
82
93
  continuationToken = result.nextLink;
83
- yield result.value || [];
94
+ let page = result.value || [];
95
+ setContinuationToken(page, continuationToken);
96
+ yield page;
84
97
  }
85
98
  }
86
99
 
@@ -109,19 +122,33 @@ export class VirtualMachinesImpl implements VirtualMachines {
109
122
  [Symbol.asyncIterator]() {
110
123
  return this;
111
124
  },
112
- byPage: () => {
113
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
125
+ byPage: (settings?: PageSettings) => {
126
+ if (settings?.maxPageSize) {
127
+ throw new Error("maxPageSize is not supported by this operation.");
128
+ }
129
+ return this.listByResourceGroupPagingPage(
130
+ resourceGroupName,
131
+ options,
132
+ settings
133
+ );
114
134
  }
115
135
  };
116
136
  }
117
137
 
118
138
  private async *listByResourceGroupPagingPage(
119
139
  resourceGroupName: string,
120
- options?: VirtualMachinesListByResourceGroupOptionalParams
140
+ options?: VirtualMachinesListByResourceGroupOptionalParams,
141
+ settings?: PageSettings
121
142
  ): AsyncIterableIterator<VirtualMachine[]> {
122
- let result = await this._listByResourceGroup(resourceGroupName, options);
123
- yield result.value || [];
124
- let continuationToken = result.nextLink;
143
+ let result: VirtualMachinesListByResourceGroupResponse;
144
+ let continuationToken = settings?.continuationToken;
145
+ if (!continuationToken) {
146
+ result = await this._listByResourceGroup(resourceGroupName, options);
147
+ let page = result.value || [];
148
+ continuationToken = result.nextLink;
149
+ setContinuationToken(page, continuationToken);
150
+ yield page;
151
+ }
125
152
  while (continuationToken) {
126
153
  result = await this._listByResourceGroupNext(
127
154
  resourceGroupName,
@@ -129,7 +156,9 @@ export class VirtualMachinesImpl implements VirtualMachines {
129
156
  options
130
157
  );
131
158
  continuationToken = result.nextLink;
132
- yield result.value || [];
159
+ let page = result.value || [];
160
+ setContinuationToken(page, continuationToken);
161
+ yield page;
133
162
  }
134
163
  }
135
164
 
@@ -927,12 +956,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
927
956
  bodyMapper: Mappers.CsrpError
928
957
  }
929
958
  },
930
- queryParameters: [
931
- Parameters.apiVersion,
932
- Parameters.filter,
933
- Parameters.top,
934
- Parameters.skipToken
935
- ],
936
959
  urlParameters: [
937
960
  Parameters.$host,
938
961
  Parameters.subscriptionId,
@@ -952,12 +975,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
952
975
  bodyMapper: Mappers.CsrpError
953
976
  }
954
977
  },
955
- queryParameters: [
956
- Parameters.apiVersion,
957
- Parameters.filter,
958
- Parameters.top,
959
- Parameters.skipToken
960
- ],
961
978
  urlParameters: [
962
979
  Parameters.$host,
963
980
  Parameters.subscriptionId,
@@ -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";
@@ -61,8 +62,17 @@ export class VirtualNetworksImpl implements VirtualNetworks {
61
62
  [Symbol.asyncIterator]() {
62
63
  return this;
63
64
  },
64
- byPage: () => {
65
- return this.listPagingPage(regionId, pcName, resourcePoolName, 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(
70
+ regionId,
71
+ pcName,
72
+ resourcePoolName,
73
+ options,
74
+ settings
75
+ );
66
76
  }
67
77
  };
68
78
  }
@@ -71,21 +81,29 @@ export class VirtualNetworksImpl implements VirtualNetworks {
71
81
  regionId: string,
72
82
  pcName: string,
73
83
  resourcePoolName: string,
74
- options?: VirtualNetworksListOptionalParams
84
+ options?: VirtualNetworksListOptionalParams,
85
+ settings?: PageSettings
75
86
  ): AsyncIterableIterator<VirtualNetwork[]> {
76
- let result = await this._list(regionId, pcName, resourcePoolName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
87
+ let result: VirtualNetworksListResponse;
88
+ let continuationToken = settings?.continuationToken;
89
+ if (!continuationToken) {
90
+ result = await this._list(regionId, pcName, resourcePoolName, options);
91
+ let page = result.value || [];
92
+ continuationToken = result.nextLink;
93
+ setContinuationToken(page, continuationToken);
94
+ yield page;
95
+ }
79
96
  while (continuationToken) {
80
97
  result = await this._listNext(
81
98
  regionId,
82
99
  pcName,
83
- resourcePoolName,
84
100
  continuationToken,
85
101
  options
86
102
  );
87
103
  continuationToken = result.nextLink;
88
- yield result.value || [];
104
+ let page = result.value || [];
105
+ setContinuationToken(page, continuationToken);
106
+ yield page;
89
107
  }
90
108
  }
91
109
 
@@ -147,19 +165,17 @@ export class VirtualNetworksImpl implements VirtualNetworks {
147
165
  * ListNext
148
166
  * @param regionId The region Id (westus, eastus)
149
167
  * @param pcName The private cloud name
150
- * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks
151
168
  * @param nextLink The nextLink from the previous successful call to the List method.
152
169
  * @param options The options parameters.
153
170
  */
154
171
  private _listNext(
155
172
  regionId: string,
156
173
  pcName: string,
157
- resourcePoolName: string,
158
174
  nextLink: string,
159
175
  options?: VirtualNetworksListNextOptionalParams
160
176
  ): Promise<VirtualNetworksListNextResponse> {
161
177
  return this.client.sendOperationRequest(
162
- { regionId, pcName, resourcePoolName, nextLink, options },
178
+ { regionId, pcName, nextLink, options },
163
179
  listNextOperationSpec
164
180
  );
165
181
  }
@@ -223,7 +239,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
223
239
  bodyMapper: Mappers.CsrpError
224
240
  }
225
241
  },
226
- queryParameters: [Parameters.apiVersion, Parameters.resourcePoolName1],
227
242
  urlParameters: [
228
243
  Parameters.$host,
229
244
  Parameters.subscriptionId,
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
@@ -74,47 +74,53 @@ export class VMwareCloudSimple extends coreClient.ServiceClient {
74
74
  credential: credentials
75
75
  };
76
76
 
77
- const packageDetails = `azsdk-js-arm-vmwarecloudsimple/3.0.2`;
77
+ const packageDetails = `azsdk-js-arm-vmwarecloudsimple/3.1.0`;
78
78
  const userAgentPrefix =
79
79
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
80
80
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
81
81
  : `${packageDetails}`;
82
82
 
83
- if (!options.credentialScopes) {
84
- options.credentialScopes = ["https://management.azure.com/.default"];
85
- }
86
83
  const optionsWithDefaults = {
87
84
  ...defaults,
88
85
  ...options,
89
86
  userAgentOptions: {
90
87
  userAgentPrefix
91
88
  },
92
- baseUri:
89
+ endpoint:
93
90
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
94
91
  };
95
92
  super(optionsWithDefaults);
96
93
 
94
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
97
95
  if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
98
96
  const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
99
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
97
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
100
98
  (pipelinePolicy) =>
101
99
  pipelinePolicy.name ===
102
100
  coreRestPipeline.bearerTokenAuthenticationPolicyName
103
101
  );
104
- if (!bearerTokenAuthenticationPolicyFound) {
105
- this.pipeline.removePolicy({
106
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
107
- });
108
- this.pipeline.addPolicy(
109
- coreRestPipeline.bearerTokenAuthenticationPolicy({
110
- scopes: `${optionsWithDefaults.baseUri}/.default`,
111
- challengeCallbacks: {
112
- authorizeRequestOnChallenge:
113
- coreClient.authorizeRequestOnClaimChallenge
114
- }
115
- })
116
- );
117
- }
102
+ }
103
+ if (
104
+ !options ||
105
+ !options.pipeline ||
106
+ options.pipeline.getOrderedPolicies().length == 0 ||
107
+ !bearerTokenAuthenticationPolicyFound
108
+ ) {
109
+ this.pipeline.removePolicy({
110
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
111
+ });
112
+ this.pipeline.addPolicy(
113
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
114
+ credential: credentials,
115
+ scopes:
116
+ optionsWithDefaults.credentialScopes ??
117
+ `${optionsWithDefaults.endpoint}/.default`,
118
+ challengeCallbacks: {
119
+ authorizeRequestOnChallenge:
120
+ coreClient.authorizeRequestOnClaimChallenge
121
+ }
122
+ })
123
+ );
118
124
  }
119
125
  // Parameter assignments
120
126
  this.subscriptionId = subscriptionId;
@@ -202,8 +202,6 @@ export declare type CustomizationPoliciesGetResponse = CustomizationPolicy;
202
202
 
203
203
  /** Optional parameters. */
204
204
  export declare interface CustomizationPoliciesListNextOptionalParams extends coreClient.OperationOptions {
205
- /** The filter to apply on the list operation. only type is allowed here as a filter e.g. $filter=type eq 'xxxx' */
206
- filter?: string;
207
205
  }
208
206
 
209
207
  /** Contains response data for the listNext operation. */
@@ -452,12 +450,6 @@ export declare type DedicatedCloudNodesGetResponse = DedicatedCloudNode;
452
450
 
453
451
  /** Optional parameters. */
454
452
  export declare interface DedicatedCloudNodesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
455
- /** The filter to apply on the list operation */
456
- filter?: string;
457
- /** The maximum number of record sets to return */
458
- top?: number;
459
- /** to be used by nextLink implementation */
460
- skipToken?: string;
461
453
  }
462
454
 
463
455
  /** Contains response data for the listByResourceGroupNext operation. */
@@ -478,12 +470,6 @@ export declare type DedicatedCloudNodesListByResourceGroupResponse = DedicatedCl
478
470
 
479
471
  /** Optional parameters. */
480
472
  export declare interface DedicatedCloudNodesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
481
- /** The filter to apply on the list operation */
482
- filter?: string;
483
- /** The maximum number of record sets to return */
484
- top?: number;
485
- /** to be used by nextLink implementation */
486
- skipToken?: string;
487
473
  }
488
474
 
489
475
  /** Contains response data for the listBySubscriptionNext operation. */
@@ -640,12 +626,6 @@ export declare type DedicatedCloudServicesGetResponse = DedicatedCloudService;
640
626
 
641
627
  /** Optional parameters. */
642
628
  export declare interface DedicatedCloudServicesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
643
- /** The filter to apply on the list operation */
644
- filter?: string;
645
- /** The maximum number of record sets to return */
646
- top?: number;
647
- /** to be used by nextLink implementation */
648
- skipToken?: string;
649
629
  }
650
630
 
651
631
  /** Contains response data for the listByResourceGroupNext operation. */
@@ -666,12 +646,6 @@ export declare type DedicatedCloudServicesListByResourceGroupResponse = Dedicate
666
646
 
667
647
  /** Optional parameters. */
668
648
  export declare interface DedicatedCloudServicesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
669
- /** The filter to apply on the list operation */
670
- filter?: string;
671
- /** The maximum number of record sets to return */
672
- top?: number;
673
- /** to be used by nextLink implementation */
674
- skipToken?: string;
675
649
  }
676
650
 
677
651
  /** Contains response data for the listBySubscriptionNext operation. */
@@ -700,6 +674,15 @@ export declare type DedicatedCloudServicesUpdateResponse = DedicatedCloudService
700
674
  /** Defines values for DiskIndependenceMode. */
701
675
  export declare type DiskIndependenceMode = "persistent" | "independent_persistent" | "independent_nonpersistent";
702
676
 
677
+ /**
678
+ * Given the last `.value` produced by the `byPage` iterator,
679
+ * returns a continuation token that can be used to begin paging from
680
+ * that point later.
681
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
682
+ * @returns The continuation token that can be passed into byPage() during future calls.
683
+ */
684
+ export declare function getContinuationToken(page: unknown): string | undefined;
685
+
703
686
  /** Guest OS Customization properties */
704
687
  export declare interface GuestOSCustomization {
705
688
  /** List of dns servers to use */
@@ -1144,8 +1127,6 @@ export declare interface SkusAvailability {
1144
1127
 
1145
1128
  /** Optional parameters. */
1146
1129
  export declare interface SkusAvailabilityListNextOptionalParams extends coreClient.OperationOptions {
1147
- /** sku id, if no sku is passed availability for all skus will be returned */
1148
- skuId?: string;
1149
1130
  }
1150
1131
 
1151
1132
  /** Contains response data for the listNext operation. */
@@ -1209,8 +1190,6 @@ export declare interface Usages {
1209
1190
 
1210
1191
  /** Optional parameters. */
1211
1192
  export declare interface UsagesListNextOptionalParams extends coreClient.OperationOptions {
1212
- /** The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' */
1213
- filter?: string;
1214
1193
  }
1215
1194
 
1216
1195
  /** Contains response data for the listNext operation. */
@@ -1525,12 +1504,6 @@ export declare type VirtualMachinesGetResponse = VirtualMachine;
1525
1504
 
1526
1505
  /** Optional parameters. */
1527
1506
  export declare interface VirtualMachinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
1528
- /** The filter to apply on the list operation */
1529
- filter?: string;
1530
- /** The maximum number of record sets to return */
1531
- top?: number;
1532
- /** to be used by nextLink implementation */
1533
- skipToken?: string;
1534
1507
  }
1535
1508
 
1536
1509
  /** Contains response data for the listByResourceGroupNext operation. */
@@ -1551,12 +1524,6 @@ export declare type VirtualMachinesListByResourceGroupResponse = VirtualMachineL
1551
1524
 
1552
1525
  /** Optional parameters. */
1553
1526
  export declare interface VirtualMachinesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
1554
- /** The filter to apply on the list operation */
1555
- filter?: string;
1556
- /** The maximum number of record sets to return */
1557
- top?: number;
1558
- /** to be used by nextLink implementation */
1559
- skipToken?: string;
1560
1527
  }
1561
1528
 
1562
1529
  /** Contains response data for the listBySubscriptionNext operation. */