@azure/arm-databricks 3.0.0-beta.3 → 3.0.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 (167) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/LICENSE +1 -1
  3. package/README.md +3 -3
  4. package/dist/index.js +1271 -273
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/accessConnectorsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/accessConnectorsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/accessConnectorsCreateOrUpdateSample.js +58 -0
  11. package/dist-esm/samples-dev/accessConnectorsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/accessConnectorsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/accessConnectorsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/accessConnectorsDeleteSample.js +38 -0
  15. package/dist-esm/samples-dev/accessConnectorsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/accessConnectorsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/accessConnectorsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/accessConnectorsGetSample.js +38 -0
  19. package/dist-esm/samples-dev/accessConnectorsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/accessConnectorsListByResourceGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/accessConnectorsListByResourceGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/accessConnectorsListByResourceGroupSample.js +53 -0
  23. package/dist-esm/samples-dev/accessConnectorsListByResourceGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/accessConnectorsListBySubscriptionSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/accessConnectorsListBySubscriptionSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/accessConnectorsListBySubscriptionSample.js +52 -0
  27. package/dist-esm/samples-dev/accessConnectorsListBySubscriptionSample.js.map +1 -0
  28. package/dist-esm/samples-dev/accessConnectorsUpdateSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/accessConnectorsUpdateSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/accessConnectorsUpdateSample.js +39 -0
  31. package/dist-esm/samples-dev/accessConnectorsUpdateSample.js.map +1 -0
  32. package/dist-esm/samples-dev/operationsListSample.js +17 -7
  33. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  34. package/dist-esm/samples-dev/outboundNetworkDependenciesEndpointsListSample.js +14 -6
  35. package/dist-esm/samples-dev/outboundNetworkDependenciesEndpointsListSample.js.map +1 -1
  36. package/dist-esm/samples-dev/privateEndpointConnectionsCreateSample.js +12 -4
  37. package/dist-esm/samples-dev/privateEndpointConnectionsCreateSample.js.map +1 -1
  38. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +12 -4
  39. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js.map +1 -1
  40. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +12 -4
  41. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js.map +1 -1
  42. package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js +18 -8
  43. package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js.map +1 -1
  44. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js +12 -4
  45. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js.map +1 -1
  46. package/dist-esm/samples-dev/privateLinkResourcesListSample.js +18 -8
  47. package/dist-esm/samples-dev/privateLinkResourcesListSample.js.map +1 -1
  48. package/dist-esm/samples-dev/vNetPeeringCreateOrUpdateSample.js +11 -4
  49. package/dist-esm/samples-dev/vNetPeeringCreateOrUpdateSample.js.map +1 -1
  50. package/dist-esm/samples-dev/vNetPeeringDeleteSample.js +11 -4
  51. package/dist-esm/samples-dev/vNetPeeringDeleteSample.js.map +1 -1
  52. package/dist-esm/samples-dev/vNetPeeringGetSample.js +11 -4
  53. package/dist-esm/samples-dev/vNetPeeringGetSample.js.map +1 -1
  54. package/dist-esm/samples-dev/vNetPeeringListByWorkspaceSample.js +17 -8
  55. package/dist-esm/samples-dev/vNetPeeringListByWorkspaceSample.js.map +1 -1
  56. package/dist-esm/samples-dev/workspacesCreateOrUpdateSample.js +98 -20
  57. package/dist-esm/samples-dev/workspacesCreateOrUpdateSample.js.map +1 -1
  58. package/dist-esm/samples-dev/workspacesDeleteSample.js +11 -4
  59. package/dist-esm/samples-dev/workspacesDeleteSample.js.map +1 -1
  60. package/dist-esm/samples-dev/workspacesGetSample.js +33 -8
  61. package/dist-esm/samples-dev/workspacesGetSample.js.map +1 -1
  62. package/dist-esm/samples-dev/workspacesListByResourceGroupSample.js +17 -8
  63. package/dist-esm/samples-dev/workspacesListByResourceGroupSample.js.map +1 -1
  64. package/dist-esm/samples-dev/workspacesListBySubscriptionSample.js +16 -7
  65. package/dist-esm/samples-dev/workspacesListBySubscriptionSample.js.map +1 -1
  66. package/dist-esm/samples-dev/workspacesUpdateSample.js +11 -4
  67. package/dist-esm/samples-dev/workspacesUpdateSample.js.map +1 -1
  68. package/dist-esm/src/azureDatabricksManagementClient.d.ts +2 -2
  69. package/dist-esm/src/azureDatabricksManagementClient.d.ts.map +1 -1
  70. package/dist-esm/src/azureDatabricksManagementClient.js +22 -20
  71. package/dist-esm/src/azureDatabricksManagementClient.js.map +1 -1
  72. package/dist-esm/src/index.d.ts +1 -0
  73. package/dist-esm/src/index.d.ts.map +1 -1
  74. package/dist-esm/src/index.js +1 -0
  75. package/dist-esm/src/index.js.map +1 -1
  76. package/dist-esm/src/lroImpl.d.ts +6 -11
  77. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  78. package/dist-esm/src/lroImpl.js +12 -20
  79. package/dist-esm/src/lroImpl.js.map +1 -1
  80. package/dist-esm/src/models/index.d.ts +252 -42
  81. package/dist-esm/src/models/index.d.ts.map +1 -1
  82. package/dist-esm/src/models/index.js +54 -0
  83. package/dist-esm/src/models/index.js.map +1 -1
  84. package/dist-esm/src/models/mappers.d.ts +8 -0
  85. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  86. package/dist-esm/src/models/mappers.js +243 -2
  87. package/dist-esm/src/models/mappers.js.map +1 -1
  88. package/dist-esm/src/models/parameters.d.ts +4 -0
  89. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  90. package/dist-esm/src/models/parameters.js +35 -2
  91. package/dist-esm/src/models/parameters.js.map +1 -1
  92. package/dist-esm/src/operations/accessConnectors.d.ts +107 -0
  93. package/dist-esm/src/operations/accessConnectors.d.ts.map +1 -0
  94. package/dist-esm/src/operations/accessConnectors.js +543 -0
  95. package/dist-esm/src/operations/accessConnectors.js.map +1 -0
  96. package/dist-esm/src/operations/index.d.ts +1 -0
  97. package/dist-esm/src/operations/index.d.ts.map +1 -1
  98. package/dist-esm/src/operations/index.js +1 -0
  99. package/dist-esm/src/operations/index.js.map +1 -1
  100. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  101. package/dist-esm/src/operations/operations.js +25 -12
  102. package/dist-esm/src/operations/operations.js.map +1 -1
  103. package/dist-esm/src/operations/outboundNetworkDependenciesEndpoints.d.ts +1 -1
  104. package/dist-esm/src/operations/outboundNetworkDependenciesEndpoints.js +1 -1
  105. package/dist-esm/src/operations/privateEndpointConnections.d.ts +3 -3
  106. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  107. package/dist-esm/src/operations/privateEndpointConnections.js +54 -33
  108. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  109. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -1
  110. package/dist-esm/src/operations/privateLinkResources.js +25 -12
  111. package/dist-esm/src/operations/privateLinkResources.js.map +1 -1
  112. package/dist-esm/src/operations/vNetPeering.d.ts +3 -3
  113. package/dist-esm/src/operations/vNetPeering.d.ts.map +1 -1
  114. package/dist-esm/src/operations/vNetPeering.js +49 -28
  115. package/dist-esm/src/operations/vNetPeering.js.map +1 -1
  116. package/dist-esm/src/operations/workspaces.d.ts +4 -4
  117. package/dist-esm/src/operations/workspaces.d.ts.map +1 -1
  118. package/dist-esm/src/operations/workspaces.js +75 -38
  119. package/dist-esm/src/operations/workspaces.js.map +1 -1
  120. package/dist-esm/src/operationsInterfaces/accessConnectors.d.ts +71 -0
  121. package/dist-esm/src/operationsInterfaces/accessConnectors.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/accessConnectors.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/accessConnectors.js.map +1 -0
  124. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  125. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  126. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  127. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  128. package/dist-esm/src/operationsInterfaces/outboundNetworkDependenciesEndpoints.d.ts +1 -1
  129. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +3 -3
  130. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -1
  131. package/dist-esm/src/operationsInterfaces/vNetPeering.d.ts +3 -3
  132. package/dist-esm/src/operationsInterfaces/vNetPeering.d.ts.map +1 -1
  133. package/dist-esm/src/operationsInterfaces/workspaces.d.ts +4 -4
  134. package/dist-esm/src/operationsInterfaces/workspaces.d.ts.map +1 -1
  135. package/dist-esm/src/pagingHelper.d.ts +13 -0
  136. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  137. package/dist-esm/src/pagingHelper.js +32 -0
  138. package/dist-esm/src/pagingHelper.js.map +1 -0
  139. package/dist-esm/test/databricks_examples.d.ts.map +1 -1
  140. package/dist-esm/test/databricks_examples.js +22 -22
  141. package/dist-esm/test/databricks_examples.js.map +1 -1
  142. package/package.json +27 -26
  143. package/review/arm-databricks.api.md +175 -71
  144. package/src/azureDatabricksManagementClient.ts +32 -24
  145. package/src/index.ts +1 -0
  146. package/src/lroImpl.ts +31 -23
  147. package/src/models/index.ts +244 -10
  148. package/src/models/mappers.ts +258 -2
  149. package/src/models/parameters.ts +41 -2
  150. package/src/operations/accessConnectors.ts +717 -0
  151. package/src/operations/index.ts +1 -0
  152. package/src/operations/operations.ts +21 -9
  153. package/src/operations/outboundNetworkDependenciesEndpoints.ts +1 -1
  154. package/src/operations/privateEndpointConnections.ts +54 -30
  155. package/src/operations/privateLinkResources.ts +26 -9
  156. package/src/operations/vNetPeering.ts +55 -35
  157. package/src/operations/workspaces.ts +87 -50
  158. package/src/operationsInterfaces/accessConnectors.ts +139 -0
  159. package/src/operationsInterfaces/index.ts +1 -0
  160. package/src/operationsInterfaces/outboundNetworkDependenciesEndpoints.ts +1 -1
  161. package/src/operationsInterfaces/privateEndpointConnections.ts +4 -4
  162. package/src/operationsInterfaces/vNetPeering.ts +4 -4
  163. package/src/operationsInterfaces/workspaces.ts +6 -6
  164. package/src/pagingHelper.ts +39 -0
  165. package/types/arm-databricks.d.ts +333 -21
  166. package/types/tsdoc-metadata.json +1 -1
  167. package/rollup.config.js +0 -122
