@azure/arm-managementgroups 1.2.0 → 2.0.0-alpha.20211215.1

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 (173) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +72 -83
  4. package/dist/index.js +2881 -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/src/index.d.ts +6 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +13 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/managementGroupsAPI.d.ts +34 -0
  17. package/dist-esm/src/managementGroupsAPI.d.ts.map +1 -0
  18. package/dist-esm/src/managementGroupsAPI.js +102 -0
  19. package/dist-esm/src/managementGroupsAPI.js.map +1 -0
  20. package/dist-esm/src/managementGroupsAPIContext.d.ts +14 -0
  21. package/dist-esm/src/managementGroupsAPIContext.d.ts.map +1 -0
  22. package/dist-esm/src/managementGroupsAPIContext.js +43 -0
  23. package/dist-esm/src/managementGroupsAPIContext.js.map +1 -0
  24. package/dist-esm/src/models/index.d.ts +956 -0
  25. package/dist-esm/src/models/index.d.ts.map +1 -0
  26. package/dist-esm/src/models/index.js +46 -0
  27. package/dist-esm/src/models/index.js.map +1 -0
  28. package/dist-esm/src/models/mappers.d.ts +39 -0
  29. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  30. package/{esm → dist-esm/src}/models/mappers.js +776 -396
  31. package/dist-esm/src/models/mappers.js.map +1 -0
  32. package/dist-esm/src/models/parameters.d.ts +24 -0
  33. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  34. package/dist-esm/src/models/parameters.js +200 -0
  35. package/dist-esm/src/models/parameters.js.map +1 -0
  36. package/dist-esm/src/operations/entities.d.ts +34 -0
  37. package/dist-esm/src/operations/entities.d.ts.map +1 -0
  38. package/dist-esm/src/operations/entities.js +142 -0
  39. package/dist-esm/src/operations/entities.js.map +1 -0
  40. package/dist-esm/src/operations/hierarchySettingsOperations.d.ts +52 -0
  41. package/dist-esm/src/operations/hierarchySettingsOperations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/hierarchySettingsOperations.js +154 -0
  43. package/dist-esm/src/operations/hierarchySettingsOperations.js.map +1 -0
  44. package/{esm → dist-esm/src}/operations/index.d.ts +1 -0
  45. package/dist-esm/src/operations/index.d.ts.map +1 -0
  46. package/{esm → dist-esm/src}/operations/index.js +4 -5
  47. package/dist-esm/src/operations/index.js.map +1 -0
  48. package/dist-esm/src/operations/managementGroupSubscriptions.d.ts +62 -0
  49. package/dist-esm/src/operations/managementGroupSubscriptions.d.ts.map +1 -0
  50. package/dist-esm/src/operations/managementGroupSubscriptions.js +215 -0
  51. package/dist-esm/src/operations/managementGroupSubscriptions.js.map +1 -0
  52. package/dist-esm/src/operations/managementGroups.d.ts +109 -0
  53. package/dist-esm/src/operations/managementGroups.d.ts.map +1 -0
  54. package/dist-esm/src/operations/managementGroups.js +462 -0
  55. package/dist-esm/src/operations/managementGroups.js.map +1 -0
  56. package/dist-esm/src/operations/operations.d.ts +32 -0
  57. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operations/operations.js +120 -0
  59. package/dist-esm/src/operations/operations.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/entities.d.ts +12 -0
  61. package/dist-esm/src/operationsInterfaces/entities.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/entities.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/entities.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.d.ts +44 -0
  65. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  69. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  71. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.d.ts +37 -0
  73. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/managementGroups.d.ts +71 -0
  77. package/dist-esm/src/operationsInterfaces/managementGroups.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/managementGroups.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/managementGroups.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  81. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  84. package/dist-esm/test/sampleTest.d.ts +2 -0
  85. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  86. package/dist-esm/test/sampleTest.js +40 -0
  87. package/dist-esm/test/sampleTest.js.map +1 -0
  88. package/package.json +69 -24
  89. package/review/arm-managementgroups.api.md +667 -0
  90. package/rollup.config.js +184 -27
  91. package/src/index.ts +13 -0
  92. package/src/lroImpl.ts +34 -0
  93. package/src/managementGroupsAPI.ts +93 -130
  94. package/src/managementGroupsAPIContext.ts +45 -45
  95. package/src/models/index.ts +801 -1185
  96. package/src/models/mappers.ts +792 -400
  97. package/src/models/parameters.ts +130 -94
  98. package/src/operations/entities.ts +105 -79
  99. package/src/operations/hierarchySettingsOperations.ts +214 -0
  100. package/src/operations/index.ts +4 -5
  101. package/src/operations/managementGroupSubscriptions.ts +226 -72
  102. package/src/operations/managementGroups.ts +449 -222
  103. package/src/operations/operations.ts +84 -70
  104. package/src/operationsInterfaces/entities.ts +23 -0
  105. package/src/operationsInterfaces/hierarchySettingsOperations.ts +80 -0
  106. package/src/operationsInterfaces/index.ts +13 -0
  107. package/src/operationsInterfaces/managementGroupSubscriptions.ts +69 -0
  108. package/src/operationsInterfaces/managementGroups.ts +131 -0
  109. package/src/operationsInterfaces/operations.ts +22 -0
  110. package/tsconfig.json +4 -4
  111. package/types/arm-managementgroups.d.ts +1266 -0
  112. package/types/tsdoc-metadata.json +11 -0
  113. package/dist/arm-managementgroups.js +0 -2017
  114. package/dist/arm-managementgroups.js.map +0 -1
  115. package/dist/arm-managementgroups.min.js +0 -1
  116. package/dist/arm-managementgroups.min.js.map +0 -1
  117. package/esm/managementGroupsAPI.d.ts +0 -74
  118. package/esm/managementGroupsAPI.d.ts.map +0 -1
  119. package/esm/managementGroupsAPI.js +0 -120
  120. package/esm/managementGroupsAPI.js.map +0 -1
  121. package/esm/managementGroupsAPIContext.d.ts +0 -20
  122. package/esm/managementGroupsAPIContext.d.ts.map +0 -1
  123. package/esm/managementGroupsAPIContext.js +0 -56
  124. package/esm/managementGroupsAPIContext.js.map +0 -1
  125. package/esm/models/entitiesMappers.d.ts +0 -2
  126. package/esm/models/entitiesMappers.d.ts.map +0 -1
  127. package/esm/models/entitiesMappers.js +0 -11
  128. package/esm/models/entitiesMappers.js.map +0 -1
  129. package/esm/models/index.d.ts +0 -1390
  130. package/esm/models/index.d.ts.map +0 -1
  131. package/esm/models/index.js +0 -10
  132. package/esm/models/index.js.map +0 -1
  133. package/esm/models/managementGroupSubscriptionsMappers.d.ts +0 -2
  134. package/esm/models/managementGroupSubscriptionsMappers.d.ts.map +0 -1
  135. package/esm/models/managementGroupSubscriptionsMappers.js +0 -11
  136. package/esm/models/managementGroupSubscriptionsMappers.js.map +0 -1
  137. package/esm/models/managementGroupsMappers.d.ts +0 -2
  138. package/esm/models/managementGroupsMappers.d.ts.map +0 -1
  139. package/esm/models/managementGroupsMappers.js +0 -11
  140. package/esm/models/managementGroupsMappers.js.map +0 -1
  141. package/esm/models/mappers.d.ts +0 -28
  142. package/esm/models/mappers.d.ts.map +0 -1
  143. package/esm/models/mappers.js.map +0 -1
  144. package/esm/models/operationsMappers.d.ts +0 -2
  145. package/esm/models/operationsMappers.d.ts.map +0 -1
  146. package/esm/models/operationsMappers.js +0 -11
  147. package/esm/models/operationsMappers.js.map +0 -1
  148. package/esm/models/parameters.d.ts +0 -18
  149. package/esm/models/parameters.d.ts.map +0 -1
  150. package/esm/models/parameters.js +0 -194
  151. package/esm/models/parameters.js.map +0 -1
  152. package/esm/operations/entities.d.ts +0 -46
  153. package/esm/operations/entities.d.ts.map +0 -1
  154. package/esm/operations/entities.js +0 -87
  155. package/esm/operations/entities.js.map +0 -1
  156. package/esm/operations/index.d.ts.map +0 -1
  157. package/esm/operations/index.js.map +0 -1
  158. package/esm/operations/managementGroupSubscriptions.d.ts +0 -55
  159. package/esm/operations/managementGroupSubscriptions.d.ts.map +0 -1
  160. package/esm/operations/managementGroupSubscriptions.js +0 -85
  161. package/esm/operations/managementGroupSubscriptions.js.map +0 -1
  162. package/esm/operations/managementGroups.d.ts +0 -120
  163. package/esm/operations/managementGroups.d.ts.map +0 -1
  164. package/esm/operations/managementGroups.js +0 -252
  165. package/esm/operations/managementGroups.js.map +0 -1
  166. package/esm/operations/operations.d.ts +0 -46
  167. package/esm/operations/operations.d.ts.map +0 -1
  168. package/esm/operations/operations.js +0 -77
  169. package/esm/operations/operations.js.map +0 -1
  170. package/src/models/entitiesMappers.ts +0 -18
  171. package/src/models/managementGroupSubscriptionsMappers.ts +0 -15
  172. package/src/models/managementGroupsMappers.ts +0 -29
  173. package/src/models/operationsMappers.ts +0 -18
