@azure/arm-defendereasm 1.0.0-beta.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 (154) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +2047 -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/labelsCreateAndUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/labelsCreateAndUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/labelsCreateAndUpdateSample.js +40 -0
  11. package/dist-esm/samples-dev/labelsCreateAndUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/labelsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/labelsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/labelsDeleteSample.js +40 -0
  15. package/dist-esm/samples-dev/labelsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/labelsGetByWorkspaceSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/labelsGetByWorkspaceSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/labelsGetByWorkspaceSample.js +40 -0
  19. package/dist-esm/samples-dev/labelsGetByWorkspaceSample.js.map +1 -0
  20. package/dist-esm/samples-dev/labelsListByWorkspaceSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/labelsListByWorkspaceSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/labelsListByWorkspaceSample.js +60 -0
  23. package/dist-esm/samples-dev/labelsListByWorkspaceSample.js.map +1 -0
  24. package/dist-esm/samples-dev/labelsUpdateSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/labelsUpdateSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/labelsUpdateSample.js +40 -0
  27. package/dist-esm/samples-dev/labelsUpdateSample.js.map +1 -0
  28. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/operationsListSample.js +58 -0
  31. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  32. package/dist-esm/samples-dev/tasksGetByWorkspaceSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/tasksGetByWorkspaceSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/tasksGetByWorkspaceSample.js +40 -0
  35. package/dist-esm/samples-dev/tasksGetByWorkspaceSample.js.map +1 -0
  36. package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.js +43 -0
  39. package/dist-esm/samples-dev/workspacesCreateAndUpdateSample.js.map +1 -0
  40. package/dist-esm/samples-dev/workspacesDeleteSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/workspacesDeleteSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/workspacesDeleteSample.js +39 -0
  43. package/dist-esm/samples-dev/workspacesDeleteSample.js.map +1 -0
  44. package/dist-esm/samples-dev/workspacesGetSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/workspacesGetSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/workspacesGetSample.js +39 -0
  47. package/dist-esm/samples-dev/workspacesGetSample.js.map +1 -0
  48. package/dist-esm/samples-dev/workspacesListByResourceGroupSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/workspacesListByResourceGroupSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/workspacesListByResourceGroupSample.js +59 -0
  51. package/dist-esm/samples-dev/workspacesListByResourceGroupSample.js.map +1 -0
  52. package/dist-esm/samples-dev/workspacesListBySubscriptionSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/workspacesListBySubscriptionSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/workspacesListBySubscriptionSample.js +58 -0
  55. package/dist-esm/samples-dev/workspacesListBySubscriptionSample.js.map +1 -0
  56. package/dist-esm/samples-dev/workspacesUpdateSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/workspacesUpdateSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/workspacesUpdateSample.js +39 -0
  59. package/dist-esm/samples-dev/workspacesUpdateSample.js.map +1 -0
  60. package/dist-esm/src/easmMgmtClient.d.ts +23 -0
  61. package/dist-esm/src/easmMgmtClient.d.ts.map +1 -0
  62. package/dist-esm/src/easmMgmtClient.js +103 -0
  63. package/dist-esm/src/easmMgmtClient.js.map +1 -0
  64. package/dist-esm/src/index.d.ts +6 -0
  65. package/dist-esm/src/index.d.ts.map +1 -0
  66. package/dist-esm/src/index.js +13 -0
  67. package/dist-esm/src/index.js.map +1 -0
  68. package/dist-esm/src/lroImpl.d.ts +11 -0
  69. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  70. package/dist-esm/src/lroImpl.js +21 -0
  71. package/dist-esm/src/lroImpl.js.map +1 -0
  72. package/dist-esm/src/models/index.d.ts +492 -0
  73. package/dist-esm/src/models/index.d.ts.map +1 -0
  74. package/dist-esm/src/models/index.js +66 -0
  75. package/dist-esm/src/models/index.js.map +1 -0
  76. package/dist-esm/src/models/mappers.d.ts +23 -0
  77. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  78. package/dist-esm/src/models/mappers.js +574 -0
  79. package/dist-esm/src/models/mappers.js.map +1 -0
  80. package/dist-esm/src/models/parameters.d.ts +16 -0
  81. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  82. package/dist-esm/src/models/parameters.js +137 -0
  83. package/dist-esm/src/models/parameters.js.map +1 -0
  84. package/dist-esm/src/operations/index.d.ts +5 -0
  85. package/dist-esm/src/operations/index.d.ts.map +1 -0
  86. package/dist-esm/src/operations/index.js +12 -0
  87. package/dist-esm/src/operations/index.js.map +1 -0
  88. package/dist-esm/src/operations/labels.d.ts +87 -0
  89. package/dist-esm/src/operations/labels.d.ts.map +1 -0
  90. package/dist-esm/src/operations/labels.js +395 -0
  91. package/dist-esm/src/operations/labels.js.map +1 -0
  92. package/dist-esm/src/operations/operations.d.ts +32 -0
  93. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  94. package/dist-esm/src/operations/operations.js +138 -0
  95. package/dist-esm/src/operations/operations.js.map +1 -0
  96. package/dist-esm/src/operations/tasks.d.ts +21 -0
  97. package/dist-esm/src/operations/tasks.d.ts.map +1 -0
  98. package/dist-esm/src/operations/tasks.js +55 -0
  99. package/dist-esm/src/operations/tasks.js.map +1 -0
  100. package/dist-esm/src/operations/workspaces.d.ts +96 -0
  101. package/dist-esm/src/operations/workspaces.d.ts.map +1 -0
  102. package/dist-esm/src/operations/workspaces.js +496 -0
  103. package/dist-esm/src/operations/workspaces.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
  105. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/index.js +12 -0
  107. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/labels.d.ts +62 -0
  109. package/dist-esm/src/operationsInterfaces/labels.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/labels.js +9 -0
  111. package/dist-esm/src/operationsInterfaces/labels.js.map +1 -0
  112. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  113. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  114. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  115. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  116. package/dist-esm/src/operationsInterfaces/tasks.d.ts +13 -0
  117. package/dist-esm/src/operationsInterfaces/tasks.d.ts.map +1 -0
  118. package/dist-esm/src/operationsInterfaces/tasks.js +9 -0
  119. package/dist-esm/src/operationsInterfaces/tasks.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/workspaces.d.ts +60 -0
  121. package/dist-esm/src/operationsInterfaces/workspaces.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/workspaces.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/workspaces.js.map +1 -0
  124. package/dist-esm/src/pagingHelper.d.ts +13 -0
  125. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  126. package/dist-esm/src/pagingHelper.js +32 -0
  127. package/dist-esm/src/pagingHelper.js.map +1 -0
  128. package/dist-esm/test/defendereasm_operations_test.spec.d.ts +4 -0
  129. package/dist-esm/test/defendereasm_operations_test.spec.d.ts.map +1 -0
  130. package/dist-esm/test/defendereasm_operations_test.spec.js +120 -0
  131. package/dist-esm/test/defendereasm_operations_test.spec.js.map +1 -0
  132. package/package.json +123 -0
  133. package/review/arm-defendereasm.api.md +400 -0
  134. package/rollup.config.js +122 -0
  135. package/src/easmMgmtClient.ts +151 -0
  136. package/src/index.ts +13 -0
  137. package/src/lroImpl.ts +42 -0
  138. package/src/models/index.ts +562 -0
  139. package/src/models/mappers.ts +639 -0
  140. package/src/models/parameters.ts +161 -0
  141. package/src/operations/index.ts +12 -0
  142. package/src/operations/labels.ts +543 -0
  143. package/src/operations/operations.ts +149 -0
  144. package/src/operations/tasks.ts +75 -0
  145. package/src/operations/workspaces.ts +625 -0
  146. package/src/operationsInterfaces/index.ts +12 -0
  147. package/src/operationsInterfaces/labels.ts +120 -0
  148. package/src/operationsInterfaces/operations.ts +22 -0
  149. package/src/operationsInterfaces/tasks.ts +29 -0
  150. package/src/operationsInterfaces/workspaces.ts +114 -0
  151. package/src/pagingHelper.ts +39 -0
  152. package/tsconfig.json +33 -0
  153. package/types/arm-defendereasm.d.ts +724 -0
  154. package/types/tsdoc-metadata.json +11 -0
