@azure/arm-servicefabric 2.1.1-alpha.20231211.1 → 3.0.1-alpha.20231220.4

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 (135) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/LICENSE +1 -1
  3. package/dist/index.js +749 -111
  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/applicationTypeVersionsCreateOrUpdateSample.js +11 -3
  8. package/dist-esm/samples-dev/applicationTypeVersionsCreateOrUpdateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/applicationTypeVersionsDeleteSample.js +11 -3
  10. package/dist-esm/samples-dev/applicationTypeVersionsDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/applicationTypeVersionsGetSample.js +11 -3
  12. package/dist-esm/samples-dev/applicationTypeVersionsGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/applicationTypeVersionsListSample.js +30 -6
  14. package/dist-esm/samples-dev/applicationTypeVersionsListSample.js.map +1 -1
  15. package/dist-esm/samples-dev/applicationTypesCreateOrUpdateSample.js +11 -3
  16. package/dist-esm/samples-dev/applicationTypesCreateOrUpdateSample.js.map +1 -1
  17. package/dist-esm/samples-dev/applicationTypesDeleteSample.js +11 -3
  18. package/dist-esm/samples-dev/applicationTypesDeleteSample.js.map +1 -1
  19. package/dist-esm/samples-dev/applicationTypesGetSample.js +11 -3
  20. package/dist-esm/samples-dev/applicationTypesGetSample.js.map +1 -1
  21. package/dist-esm/samples-dev/applicationTypesListSample.js +30 -6
  22. package/dist-esm/samples-dev/applicationTypesListSample.js.map +1 -1
  23. package/dist-esm/samples-dev/applicationsCreateOrUpdateSample.js +19 -9
  24. package/dist-esm/samples-dev/applicationsCreateOrUpdateSample.js.map +1 -1
  25. package/dist-esm/samples-dev/applicationsDeleteSample.js +11 -3
  26. package/dist-esm/samples-dev/applicationsDeleteSample.js.map +1 -1
  27. package/dist-esm/samples-dev/applicationsGetSample.js +11 -3
  28. package/dist-esm/samples-dev/applicationsGetSample.js.map +1 -1
  29. package/dist-esm/samples-dev/applicationsListSample.js +30 -6
  30. package/dist-esm/samples-dev/applicationsListSample.js.map +1 -1
  31. package/dist-esm/samples-dev/applicationsUpdateSample.js +11 -3
  32. package/dist-esm/samples-dev/applicationsUpdateSample.js.map +1 -1
  33. package/dist-esm/samples-dev/clusterVersionsGetByEnvironmentSample.js +10 -2
  34. package/dist-esm/samples-dev/clusterVersionsGetByEnvironmentSample.js.map +1 -1
  35. package/dist-esm/samples-dev/clusterVersionsGetSample.js +10 -2
  36. package/dist-esm/samples-dev/clusterVersionsGetSample.js.map +1 -1
  37. package/dist-esm/samples-dev/clusterVersionsListByEnvironmentSample.js +10 -2
  38. package/dist-esm/samples-dev/clusterVersionsListByEnvironmentSample.js.map +1 -1
  39. package/dist-esm/samples-dev/clusterVersionsListSample.js +10 -2
  40. package/dist-esm/samples-dev/clusterVersionsListSample.js.map +1 -1
  41. package/dist-esm/samples-dev/clustersCreateOrUpdateSample.js +15 -6
  42. package/dist-esm/samples-dev/clustersCreateOrUpdateSample.js.map +1 -1
  43. package/dist-esm/samples-dev/clustersDeleteSample.js +11 -3
  44. package/dist-esm/samples-dev/clustersDeleteSample.js.map +1 -1
  45. package/dist-esm/samples-dev/clustersGetSample.js +11 -3
  46. package/dist-esm/samples-dev/clustersGetSample.js.map +1 -1
  47. package/dist-esm/samples-dev/clustersListByResourceGroupSample.js +30 -6
  48. package/dist-esm/samples-dev/clustersListByResourceGroupSample.js.map +1 -1
  49. package/dist-esm/samples-dev/clustersListSample.js +29 -5
  50. package/dist-esm/samples-dev/clustersListSample.js.map +1 -1
  51. package/dist-esm/samples-dev/clustersListUpgradableVersionsSample.js +15 -6
  52. package/dist-esm/samples-dev/clustersListUpgradableVersionsSample.js.map +1 -1
  53. package/dist-esm/samples-dev/clustersUpdateSample.js +11 -3
  54. package/dist-esm/samples-dev/clustersUpdateSample.js.map +1 -1
  55. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  56. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  57. package/dist-esm/samples-dev/servicesCreateOrUpdateSample.js +15 -6
  58. package/dist-esm/samples-dev/servicesCreateOrUpdateSample.js.map +1 -1
  59. package/dist-esm/samples-dev/servicesDeleteSample.js +11 -3
  60. package/dist-esm/samples-dev/servicesDeleteSample.js.map +1 -1
  61. package/dist-esm/samples-dev/servicesGetSample.js +11 -3
  62. package/dist-esm/samples-dev/servicesGetSample.js.map +1 -1
  63. package/dist-esm/samples-dev/servicesListSample.js +30 -6
  64. package/dist-esm/samples-dev/servicesListSample.js.map +1 -1
  65. package/dist-esm/samples-dev/servicesUpdateSample.js +11 -3
  66. package/dist-esm/samples-dev/servicesUpdateSample.js.map +1 -1
  67. package/dist-esm/src/lroImpl.d.ts +6 -11
  68. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  69. package/dist-esm/src/lroImpl.js +12 -20
  70. package/dist-esm/src/lroImpl.js.map +1 -1
  71. package/dist-esm/src/models/index.d.ts +38 -8
  72. package/dist-esm/src/models/index.d.ts.map +1 -1
  73. package/dist-esm/src/models/index.js +7 -7
  74. package/dist-esm/src/models/index.js.map +1 -1
  75. package/dist-esm/src/models/parameters.d.ts +1 -1
  76. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  77. package/dist-esm/src/models/parameters.js +11 -11
  78. package/dist-esm/src/models/parameters.js.map +1 -1
  79. package/dist-esm/src/operations/applicationTypeVersions.d.ts +26 -5
  80. package/dist-esm/src/operations/applicationTypeVersions.d.ts.map +1 -1
  81. package/dist-esm/src/operations/applicationTypeVersions.js +139 -19
  82. package/dist-esm/src/operations/applicationTypeVersions.js.map +1 -1
  83. package/dist-esm/src/operations/applicationTypes.d.ts +23 -4
  84. package/dist-esm/src/operations/applicationTypes.d.ts.map +1 -1
  85. package/dist-esm/src/operations/applicationTypes.js +109 -8
  86. package/dist-esm/src/operations/applicationTypes.js.map +1 -1
  87. package/dist-esm/src/operations/applications.d.ts +25 -6
  88. package/dist-esm/src/operations/applications.d.ts.map +1 -1
  89. package/dist-esm/src/operations/applications.js +137 -16
  90. package/dist-esm/src/operations/applications.js.map +1 -1
  91. package/dist-esm/src/operations/clusterVersions.d.ts +3 -3
  92. package/dist-esm/src/operations/clusterVersions.d.ts.map +1 -1
  93. package/dist-esm/src/operations/clusterVersions.js.map +1 -1
  94. package/dist-esm/src/operations/clusters.d.ts +37 -6
  95. package/dist-esm/src/operations/clusters.d.ts.map +1 -1
  96. package/dist-esm/src/operations/clusters.js +204 -13
  97. package/dist-esm/src/operations/clusters.js.map +1 -1
  98. package/dist-esm/src/operations/services.d.ts +27 -6
  99. package/dist-esm/src/operations/services.d.ts.map +1 -1
  100. package/dist-esm/src/operations/services.js +148 -30
  101. package/dist-esm/src/operations/services.js.map +1 -1
  102. package/dist-esm/src/operationsInterfaces/applicationTypeVersions.d.ts +14 -13
  103. package/dist-esm/src/operationsInterfaces/applicationTypeVersions.d.ts.map +1 -1
  104. package/dist-esm/src/operationsInterfaces/applicationTypes.d.ts +12 -11
  105. package/dist-esm/src/operationsInterfaces/applicationTypes.d.ts.map +1 -1
  106. package/dist-esm/src/operationsInterfaces/applications.d.ts +14 -13
  107. package/dist-esm/src/operationsInterfaces/applications.d.ts.map +1 -1
  108. package/dist-esm/src/operationsInterfaces/clusterVersions.d.ts +3 -3
  109. package/dist-esm/src/operationsInterfaces/clusterVersions.d.ts.map +1 -1
  110. package/dist-esm/src/operationsInterfaces/clusters.d.ts +18 -17
  111. package/dist-esm/src/operationsInterfaces/clusters.d.ts.map +1 -1
  112. package/dist-esm/src/operationsInterfaces/services.d.ts +15 -14
  113. package/dist-esm/src/operationsInterfaces/services.d.ts.map +1 -1
  114. package/dist-esm/src/serviceFabricManagementClient.js +1 -1
  115. package/dist-esm/test/servicefabric_examples.spec.js +73 -11
  116. package/dist-esm/test/servicefabric_examples.spec.js.map +1 -1
  117. package/package.json +12 -9
  118. package/review/arm-servicefabric.api.md +72 -30
  119. package/src/lroImpl.ts +31 -23
  120. package/src/models/index.ts +50 -8
  121. package/src/models/parameters.ts +12 -12
  122. package/src/operations/applicationTypeVersions.ts +186 -25
  123. package/src/operations/applicationTypes.ts +141 -15
  124. package/src/operations/applications.ts +179 -35
  125. package/src/operations/clusterVersions.ts +3 -3
  126. package/src/operations/clusters.ts +245 -30
  127. package/src/operations/services.ts +193 -35
  128. package/src/operationsInterfaces/applicationTypeVersions.ts +23 -22
  129. package/src/operationsInterfaces/applicationTypes.ts +19 -18
  130. package/src/operationsInterfaces/applications.ts +23 -22
  131. package/src/operationsInterfaces/clusterVersions.ts +3 -3
  132. package/src/operationsInterfaces/clusters.ts +28 -26
  133. package/src/operationsInterfaces/services.ts +25 -24
  134. package/src/serviceFabricManagementClient.ts +1 -1
  135. package/types/arm-servicefabric.d.ts +125 -83