@@ -1,146 +1,188 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
9
+ import {
10
+ OperationParameter,
11
+ OperationURLParameter,
12
+ OperationQueryParameter
13
+ } from "@azure/core-client";
14
+ import {
15
+ CreateManagementGroupRequest as CreateManagementGroupRequestMapper,
16
+ PatchManagementGroupRequest as PatchManagementGroupRequestMapper,
17
+ CreateOrUpdateSettingsRequest as CreateOrUpdateSettingsRequestMapper,
18
+ CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper
19
+ } from "../models/mappers";
12
20
 
13
- export const acceptLanguage: msRest.OperationParameter = {
14
- parameterPath: "acceptLanguage",
21
+ export const accept: OperationParameter = {
22
+ parameterPath: "accept",
15
23
  mapper: {
16
- serializedName: "accept-language",
17
- defaultValue: 'en-US',
24
+ defaultValue: "application/json",
25
+ isConstant: true,
26
+ serializedName: "Accept",
18
27
  type: {
19
28
  name: "String"
20
29
  }
21
30
  }
22
31
  };
23
- export const apiVersion: msRest.OperationQueryParameter = {
24
- parameterPath: "apiVersion",
32
+
33
+ export const $host: OperationURLParameter = {
34
+ parameterPath: "$host",
25
35
  mapper: {
36
+ serializedName: "$host",
26
37
  required: true,
38
+ type: {
39
+ name: "String"
40
+ }
41
+ },
42
+ skipEncoding: true
43
+ };
44
+
45
+ export const apiVersion: OperationQueryParameter = {
46
+ parameterPath: "apiVersion",
47
+ mapper: {
48
+ defaultValue: "2021-04-01",
49
+ isConstant: true,
27
50
  serializedName: "api-version",
28
51
  type: {
29
52
  name: "String"
30
53
  }
31
54
  }
32
55
  };
33
- export const cacheControl: msRest.OperationParameter = {
34
- parameterPath: [
35
- "options",
36
- "cacheControl"
37
- ],
56
+
57
+ export const cacheControl: OperationParameter = {
58
+ parameterPath: ["options", "cacheControl"],
38
59
  mapper: {
60
+ defaultValue: "no-cache",
39
61
  serializedName: "Cache-Control",
40
- defaultValue: 'no-cache',
41
62
  type: {
42
63
  name: "String"
43
64
  }
44
65
  }
45
66
  };
46
- export const expand: msRest.OperationQueryParameter = {
47
- parameterPath: [
48
- "options",
49
- "expand"
50
- ],
67
+
68
+ export const skiptoken: OperationQueryParameter = {
69
+ parameterPath: ["options", "skiptoken"],
51
70
  mapper: {
52
- serializedName: "$expand",
71
+ serializedName: "$skiptoken",
53
72
  type: {
54
73
  name: "String"
55
74
  }
56
75
  }
57
76
  };
58
- export const filter: msRest.OperationQueryParameter = {
59
- parameterPath: [
60
- "options",
61
- "filter"
62
- ],
77
+
78
+ export const groupId: OperationURLParameter = {
79
+ parameterPath: "groupId",
63
80
  mapper: {
64
- serializedName: "$filter",
81
+ serializedName: "groupId",
82
+ required: true,
65
83
  type: {
66
84
  name: "String"
67
85
  }
68
86
  }
69
87
  };
70
- export const groupId: msRest.OperationURLParameter = {
71
- parameterPath: "groupId",
88
+
89
+ export const expand: OperationQueryParameter = {
90
+ parameterPath: ["options", "expand"],
72
91
  mapper: {
73
- required: true,
74
- serializedName: "groupId",
92
+ serializedName: "$expand",
75
93
  type: {
76
94
  name: "String"
77
95
  }
78
96
  }
79
97
  };
80
- export const groupName: msRest.OperationQueryParameter = {
81
- parameterPath: [
82
- "options",
83
- "groupName"
84
- ],
98
+
99
+ export const recurse: OperationQueryParameter = {
100
+ parameterPath: ["options", "recurse"],
85
101
  mapper: {
86
- serializedName: "groupName",
102
+ serializedName: "$recurse",
103
+ type: {
104
+ name: "Boolean"
105
+ }
106
+ }
107
+ };
108
+
109
+ export const filter: OperationQueryParameter = {
110
+ parameterPath: ["options", "filter"],
111
+ mapper: {
112
+ serializedName: "$filter",
87
113
  type: {
88
114
  name: "String"
89
115
  }
90
116
  }
91
117
  };
92
- export const nextPageLink: msRest.OperationURLParameter = {
93
- parameterPath: "nextPageLink",
118
+
119
+ export const contentType: OperationParameter = {
120
+ parameterPath: ["options", "contentType"],
94
121
  mapper: {
95
- required: true,
96
- serializedName: "nextLink",
122
+ defaultValue: "application/json",
123
+ isConstant: true,
124
+ serializedName: "Content-Type",
97
125
  type: {
98
126
  name: "String"
99
127
  }
100
- },
101
- skipEncoding: true
128
+ }
102
129
  };
103
- export const recurse: msRest.OperationQueryParameter = {
104
- parameterPath: [
105
- "options",
106
- "recurse"
107
- ],
130
+
131
+ export const createManagementGroupRequest: OperationParameter = {
132
+ parameterPath: "createManagementGroupRequest",
133
+ mapper: CreateManagementGroupRequestMapper
134
+ };
135
+
136
+ export const patchGroupRequest: OperationParameter = {
137
+ parameterPath: "patchGroupRequest",
138
+ mapper: PatchManagementGroupRequestMapper
139
+ };
140
+
141
+ export const top: OperationQueryParameter = {
142
+ parameterPath: ["options", "top"],
108
143
  mapper: {
109
- serializedName: "$recurse",
144
+ serializedName: "$top",
110
145
  type: {
111
- name: "Boolean"
146
+ name: "Number"
112
147
  }
113
148
  }
114
149
  };
115
- export const search: msRest.OperationQueryParameter = {
116
- parameterPath: [
117
- "options",
118
- "search"
119
- ],
150
+
151
+ export const nextLink: OperationURLParameter = {
152
+ parameterPath: "nextLink",
120
153
  mapper: {
121
- serializedName: "$search",
154
+ serializedName: "nextLink",
155
+ required: true,
122
156
  type: {
123
157
  name: "String"
124
158
  }
125
- }
159
+ },
160
+ skipEncoding: true
126
161
  };
127
- export const select: msRest.OperationQueryParameter = {
128
- parameterPath: [
129
- "options",
130
- "select"
131
- ],
162
+
163
+ export const subscriptionId: OperationURLParameter = {
164
+ parameterPath: "subscriptionId",
132
165
  mapper: {
133
- serializedName: "$select",
166
+ serializedName: "subscriptionId",
167
+ required: true,
134
168
  type: {
135
169
  name: "String"
136
170
  }
137
171
  }
138
172
  };
139
- export const skip: msRest.OperationQueryParameter = {
140
- parameterPath: [
141
- "options",
142
- "skip"
143
- ],
173
+
174
+ export const createTenantSettingsRequest: OperationParameter = {
175
+ parameterPath: "createTenantSettingsRequest",
176
+ mapper: CreateOrUpdateSettingsRequestMapper
177
+ };
178
+
179
+ export const checkNameAvailabilityRequest: OperationParameter = {
180
+ parameterPath: "checkNameAvailabilityRequest",
181
+ mapper: CheckNameAvailabilityRequestMapper
182
+ };
183
+
184
+ export const skip: OperationQueryParameter = {
185
+ parameterPath: ["options", "skip"],
144
186
  mapper: {
145
187
  serializedName: "$skip",
146
188
  type: {
@@ -148,47 +190,41 @@ export const skip: msRest.OperationQueryParameter = {
148
190
  }
149
191
  }
150
192
  };
151
- export const skiptoken: msRest.OperationQueryParameter = {
152
- parameterPath: [
153
- "options",
154
- "skiptoken"
155
- ],
193
+
194
+ export const select: OperationQueryParameter = {
195
+ parameterPath: ["options", "select"],
156
196
  mapper: {
157
- serializedName: "$skiptoken",
197
+ serializedName: "$select",
158
198
  type: {
159
199
  name: "String"
160
200
  }
161
201
  }
162
202
  };
163
- export const subscriptionId: msRest.OperationURLParameter = {
164
- parameterPath: "subscriptionId",
203
+
204
+ export const search: OperationQueryParameter = {
205
+ parameterPath: ["options", "search"],
165
206
  mapper: {
166
- required: true,
167
- serializedName: "subscriptionId",
207
+ serializedName: "$search",
168
208
  type: {
169
209
  name: "String"
170
210
  }
171
211
  }
172
212
  };
173
- export const top: msRest.OperationQueryParameter = {
174
- parameterPath: [
175
- "options",
176
- "top"
177
- ],
213
+
214
+ export const view: OperationQueryParameter = {
215
+ parameterPath: ["options", "view"],
178
216
  mapper: {
179
- serializedName: "$top",
217
+ serializedName: "$view",
180
218
  type: {
181
- name: "Number"
219
+ name: "String"
182
220
  }
183
221
  }
184
222
  };
185
- export const view: msRest.OperationQueryParameter = {
186
- parameterPath: [
187
- "options",
188
- "view"
189
- ],
223
+
224
+ export const groupName: OperationQueryParameter = {
225
+ parameterPath: ["options", "groupName"],
190
226
  mapper: {
191
- serializedName: "$view",
227
+ serializedName: "groupName",
192
228
  type: {
193
229
  name: "String"
194
230
  }
@@ -1,26 +1,33 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/entitiesMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Entities } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
14
  import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
15
+ import {
16
+ EntityInfo,
17
+ EntitiesListNextOptionalParams,
18
+ EntitiesListOptionalParams,
19
+ EntitiesListResponse,
20
+ EntitiesListNextResponse
21
+ } from "../models";
16
22
 
17
- /** Class representing a Entities. */
18
- export class Entities {
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing Entities operations. */
25
+ export class EntitiesImpl implements Entities {
19
26
  private readonly client: ManagementGroupsAPIContext;
20
27
 
21
28
  /**
22
- * Create a Entities.
23
- * @param {ManagementGroupsAPIContext} client Reference to the service client.
29
+ * Initialize a new instance of the class Entities class.
30
+ * @param client Reference to the service client
24
31
  */
25
32
  constructor(client: ManagementGroupsAPIContext) {
26
33
  this.client = client;
@@ -28,99 +35,105 @@ export class Entities {
28
35
 
29
36
  /**
30
37
  * List all entities (Management Groups, Subscriptions, etc.) for the authenticated user.
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.EntitiesListResponse>
38
+ *
39
+ * @param options The options parameters.
33
40
  */
34
- list(options?: Models.EntitiesListOptionalParams): Promise<Models.EntitiesListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.EntityListResult>): void;
39
- /**
40
- * @param options The optional parameters
41
- * @param callback The callback
42
- */
43
- list(options: Models.EntitiesListOptionalParams, callback: msRest.ServiceCallback<Models.EntityListResult>): void;
44
- list(options?: Models.EntitiesListOptionalParams | msRest.ServiceCallback<Models.EntityListResult>, callback?: msRest.ServiceCallback<Models.EntityListResult>): Promise<Models.EntitiesListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
41
+ public list(
42
+ options?: EntitiesListOptionalParams
43
+ ): PagedAsyncIterableIterator<EntityInfo> {
44
+ const iter = this.listPagingAll(options);
45
+ return {
46
+ next() {
47
+ return iter.next();
48
+ },
49
+ [Symbol.asyncIterator]() {
50
+ return this;
48
51
  },
49
- listOperationSpec,
50
- callback) as Promise<Models.EntitiesListResponse>;
52
+ byPage: () => {
53
+ return this.listPagingPage(options);
54
+ }
55
+ };
56
+ }
57
+
58
+ private async *listPagingPage(
59
+ options?: EntitiesListOptionalParams
60
+ ): AsyncIterableIterator<EntityInfo[]> {
61
+ let result = await this._list(options);
62
+ yield result.value || [];
63
+ let continuationToken = result.nextLink;
64
+ while (continuationToken) {
65
+ result = await this._listNext(continuationToken, options);
66
+ continuationToken = result.nextLink;
67
+ yield result.value || [];
68
+ }
69
+ }
70
+
71
+ private async *listPagingAll(
72
+ options?: EntitiesListOptionalParams
73
+ ): AsyncIterableIterator<EntityInfo> {
74
+ for await (const page of this.listPagingPage(options)) {
75
+ yield* page;
76
+ }
51
77
  }
52
78
 
53
79
  /**
54
80
  * List all entities (Management Groups, Subscriptions, etc.) for the authenticated user.
55
- * @param nextPageLink The NextLink from the previous successful call to List operation.
56
- * @param [options] The optional parameters
57
- * @returns Promise<Models.EntitiesListNextResponse>
58
- */
59
- listNext(nextPageLink: string, options?: Models.EntitiesListNextOptionalParams): Promise<Models.EntitiesListNextResponse>;
60
- /**
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param callback The callback
81
+ *
82
+ * @param options The options parameters.
63
83
  */
64
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.EntityListResult>): void;
84
+ private _list(
85
+ options?: EntitiesListOptionalParams
86
+ ): Promise<EntitiesListResponse> {
87
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
88
+ }
89
+
65
90
  /**
66
- * @param nextPageLink The NextLink from the previous successful call to List operation.
67
- * @param options The optional parameters
68
- * @param callback The callback
91
+ * ListNext
92
+ * @param nextLink The nextLink from the previous successful call to the List method.
93
+ * @param options The options parameters.
69
94
  */
70
- listNext(nextPageLink: string, options: Models.EntitiesListNextOptionalParams, callback: msRest.ServiceCallback<Models.EntityListResult>): void;
71
- listNext(nextPageLink: string, options?: Models.EntitiesListNextOptionalParams | msRest.ServiceCallback<Models.EntityListResult>, callback?: msRest.ServiceCallback<Models.EntityListResult>): Promise<Models.EntitiesListNextResponse> {
95
+ private _listNext(
96
+ nextLink: string,
97
+ options?: EntitiesListNextOptionalParams
98
+ ): Promise<EntitiesListNextResponse> {
72
99
  return this.client.sendOperationRequest(
73
- {
74
- nextPageLink,
75
- options
76
- },
77
- listNextOperationSpec,
78
- callback) as Promise<Models.EntitiesListNextResponse>;
100
+ { nextLink, options },
101
+ listNextOperationSpec
102
+ );
79
103
  }
80
104
  }
81
-
82
105
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
106
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
107
+
108
+ const listOperationSpec: coreClient.OperationSpec = {
109
+ path: "/providers/Microsoft.Management/getEntities",
85
110
  httpMethod: "POST",
86
- path: "providers/Microsoft.Management/getEntities",
111
+ responses: {
112
+ 200: {
113
+ bodyMapper: Mappers.EntityListResult
114
+ },
115
+ default: {
116
+ bodyMapper: Mappers.ErrorResponse
117
+ }
118
+ },
87
119
  queryParameters: [
88
120
  Parameters.apiVersion,
89
121
  Parameters.skiptoken,
90
- Parameters.skip,
122
+ Parameters.filter,
91
123
  Parameters.top,
124
+ Parameters.skip,
92
125
  Parameters.select,
93
126
  Parameters.search,
94
- Parameters.filter,
95
127
  Parameters.view,
96
128
  Parameters.groupName
97
129
  ],
98
- headerParameters: [
99
- Parameters.cacheControl,
100
- Parameters.acceptLanguage
101
- ],
102
- responses: {
103
- 200: {
104
- bodyMapper: Mappers.EntityListResult
105
- },
106
- default: {
107
- bodyMapper: Mappers.ErrorResponse
108
- }
109
- },
130
+ urlParameters: [Parameters.$host],
131
+ headerParameters: [Parameters.accept, Parameters.cacheControl],
110
132
  serializer
111
133
  };
112
-
113
- const listNextOperationSpec: msRest.OperationSpec = {
114
- httpMethod: "POST",
115
- baseUrl: "https://management.azure.com",
134
+ const listNextOperationSpec: coreClient.OperationSpec = {
116
135
  path: "{nextLink}",
117
- urlParameters: [
118
- Parameters.nextPageLink
119
- ],
120
- headerParameters: [
121
- Parameters.cacheControl,
122
- Parameters.acceptLanguage
123
- ],
136
+ httpMethod: "GET",
124
137
  responses: {
125
138
  200: {
126
139
  bodyMapper: Mappers.EntityListResult
@@ -129,5 +142,18 @@ const listNextOperationSpec: msRest.OperationSpec = {
129
142
  bodyMapper: Mappers.ErrorResponse
130
143
  }
131
144
  },
145
+ queryParameters: [
146
+ Parameters.apiVersion,
147
+ Parameters.skiptoken,
148
+ Parameters.filter,
149
+ Parameters.top,
150
+ Parameters.skip,
151
+ Parameters.select,
152
+ Parameters.search,
153
+ Parameters.view,
154
+ Parameters.groupName
155
+ ],
156
+ urlParameters: [Parameters.$host, Parameters.nextLink],
157
+ headerParameters: [Parameters.accept, Parameters.cacheControl],
132
158
  serializer
133
159
  };