package/dist/index.js ADDED
@@ -0,0 +1,2047 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib = require('tslib');
6
+ var coreClient = require('@azure/core-client');
7
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
8
+ var coreLro = require('@azure/core-lro');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n["default"] = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
+
31
+ /*
32
+ * Copyright (c) Microsoft Corporation.
33
+ * Licensed under the MIT License.
34
+ *
35
+ * Code generated by Microsoft (R) AutoRest Code Generator.
36
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
37
+ */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given the last `.value` produced by the `byPage` iterator,
41
+ * returns a continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
44
+ * @returns The continuation token that can be passed into byPage() during future calls.
45
+ */
46
+ function getContinuationToken(page) {
47
+ var _a;
48
+ if (typeof page !== "object" || page === null) {
49
+ return undefined;
50
+ }
51
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
52
+ }
53
+ function setContinuationToken(page, continuationToken) {
54
+ var _a;
55
+ if (typeof page !== "object" || page === null || !continuationToken) {
56
+ return;
57
+ }
58
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
59
+ pageInfo.continuationToken = continuationToken;
60
+ pageMap.set(page, pageInfo);
61
+ }
62
+
63
+ /*
64
+ * Copyright (c) Microsoft Corporation.
65
+ * Licensed under the MIT License.
66
+ *
67
+ * Code generated by Microsoft (R) AutoRest Code Generator.
68
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
69
+ */
70
+ /** Known values of {@link ResourceState} that the service accepts. */
71
+ exports.KnownResourceState = void 0;
72
+ (function (KnownResourceState) {
73
+ /** NotSpecified */
74
+ KnownResourceState["NotSpecified"] = "NotSpecified";
75
+ /** Accepted */
76
+ KnownResourceState["Accepted"] = "Accepted";
77
+ /** Creating */
78
+ KnownResourceState["Creating"] = "Creating";
79
+ /** Succeeded */
80
+ KnownResourceState["Succeeded"] = "Succeeded";
81
+ /** Failed */
82
+ KnownResourceState["Failed"] = "Failed";
83
+ /** Canceled */
84
+ KnownResourceState["Canceled"] = "Canceled";
85
+ /** ProvisioningResources */
86
+ KnownResourceState["ProvisioningResources"] = "ProvisioningResources";
87
+ /** InstallingApplication */
88
+ KnownResourceState["InstallingApplication"] = "InstallingApplication";
89
+ /** ConfiguringApplication */
90
+ KnownResourceState["ConfiguringApplication"] = "ConfiguringApplication";
91
+ /** MigratingApplicationData */
92
+ KnownResourceState["MigratingApplicationData"] = "MigratingApplicationData";
93
+ /** RunningValidations */
94
+ KnownResourceState["RunningValidations"] = "RunningValidations";
95
+ /** CreatingArtifacts */
96
+ KnownResourceState["CreatingArtifacts"] = "CreatingArtifacts";
97
+ /** DeletingArtifacts */
98
+ KnownResourceState["DeletingArtifacts"] = "DeletingArtifacts";
99
+ })(exports.KnownResourceState || (exports.KnownResourceState = {}));
100
+ /** Known values of {@link CreatedByType} that the service accepts. */
101
+ exports.KnownCreatedByType = void 0;
102
+ (function (KnownCreatedByType) {
103
+ /** User */
104
+ KnownCreatedByType["User"] = "User";
105
+ /** Application */
106
+ KnownCreatedByType["Application"] = "Application";
107
+ /** ManagedIdentity */
108
+ KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
109
+ /** Key */
110
+ KnownCreatedByType["Key"] = "Key";
111
+ })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
112
+ /** Known values of {@link Origin} that the service accepts. */
113
+ exports.KnownOrigin = void 0;
114
+ (function (KnownOrigin) {
115
+ /** User */
116
+ KnownOrigin["User"] = "user";
117
+ /** System */
118
+ KnownOrigin["System"] = "system";
119
+ /** UserSystem */
120
+ KnownOrigin["UserSystem"] = "user,system";
121
+ })(exports.KnownOrigin || (exports.KnownOrigin = {}));
122
+ /** Known values of {@link ActionType} that the service accepts. */
123
+ exports.KnownActionType = void 0;
124
+ (function (KnownActionType) {
125
+ /** Internal */
126
+ KnownActionType["Internal"] = "Internal";
127
+ })(exports.KnownActionType || (exports.KnownActionType = {}));
128
+
129
+ /*
130
+ * Copyright (c) Microsoft Corporation.
131
+ * Licensed under the MIT License.
132
+ *
133
+ * Code generated by Microsoft (R) AutoRest Code Generator.
134
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
135
+ */
136
+ const WorkspaceResourceList = {
137
+ type: {
138
+ name: "Composite",
139
+ className: "WorkspaceResourceList",
140
+ modelProperties: {
141
+ nextLink: {
142
+ serializedName: "nextLink",
143
+ type: {
144
+ name: "String"
145
+ }
146
+ },
147
+ value: {
148
+ serializedName: "value",
149
+ type: {
150
+ name: "Sequence",
151
+ element: {
152
+ type: {
153
+ name: "Composite",
154
+ className: "WorkspaceResource"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ };
162
+ const ResourceBaseProperties = {
163
+ type: {
164
+ name: "Composite",
165
+ className: "ResourceBaseProperties",
166
+ modelProperties: {
167
+ provisioningState: {
168
+ serializedName: "provisioningState",
169
+ readOnly: true,
170
+ type: {
171
+ name: "String"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ };
177
+ const Resource = {
178
+ type: {
179
+ name: "Composite",
180
+ className: "Resource",
181
+ modelProperties: {
182
+ id: {
183
+ serializedName: "id",
184
+ readOnly: true,
185
+ type: {
186
+ name: "String"
187
+ }
188
+ },
189
+ name: {
190
+ serializedName: "name",
191
+ readOnly: true,
192
+ type: {
193
+ name: "String"
194
+ }
195
+ },
196
+ type: {
197
+ serializedName: "type",
198
+ readOnly: true,
199
+ type: {
200
+ name: "String"
201
+ }
202
+ },
203
+ systemData: {
204
+ serializedName: "systemData",
205
+ type: {
206
+ name: "Composite",
207
+ className: "SystemData"
208
+ }
209
+ }
210
+ }
211
+ }
212
+ };
213
+ const SystemData = {
214
+ type: {
215
+ name: "Composite",
216
+ className: "SystemData",
217
+ modelProperties: {
218
+ createdBy: {
219
+ serializedName: "createdBy",
220
+ type: {
221
+ name: "String"
222
+ }
223
+ },
224
+ createdByType: {
225
+ serializedName: "createdByType",
226
+ type: {
227
+ name: "String"
228
+ }
229
+ },
230
+ createdAt: {
231
+ serializedName: "createdAt",
232
+ type: {
233
+ name: "DateTime"
234
+ }
235
+ },
236
+ lastModifiedBy: {
237
+ serializedName: "lastModifiedBy",
238
+ type: {
239
+ name: "String"
240
+ }
241
+ },
242
+ lastModifiedByType: {
243
+ serializedName: "lastModifiedByType",
244
+ type: {
245
+ name: "String"
246
+ }
247
+ },
248
+ lastModifiedAt: {
249
+ serializedName: "lastModifiedAt",
250
+ type: {
251
+ name: "DateTime"
252
+ }
253
+ }
254
+ }
255
+ }
256
+ };
257
+ const ErrorResponse = {
258
+ type: {
259
+ name: "Composite",
260
+ className: "ErrorResponse",
261
+ modelProperties: {
262
+ error: {
263
+ serializedName: "error",
264
+ type: {
265
+ name: "Composite",
266
+ className: "ErrorDetail"
267
+ }
268
+ }
269
+ }
270
+ }
271
+ };
272
+ const ErrorDetail = {
273
+ type: {
274
+ name: "Composite",
275
+ className: "ErrorDetail",
276
+ modelProperties: {
277
+ code: {
278
+ serializedName: "code",
279
+ readOnly: true,
280
+ type: {
281
+ name: "String"
282
+ }
283
+ },
284
+ message: {
285
+ serializedName: "message",
286
+ readOnly: true,
287
+ type: {
288
+ name: "String"
289
+ }
290
+ },
291
+ target: {
292
+ serializedName: "target",
293
+ readOnly: true,
294
+ type: {
295
+ name: "String"
296
+ }
297
+ },
298
+ details: {
299
+ serializedName: "details",
300
+ readOnly: true,
301
+ type: {
302
+ name: "Sequence",
303
+ element: {
304
+ type: {
305
+ name: "Composite",
306
+ className: "ErrorDetail"
307
+ }
308
+ }
309
+ }
310
+ },
311
+ additionalInfo: {
312
+ serializedName: "additionalInfo",
313
+ readOnly: true,
314
+ type: {
315
+ name: "Sequence",
316
+ element: {
317
+ type: {
318
+ name: "Composite",
319
+ className: "ErrorAdditionalInfo"
320
+ }
321
+ }
322
+ }
323
+ }
324
+ }
325
+ }
326
+ };
327
+ const ErrorAdditionalInfo = {
328
+ type: {
329
+ name: "Composite",
330
+ className: "ErrorAdditionalInfo",
331
+ modelProperties: {
332
+ type: {
333
+ serializedName: "type",
334
+ readOnly: true,
335
+ type: {
336
+ name: "String"
337
+ }
338
+ },
339
+ info: {
340
+ serializedName: "info",
341
+ readOnly: true,
342
+ type: {
343
+ name: "Dictionary",
344
+ value: { type: { name: "any" } }
345
+ }
346
+ }
347
+ }
348
+ }
349
+ };
350
+ const WorkspacePatchResource = {
351
+ type: {
352
+ name: "Composite",
353
+ className: "WorkspacePatchResource",
354
+ modelProperties: {
355
+ tags: {
356
+ serializedName: "tags",
357
+ type: {
358
+ name: "Dictionary",
359
+ value: { type: { name: "String" } }
360
+ }
361
+ },
362
+ systemData: {
363
+ serializedName: "systemData",
364
+ type: {
365
+ name: "Composite",
366
+ className: "SystemData"
367
+ }
368
+ }
369
+ }
370
+ }
371
+ };
372
+ const LabelResourceList = {
373
+ type: {
374
+ name: "Composite",
375
+ className: "LabelResourceList",
376
+ modelProperties: {
377
+ value: {
378
+ serializedName: "value",
379
+ type: {
380
+ name: "Sequence",
381
+ element: {
382
+ type: {
383
+ name: "Composite",
384
+ className: "LabelResource"
385
+ }
386
+ }
387
+ }
388
+ },
389
+ nextLink: {
390
+ serializedName: "nextLink",
391
+ type: {
392
+ name: "String"
393
+ }
394
+ }
395
+ }
396
+ }
397
+ };
398
+ const OperationListResult = {
399
+ type: {
400
+ name: "Composite",
401
+ className: "OperationListResult",
402
+ modelProperties: {
403
+ value: {
404
+ serializedName: "value",
405
+ readOnly: true,
406
+ type: {
407
+ name: "Sequence",
408
+ element: {
409
+ type: {
410
+ name: "Composite",
411
+ className: "Operation"
412
+ }
413
+ }
414
+ }
415
+ },
416
+ nextLink: {
417
+ serializedName: "nextLink",
418
+ readOnly: true,
419
+ type: {
420
+ name: "String"
421
+ }
422
+ }
423
+ }
424
+ }
425
+ };
426
+ const Operation = {
427
+ type: {
428
+ name: "Composite",
429
+ className: "Operation",
430
+ modelProperties: {
431
+ name: {
432
+ serializedName: "name",
433
+ readOnly: true,
434
+ type: {
435
+ name: "String"
436
+ }
437
+ },
438
+ isDataAction: {
439
+ serializedName: "isDataAction",
440
+ readOnly: true,
441
+ type: {
442
+ name: "Boolean"
443
+ }
444
+ },
445
+ display: {
446
+ serializedName: "display",
447
+ type: {
448
+ name: "Composite",
449
+ className: "OperationDisplay"
450
+ }
451
+ },
452
+ origin: {
453
+ serializedName: "origin",
454
+ readOnly: true,
455
+ type: {
456
+ name: "String"
457
+ }
458
+ },
459
+ actionType: {
460
+ serializedName: "actionType",
461
+ readOnly: true,
462
+ type: {
463
+ name: "String"
464
+ }
465
+ }
466
+ }
467
+ }
468
+ };
469
+ const OperationDisplay = {
470
+ type: {
471
+ name: "Composite",
472
+ className: "OperationDisplay",
473
+ modelProperties: {
474
+ provider: {
475
+ serializedName: "provider",
476
+ readOnly: true,
477
+ type: {
478
+ name: "String"
479
+ }
480
+ },
481
+ resource: {
482
+ serializedName: "resource",
483
+ readOnly: true,
484
+ type: {
485
+ name: "String"
486
+ }
487
+ },
488
+ operation: {
489
+ serializedName: "operation",
490
+ readOnly: true,
491
+ type: {
492
+ name: "String"
493
+ }
494
+ },
495
+ description: {
496
+ serializedName: "description",
497
+ readOnly: true,
498
+ type: {
499
+ name: "String"
500
+ }
501
+ }
502
+ }
503
+ }
504
+ };
505
+ const WorkspaceResourceProperties = {
506
+ type: {
507
+ name: "Composite",
508
+ className: "WorkspaceResourceProperties",
509
+ modelProperties: Object.assign(Object.assign({}, ResourceBaseProperties.type.modelProperties), { dataPlaneEndpoint: {
510
+ serializedName: "dataPlaneEndpoint",
511
+ readOnly: true,
512
+ type: {
513
+ name: "String"
514
+ }
515
+ } })
516
+ }
517
+ };
518
+ const LabelResourceProperties = {
519
+ type: {
520
+ name: "Composite",
521
+ className: "LabelResourceProperties",
522
+ modelProperties: Object.assign(Object.assign({}, ResourceBaseProperties.type.modelProperties), { displayName: {
523
+ serializedName: "displayName",
524
+ type: {
525
+ name: "String"
526
+ }
527
+ }, color: {
528
+ serializedName: "color",
529
+ type: {
530
+ name: "String"
531
+ }
532
+ } })
533
+ }
534
+ };
535
+ const TaskResourceProperties = {
536
+ type: {
537
+ name: "Composite",
538
+ className: "TaskResourceProperties",
539
+ modelProperties: Object.assign(Object.assign({}, ResourceBaseProperties.type.modelProperties), { startedAt: {
540
+ serializedName: "startedAt",
541
+ type: {
542
+ name: "String"
543
+ }
544
+ }, completedAt: {
545
+ serializedName: "completedAt",
546
+ type: {
547
+ name: "String"
548
+ }
549
+ }, lastPolledAt: {
550
+ serializedName: "lastPolledAt",
551
+ type: {
552
+ name: "String"
553
+ }
554
+ }, state: {
555
+ serializedName: "state",
556
+ type: {
557
+ name: "String"
558
+ }
559
+ }, phase: {
560
+ serializedName: "phase",
561
+ type: {
562
+ name: "String"
563
+ }
564
+ }, reason: {
565
+ serializedName: "reason",
566
+ type: {
567
+ name: "String"
568
+ }
569
+ }, metadata: {
570
+ serializedName: "metadata",
571
+ type: {
572
+ name: "Dictionary",
573
+ value: { type: { name: "any" } }
574
+ }
575
+ } })
576
+ }
577
+ };
578
+ const TrackedResource = {
579
+ type: {
580
+ name: "Composite",
581
+ className: "TrackedResource",
582
+ modelProperties: Object.assign(Object.assign({}, Resource.type.modelProperties), { tags: {
583
+ serializedName: "tags",
584
+ type: {
585
+ name: "Dictionary",
586
+ value: { type: { name: "String" } }
587
+ }
588
+ }, location: {
589
+ serializedName: "location",
590
+ required: true,
591
+ type: {
592
+ name: "String"
593
+ }
594
+ } })
595
+ }
596
+ };
597
+ const ProxyResource = {
598
+ type: {
599
+ name: "Composite",
600
+ className: "ProxyResource",
601
+ modelProperties: Object.assign({}, Resource.type.modelProperties)
602
+ }
603
+ };
604
+ const WorkspaceResource = {
605
+ type: {
606
+ name: "Composite",
607
+ className: "WorkspaceResource",
608
+ modelProperties: Object.assign(Object.assign({}, TrackedResource.type.modelProperties), { provisioningState: {
609
+ serializedName: "properties.provisioningState",
610
+ readOnly: true,
611
+ type: {
612
+ name: "String"
613
+ }
614
+ }, dataPlaneEndpoint: {
615
+ serializedName: "properties.dataPlaneEndpoint",
616
+ readOnly: true,
617
+ type: {
618
+ name: "String"
619
+ }
620
+ } })
621
+ }
622
+ };
623
+ const LabelResource = {
624
+ type: {
625
+ name: "Composite",
626
+ className: "LabelResource",
627
+ modelProperties: Object.assign(Object.assign({}, ProxyResource.type.modelProperties), { provisioningState: {
628
+ serializedName: "properties.provisioningState",
629
+ readOnly: true,
630
+ type: {
631
+ name: "String"
632
+ }
633
+ }, displayName: {
634
+ serializedName: "properties.displayName",
635
+ type: {
636
+ name: "String"
637
+ }
638
+ }, color: {
639
+ serializedName: "properties.color",
640
+ type: {
641
+ name: "String"
642
+ }
643
+ } })
644
+ }
645
+ };
646
+ const TaskResource = {
647
+ type: {
648
+ name: "Composite",
649
+ className: "TaskResource",
650
+ modelProperties: Object.assign(Object.assign({}, ProxyResource.type.modelProperties), { provisioningState: {
651
+ serializedName: "properties.provisioningState",
652
+ readOnly: true,
653
+ type: {
654
+ name: "String"
655
+ }
656
+ }, startedAt: {
657
+ serializedName: "properties.startedAt",
658
+ type: {
659
+ name: "String"
660
+ }
661
+ }, completedAt: {
662
+ serializedName: "properties.completedAt",
663
+ type: {
664
+ name: "String"
665
+ }
666
+ }, lastPolledAt: {
667
+ serializedName: "properties.lastPolledAt",
668
+ type: {
669
+ name: "String"
670
+ }
671
+ }, state: {
672
+ serializedName: "properties.state",
673
+ type: {
674
+ name: "String"
675
+ }
676
+ }, phase: {
677
+ serializedName: "properties.phase",
678
+ type: {
679
+ name: "String"
680
+ }
681
+ }, reason: {
682
+ serializedName: "properties.reason",
683
+ type: {
684
+ name: "String"
685
+ }
686
+ }, metadata: {
687
+ serializedName: "properties.metadata",
688
+ type: {
689
+ name: "Dictionary",
690
+ value: { type: { name: "any" } }
691
+ }
692
+ } })
693
+ }
694
+ };
695
+ const LabelPatchResource = {
696
+ type: {
697
+ name: "Composite",
698
+ className: "LabelPatchResource",
699
+ modelProperties: Object.assign({}, LabelResource.type.modelProperties)
700
+ }
701
+ };
702
+
703
+ var Mappers = /*#__PURE__*/Object.freeze({
704
+ __proto__: null,
705
+ WorkspaceResourceList: WorkspaceResourceList,
706
+ ResourceBaseProperties: ResourceBaseProperties,
707
+ Resource: Resource,
708
+ SystemData: SystemData,
709
+ ErrorResponse: ErrorResponse,
710
+ ErrorDetail: ErrorDetail,
711
+ ErrorAdditionalInfo: ErrorAdditionalInfo,
712
+ WorkspacePatchResource: WorkspacePatchResource,
713
+ LabelResourceList: LabelResourceList,
714
+ OperationListResult: OperationListResult,
715
+ Operation: Operation,
716
+ OperationDisplay: OperationDisplay,
717
+ WorkspaceResourceProperties: WorkspaceResourceProperties,
718
+ LabelResourceProperties: LabelResourceProperties,
719
+ TaskResourceProperties: TaskResourceProperties,
720
+ TrackedResource: TrackedResource,
721
+ ProxyResource: ProxyResource,
722
+ WorkspaceResource: WorkspaceResource,
723
+ LabelResource: LabelResource,
724
+ TaskResource: TaskResource,
725
+ LabelPatchResource: LabelPatchResource
726
+ });
727
+
728
+ /*
729
+ * Copyright (c) Microsoft Corporation.
730
+ * Licensed under the MIT License.
731
+ *
732
+ * Code generated by Microsoft (R) AutoRest Code Generator.
733
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
734
+ */
735
+ const accept = {
736
+ parameterPath: "accept",
737
+ mapper: {
738
+ defaultValue: "application/json",
739
+ isConstant: true,
740
+ serializedName: "Accept",
741
+ type: {
742
+ name: "String"
743
+ }
744
+ }
745
+ };
746
+ const $host = {
747
+ parameterPath: "$host",
748
+ mapper: {
749
+ serializedName: "$host",
750
+ required: true,
751
+ type: {
752
+ name: "String"
753
+ }
754
+ },
755
+ skipEncoding: true
756
+ };
757
+ const apiVersion = {
758
+ parameterPath: "apiVersion",
759
+ mapper: {
760
+ defaultValue: "2023-04-01-preview",
761
+ isConstant: true,
762
+ serializedName: "api-version",
763
+ type: {
764
+ name: "String"
765
+ }
766
+ }
767
+ };
768
+ const subscriptionId = {
769
+ parameterPath: "subscriptionId",
770
+ mapper: {
771
+ constraints: {
772
+ MinLength: 1
773
+ },
774
+ serializedName: "subscriptionId",
775
+ required: true,
776
+ type: {
777
+ name: "String"
778
+ }
779
+ }
780
+ };
781
+ const resourceGroupName = {
782
+ parameterPath: "resourceGroupName",
783
+ mapper: {
784
+ constraints: {
785
+ MaxLength: 90,
786
+ MinLength: 1
787
+ },
788
+ serializedName: "resourceGroupName",
789
+ required: true,
790
+ type: {
791
+ name: "String"
792
+ }
793
+ }
794
+ };
795
+ const workspaceName = {
796
+ parameterPath: "workspaceName",
797
+ mapper: {
798
+ serializedName: "workspaceName",
799
+ required: true,
800
+ type: {
801
+ name: "String"
802
+ }
803
+ }
804
+ };
805
+ const contentType = {
806
+ parameterPath: ["options", "contentType"],
807
+ mapper: {
808
+ defaultValue: "application/json",
809
+ isConstant: true,
810
+ serializedName: "Content-Type",
811
+ type: {
812
+ name: "String"
813
+ }
814
+ }
815
+ };
816
+ const workspaceResource = {
817
+ parameterPath: ["options", "workspaceResource"],
818
+ mapper: WorkspaceResource
819
+ };
820
+ const workspacePatchResource = {
821
+ parameterPath: ["options", "workspacePatchResource"],
822
+ mapper: WorkspacePatchResource
823
+ };
824
+ const nextLink = {
825
+ parameterPath: "nextLink",
826
+ mapper: {
827
+ serializedName: "nextLink",
828
+ required: true,
829
+ type: {
830
+ name: "String"
831
+ }
832
+ },
833
+ skipEncoding: true
834
+ };
835
+ const labelName = {
836
+ parameterPath: "labelName",
837
+ mapper: {
838
+ serializedName: "labelName",
839
+ required: true,
840
+ type: {
841
+ name: "String"
842
+ }
843
+ }
844
+ };
845
+ const labelResource = {
846
+ parameterPath: ["options", "labelResource"],
847
+ mapper: LabelResource
848
+ };
849
+ const labelPatchResource = {
850
+ parameterPath: ["options", "labelPatchResource"],
851
+ mapper: LabelPatchResource
852
+ };
853
+ const taskId = {
854
+ parameterPath: "taskId",
855
+ mapper: {
856
+ serializedName: "taskId",
857
+ required: true,
858
+ type: {
859
+ name: "String"
860
+ }
861
+ }
862
+ };
863
+
864
+ /*
865
+ * Copyright (c) Microsoft Corporation.
866
+ * Licensed under the MIT License.
867
+ *
868
+ * Code generated by Microsoft (R) AutoRest Code Generator.
869
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
870
+ */
871
+ function createLroSpec(inputs) {
872
+ const { args, spec, sendOperationFn } = inputs;
873
+ return {
874
+ requestMethod: spec.httpMethod,
875
+ requestPath: spec.path,
876
+ sendInitialRequest: () => sendOperationFn(args, spec),
877
+ sendPollRequest: (path, options) => {
878
+ const restSpec = tslib.__rest(spec, ["requestBody"]);
879
+ return sendOperationFn(args, Object.assign(Object.assign({}, restSpec), { httpMethod: "GET", path, abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }));
880
+ }
881
+ };
882
+ }
883
+
884
+ /*
885
+ * Copyright (c) Microsoft Corporation.
886
+ * Licensed under the MIT License.
887
+ *
888
+ * Code generated by Microsoft (R) AutoRest Code Generator.
889
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
890
+ */
891
+ /// <reference lib="esnext.asynciterable" />
892
+ /** Class containing Workspaces operations. */
893
+ class WorkspacesImpl {
894
+ /**
895
+ * Initialize a new instance of the class Workspaces class.
896
+ * @param client Reference to the service client
897
+ */
898
+ constructor(client) {
899
+ this.client = client;
900
+ }
901
+ /**
902
+ * Returns a list of workspaces under the given subscription.
903
+ * @param options The options parameters.
904
+ */
905
+ listBySubscription(options) {
906
+ const iter = this.listBySubscriptionPagingAll(options);
907
+ return {
908
+ next() {
909
+ return iter.next();
910
+ },
911
+ [Symbol.asyncIterator]() {
912
+ return this;
913
+ },
914
+ byPage: (settings) => {
915
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
916
+ throw new Error("maxPageSize is not supported by this operation.");
917
+ }
918
+ return this.listBySubscriptionPagingPage(options, settings);
919
+ }
920
+ };
921
+ }
922
+ listBySubscriptionPagingPage(options, settings) {
923
+ return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
924
+ let result;
925
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
926
+ if (!continuationToken) {
927
+ result = yield tslib.__await(this._listBySubscription(options));
928
+ let page = result.value || [];
929
+ continuationToken = result.nextLink;
930
+ setContinuationToken(page, continuationToken);
931
+ yield yield tslib.__await(page);
932
+ }
933
+ while (continuationToken) {
934
+ result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
935
+ continuationToken = result.nextLink;
936
+ let page = result.value || [];
937
+ setContinuationToken(page, continuationToken);
938
+ yield yield tslib.__await(page);
939
+ }
940
+ });
941
+ }
942
+ listBySubscriptionPagingAll(options) {
943
+ return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
944
+ var _a, e_1, _b, _c;
945
+ try {
946
+ for (var _d = true, _e = tslib.__asyncValues(this.listBySubscriptionPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
947
+ _c = _f.value;
948
+ _d = false;
949
+ try {
950
+ const page = _c;
951
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
952
+ }
953
+ finally {
954
+ _d = true;
955
+ }
956
+ }
957
+ }
958
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
959
+ finally {
960
+ try {
961
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
962
+ }
963
+ finally { if (e_1) throw e_1.error; }
964
+ }
965
+ });
966
+ }
967
+ /**
968
+ * Returns a list of workspaces in the given resource group.
969
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
970
+ * @param options The options parameters.
971
+ */
972
+ listByResourceGroup(resourceGroupName, options) {
973
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
974
+ return {
975
+ next() {
976
+ return iter.next();
977
+ },
978
+ [Symbol.asyncIterator]() {
979
+ return this;
980
+ },
981
+ byPage: (settings) => {
982
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
983
+ throw new Error("maxPageSize is not supported by this operation.");
984
+ }
985
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
986
+ }
987
+ };
988
+ }
989
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
990
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
991
+ let result;
992
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
993
+ if (!continuationToken) {
994
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
995
+ let page = result.value || [];
996
+ continuationToken = result.nextLink;
997
+ setContinuationToken(page, continuationToken);
998
+ yield yield tslib.__await(page);
999
+ }
1000
+ while (continuationToken) {
1001
+ result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1002
+ continuationToken = result.nextLink;
1003
+ let page = result.value || [];
1004
+ setContinuationToken(page, continuationToken);
1005
+ yield yield tslib.__await(page);
1006
+ }
1007
+ });
1008
+ }
1009
+ listByResourceGroupPagingAll(resourceGroupName, options) {
1010
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
1011
+ var _a, e_2, _b, _c;
1012
+ try {
1013
+ for (var _d = true, _e = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
1014
+ _c = _f.value;
1015
+ _d = false;
1016
+ try {
1017
+ const page = _c;
1018
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1019
+ }
1020
+ finally {
1021
+ _d = true;
1022
+ }
1023
+ }
1024
+ }
1025
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1026
+ finally {
1027
+ try {
1028
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1029
+ }
1030
+ finally { if (e_2) throw e_2.error; }
1031
+ }
1032
+ });
1033
+ }
1034
+ /**
1035
+ * Returns a list of workspaces under the given subscription.
1036
+ * @param options The options parameters.
1037
+ */
1038
+ _listBySubscription(options) {
1039
+ return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
1040
+ }
1041
+ /**
1042
+ * Returns a list of workspaces in the given resource group.
1043
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1044
+ * @param options The options parameters.
1045
+ */
1046
+ _listByResourceGroup(resourceGroupName, options) {
1047
+ return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
1048
+ }
1049
+ /**
1050
+ * Returns a workspace with the given name.
1051
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1052
+ * @param workspaceName The name of the Workspace.
1053
+ * @param options The options parameters.
1054
+ */
1055
+ get(resourceGroupName, workspaceName, options) {
1056
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, options }, getOperationSpec);
1057
+ }
1058
+ /**
1059
+ * Create or update a Workspace.
1060
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1061
+ * @param workspaceName The name of the Workspace.
1062
+ * @param options The options parameters.
1063
+ */
1064
+ beginCreateAndUpdate(resourceGroupName, workspaceName, options) {
1065
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1066
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1067
+ return this.client.sendOperationRequest(args, spec);
1068
+ });
1069
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1070
+ var _a;
1071
+ let currentRawResponse = undefined;
1072
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1073
+ const callback = (rawResponse, flatResponse) => {
1074
+ currentRawResponse = rawResponse;
1075
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1076
+ };
1077
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1078
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1079
+ return {
1080
+ flatResponse,
1081
+ rawResponse: {
1082
+ statusCode: currentRawResponse.status,
1083
+ body: currentRawResponse.parsedBody,
1084
+ headers: currentRawResponse.headers.toJSON()
1085
+ }
1086
+ };
1087
+ });
1088
+ const lro = createLroSpec({
1089
+ sendOperationFn,
1090
+ args: { resourceGroupName, workspaceName, options },
1091
+ spec: createAndUpdateOperationSpec$1
1092
+ });
1093
+ const poller = yield coreLro.createHttpPoller(lro, {
1094
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1095
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1096
+ resourceLocationConfig: "azure-async-operation"
1097
+ });
1098
+ yield poller.poll();
1099
+ return poller;
1100
+ });
1101
+ }
1102
+ /**
1103
+ * Create or update a Workspace.
1104
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1105
+ * @param workspaceName The name of the Workspace.
1106
+ * @param options The options parameters.
1107
+ */
1108
+ beginCreateAndUpdateAndWait(resourceGroupName, workspaceName, options) {
1109
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1110
+ const poller = yield this.beginCreateAndUpdate(resourceGroupName, workspaceName, options);
1111
+ return poller.pollUntilDone();
1112
+ });
1113
+ }
1114
+ /**
1115
+ * Update a Workspace.
1116
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1117
+ * @param workspaceName The name of the Workspace.
1118
+ * @param options The options parameters.
1119
+ */
1120
+ update(resourceGroupName, workspaceName, options) {
1121
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, options }, updateOperationSpec$1);
1122
+ }
1123
+ /**
1124
+ * Delete a Workspace.
1125
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1126
+ * @param workspaceName The name of the Workspace.
1127
+ * @param options The options parameters.
1128
+ */
1129
+ beginDelete(resourceGroupName, workspaceName, options) {
1130
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1131
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1132
+ return this.client.sendOperationRequest(args, spec);
1133
+ });
1134
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1135
+ var _a;
1136
+ let currentRawResponse = undefined;
1137
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1138
+ const callback = (rawResponse, flatResponse) => {
1139
+ currentRawResponse = rawResponse;
1140
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1141
+ };
1142
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1143
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1144
+ return {
1145
+ flatResponse,
1146
+ rawResponse: {
1147
+ statusCode: currentRawResponse.status,
1148
+ body: currentRawResponse.parsedBody,
1149
+ headers: currentRawResponse.headers.toJSON()
1150
+ }
1151
+ };
1152
+ });
1153
+ const lro = createLroSpec({
1154
+ sendOperationFn,
1155
+ args: { resourceGroupName, workspaceName, options },
1156
+ spec: deleteOperationSpec$1
1157
+ });
1158
+ const poller = yield coreLro.createHttpPoller(lro, {
1159
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1160
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1161
+ resourceLocationConfig: "azure-async-operation"
1162
+ });
1163
+ yield poller.poll();
1164
+ return poller;
1165
+ });
1166
+ }
1167
+ /**
1168
+ * Delete a Workspace.
1169
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1170
+ * @param workspaceName The name of the Workspace.
1171
+ * @param options The options parameters.
1172
+ */
1173
+ beginDeleteAndWait(resourceGroupName, workspaceName, options) {
1174
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1175
+ const poller = yield this.beginDelete(resourceGroupName, workspaceName, options);
1176
+ return poller.pollUntilDone();
1177
+ });
1178
+ }
1179
+ /**
1180
+ * ListBySubscriptionNext
1181
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
1182
+ * @param options The options parameters.
1183
+ */
1184
+ _listBySubscriptionNext(nextLink, options) {
1185
+ return this.client.sendOperationRequest({ nextLink, options }, listBySubscriptionNextOperationSpec);
1186
+ }
1187
+ /**
1188
+ * ListByResourceGroupNext
1189
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1190
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
1191
+ * @param options The options parameters.
1192
+ */
1193
+ _listByResourceGroupNext(resourceGroupName, nextLink, options) {
1194
+ return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec);
1195
+ }
1196
+ }
1197
+ // Operation Specifications
1198
+ const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1199
+ const listBySubscriptionOperationSpec = {
1200
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Easm/workspaces",
1201
+ httpMethod: "GET",
1202
+ responses: {
1203
+ 200: {
1204
+ bodyMapper: WorkspaceResourceList
1205
+ },
1206
+ default: {
1207
+ bodyMapper: ErrorResponse
1208
+ }
1209
+ },
1210
+ queryParameters: [apiVersion],
1211
+ urlParameters: [$host, subscriptionId],
1212
+ headerParameters: [accept],
1213
+ serializer: serializer$3
1214
+ };
1215
+ const listByResourceGroupOperationSpec = {
1216
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces",
1217
+ httpMethod: "GET",
1218
+ responses: {
1219
+ 200: {
1220
+ bodyMapper: WorkspaceResourceList
1221
+ },
1222
+ default: {
1223
+ bodyMapper: ErrorResponse
1224
+ }
1225
+ },
1226
+ queryParameters: [apiVersion],
1227
+ urlParameters: [
1228
+ $host,
1229
+ subscriptionId,
1230
+ resourceGroupName
1231
+ ],
1232
+ headerParameters: [accept],
1233
+ serializer: serializer$3
1234
+ };
1235
+ const getOperationSpec = {
1236
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}",
1237
+ httpMethod: "GET",
1238
+ responses: {
1239
+ 200: {
1240
+ bodyMapper: WorkspaceResource
1241
+ },
1242
+ default: {
1243
+ bodyMapper: ErrorResponse
1244
+ }
1245
+ },
1246
+ queryParameters: [apiVersion],
1247
+ urlParameters: [
1248
+ $host,
1249
+ subscriptionId,
1250
+ resourceGroupName,
1251
+ workspaceName
1252
+ ],
1253
+ headerParameters: [accept],
1254
+ serializer: serializer$3
1255
+ };
1256
+ const createAndUpdateOperationSpec$1 = {
1257
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}",
1258
+ httpMethod: "PUT",
1259
+ responses: {
1260
+ 200: {
1261
+ bodyMapper: WorkspaceResource
1262
+ },
1263
+ 201: {
1264
+ bodyMapper: WorkspaceResource
1265
+ },
1266
+ 202: {
1267
+ bodyMapper: WorkspaceResource
1268
+ },
1269
+ 204: {
1270
+ bodyMapper: WorkspaceResource
1271
+ },
1272
+ default: {
1273
+ bodyMapper: ErrorResponse
1274
+ }
1275
+ },
1276
+ requestBody: workspaceResource,
1277
+ queryParameters: [apiVersion],
1278
+ urlParameters: [
1279
+ $host,
1280
+ subscriptionId,
1281
+ resourceGroupName,
1282
+ workspaceName
1283
+ ],
1284
+ headerParameters: [accept, contentType],
1285
+ mediaType: "json",
1286
+ serializer: serializer$3
1287
+ };
1288
+ const updateOperationSpec$1 = {
1289
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}",
1290
+ httpMethod: "PATCH",
1291
+ responses: {
1292
+ 200: {
1293
+ bodyMapper: WorkspaceResource
1294
+ },
1295
+ default: {
1296
+ bodyMapper: ErrorResponse
1297
+ }
1298
+ },
1299
+ requestBody: workspacePatchResource,
1300
+ queryParameters: [apiVersion],
1301
+ urlParameters: [
1302
+ $host,
1303
+ subscriptionId,
1304
+ resourceGroupName,
1305
+ workspaceName
1306
+ ],
1307
+ headerParameters: [accept, contentType],
1308
+ mediaType: "json",
1309
+ serializer: serializer$3
1310
+ };
1311
+ const deleteOperationSpec$1 = {
1312
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}",
1313
+ httpMethod: "DELETE",
1314
+ responses: {
1315
+ 200: {},
1316
+ 201: {},
1317
+ 202: {},
1318
+ 204: {},
1319
+ default: {
1320
+ bodyMapper: ErrorResponse
1321
+ }
1322
+ },
1323
+ queryParameters: [apiVersion],
1324
+ urlParameters: [
1325
+ $host,
1326
+ subscriptionId,
1327
+ resourceGroupName,
1328
+ workspaceName
1329
+ ],
1330
+ headerParameters: [accept],
1331
+ serializer: serializer$3
1332
+ };
1333
+ const listBySubscriptionNextOperationSpec = {
1334
+ path: "{nextLink}",
1335
+ httpMethod: "GET",
1336
+ responses: {
1337
+ 200: {
1338
+ bodyMapper: WorkspaceResourceList
1339
+ },
1340
+ default: {
1341
+ bodyMapper: ErrorResponse
1342
+ }
1343
+ },
1344
+ urlParameters: [
1345
+ $host,
1346
+ subscriptionId,
1347
+ nextLink
1348
+ ],
1349
+ headerParameters: [accept],
1350
+ serializer: serializer$3
1351
+ };
1352
+ const listByResourceGroupNextOperationSpec = {
1353
+ path: "{nextLink}",
1354
+ httpMethod: "GET",
1355
+ responses: {
1356
+ 200: {
1357
+ bodyMapper: WorkspaceResourceList
1358
+ },
1359
+ default: {
1360
+ bodyMapper: ErrorResponse
1361
+ }
1362
+ },
1363
+ urlParameters: [
1364
+ $host,
1365
+ subscriptionId,
1366
+ resourceGroupName,
1367
+ nextLink
1368
+ ],
1369
+ headerParameters: [accept],
1370
+ serializer: serializer$3
1371
+ };
1372
+
1373
+ /*
1374
+ * Copyright (c) Microsoft Corporation.
1375
+ * Licensed under the MIT License.
1376
+ *
1377
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1378
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1379
+ */
1380
+ /// <reference lib="esnext.asynciterable" />
1381
+ /** Class containing Labels operations. */
1382
+ class LabelsImpl {
1383
+ /**
1384
+ * Initialize a new instance of the class Labels class.
1385
+ * @param client Reference to the service client
1386
+ */
1387
+ constructor(client) {
1388
+ this.client = client;
1389
+ }
1390
+ /**
1391
+ * Returns a list of labels in the given workspace.
1392
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1393
+ * @param workspaceName The name of the Workspace.
1394
+ * @param options The options parameters.
1395
+ */
1396
+ listByWorkspace(resourceGroupName, workspaceName, options) {
1397
+ const iter = this.listByWorkspacePagingAll(resourceGroupName, workspaceName, options);
1398
+ return {
1399
+ next() {
1400
+ return iter.next();
1401
+ },
1402
+ [Symbol.asyncIterator]() {
1403
+ return this;
1404
+ },
1405
+ byPage: (settings) => {
1406
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1407
+ throw new Error("maxPageSize is not supported by this operation.");
1408
+ }
1409
+ return this.listByWorkspacePagingPage(resourceGroupName, workspaceName, options, settings);
1410
+ }
1411
+ };
1412
+ }
1413
+ listByWorkspacePagingPage(resourceGroupName, workspaceName, options, settings) {
1414
+ return tslib.__asyncGenerator(this, arguments, function* listByWorkspacePagingPage_1() {
1415
+ let result;
1416
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1417
+ if (!continuationToken) {
1418
+ result = yield tslib.__await(this._listByWorkspace(resourceGroupName, workspaceName, options));
1419
+ let page = result.value || [];
1420
+ continuationToken = result.nextLink;
1421
+ setContinuationToken(page, continuationToken);
1422
+ yield yield tslib.__await(page);
1423
+ }
1424
+ while (continuationToken) {
1425
+ result = yield tslib.__await(this._listByWorkspaceNext(resourceGroupName, workspaceName, continuationToken, options));
1426
+ continuationToken = result.nextLink;
1427
+ let page = result.value || [];
1428
+ setContinuationToken(page, continuationToken);
1429
+ yield yield tslib.__await(page);
1430
+ }
1431
+ });
1432
+ }
1433
+ listByWorkspacePagingAll(resourceGroupName, workspaceName, options) {
1434
+ return tslib.__asyncGenerator(this, arguments, function* listByWorkspacePagingAll_1() {
1435
+ var _a, e_1, _b, _c;
1436
+ try {
1437
+ for (var _d = true, _e = tslib.__asyncValues(this.listByWorkspacePagingPage(resourceGroupName, workspaceName, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
1438
+ _c = _f.value;
1439
+ _d = false;
1440
+ try {
1441
+ const page = _c;
1442
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1443
+ }
1444
+ finally {
1445
+ _d = true;
1446
+ }
1447
+ }
1448
+ }
1449
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1450
+ finally {
1451
+ try {
1452
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1453
+ }
1454
+ finally { if (e_1) throw e_1.error; }
1455
+ }
1456
+ });
1457
+ }
1458
+ /**
1459
+ * Returns a list of labels in the given workspace.
1460
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1461
+ * @param workspaceName The name of the Workspace.
1462
+ * @param options The options parameters.
1463
+ */
1464
+ _listByWorkspace(resourceGroupName, workspaceName, options) {
1465
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, options }, listByWorkspaceOperationSpec);
1466
+ }
1467
+ /**
1468
+ * Returns a label in the given workspace.
1469
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1470
+ * @param workspaceName The name of the Workspace.
1471
+ * @param labelName The name of the Label.
1472
+ * @param options The options parameters.
1473
+ */
1474
+ getByWorkspace(resourceGroupName, workspaceName, labelName, options) {
1475
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, labelName, options }, getByWorkspaceOperationSpec$1);
1476
+ }
1477
+ /**
1478
+ * Create or update a Label.
1479
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1480
+ * @param workspaceName The name of the Workspace.
1481
+ * @param labelName The name of the Label.
1482
+ * @param options The options parameters.
1483
+ */
1484
+ beginCreateAndUpdate(resourceGroupName, workspaceName, labelName, options) {
1485
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1486
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1487
+ return this.client.sendOperationRequest(args, spec);
1488
+ });
1489
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1490
+ var _a;
1491
+ let currentRawResponse = undefined;
1492
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1493
+ const callback = (rawResponse, flatResponse) => {
1494
+ currentRawResponse = rawResponse;
1495
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1496
+ };
1497
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1498
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1499
+ return {
1500
+ flatResponse,
1501
+ rawResponse: {
1502
+ statusCode: currentRawResponse.status,
1503
+ body: currentRawResponse.parsedBody,
1504
+ headers: currentRawResponse.headers.toJSON()
1505
+ }
1506
+ };
1507
+ });
1508
+ const lro = createLroSpec({
1509
+ sendOperationFn,
1510
+ args: { resourceGroupName, workspaceName, labelName, options },
1511
+ spec: createAndUpdateOperationSpec
1512
+ });
1513
+ const poller = yield coreLro.createHttpPoller(lro, {
1514
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1515
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1516
+ resourceLocationConfig: "azure-async-operation"
1517
+ });
1518
+ yield poller.poll();
1519
+ return poller;
1520
+ });
1521
+ }
1522
+ /**
1523
+ * Create or update a Label.
1524
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1525
+ * @param workspaceName The name of the Workspace.
1526
+ * @param labelName The name of the Label.
1527
+ * @param options The options parameters.
1528
+ */
1529
+ beginCreateAndUpdateAndWait(resourceGroupName, workspaceName, labelName, options) {
1530
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1531
+ const poller = yield this.beginCreateAndUpdate(resourceGroupName, workspaceName, labelName, options);
1532
+ return poller.pollUntilDone();
1533
+ });
1534
+ }
1535
+ /**
1536
+ * Update a Label.
1537
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1538
+ * @param workspaceName The name of the Workspace.
1539
+ * @param labelName The name of the Label.
1540
+ * @param options The options parameters.
1541
+ */
1542
+ update(resourceGroupName, workspaceName, labelName, options) {
1543
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, labelName, options }, updateOperationSpec);
1544
+ }
1545
+ /**
1546
+ * Delete a Label.
1547
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1548
+ * @param workspaceName The name of the Workspace.
1549
+ * @param labelName The name of the Label.
1550
+ * @param options The options parameters.
1551
+ */
1552
+ beginDelete(resourceGroupName, workspaceName, labelName, options) {
1553
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1554
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1555
+ return this.client.sendOperationRequest(args, spec);
1556
+ });
1557
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1558
+ var _a;
1559
+ let currentRawResponse = undefined;
1560
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1561
+ const callback = (rawResponse, flatResponse) => {
1562
+ currentRawResponse = rawResponse;
1563
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1564
+ };
1565
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1566
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1567
+ return {
1568
+ flatResponse,
1569
+ rawResponse: {
1570
+ statusCode: currentRawResponse.status,
1571
+ body: currentRawResponse.parsedBody,
1572
+ headers: currentRawResponse.headers.toJSON()
1573
+ }
1574
+ };
1575
+ });
1576
+ const lro = createLroSpec({
1577
+ sendOperationFn,
1578
+ args: { resourceGroupName, workspaceName, labelName, options },
1579
+ spec: deleteOperationSpec
1580
+ });
1581
+ const poller = yield coreLro.createHttpPoller(lro, {
1582
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1583
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1584
+ resourceLocationConfig: "azure-async-operation"
1585
+ });
1586
+ yield poller.poll();
1587
+ return poller;
1588
+ });
1589
+ }
1590
+ /**
1591
+ * Delete a Label.
1592
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1593
+ * @param workspaceName The name of the Workspace.
1594
+ * @param labelName The name of the Label.
1595
+ * @param options The options parameters.
1596
+ */
1597
+ beginDeleteAndWait(resourceGroupName, workspaceName, labelName, options) {
1598
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1599
+ const poller = yield this.beginDelete(resourceGroupName, workspaceName, labelName, options);
1600
+ return poller.pollUntilDone();
1601
+ });
1602
+ }
1603
+ /**
1604
+ * ListByWorkspaceNext
1605
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1606
+ * @param workspaceName The name of the Workspace.
1607
+ * @param nextLink The nextLink from the previous successful call to the ListByWorkspace method.
1608
+ * @param options The options parameters.
1609
+ */
1610
+ _listByWorkspaceNext(resourceGroupName, workspaceName, nextLink, options) {
1611
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, nextLink, options }, listByWorkspaceNextOperationSpec);
1612
+ }
1613
+ }
1614
+ // Operation Specifications
1615
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1616
+ const listByWorkspaceOperationSpec = {
1617
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels",
1618
+ httpMethod: "GET",
1619
+ responses: {
1620
+ 200: {
1621
+ bodyMapper: LabelResourceList
1622
+ },
1623
+ default: {
1624
+ bodyMapper: ErrorResponse
1625
+ }
1626
+ },
1627
+ queryParameters: [apiVersion],
1628
+ urlParameters: [
1629
+ $host,
1630
+ subscriptionId,
1631
+ resourceGroupName,
1632
+ workspaceName
1633
+ ],
1634
+ headerParameters: [accept],
1635
+ serializer: serializer$2
1636
+ };
1637
+ const getByWorkspaceOperationSpec$1 = {
1638
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
1639
+ httpMethod: "GET",
1640
+ responses: {
1641
+ 200: {
1642
+ bodyMapper: LabelResource
1643
+ },
1644
+ default: {
1645
+ bodyMapper: ErrorResponse
1646
+ }
1647
+ },
1648
+ queryParameters: [apiVersion],
1649
+ urlParameters: [
1650
+ $host,
1651
+ subscriptionId,
1652
+ resourceGroupName,
1653
+ workspaceName,
1654
+ labelName
1655
+ ],
1656
+ headerParameters: [accept],
1657
+ serializer: serializer$2
1658
+ };
1659
+ const createAndUpdateOperationSpec = {
1660
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
1661
+ httpMethod: "PUT",
1662
+ responses: {
1663
+ 200: {
1664
+ bodyMapper: LabelResource
1665
+ },
1666
+ 201: {
1667
+ bodyMapper: LabelResource
1668
+ },
1669
+ 202: {
1670
+ bodyMapper: LabelResource
1671
+ },
1672
+ 204: {
1673
+ bodyMapper: LabelResource
1674
+ },
1675
+ default: {
1676
+ bodyMapper: ErrorResponse
1677
+ }
1678
+ },
1679
+ requestBody: labelResource,
1680
+ queryParameters: [apiVersion],
1681
+ urlParameters: [
1682
+ $host,
1683
+ subscriptionId,
1684
+ resourceGroupName,
1685
+ workspaceName,
1686
+ labelName
1687
+ ],
1688
+ headerParameters: [accept, contentType],
1689
+ mediaType: "json",
1690
+ serializer: serializer$2
1691
+ };
1692
+ const updateOperationSpec = {
1693
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
1694
+ httpMethod: "PATCH",
1695
+ responses: {
1696
+ 200: {
1697
+ bodyMapper: LabelResource
1698
+ },
1699
+ default: {
1700
+ bodyMapper: ErrorResponse
1701
+ }
1702
+ },
1703
+ requestBody: labelPatchResource,
1704
+ queryParameters: [apiVersion],
1705
+ urlParameters: [
1706
+ $host,
1707
+ subscriptionId,
1708
+ resourceGroupName,
1709
+ workspaceName,
1710
+ labelName
1711
+ ],
1712
+ headerParameters: [accept, contentType],
1713
+ mediaType: "json",
1714
+ serializer: serializer$2
1715
+ };
1716
+ const deleteOperationSpec = {
1717
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/labels/{labelName}",
1718
+ httpMethod: "DELETE",
1719
+ responses: {
1720
+ 200: {},
1721
+ 201: {},
1722
+ 202: {},
1723
+ 204: {},
1724
+ default: {
1725
+ bodyMapper: ErrorResponse
1726
+ }
1727
+ },
1728
+ queryParameters: [apiVersion],
1729
+ urlParameters: [
1730
+ $host,
1731
+ subscriptionId,
1732
+ resourceGroupName,
1733
+ workspaceName,
1734
+ labelName
1735
+ ],
1736
+ headerParameters: [accept],
1737
+ serializer: serializer$2
1738
+ };
1739
+ const listByWorkspaceNextOperationSpec = {
1740
+ path: "{nextLink}",
1741
+ httpMethod: "GET",
1742
+ responses: {
1743
+ 200: {
1744
+ bodyMapper: LabelResourceList
1745
+ },
1746
+ default: {
1747
+ bodyMapper: ErrorResponse
1748
+ }
1749
+ },
1750
+ urlParameters: [
1751
+ $host,
1752
+ subscriptionId,
1753
+ resourceGroupName,
1754
+ workspaceName,
1755
+ nextLink
1756
+ ],
1757
+ headerParameters: [accept],
1758
+ serializer: serializer$2
1759
+ };
1760
+
1761
+ /*
1762
+ * Copyright (c) Microsoft Corporation.
1763
+ * Licensed under the MIT License.
1764
+ *
1765
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1766
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1767
+ */
1768
+ /** Class containing Tasks operations. */
1769
+ class TasksImpl {
1770
+ /**
1771
+ * Initialize a new instance of the class Tasks class.
1772
+ * @param client Reference to the service client
1773
+ */
1774
+ constructor(client) {
1775
+ this.client = client;
1776
+ }
1777
+ /**
1778
+ * Returns a task in the given workspace.
1779
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1780
+ * @param workspaceName The name of the Workspace.
1781
+ * @param taskId The id of the Task.
1782
+ * @param options The options parameters.
1783
+ */
1784
+ getByWorkspace(resourceGroupName, workspaceName, taskId, options) {
1785
+ return this.client.sendOperationRequest({ resourceGroupName, workspaceName, taskId, options }, getByWorkspaceOperationSpec);
1786
+ }
1787
+ }
1788
+ // Operation Specifications
1789
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1790
+ const getByWorkspaceOperationSpec = {
1791
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName}/tasks/{taskId}",
1792
+ httpMethod: "GET",
1793
+ responses: {
1794
+ 200: {
1795
+ bodyMapper: TaskResource
1796
+ },
1797
+ default: {
1798
+ bodyMapper: ErrorResponse
1799
+ }
1800
+ },
1801
+ queryParameters: [apiVersion],
1802
+ urlParameters: [
1803
+ $host,
1804
+ subscriptionId,
1805
+ resourceGroupName,
1806
+ workspaceName,
1807
+ taskId
1808
+ ],
1809
+ headerParameters: [accept],
1810
+ serializer: serializer$1
1811
+ };
1812
+
1813
+ /*
1814
+ * Copyright (c) Microsoft Corporation.
1815
+ * Licensed under the MIT License.
1816
+ *
1817
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1818
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1819
+ */
1820
+ /// <reference lib="esnext.asynciterable" />
1821
+ /** Class containing Operations operations. */
1822
+ class OperationsImpl {
1823
+ /**
1824
+ * Initialize a new instance of the class Operations class.
1825
+ * @param client Reference to the service client
1826
+ */
1827
+ constructor(client) {
1828
+ this.client = client;
1829
+ }
1830
+ /**
1831
+ * Returns list of operations.
1832
+ * @param options The options parameters.
1833
+ */
1834
+ list(options) {
1835
+ const iter = this.listPagingAll(options);
1836
+ return {
1837
+ next() {
1838
+ return iter.next();
1839
+ },
1840
+ [Symbol.asyncIterator]() {
1841
+ return this;
1842
+ },
1843
+ byPage: (settings) => {
1844
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1845
+ throw new Error("maxPageSize is not supported by this operation.");
1846
+ }
1847
+ return this.listPagingPage(options, settings);
1848
+ }
1849
+ };
1850
+ }
1851
+ listPagingPage(options, settings) {
1852
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1853
+ let result;
1854
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1855
+ if (!continuationToken) {
1856
+ result = yield tslib.__await(this._list(options));
1857
+ let page = result.value || [];
1858
+ continuationToken = result.nextLink;
1859
+ setContinuationToken(page, continuationToken);
1860
+ yield yield tslib.__await(page);
1861
+ }
1862
+ while (continuationToken) {
1863
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1864
+ continuationToken = result.nextLink;
1865
+ let page = result.value || [];
1866
+ setContinuationToken(page, continuationToken);
1867
+ yield yield tslib.__await(page);
1868
+ }
1869
+ });
1870
+ }
1871
+ listPagingAll(options) {
1872
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1873
+ var _a, e_1, _b, _c;
1874
+ try {
1875
+ for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
1876
+ _c = _f.value;
1877
+ _d = false;
1878
+ try {
1879
+ const page = _c;
1880
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1881
+ }
1882
+ finally {
1883
+ _d = true;
1884
+ }
1885
+ }
1886
+ }
1887
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1888
+ finally {
1889
+ try {
1890
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
1891
+ }
1892
+ finally { if (e_1) throw e_1.error; }
1893
+ }
1894
+ });
1895
+ }
1896
+ /**
1897
+ * Returns list of operations.
1898
+ * @param options The options parameters.
1899
+ */
1900
+ _list(options) {
1901
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1902
+ }
1903
+ /**
1904
+ * ListNext
1905
+ * @param nextLink The nextLink from the previous successful call to the List method.
1906
+ * @param options The options parameters.
1907
+ */
1908
+ _listNext(nextLink, options) {
1909
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1910
+ }
1911
+ }
1912
+ // Operation Specifications
1913
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1914
+ const listOperationSpec = {
1915
+ path: "/providers/Microsoft.Easm/operations",
1916
+ httpMethod: "GET",
1917
+ responses: {
1918
+ 200: {
1919
+ bodyMapper: OperationListResult
1920
+ },
1921
+ default: {
1922
+ bodyMapper: ErrorResponse
1923
+ }
1924
+ },
1925
+ queryParameters: [apiVersion],
1926
+ urlParameters: [$host],
1927
+ headerParameters: [accept],
1928
+ serializer
1929
+ };
1930
+ const listNextOperationSpec = {
1931
+ path: "{nextLink}",
1932
+ httpMethod: "GET",
1933
+ responses: {
1934
+ 200: {
1935
+ bodyMapper: OperationListResult
1936
+ },
1937
+ default: {
1938
+ bodyMapper: ErrorResponse
1939
+ }
1940
+ },
1941
+ urlParameters: [$host, nextLink],
1942
+ headerParameters: [accept],
1943
+ serializer
1944
+ };
1945
+
1946
+ /*
1947
+ * Copyright (c) Microsoft Corporation.
1948
+ * Licensed under the MIT License.
1949
+ *
1950
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1951
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1952
+ */
1953
+ class EasmMgmtClient extends coreClient__namespace.ServiceClient {
1954
+ /**
1955
+ * Initializes a new instance of the EasmMgmtClient class.
1956
+ * @param credentials Subscription credentials which uniquely identify client subscription.
1957
+ * @param subscriptionId The ID of the target subscription.
1958
+ * @param options The parameter options
1959
+ */
1960
+ constructor(credentials, subscriptionId, options) {
1961
+ var _a, _b, _c;
1962
+ if (credentials === undefined) {
1963
+ throw new Error("'credentials' cannot be null");
1964
+ }
1965
+ if (subscriptionId === undefined) {
1966
+ throw new Error("'subscriptionId' cannot be null");
1967
+ }
1968
+ // Initializing default values for options
1969
+ if (!options) {
1970
+ options = {};
1971
+ }
1972
+ const defaults = {
1973
+ requestContentType: "application/json; charset=utf-8",
1974
+ credential: credentials
1975
+ };
1976
+ const packageDetails = `azsdk-js-arm-defendereasm/1.0.0-beta.1`;
1977
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1978
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1979
+ : `${packageDetails}`;
1980
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1981
+ userAgentPrefix
1982
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1983
+ super(optionsWithDefaults);
1984
+ let bearerTokenAuthenticationPolicyFound = false;
1985
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1986
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1987
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1988
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1989
+ }
1990
+ if (!options ||
1991
+ !options.pipeline ||
1992
+ options.pipeline.getOrderedPolicies().length == 0 ||
1993
+ !bearerTokenAuthenticationPolicyFound) {
1994
+ this.pipeline.removePolicy({
1995
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1996
+ });
1997
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1998
+ credential: credentials,
1999
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2000
+ challengeCallbacks: {
2001
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2002
+ }
2003
+ }));
2004
+ }
2005
+ // Parameter assignments
2006
+ this.subscriptionId = subscriptionId;
2007
+ // Assigning values to Constant parameters
2008
+ this.$host = options.$host || "https://management.azure.com";
2009
+ this.apiVersion = options.apiVersion || "2023-04-01-preview";
2010
+ this.workspaces = new WorkspacesImpl(this);
2011
+ this.labels = new LabelsImpl(this);
2012
+ this.tasks = new TasksImpl(this);
2013
+ this.operations = new OperationsImpl(this);
2014
+ this.addCustomApiVersionPolicy(options.apiVersion);
2015
+ }
2016
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2017
+ addCustomApiVersionPolicy(apiVersion) {
2018
+ if (!apiVersion) {
2019
+ return;
2020
+ }
2021
+ const apiVersionPolicy = {
2022
+ name: "CustomApiVersionPolicy",
2023
+ sendRequest(request, next) {
2024
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2025
+ const param = request.url.split("?");
2026
+ if (param.length > 1) {
2027
+ const newParams = param[1].split("&").map((item) => {
2028
+ if (item.indexOf("api-version") > -1) {
2029
+ return "api-version=" + apiVersion;
2030
+ }
2031
+ else {
2032
+ return item;
2033
+ }
2034
+ });
2035
+ request.url = param[0] + "?" + newParams.join("&");
2036
+ }
2037
+ return next(request);
2038
+ });
2039
+ }
2040
+ };
2041
+ this.pipeline.addPolicy(apiVersionPolicy);
2042
+ }
2043
+ }
2044
+
2045
+ exports.EasmMgmtClient = EasmMgmtClient;
2046
+ exports.getContinuationToken = getContinuationToken;
2047
+ //# sourceMappingURL=index.js.map