@@ -6,24 +6,33 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
9
11
  import { ApplicationTypeVersions } from "../operationsInterfaces";
10
12
  import * as coreClient from "@azure/core-client";
11
13
  import * as Mappers from "../models/mappers";
12
14
  import * as Parameters from "../models/parameters";
13
15
  import { ServiceFabricManagementClient } from "../serviceFabricManagementClient";
14
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
15
- import { LroImpl } from "../lroImpl";
16
16
  import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
22
+ import {
23
+ ApplicationTypeVersionResource,
24
+ ApplicationTypeVersionsListNextOptionalParams,
25
+ ApplicationTypeVersionsListOptionalParams,
26
+ ApplicationTypeVersionsListResponse,
17
27
  ApplicationTypeVersionsGetOptionalParams,
18
28
  ApplicationTypeVersionsGetResponse,
19
- ApplicationTypeVersionResource,
20
29
  ApplicationTypeVersionsCreateOrUpdateOptionalParams,
21
30
  ApplicationTypeVersionsCreateOrUpdateResponse,
22
31
  ApplicationTypeVersionsDeleteOptionalParams,
23
- ApplicationTypeVersionsListOptionalParams,
24
- ApplicationTypeVersionsListResponse
32
+ ApplicationTypeVersionsListNextResponse
25
33
  } from "../models";