@@ -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
@@ -32,7 +32,7 @@ export class OutboundNetworkDependenciesEndpointsImpl
32
32
  /**
33
33
  * Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane. You
34
34
  * must configure outbound access with these endpoints. For more information, see
35
- * https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr
35
+ * https://docs.microsoft.com/azure/databricks/administration-guide/cloud-configurations/azure/udr
36
36
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
37
37
  * @param workspaceName The name of the workspace.
38
38
  * @param options The options parameters.
@@ -6,14 +6,19 @@
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 { PrivateEndpointConnections } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
13
14
  import * as Parameters from "../models/parameters";
14
15
  import { AzureDatabricksManagementClient } from "../azureDatabricksManagementClient";
15
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
17
22
  import {
18
23
  PrivateEndpointConnection,
19
24
  PrivateEndpointConnectionsListNextOptionalParams,
@@ -60,8 +65,16 @@ export class PrivateEndpointConnectionsImpl
60
65
  [Symbol.asyncIterator]() {
61
66
  return this;
62
67
  },
63
- byPage: () => {
64
- return this.listPagingPage(resourceGroupName, workspaceName, options);
68
+ byPage: (settings?: PageSettings) => {
69
+ if (settings?.maxPageSize) {
70
+ throw new Error("maxPageSize is not supported by this operation.");
71
+ }
72
+ return this.listPagingPage(
73
+ resourceGroupName,
74
+ workspaceName,
75
+ options,
76
+ settings
77
+ );
65
78
  }
66
79
  };
67
80
  }
@@ -69,11 +82,18 @@ export class PrivateEndpointConnectionsImpl
69
82
  private async *listPagingPage(
70
83
  resourceGroupName: string,
71
84
  workspaceName: string,
72
- options?: PrivateEndpointConnectionsListOptionalParams
85
+ options?: PrivateEndpointConnectionsListOptionalParams,
86
+ settings?: PageSettings
73
87
  ): AsyncIterableIterator<PrivateEndpointConnection[]> {
74
- let result = await this._list(resourceGroupName, workspaceName, options);
75
- yield result.value || [];
76
- let continuationToken = result.nextLink;
88
+ let result: PrivateEndpointConnectionsListResponse;
89
+ let continuationToken = settings?.continuationToken;
90
+ if (!continuationToken) {
91
+ result = await this._list(resourceGroupName, workspaceName, options);
92
+ let page = result.value || [];
93
+ continuationToken = result.nextLink;
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
96
+ }
77
97
  while (continuationToken) {
78
98
  result = await this._listNext(
79
99
  resourceGroupName,
@@ -82,7 +102,9 @@ export class PrivateEndpointConnectionsImpl
82
102
  options
83
103
  );
84
104
  continuationToken = result.nextLink;
85
- yield result.value || [];
105
+ let page = result.value || [];
106
+ setContinuationToken(page, continuationToken);
107
+ yield page;
86
108
  }
87
109
  }
88
110
 
@@ -156,8 +178,8 @@ export class PrivateEndpointConnectionsImpl
156
178
  privateEndpointConnection: PrivateEndpointConnection,
157
179
  options?: PrivateEndpointConnectionsCreateOptionalParams
158
180
  ): Promise<
159
- PollerLike<
160
- PollOperationState<PrivateEndpointConnectionsCreateResponse>,
181
+ SimplePollerLike<
182
+ OperationState<PrivateEndpointConnectionsCreateResponse>,
161
183
  PrivateEndpointConnectionsCreateResponse
162
184
  >
163
185
  > {
@@ -167,7 +189,7 @@ export class PrivateEndpointConnectionsImpl
167
189
  ): Promise<PrivateEndpointConnectionsCreateResponse> => {
168
190
  return this.client.sendOperationRequest(args, spec);
169
191
  };
170
- const sendOperation = async (
192
+ const sendOperationFn = async (
171
193
  args: coreClient.OperationArguments,
172
194
  spec: coreClient.OperationSpec
173
195
  ) => {
@@ -200,19 +222,22 @@ export class PrivateEndpointConnectionsImpl
200
222
  };
201
223
  };
202
224
 
203
- const lro = new LroImpl(
204
- sendOperation,
205
- {
225
+ const lro = createLroSpec({
226
+ sendOperationFn,
227
+ args: {
206
228
  resourceGroupName,
207
229
  workspaceName,
208
230
  privateEndpointConnectionName,
209
231
  privateEndpointConnection,
210
232
  options
211
233
  },
212
- createOperationSpec
213
- );
214
- const poller = new LroEngine(lro, {
215
- resumeFrom: options?.resumeFrom,
234
+ spec: createOperationSpec
235
+ });
236
+ const poller = await createHttpPoller<
237
+ PrivateEndpointConnectionsCreateResponse,
238
+ OperationState<PrivateEndpointConnectionsCreateResponse>
239
+ >(lro, {
240
+ restoreFrom: options?.resumeFrom,
216
241
  intervalInMs: options?.updateIntervalInMs
217
242
  });
218
243
  await poller.poll();
@@ -256,14 +281,14 @@ export class PrivateEndpointConnectionsImpl
256
281
  workspaceName: string,
257
282
  privateEndpointConnectionName: string,
258
283
  options?: PrivateEndpointConnectionsDeleteOptionalParams
259
- ): Promise<PollerLike<PollOperationState<void>, void>> {
284
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
260
285
  const directSendOperation = async (
261
286
  args: coreClient.OperationArguments,
262
287
  spec: coreClient.OperationSpec
263
288
  ): Promise<void> => {
264
289
  return this.client.sendOperationRequest(args, spec);
265
290
  };
266
- const sendOperation = async (
291
+ const sendOperationFn = async (
267
292
  args: coreClient.OperationArguments,
268
293
  spec: coreClient.OperationSpec
269
294
  ) => {
@@ -296,18 +321,18 @@ export class PrivateEndpointConnectionsImpl
296
321
  };
297
322
  };
298
323
 
299
- const lro = new LroImpl(
300
- sendOperation,
301
- {
324
+ const lro = createLroSpec({
325
+ sendOperationFn,
326
+ args: {
302
327
  resourceGroupName,
303
328
  workspaceName,
304
329
  privateEndpointConnectionName,
305
330
  options
306
331
  },
307
- deleteOperationSpec
308
- );
309
- const poller = new LroEngine(lro, {
310
- resumeFrom: options?.resumeFrom,
332
+ spec: deleteOperationSpec
333
+ });
334
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
335
+ restoreFrom: options?.resumeFrom,
311
336
  intervalInMs: options?.updateIntervalInMs
312
337
  });
313
338
  await poller.poll();
@@ -472,7 +497,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
472
497
  bodyMapper: Mappers.ErrorResponse
473
498
  }
474
499
  },
475
- queryParameters: [Parameters.apiVersion],
476
500
  urlParameters: [
477
501
  Parameters.$host,
478
502
  Parameters.resourceGroupName,
@@ -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 { PrivateLinkResources } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -54,8 +55,16 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources {
54
55
  [Symbol.asyncIterator]() {
55
56
  return this;
56
57
  },
57
- byPage: () => {
58
- return this.listPagingPage(resourceGroupName, workspaceName, options);
58
+ byPage: (settings?: PageSettings) => {
59
+ if (settings?.maxPageSize) {
60
+ throw new Error("maxPageSize is not supported by this operation.");
61
+ }
62
+ return this.listPagingPage(
63
+ resourceGroupName,
64
+ workspaceName,
65
+ options,
66
+ settings
67
+ );
59
68
  }
60
69
  };
61
70
  }
@@ -63,11 +72,18 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources {
63
72
  private async *listPagingPage(
64
73
  resourceGroupName: string,
65
74
  workspaceName: string,
66
- options?: PrivateLinkResourcesListOptionalParams
75
+ options?: PrivateLinkResourcesListOptionalParams,
76
+ settings?: PageSettings
67
77
  ): AsyncIterableIterator<GroupIdInformation[]> {
68
- let result = await this._list(resourceGroupName, workspaceName, options);
69
- yield result.value || [];
70
- let continuationToken = result.nextLink;
78
+ let result: PrivateLinkResourcesListResponse;
79
+ let continuationToken = settings?.continuationToken;
80
+ if (!continuationToken) {
81
+ result = await this._list(resourceGroupName, workspaceName, options);
82
+ let page = result.value || [];
83
+ continuationToken = result.nextLink;
84
+ setContinuationToken(page, continuationToken);
85
+ yield page;
86
+ }
71
87
  while (continuationToken) {
72
88
  result = await this._listNext(
73
89
  resourceGroupName,
@@ -76,7 +92,9 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources {
76
92
  options
77
93
  );
78
94
  continuationToken = result.nextLink;
79
- yield result.value || [];
95
+ let page = result.value || [];
96
+ setContinuationToken(page, continuationToken);
97
+ yield page;
80
98
  }
81
99
  }
82
100
 
@@ -208,7 +226,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
208
226
  bodyMapper: Mappers.ErrorResponse
209
227
  }
210
228
  },
211
- queryParameters: [Parameters.apiVersion],
212
229
  urlParameters: [
213
230
  Parameters.$host,
214
231
  Parameters.resourceGroupName,
@@ -6,24 +6,29 @@
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 { VNetPeering } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
13
14
  import * as Parameters from "../models/parameters";
14
15
  import { AzureDatabricksManagementClient } from "../azureDatabricksManagementClient";
15
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
17
22
  import {
18
23
  VirtualNetworkPeering,
19
24
  VNetPeeringListByWorkspaceNextOptionalParams,
20
25
  VNetPeeringListByWorkspaceOptionalParams,
26
+ VNetPeeringListByWorkspaceResponse,
21
27
  VNetPeeringGetOptionalParams,
22
28
  VNetPeeringGetResponse,
23
29
  VNetPeeringDeleteOptionalParams,
24
30
  VNetPeeringCreateOrUpdateOptionalParams,
25
31
  VNetPeeringCreateOrUpdateResponse,
26
- VNetPeeringListByWorkspaceResponse,
27
32
  VNetPeeringListByWorkspaceNextResponse
28
33
  } from "../models";
29
34
 
@@ -63,11 +68,15 @@ export class VNetPeeringImpl implements VNetPeering {
63
68
  [Symbol.asyncIterator]() {
64
69
  return this;
65
70
  },
66
- byPage: () => {
71
+ byPage: (settings?: PageSettings) => {
72
+ if (settings?.maxPageSize) {
73
+ throw new Error("maxPageSize is not supported by this operation.");
74
+ }
67
75
  return this.listByWorkspacePagingPage(
68
76
  resourceGroupName,
69
77
  workspaceName,
70
- options
78
+ options,
79
+ settings
71
80
  );
72
81
  }
73
82
  };
@@ -76,15 +85,22 @@ export class VNetPeeringImpl implements VNetPeering {
76
85
  private async *listByWorkspacePagingPage(
77
86
  resourceGroupName: string,
78
87
  workspaceName: string,
79
- options?: VNetPeeringListByWorkspaceOptionalParams
88
+ options?: VNetPeeringListByWorkspaceOptionalParams,
89
+ settings?: PageSettings
80
90
  ): AsyncIterableIterator<VirtualNetworkPeering[]> {
81
- let result = await this._listByWorkspace(
82
- resourceGroupName,
83
- workspaceName,
84
- options
85
- );
86
- yield result.value || [];
87
- let continuationToken = result.nextLink;
91
+ let result: VNetPeeringListByWorkspaceResponse;
92
+ let continuationToken = settings?.continuationToken;
93
+ if (!continuationToken) {
94
+ result = await this._listByWorkspace(
95
+ resourceGroupName,
96
+ workspaceName,
97
+ options
98
+ );
99
+ let page = result.value || [];
100
+ continuationToken = result.nextLink;
101
+ setContinuationToken(page, continuationToken);
102
+ yield page;
103
+ }
88
104
  while (continuationToken) {
89
105
  result = await this._listByWorkspaceNext(
90
106
  resourceGroupName,
@@ -93,7 +109,9 @@ export class VNetPeeringImpl implements VNetPeering {
93
109
  options
94
110
  );
95
111
  continuationToken = result.nextLink;
96
- yield result.value || [];
112
+ let page = result.value || [];
113
+ setContinuationToken(page, continuationToken);
114
+ yield page;
97
115
  }
98
116
  }
99
117
 
@@ -142,14 +160,14 @@ export class VNetPeeringImpl implements VNetPeering {
142
160
  workspaceName: string,
143
161
  peeringName: string,
144
162
  options?: VNetPeeringDeleteOptionalParams
145
- ): Promise<PollerLike<PollOperationState<void>, void>> {
163
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
146
164
  const directSendOperation = async (
147
165
  args: coreClient.OperationArguments,
148
166
  spec: coreClient.OperationSpec
149
167
  ): Promise<void> => {
150
168
  return this.client.sendOperationRequest(args, spec);
151
169
  };
152
- const sendOperation = async (
170
+ const sendOperationFn = async (
153
171
  args: coreClient.OperationArguments,
154
172
  spec: coreClient.OperationSpec
155
173
  ) => {
@@ -182,13 +200,13 @@ export class VNetPeeringImpl implements VNetPeering {
182
200
  };
183
201
  };
184
202
 
185
- const lro = new LroImpl(
186
- sendOperation,
187
- { resourceGroupName, workspaceName, peeringName, options },
188
- deleteOperationSpec
189
- );
190
- const poller = new LroEngine(lro, {
191
- resumeFrom: options?.resumeFrom,
203
+ const lro = createLroSpec({
204
+ sendOperationFn,
205
+ args: { resourceGroupName, workspaceName, peeringName, options },
206
+ spec: deleteOperationSpec
207
+ });
208
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
209
+ restoreFrom: options?.resumeFrom,
192
210
  intervalInMs: options?.updateIntervalInMs
193
211
  });
194
212
  await poller.poll();
@@ -232,8 +250,8 @@ export class VNetPeeringImpl implements VNetPeering {
232
250
  virtualNetworkPeeringParameters: VirtualNetworkPeering,
233
251
  options?: VNetPeeringCreateOrUpdateOptionalParams
234
252
  ): Promise<
235
- PollerLike<
236
- PollOperationState<VNetPeeringCreateOrUpdateResponse>,
253
+ SimplePollerLike<
254
+ OperationState<VNetPeeringCreateOrUpdateResponse>,
237
255
  VNetPeeringCreateOrUpdateResponse
238
256
  >
239
257
  > {
@@ -243,7 +261,7 @@ export class VNetPeeringImpl implements VNetPeering {
243
261
  ): Promise<VNetPeeringCreateOrUpdateResponse> => {
244
262
  return this.client.sendOperationRequest(args, spec);
245
263
  };
246
- const sendOperation = async (
264
+ const sendOperationFn = async (
247
265
  args: coreClient.OperationArguments,
248
266
  spec: coreClient.OperationSpec
249
267
  ) => {
@@ -276,19 +294,22 @@ export class VNetPeeringImpl implements VNetPeering {
276
294
  };
277
295
  };
278
296
 
279
- const lro = new LroImpl(
280
- sendOperation,
281
- {
297
+ const lro = createLroSpec({
298
+ sendOperationFn,
299
+ args: {
282
300
  resourceGroupName,
283
301
  workspaceName,
284
302
  peeringName,
285
303
  virtualNetworkPeeringParameters,
286
304
  options
287
305
  },
288
- createOrUpdateOperationSpec
289
- );
290
- const poller = new LroEngine(lro, {
291
- resumeFrom: options?.resumeFrom,
306
+ spec: createOrUpdateOperationSpec
307
+ });
308
+ const poller = await createHttpPoller<
309
+ VNetPeeringCreateOrUpdateResponse,
310
+ OperationState<VNetPeeringCreateOrUpdateResponse>
311
+ >(lro, {
312
+ restoreFrom: options?.resumeFrom,
292
313
  intervalInMs: options?.updateIntervalInMs
293
314
  });
294
315
  await poller.poll();
@@ -474,7 +495,6 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = {
474
495
  bodyMapper: Mappers.ErrorResponse
475
496
  }
476
497
  },
477
- queryParameters: [Parameters.apiVersion],
478
498
  urlParameters: [
479
499
  Parameters.$host,
480
500
  Parameters.resourceGroupName,