@azure/arm-storageactions 1.0.0-alpha.20240322.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +2533 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/operationsListSample.js +53 -0
  11. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  12. package/dist-esm/samples-dev/storageTaskAssignmentListSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/storageTaskAssignmentListSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/storageTaskAssignmentListSample.js +55 -0
  15. package/dist-esm/samples-dev/storageTaskAssignmentListSample.js.map +1 -0
  16. package/dist-esm/samples-dev/storageTasksCreateSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/storageTasksCreateSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/storageTasksCreateSample.js +64 -0
  19. package/dist-esm/samples-dev/storageTasksCreateSample.js.map +1 -0
  20. package/dist-esm/samples-dev/storageTasksDeleteSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/storageTasksDeleteSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/storageTasksDeleteSample.js +39 -0
  23. package/dist-esm/samples-dev/storageTasksDeleteSample.js.map +1 -0
  24. package/dist-esm/samples-dev/storageTasksGetSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/storageTasksGetSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/storageTasksGetSample.js +39 -0
  27. package/dist-esm/samples-dev/storageTasksGetSample.js.map +1 -0
  28. package/dist-esm/samples-dev/storageTasksListByResourceGroupSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/storageTasksListByResourceGroupSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/storageTasksListByResourceGroupSample.js +54 -0
  31. package/dist-esm/samples-dev/storageTasksListByResourceGroupSample.js.map +1 -0
  32. package/dist-esm/samples-dev/storageTasksListBySubscriptionSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/storageTasksListBySubscriptionSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/storageTasksListBySubscriptionSample.js +53 -0
  35. package/dist-esm/samples-dev/storageTasksListBySubscriptionSample.js.map +1 -0
  36. package/dist-esm/samples-dev/storageTasksPreviewActionsSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/storageTasksPreviewActionsSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/storageTasksPreviewActionsSample.js +87 -0
  39. package/dist-esm/samples-dev/storageTasksPreviewActionsSample.js.map +1 -0
  40. package/dist-esm/samples-dev/storageTasksReportListSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/storageTasksReportListSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/storageTasksReportListSample.js +55 -0
  43. package/dist-esm/samples-dev/storageTasksReportListSample.js.map +1 -0
  44. package/dist-esm/samples-dev/storageTasksUpdateSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/storageTasksUpdateSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/storageTasksUpdateSample.js +63 -0
  47. package/dist-esm/samples-dev/storageTasksUpdateSample.js.map +1 -0
  48. package/dist-esm/src/index.d.ts +6 -0
  49. package/dist-esm/src/index.d.ts.map +1 -0
  50. package/dist-esm/src/index.js +13 -0
  51. package/dist-esm/src/index.js.map +1 -0
  52. package/dist-esm/src/lroImpl.d.ts +11 -0
  53. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  54. package/dist-esm/src/lroImpl.js +21 -0
  55. package/dist-esm/src/lroImpl.js.map +1 -0
  56. package/dist-esm/src/models/index.d.ts +720 -0
  57. package/dist-esm/src/models/index.d.ts.map +1 -0
  58. package/dist-esm/src/models/index.js +92 -0
  59. package/dist-esm/src/models/index.js.map +1 -0
  60. package/dist-esm/src/models/mappers.d.ts +37 -0
  61. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  62. package/dist-esm/src/models/mappers.js +1043 -0
  63. package/dist-esm/src/models/mappers.js.map +1 -0
  64. package/dist-esm/src/models/parameters.d.ts +16 -0
  65. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  66. package/dist-esm/src/models/parameters.js +143 -0
  67. package/dist-esm/src/models/parameters.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +5 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +12 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operations.d.ts +32 -0
  73. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operations.js +133 -0
  75. package/dist-esm/src/operations/operations.js.map +1 -0
  76. package/dist-esm/src/operations/storageTaskAssignmentOperations.d.ts +44 -0
  77. package/dist-esm/src/operations/storageTaskAssignmentOperations.d.ts.map +1 -0
  78. package/dist-esm/src/operations/storageTaskAssignmentOperations.js +156 -0
  79. package/dist-esm/src/operations/storageTaskAssignmentOperations.js.map +1 -0
  80. package/dist-esm/src/operations/storageTasks.d.ts +135 -0
  81. package/dist-esm/src/operations/storageTasks.d.ts.map +1 -0
  82. package/dist-esm/src/operations/storageTasks.js +606 -0
  83. package/dist-esm/src/operations/storageTasks.js.map +1 -0
  84. package/dist-esm/src/operations/storageTasksReport.d.ts +44 -0
  85. package/dist-esm/src/operations/storageTasksReport.d.ts.map +1 -0
  86. package/dist-esm/src/operations/storageTasksReport.js +160 -0
  87. package/dist-esm/src/operations/storageTasksReport.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
  89. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/index.js +12 -0
  91. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  92. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  93. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  94. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  95. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/storageTaskAssignmentOperations.d.ts +15 -0
  97. package/dist-esm/src/operationsInterfaces/storageTaskAssignmentOperations.d.ts.map +1 -0
  98. package/dist-esm/src/operationsInterfaces/storageTaskAssignmentOperations.js +9 -0
  99. package/dist-esm/src/operationsInterfaces/storageTaskAssignmentOperations.js.map +1 -0
  100. package/dist-esm/src/operationsInterfaces/storageTasks.d.ts +99 -0
  101. package/dist-esm/src/operationsInterfaces/storageTasks.d.ts.map +1 -0
  102. package/dist-esm/src/operationsInterfaces/storageTasks.js +9 -0
  103. package/dist-esm/src/operationsInterfaces/storageTasks.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/storageTasksReport.d.ts +15 -0
  105. package/dist-esm/src/operationsInterfaces/storageTasksReport.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/storageTasksReport.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/storageTasksReport.js.map +1 -0
  108. package/dist-esm/src/pagingHelper.d.ts +13 -0
  109. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  110. package/dist-esm/src/pagingHelper.js +32 -0
  111. package/dist-esm/src/pagingHelper.js.map +1 -0
  112. package/dist-esm/src/storageActionsManagementClient.d.ts +23 -0
  113. package/dist-esm/src/storageActionsManagementClient.d.ts.map +1 -0
  114. package/dist-esm/src/storageActionsManagementClient.js +104 -0
  115. package/dist-esm/src/storageActionsManagementClient.js.map +1 -0
  116. package/dist-esm/test/storageactions_operations_test.spec.d.ts +4 -0
  117. package/dist-esm/test/storageactions_operations_test.spec.d.ts.map +1 -0
  118. package/dist-esm/test/storageactions_operations_test.spec.js +135 -0
  119. package/dist-esm/test/storageactions_operations_test.spec.js.map +1 -0
  120. package/package.json +118 -0
  121. package/review/arm-storageactions.api.md +521 -0
  122. package/src/index.ts +13 -0
  123. package/src/lroImpl.ts +42 -0
  124. package/src/models/index.ts +818 -0
  125. package/src/models/mappers.ts +1094 -0
  126. package/src/models/parameters.ts +166 -0
  127. package/src/operations/index.ts +12 -0
  128. package/src/operations/operations.ts +149 -0
  129. package/src/operations/storageTaskAssignmentOperations.ts +205 -0
  130. package/src/operations/storageTasks.ts +791 -0
  131. package/src/operations/storageTasksReport.ts +207 -0
  132. package/src/operationsInterfaces/index.ts +12 -0
  133. package/src/operationsInterfaces/operations.ts +22 -0
  134. package/src/operationsInterfaces/storageTaskAssignmentOperations.ts +31 -0
  135. package/src/operationsInterfaces/storageTasks.ts +180 -0
  136. package/src/operationsInterfaces/storageTasksReport.ts +31 -0
  137. package/src/pagingHelper.ts +39 -0
  138. package/src/storageActionsManagementClient.ts +158 -0
  139. package/tsconfig.json +33 -0
  140. package/types/arm-storageactions.d.ts +967 -0
  141. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,166 @@
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
+ import {
10
+ OperationParameter,
11
+ OperationURLParameter,
12
+ OperationQueryParameter,
13
+ } from "@azure/core-client";
14
+ import {
15
+ StorageTask as StorageTaskMapper,
16
+ StorageTaskUpdateParameters as StorageTaskUpdateParametersMapper,
17
+ StorageTaskPreviewAction as StorageTaskPreviewActionMapper,
18
+ } from "../models/mappers";
19
+
20
+ export const accept: OperationParameter = {
21
+ parameterPath: "accept",
22
+ mapper: {
23
+ defaultValue: "application/json",
24
+ isConstant: true,
25
+ serializedName: "Accept",
26
+ type: {
27
+ name: "String",
28
+ },
29
+ },
30
+ };
31
+
32
+ export const $host: OperationURLParameter = {
33
+ parameterPath: "$host",
34
+ mapper: {
35
+ serializedName: "$host",
36
+ required: true,
37
+ type: {
38
+ name: "String",
39
+ },
40
+ },
41
+ skipEncoding: true,
42
+ };
43
+
44
+ export const apiVersion: OperationQueryParameter = {
45
+ parameterPath: "apiVersion",
46
+ mapper: {
47
+ defaultValue: "2023-01-01",
48
+ isConstant: true,
49
+ serializedName: "api-version",
50
+ type: {
51
+ name: "String",
52
+ },
53
+ },
54
+ };
55
+
56
+ export const nextLink: OperationURLParameter = {
57
+ parameterPath: "nextLink",
58
+ mapper: {
59
+ serializedName: "nextLink",
60
+ required: true,
61
+ type: {
62
+ name: "String",
63
+ },
64
+ },
65
+ skipEncoding: true,
66
+ };
67
+
68
+ export const contentType: OperationParameter = {
69
+ parameterPath: ["options", "contentType"],
70
+ mapper: {
71
+ defaultValue: "application/json",
72
+ isConstant: true,
73
+ serializedName: "Content-Type",
74
+ type: {
75
+ name: "String",
76
+ },
77
+ },
78
+ };
79
+
80
+ export const parameters: OperationParameter = {
81
+ parameterPath: "parameters",
82
+ mapper: StorageTaskMapper,
83
+ };
84
+
85
+ export const resourceGroupName: OperationURLParameter = {
86
+ parameterPath: "resourceGroupName",
87
+ mapper: {
88
+ constraints: {
89
+ MaxLength: 90,
90
+ MinLength: 1,
91
+ },
92
+ serializedName: "resourceGroupName",
93
+ required: true,
94
+ type: {
95
+ name: "String",
96
+ },
97
+ },
98
+ };
99
+
100
+ export const storageTaskName: OperationURLParameter = {
101
+ parameterPath: "storageTaskName",
102
+ mapper: {
103
+ constraints: {
104
+ Pattern: new RegExp("^[a-z0-9]{3,18}$"),
105
+ MaxLength: 18,
106
+ MinLength: 3,
107
+ },
108
+ serializedName: "storageTaskName",
109
+ required: true,
110
+ type: {
111
+ name: "String",
112
+ },
113
+ },
114
+ };
115
+
116
+ export const subscriptionId: OperationURLParameter = {
117
+ parameterPath: "subscriptionId",
118
+ mapper: {
119
+ serializedName: "subscriptionId",
120
+ required: true,
121
+ type: {
122
+ name: "Uuid",
123
+ },
124
+ },
125
+ };
126
+
127
+ export const parameters1: OperationParameter = {
128
+ parameterPath: "parameters",
129
+ mapper: StorageTaskUpdateParametersMapper,
130
+ };
131
+
132
+ export const parameters2: OperationParameter = {
133
+ parameterPath: "parameters",
134
+ mapper: StorageTaskPreviewActionMapper,
135
+ };
136
+
137
+ export const location: OperationURLParameter = {
138
+ parameterPath: "location",
139
+ mapper: {
140
+ serializedName: "location",
141
+ required: true,
142
+ type: {
143
+ name: "String",
144
+ },
145
+ },
146
+ };
147
+
148
+ export const maxpagesize: OperationQueryParameter = {
149
+ parameterPath: ["options", "maxpagesize"],
150
+ mapper: {
151
+ serializedName: "$maxpagesize",
152
+ type: {
153
+ name: "String",
154
+ },
155
+ },
156
+ };
157
+
158
+ export const filter: OperationQueryParameter = {
159
+ parameterPath: ["options", "filter"],
160
+ mapper: {
161
+ serializedName: "$filter",
162
+ type: {
163
+ name: "String",
164
+ },
165
+ },
166
+ };
@@ -0,0 +1,12 @@
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 * from "./operations";
10
+ export * from "./storageTasks";
11
+ export * from "./storageTaskAssignmentOperations";
12
+ export * from "./storageTasksReport";
@@ -0,0 +1,149 @@
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
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { Operations } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { StorageActionsManagementClient } from "../storageActionsManagementClient";
16
+ import {
17
+ Operation,
18
+ OperationsListNextOptionalParams,
19
+ OperationsListOptionalParams,
20
+ OperationsListResponse,
21
+ OperationsListNextResponse,
22
+ } from "../models";
23
+
24
+ /// <reference lib="esnext.asynciterable" />
25
+ /** Class containing Operations operations. */
26
+ export class OperationsImpl implements Operations {
27
+ private readonly client: StorageActionsManagementClient;
28
+
29
+ /**
30
+ * Initialize a new instance of the class Operations class.
31
+ * @param client Reference to the service client
32
+ */
33
+ constructor(client: StorageActionsManagementClient) {
34
+ this.client = client;
35
+ }
36
+
37
+ /**
38
+ * Lists all of the available Storage Actions Rest API operations.
39
+ * @param options The options parameters.
40
+ */
41
+ public list(
42
+ options?: OperationsListOptionalParams,
43
+ ): PagedAsyncIterableIterator<Operation> {
44
+ const iter = this.listPagingAll(options);
45
+ return {
46
+ next() {
47
+ return iter.next();
48
+ },
49
+ [Symbol.asyncIterator]() {
50
+ return this;
51
+ },
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);
57
+ },
58
+ };
59
+ }
60
+
61
+ private async *listPagingPage(
62
+ options?: OperationsListOptionalParams,
63
+ settings?: PageSettings,
64
+ ): AsyncIterableIterator<Operation[]> {
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
+ }
74
+ while (continuationToken) {
75
+ result = await this._listNext(continuationToken, options);
76
+ continuationToken = result.nextLink;
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
80
+ }
81
+ }
82
+
83
+ private async *listPagingAll(
84
+ options?: OperationsListOptionalParams,
85
+ ): AsyncIterableIterator<Operation> {
86
+ for await (const page of this.listPagingPage(options)) {
87
+ yield* page;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Lists all of the available Storage Actions Rest API operations.
93
+ * @param options The options parameters.
94
+ */
95
+ private _list(
96
+ options?: OperationsListOptionalParams,
97
+ ): Promise<OperationsListResponse> {
98
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
99
+ }
100
+
101
+ /**
102
+ * ListNext
103
+ * @param nextLink The nextLink from the previous successful call to the List method.
104
+ * @param options The options parameters.
105
+ */
106
+ private _listNext(
107
+ nextLink: string,
108
+ options?: OperationsListNextOptionalParams,
109
+ ): Promise<OperationsListNextResponse> {
110
+ return this.client.sendOperationRequest(
111
+ { nextLink, options },
112
+ listNextOperationSpec,
113
+ );
114
+ }
115
+ }
116
+ // Operation Specifications
117
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
118
+
119
+ const listOperationSpec: coreClient.OperationSpec = {
120
+ path: "/providers/Microsoft.StorageActions/operations",
121
+ httpMethod: "GET",
122
+ responses: {
123
+ 200: {
124
+ bodyMapper: Mappers.OperationListResult,
125
+ },
126
+ default: {
127
+ bodyMapper: Mappers.ErrorResponse,
128
+ },
129
+ },
130
+ queryParameters: [Parameters.apiVersion],
131
+ urlParameters: [Parameters.$host],
132
+ headerParameters: [Parameters.accept],
133
+ serializer,
134
+ };
135
+ const listNextOperationSpec: coreClient.OperationSpec = {
136
+ path: "{nextLink}",
137
+ httpMethod: "GET",
138
+ responses: {
139
+ 200: {
140
+ bodyMapper: Mappers.OperationListResult,
141
+ },
142
+ default: {
143
+ bodyMapper: Mappers.ErrorResponse,
144
+ },
145
+ },
146
+ urlParameters: [Parameters.$host, Parameters.nextLink],
147
+ headerParameters: [Parameters.accept],
148
+ serializer,
149
+ };
@@ -0,0 +1,205 @@
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
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { StorageTaskAssignmentOperations } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { StorageActionsManagementClient } from "../storageActionsManagementClient";
16
+ import {
17
+ StorageTaskAssignment,
18
+ StorageTaskAssignmentListNextOptionalParams,
19
+ StorageTaskAssignmentListOptionalParams,
20
+ StorageTaskAssignmentListResponse,
21
+ StorageTaskAssignmentListNextResponse,
22
+ } from "../models";
23
+
24
+ /// <reference lib="esnext.asynciterable" />
25
+ /** Class containing StorageTaskAssignmentOperations operations. */
26
+ export class StorageTaskAssignmentOperationsImpl
27
+ implements StorageTaskAssignmentOperations
28
+ {
29
+ private readonly client: StorageActionsManagementClient;
30
+
31
+ /**
32
+ * Initialize a new instance of the class StorageTaskAssignmentOperations class.
33
+ * @param client Reference to the service client
34
+ */
35
+ constructor(client: StorageActionsManagementClient) {
36
+ this.client = client;
37
+ }
38
+
39
+ /**
40
+ * Lists all the storage tasks available under the given resource group.
41
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
42
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage
43
+ * task names must be between 3 and 18 characters in length and use numbers and lower-case letters
44
+ * only.
45
+ * @param options The options parameters.
46
+ */
47
+ public list(
48
+ resourceGroupName: string,
49
+ storageTaskName: string,
50
+ options?: StorageTaskAssignmentListOptionalParams,
51
+ ): PagedAsyncIterableIterator<StorageTaskAssignment> {
52
+ const iter = this.listPagingAll(
53
+ resourceGroupName,
54
+ storageTaskName,
55
+ options,
56
+ );
57
+ return {
58
+ next() {
59
+ return iter.next();
60
+ },
61
+ [Symbol.asyncIterator]() {
62
+ return this;
63
+ },
64
+ byPage: (settings?: PageSettings) => {
65
+ if (settings?.maxPageSize) {
66
+ throw new Error("maxPageSize is not supported by this operation.");
67
+ }
68
+ return this.listPagingPage(
69
+ resourceGroupName,
70
+ storageTaskName,
71
+ options,
72
+ settings,
73
+ );
74
+ },
75
+ };
76
+ }
77
+
78
+ private async *listPagingPage(
79
+ resourceGroupName: string,
80
+ storageTaskName: string,
81
+ options?: StorageTaskAssignmentListOptionalParams,
82
+ settings?: PageSettings,
83
+ ): AsyncIterableIterator<StorageTaskAssignment[]> {
84
+ let result: StorageTaskAssignmentListResponse;
85
+ let continuationToken = settings?.continuationToken;
86
+ if (!continuationToken) {
87
+ result = await this._list(resourceGroupName, storageTaskName, options);
88
+ let page = result.value || [];
89
+ continuationToken = result.nextLink;
90
+ setContinuationToken(page, continuationToken);
91
+ yield page;
92
+ }
93
+ while (continuationToken) {
94
+ result = await this._listNext(
95
+ resourceGroupName,
96
+ storageTaskName,
97
+ continuationToken,
98
+ options,
99
+ );
100
+ continuationToken = result.nextLink;
101
+ let page = result.value || [];
102
+ setContinuationToken(page, continuationToken);
103
+ yield page;
104
+ }
105
+ }
106
+
107
+ private async *listPagingAll(
108
+ resourceGroupName: string,
109
+ storageTaskName: string,
110
+ options?: StorageTaskAssignmentListOptionalParams,
111
+ ): AsyncIterableIterator<StorageTaskAssignment> {
112
+ for await (const page of this.listPagingPage(
113
+ resourceGroupName,
114
+ storageTaskName,
115
+ options,
116
+ )) {
117
+ yield* page;
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Lists all the storage tasks available under the given resource group.
123
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
124
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage
125
+ * task names must be between 3 and 18 characters in length and use numbers and lower-case letters
126
+ * only.
127
+ * @param options The options parameters.
128
+ */
129
+ private _list(
130
+ resourceGroupName: string,
131
+ storageTaskName: string,
132
+ options?: StorageTaskAssignmentListOptionalParams,
133
+ ): Promise<StorageTaskAssignmentListResponse> {
134
+ return this.client.sendOperationRequest(
135
+ { resourceGroupName, storageTaskName, options },
136
+ listOperationSpec,
137
+ );
138
+ }
139
+
140
+ /**
141
+ * ListNext
142
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
143
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage
144
+ * task names must be between 3 and 18 characters in length and use numbers and lower-case letters
145
+ * only.
146
+ * @param nextLink The nextLink from the previous successful call to the List method.
147
+ * @param options The options parameters.
148
+ */
149
+ private _listNext(
150
+ resourceGroupName: string,
151
+ storageTaskName: string,
152
+ nextLink: string,
153
+ options?: StorageTaskAssignmentListNextOptionalParams,
154
+ ): Promise<StorageTaskAssignmentListNextResponse> {
155
+ return this.client.sendOperationRequest(
156
+ { resourceGroupName, storageTaskName, nextLink, options },
157
+ listNextOperationSpec,
158
+ );
159
+ }
160
+ }
161
+ // Operation Specifications
162
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
163
+
164
+ const listOperationSpec: coreClient.OperationSpec = {
165
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/storageTaskAssignments",
166
+ httpMethod: "GET",
167
+ responses: {
168
+ 200: {
169
+ bodyMapper: Mappers.StorageTaskAssignmentsListResult,
170
+ },
171
+ default: {
172
+ bodyMapper: Mappers.ErrorResponse,
173
+ },
174
+ },
175
+ queryParameters: [Parameters.apiVersion, Parameters.maxpagesize],
176
+ urlParameters: [
177
+ Parameters.$host,
178
+ Parameters.resourceGroupName,
179
+ Parameters.storageTaskName,
180
+ Parameters.subscriptionId,
181
+ ],
182
+ headerParameters: [Parameters.accept],
183
+ serializer,
184
+ };
185
+ const listNextOperationSpec: coreClient.OperationSpec = {
186
+ path: "{nextLink}",
187
+ httpMethod: "GET",
188
+ responses: {
189
+ 200: {
190
+ bodyMapper: Mappers.StorageTaskAssignmentsListResult,
191
+ },
192
+ default: {
193
+ bodyMapper: Mappers.ErrorResponse,
194
+ },
195
+ },
196
+ urlParameters: [
197
+ Parameters.$host,
198
+ Parameters.nextLink,
199
+ Parameters.resourceGroupName,
200
+ Parameters.storageTaskName,
201
+ Parameters.subscriptionId,
202
+ ],
203
+ headerParameters: [Parameters.accept],
204
+ serializer,
205
+ };