26
34
 
35
+ /// <reference lib="esnext.asynciterable" />
27
36
  /** Class containing ApplicationTypeVersions operations. */
28
37
  export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
29
38
  private readonly client: ServiceFabricManagementClient;
@@ -36,6 +45,100 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
36
45
  this.client = client;
37
46
  }
38
47
 
48
+ /**
49
+ * Gets all application type version resources created or in the process of being created in the
50
+ * Service Fabric application type name resource.
51
+ * @param resourceGroupName The name of the resource group.
52
+ * @param clusterName The name of the cluster resource.
53
+ * @param applicationTypeName The name of the application type name resource.
54
+ * @param options The options parameters.
55
+ */
56
+ public list(
57
+ resourceGroupName: string,
58
+ clusterName: string,
59
+ applicationTypeName: string,
60
+ options?: ApplicationTypeVersionsListOptionalParams
61
+ ): PagedAsyncIterableIterator<ApplicationTypeVersionResource> {
62
+ const iter = this.listPagingAll(
63
+ resourceGroupName,
64
+ clusterName,
65
+ applicationTypeName,
66
+ options
67
+ );
68
+ return {
69
+ next() {
70
+ return iter.next();
71
+ },
72
+ [Symbol.asyncIterator]() {
73
+ return this;
74
+ },
75
+ byPage: (settings?: PageSettings) => {
76
+ if (settings?.maxPageSize) {
77
+ throw new Error("maxPageSize is not supported by this operation.");
78
+ }
79
+ return this.listPagingPage(
80
+ resourceGroupName,
81
+ clusterName,
82
+ applicationTypeName,
83
+ options,
84
+ settings
85
+ );
86
+ }
87
+ };
88
+ }
89
+
90
+ private async *listPagingPage(
91
+ resourceGroupName: string,
92
+ clusterName: string,
93
+ applicationTypeName: string,
94
+ options?: ApplicationTypeVersionsListOptionalParams,
95
+ settings?: PageSettings
96
+ ): AsyncIterableIterator<ApplicationTypeVersionResource[]> {
97
+ let result: ApplicationTypeVersionsListResponse;
98
+ let continuationToken = settings?.continuationToken;
99
+ if (!continuationToken) {
100
+ result = await this._list(
101
+ resourceGroupName,
102
+ clusterName,
103
+ applicationTypeName,
104
+ options
105
+ );
106
+ let page = result.value || [];
107
+ continuationToken = result.nextLink;
108
+ setContinuationToken(page, continuationToken);
109
+ yield page;
110
+ }
111
+ while (continuationToken) {
112
+ result = await this._listNext(
113
+ resourceGroupName,
114
+ clusterName,
115
+ applicationTypeName,
116
+ continuationToken,
117
+ options
118
+ );
119
+ continuationToken = result.nextLink;
120
+ let page = result.value || [];
121
+ setContinuationToken(page, continuationToken);
122
+ yield page;
123
+ }
124
+ }
125
+
126
+ private async *listPagingAll(
127
+ resourceGroupName: string,
128
+ clusterName: string,
129
+ applicationTypeName: string,
130
+ options?: ApplicationTypeVersionsListOptionalParams
131
+ ): AsyncIterableIterator<ApplicationTypeVersionResource> {
132
+ for await (const page of this.listPagingPage(
133
+ resourceGroupName,
134
+ clusterName,
135
+ applicationTypeName,
136
+ options
137
+ )) {
138
+ yield* page;
139
+ }
140
+ }
141
+
39
142
  /**
40
143
  * Get a Service Fabric application type version resource created or in the process of being created in
41
144
  * the Service Fabric application type name resource.
@@ -75,8 +178,8 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
75
178
  parameters: ApplicationTypeVersionResource,
76
179
  options?: ApplicationTypeVersionsCreateOrUpdateOptionalParams
77
180
  ): Promise<
78
- PollerLike<
79
- PollOperationState<ApplicationTypeVersionsCreateOrUpdateResponse>,
181
+ SimplePollerLike<
182
+ OperationState<ApplicationTypeVersionsCreateOrUpdateResponse>,
80
183
  ApplicationTypeVersionsCreateOrUpdateResponse
81
184
  >
82
185
  > {
@@ -86,7 +189,7 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
86
189
  ): Promise<ApplicationTypeVersionsCreateOrUpdateResponse> => {
87
190
  return this.client.sendOperationRequest(args, spec);
88
191
  };
89
- const sendOperation = async (
192
+ const sendOperationFn = async (
90
193
  args: coreClient.OperationArguments,
91
194
  spec: coreClient.OperationSpec
92
195
  ) => {
@@ -119,9 +222,9 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
119
222
  };
120
223
  };
121
224
 
122
- const lro = new LroImpl(
123
- sendOperation,
124
- {
225
+ const lro = createLroSpec({
226
+ sendOperationFn,
227
+ args: {
125
228
  resourceGroupName,
126
229
  clusterName,
127
230
  applicationTypeName,
@@ -129,10 +232,13 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
129
232
  parameters,
130
233
  options
131
234
  },
132
- createOrUpdateOperationSpec
133
- );
134
- const poller = new LroEngine(lro, {
135
- resumeFrom: options?.resumeFrom,
235
+ spec: createOrUpdateOperationSpec
236
+ });
237
+ const poller = await createHttpPoller<
238
+ ApplicationTypeVersionsCreateOrUpdateResponse,
239
+ OperationState<ApplicationTypeVersionsCreateOrUpdateResponse>
240
+ >(lro, {
241
+ restoreFrom: options?.resumeFrom,
136
242
  intervalInMs: options?.updateIntervalInMs
137
243
  });
138
244
  await poller.poll();
@@ -181,14 +287,14 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
181
287
  applicationTypeName: string,
182
288
  version: string,
183
289
  options?: ApplicationTypeVersionsDeleteOptionalParams
184
- ): Promise<PollerLike<PollOperationState<void>, void>> {
290
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
185
291
  const directSendOperation = async (
186
292
  args: coreClient.OperationArguments,
187
293
  spec: coreClient.OperationSpec
188
294
  ): Promise<void> => {
189
295
  return this.client.sendOperationRequest(args, spec);
190
296
  };
191
- const sendOperation = async (
297
+ const sendOperationFn = async (
192
298
  args: coreClient.OperationArguments,
193
299
  spec: coreClient.OperationSpec
194
300
  ) => {
@@ -221,13 +327,19 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
221
327
  };
222
328
  };
223
329
 
224
- const lro = new LroImpl(
225
- sendOperation,
226
- { resourceGroupName, clusterName, applicationTypeName, version, options },
227
- deleteOperationSpec
228
- );
229
- const poller = new LroEngine(lro, {
230
- resumeFrom: options?.resumeFrom,
330
+ const lro = createLroSpec({
331
+ sendOperationFn,
332
+ args: {
333
+ resourceGroupName,
334
+ clusterName,
335
+ applicationTypeName,
336
+ version,
337
+ options
338
+ },
339
+ spec: deleteOperationSpec
340
+ });
341
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
342
+ restoreFrom: options?.resumeFrom,
231
343
  intervalInMs: options?.updateIntervalInMs
232
344
  });
233
345
  await poller.poll();
@@ -267,7 +379,7 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
267
379
  * @param applicationTypeName The name of the application type name resource.
268
380
  * @param options The options parameters.
269
381
  */
270
- list(
382
+ private _list(
271
383
  resourceGroupName: string,
272
384
  clusterName: string,
273
385
  applicationTypeName: string,
@@ -278,6 +390,33 @@ export class ApplicationTypeVersionsImpl implements ApplicationTypeVersions {
278
390
  listOperationSpec
279
391
  );
280
392
  }
393
+
394
+ /**
395
+ * ListNext
396
+ * @param resourceGroupName The name of the resource group.
397
+ * @param clusterName The name of the cluster resource.
398
+ * @param applicationTypeName The name of the application type name resource.
399
+ * @param nextLink The nextLink from the previous successful call to the List method.
400
+ * @param options The options parameters.
401
+ */
402
+ private _listNext(
403
+ resourceGroupName: string,
404
+ clusterName: string,
405
+ applicationTypeName: string,
406
+ nextLink: string,
407
+ options?: ApplicationTypeVersionsListNextOptionalParams
408
+ ): Promise<ApplicationTypeVersionsListNextResponse> {
409
+ return this.client.sendOperationRequest(
410
+ {
411
+ resourceGroupName,
412
+ clusterName,
413
+ applicationTypeName,
414
+ nextLink,
415
+ options
416
+ },
417
+ listNextOperationSpec
418
+ );
419
+ }
281
420
  }
282
421
  // Operation Specifications
283
422
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
@@ -389,3 +528,25 @@ const listOperationSpec: coreClient.OperationSpec = {
389
528
  headerParameters: [Parameters.accept],
390
529
  serializer
391
530
  };
531
+ const listNextOperationSpec: coreClient.OperationSpec = {
532
+ path: "{nextLink}",
533
+ httpMethod: "GET",
534
+ responses: {
535
+ 200: {
536
+ bodyMapper: Mappers.ApplicationTypeVersionResourceList
537
+ },
538
+ default: {
539
+ bodyMapper: Mappers.ErrorModel
540
+ }
541
+ },
542
+ urlParameters: [
543
+ Parameters.$host,
544
+ Parameters.resourceGroupName,
545
+ Parameters.clusterName,
546
+ Parameters.subscriptionId,
547
+ Parameters.nextLink,
548
+ Parameters.applicationTypeName
549
+ ],
550
+ headerParameters: [Parameters.accept],
551
+ serializer
552
+ };
@@ -6,24 +6,33 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
9
11
  import { ApplicationTypes } from "../operationsInterfaces";
10
12
  import * as coreClient from "@azure/core-client";
11
13
  import * as Mappers from "../models/mappers";
12
14
  import * as Parameters from "../models/parameters";
13
15
  import { ServiceFabricManagementClient } from "../serviceFabricManagementClient";
14
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
15
- import { LroImpl } from "../lroImpl";
16
16
  import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
22
+ import {
23
+ ApplicationTypeResource,
24
+ ApplicationTypesListNextOptionalParams,
25
+ ApplicationTypesListOptionalParams,
26
+ ApplicationTypesListResponse,
17
27
  ApplicationTypesGetOptionalParams,
18
28
  ApplicationTypesGetResponse,
19
- ApplicationTypeResource,
20
29
  ApplicationTypesCreateOrUpdateOptionalParams,
21
30
  ApplicationTypesCreateOrUpdateResponse,
22
31
  ApplicationTypesDeleteOptionalParams,
23
- ApplicationTypesListOptionalParams,
24
- ApplicationTypesListResponse
32
+ ApplicationTypesListNextResponse
25
33
  } from "../models";
26
34
 
35
+ /// <reference lib="esnext.asynciterable" />
27
36
  /** Class containing ApplicationTypes operations. */
28
37
  export class ApplicationTypesImpl implements ApplicationTypes {
29
38
  private readonly client: ServiceFabricManagementClient;
@@ -36,6 +45,83 @@ export class ApplicationTypesImpl implements ApplicationTypes {
36
45
  this.client = client;
37
46
  }
38
47
 
48
+ /**
49
+ * Gets all application type name resources created or in the process of being created in the Service
50
+ * Fabric cluster resource.
51
+ * @param resourceGroupName The name of the resource group.
52
+ * @param clusterName The name of the cluster resource.
53
+ * @param options The options parameters.
54
+ */
55
+ public list(
56
+ resourceGroupName: string,
57
+ clusterName: string,
58
+ options?: ApplicationTypesListOptionalParams
59
+ ): PagedAsyncIterableIterator<ApplicationTypeResource> {
60
+ const iter = this.listPagingAll(resourceGroupName, clusterName, options);
61
+ return {
62
+ next() {
63
+ return iter.next();
64
+ },
65
+ [Symbol.asyncIterator]() {
66
+ return this;
67
+ },
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
+ clusterName,
75
+ options,
76
+ settings
77
+ );
78
+ }
79
+ };
80
+ }
81
+
82
+ private async *listPagingPage(
83
+ resourceGroupName: string,
84
+ clusterName: string,
85
+ options?: ApplicationTypesListOptionalParams,
86
+ settings?: PageSettings
87
+ ): AsyncIterableIterator<ApplicationTypeResource[]> {
88
+ let result: ApplicationTypesListResponse;
89
+ let continuationToken = settings?.continuationToken;
90
+ if (!continuationToken) {
91
+ result = await this._list(resourceGroupName, clusterName, options);
92
+ let page = result.value || [];
93
+ continuationToken = result.nextLink;
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
96
+ }
97
+ while (continuationToken) {
98
+ result = await this._listNext(
99
+ resourceGroupName,
100
+ clusterName,
101
+ continuationToken,
102
+ options
103
+ );
104
+ continuationToken = result.nextLink;
105
+ let page = result.value || [];
106
+ setContinuationToken(page, continuationToken);
107
+ yield page;
108
+ }
109
+ }
110
+
111
+ private async *listPagingAll(
112
+ resourceGroupName: string,
113
+ clusterName: string,
114
+ options?: ApplicationTypesListOptionalParams
115
+ ): AsyncIterableIterator<ApplicationTypeResource> {
116
+ for await (const page of this.listPagingPage(
117
+ resourceGroupName,
118
+ clusterName,
119
+ options
120
+ )) {
121
+ yield* page;
122
+ }
123
+ }
124
+
39
125
  /**
40
126
  * Get a Service Fabric application type name resource created or in the process of being created in
41
127
  * the Service Fabric cluster resource.
@@ -95,14 +181,14 @@ export class ApplicationTypesImpl implements ApplicationTypes {
95
181
  clusterName: string,
96
182
  applicationTypeName: string,
97
183
  options?: ApplicationTypesDeleteOptionalParams
98
- ): Promise<PollerLike<PollOperationState<void>, void>> {
184
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
99
185
  const directSendOperation = async (
100
186
  args: coreClient.OperationArguments,
101
187
  spec: coreClient.OperationSpec
102
188
  ): Promise<void> => {
103
189
  return this.client.sendOperationRequest(args, spec);
104
190
  };
105
- const sendOperation = async (
191
+ const sendOperationFn = async (
106
192
  args: coreClient.OperationArguments,
107
193
  spec: coreClient.OperationSpec
108
194
  ) => {
@@ -135,13 +221,13 @@ export class ApplicationTypesImpl implements ApplicationTypes {
135
221
  };
136
222
  };
137
223
 
138
- const lro = new LroImpl(
139
- sendOperation,
140
- { resourceGroupName, clusterName, applicationTypeName, options },
141
- deleteOperationSpec
142
- );
143
- const poller = new LroEngine(lro, {
144
- resumeFrom: options?.resumeFrom,
224
+ const lro = createLroSpec({
225
+ sendOperationFn,
226
+ args: { resourceGroupName, clusterName, applicationTypeName, options },
227
+ spec: deleteOperationSpec
228
+ });
229
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
230
+ restoreFrom: options?.resumeFrom,
145
231
  intervalInMs: options?.updateIntervalInMs
146
232
  });
147
233
  await poller.poll();
@@ -177,7 +263,7 @@ export class ApplicationTypesImpl implements ApplicationTypes {
177
263
  * @param clusterName The name of the cluster resource.
178
264
  * @param options The options parameters.
179
265
  */
180
- list(
266
+ private _list(
181
267
  resourceGroupName: string,
182
268
  clusterName: string,
183
269
  options?: ApplicationTypesListOptionalParams
@@ -187,6 +273,25 @@ export class ApplicationTypesImpl implements ApplicationTypes {
187
273
  listOperationSpec
188
274
  );
189
275
  }
276
+
277
+ /**
278
+ * ListNext
279
+ * @param resourceGroupName The name of the resource group.
280
+ * @param clusterName The name of the cluster resource.
281
+ * @param nextLink The nextLink from the previous successful call to the List method.
282
+ * @param options The options parameters.
283
+ */
284
+ private _listNext(
285
+ resourceGroupName: string,
286
+ clusterName: string,
287
+ nextLink: string,
288
+ options?: ApplicationTypesListNextOptionalParams
289
+ ): Promise<ApplicationTypesListNextResponse> {
290
+ return this.client.sendOperationRequest(
291
+ { resourceGroupName, clusterName, nextLink, options },
292
+ listNextOperationSpec
293
+ );
294
+ }
190
295
  }
191
296
  // Operation Specifications
192
297
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
@@ -285,3 +390,24 @@ const listOperationSpec: coreClient.OperationSpec = {
285
390
  headerParameters: [Parameters.accept],
286
391
  serializer
287
392
  };
393
+ const listNextOperationSpec: coreClient.OperationSpec = {
394
+ path: "{nextLink}",
395
+ httpMethod: "GET",
396
+ responses: {
397
+ 200: {
398
+ bodyMapper: Mappers.ApplicationTypeResourceList
399
+ },
400
+ default: {
401
+ bodyMapper: Mappers.ErrorModel
402
+ }
403
+ },
404
+ urlParameters: [
405
+ Parameters.$host,
406
+ Parameters.resourceGroupName,
407
+ Parameters.clusterName,
408
+ Parameters.subscriptionId,
409
+ Parameters.nextLink
410
+ ],
411
+ headerParameters: [Parameters.accept],
412
+ serializer
413
+ };