@azure/arm-graphservices 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 (120) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1313 -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/accountCreateAndUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/accountCreateAndUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/accountCreateAndUpdateSample.js +43 -0
  11. package/dist-esm/samples-dev/accountCreateAndUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/accountDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/accountDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/accountDeleteSample.js +39 -0
  15. package/dist-esm/samples-dev/accountDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/accountGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/accountGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/accountGetSample.js +39 -0
  19. package/dist-esm/samples-dev/accountGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/accountUpdateSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/accountUpdateSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/accountUpdateSample.js +42 -0
  23. package/dist-esm/samples-dev/accountUpdateSample.js.map +1 -0
  24. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +52 -0
  27. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -0
  28. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +51 -0
  31. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -0
  32. package/dist-esm/samples-dev/operationListSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/operationListSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/operationListSample.js +51 -0
  35. package/dist-esm/samples-dev/operationListSample.js.map +1 -0
  36. package/dist-esm/src/graphServices.d.ts +22 -0
  37. package/dist-esm/src/graphServices.d.ts.map +1 -0
  38. package/dist-esm/src/graphServices.js +102 -0
  39. package/dist-esm/src/graphServices.js.map +1 -0
  40. package/dist-esm/src/index.d.ts +6 -0
  41. package/dist-esm/src/index.d.ts.map +1 -0
  42. package/dist-esm/src/index.js +13 -0
  43. package/dist-esm/src/index.js.map +1 -0
  44. package/dist-esm/src/lroImpl.d.ts +11 -0
  45. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  46. package/dist-esm/src/lroImpl.js +21 -0
  47. package/dist-esm/src/lroImpl.js.map +1 -0
  48. package/dist-esm/src/models/index.d.ts +320 -0
  49. package/dist-esm/src/models/index.d.ts.map +1 -0
  50. package/dist-esm/src/models/index.js +46 -0
  51. package/dist-esm/src/models/index.js.map +1 -0
  52. package/dist-esm/src/models/mappers.d.ts +15 -0
  53. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  54. package/dist-esm/src/models/mappers.js +384 -0
  55. package/dist-esm/src/models/mappers.js.map +1 -0
  56. package/dist-esm/src/models/parameters.d.ts +12 -0
  57. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  58. package/dist-esm/src/models/parameters.js +109 -0
  59. package/dist-esm/src/models/parameters.js.map +1 -0
  60. package/dist-esm/src/operations/account.d.ts +52 -0
  61. package/dist-esm/src/operations/account.d.ts.map +1 -0
  62. package/dist-esm/src/operations/account.js +208 -0
  63. package/dist-esm/src/operations/account.js.map +1 -0
  64. package/dist-esm/src/operations/accounts.d.ts +53 -0
  65. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  66. package/dist-esm/src/operations/accounts.js +252 -0
  67. package/dist-esm/src/operations/accounts.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +4 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +11 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operationOperations.d.ts +32 -0
  73. package/dist-esm/src/operations/operationOperations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operationOperations.js +131 -0
  75. package/dist-esm/src/operations/operationOperations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/account.d.ts +44 -0
  77. package/dist-esm/src/operationsInterfaces/account.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/account.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/account.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/accounts.d.ts +17 -0
  81. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  85. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  87. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/operationOperations.d.ts +11 -0
  89. package/dist-esm/src/operationsInterfaces/operationOperations.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/operationOperations.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/operationOperations.js.map +1 -0
  92. package/dist-esm/src/pagingHelper.d.ts +13 -0
  93. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  94. package/dist-esm/src/pagingHelper.js +32 -0
  95. package/dist-esm/src/pagingHelper.js.map +1 -0
  96. package/dist-esm/test/graphservices_operations_test.spec.d.ts +4 -0
  97. package/dist-esm/test/graphservices_operations_test.spec.d.ts.map +1 -0
  98. package/dist-esm/test/graphservices_operations_test.spec.js +55 -0
  99. package/dist-esm/test/graphservices_operations_test.spec.js.map +1 -0
  100. package/package.json +123 -0
  101. package/review/arm-graphservices.api.md +262 -0
  102. package/rollup.config.js +122 -0
  103. package/src/graphServices.ts +148 -0
  104. package/src/index.ts +13 -0
  105. package/src/lroImpl.ts +42 -0
  106. package/src/models/index.ts +364 -0
  107. package/src/models/mappers.ts +408 -0
  108. package/src/models/parameters.ts +127 -0
  109. package/src/operations/account.ts +295 -0
  110. package/src/operations/accounts.ts +303 -0
  111. package/src/operations/index.ts +11 -0
  112. package/src/operations/operationOperations.ts +149 -0
  113. package/src/operationsInterfaces/account.ts +90 -0
  114. package/src/operationsInterfaces/accounts.ts +35 -0
  115. package/src/operationsInterfaces/index.ts +11 -0
  116. package/src/operationsInterfaces/operationOperations.ts +22 -0
  117. package/src/pagingHelper.ts +39 -0
  118. package/tsconfig.json +33 -0
  119. package/types/arm-graphservices.d.ts +459 -0
  120. package/types/tsdoc-metadata.json +11 -0
package/dist/index.js ADDED
@@ -0,0 +1,1313 @@
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 CreatedByType} that the service accepts. */
71
+ exports.KnownCreatedByType = void 0;
72
+ (function (KnownCreatedByType) {
73
+ /** User */
74
+ KnownCreatedByType["User"] = "User";
75
+ /** Application */
76
+ KnownCreatedByType["Application"] = "Application";
77
+ /** ManagedIdentity */
78
+ KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
79
+ /** Key */
80
+ KnownCreatedByType["Key"] = "Key";
81
+ })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
82
+ /** Known values of {@link ProvisioningState} that the service accepts. */
83
+ exports.KnownProvisioningState = void 0;
84
+ (function (KnownProvisioningState) {
85
+ /** Succeeded */
86
+ KnownProvisioningState["Succeeded"] = "Succeeded";
87
+ /** Failed */
88
+ KnownProvisioningState["Failed"] = "Failed";
89
+ /** Canceled */
90
+ KnownProvisioningState["Canceled"] = "Canceled";
91
+ })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
92
+ /** Known values of {@link Origin} that the service accepts. */
93
+ exports.KnownOrigin = void 0;
94
+ (function (KnownOrigin) {
95
+ /** User */
96
+ KnownOrigin["User"] = "user";
97
+ /** System */
98
+ KnownOrigin["System"] = "system";
99
+ /** UserSystem */
100
+ KnownOrigin["UserSystem"] = "user,system";
101
+ })(exports.KnownOrigin || (exports.KnownOrigin = {}));
102
+ /** Known values of {@link ActionType} that the service accepts. */
103
+ exports.KnownActionType = void 0;
104
+ (function (KnownActionType) {
105
+ /** Internal */
106
+ KnownActionType["Internal"] = "Internal";
107
+ })(exports.KnownActionType || (exports.KnownActionType = {}));
108
+
109
+ /*
110
+ * Copyright (c) Microsoft Corporation.
111
+ * Licensed under the MIT License.
112
+ *
113
+ * Code generated by Microsoft (R) AutoRest Code Generator.
114
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
115
+ */
116
+ const AccountResourceList = {
117
+ type: {
118
+ name: "Composite",
119
+ className: "AccountResourceList",
120
+ modelProperties: {
121
+ nextLink: {
122
+ serializedName: "nextLink",
123
+ type: {
124
+ name: "String"
125
+ }
126
+ },
127
+ value: {
128
+ serializedName: "value",
129
+ type: {
130
+ name: "Sequence",
131
+ element: {
132
+ type: {
133
+ name: "Composite",
134
+ className: "AccountResource"
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ };
142
+ const AccountResourceSystemData = {
143
+ type: {
144
+ name: "Composite",
145
+ className: "AccountResourceSystemData",
146
+ modelProperties: {
147
+ createdByType: {
148
+ serializedName: "createdByType",
149
+ type: {
150
+ name: "String"
151
+ }
152
+ },
153
+ createdAt: {
154
+ serializedName: "createdAt",
155
+ type: {
156
+ name: "DateTime"
157
+ }
158
+ },
159
+ lastModifiedByType: {
160
+ serializedName: "lastModifiedByType",
161
+ type: {
162
+ name: "String"
163
+ }
164
+ },
165
+ lastModifiedAt: {
166
+ serializedName: "lastModifiedAt",
167
+ type: {
168
+ name: "DateTime"
169
+ }
170
+ }
171
+ }
172
+ }
173
+ };
174
+ const AccountResourceProperties = {
175
+ type: {
176
+ name: "Composite",
177
+ className: "AccountResourceProperties",
178
+ modelProperties: {
179
+ provisioningState: {
180
+ serializedName: "provisioningState",
181
+ readOnly: true,
182
+ type: {
183
+ name: "String"
184
+ }
185
+ },
186
+ appId: {
187
+ constraints: {
188
+ Pattern: new RegExp("(^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}?)$")
189
+ },
190
+ serializedName: "appId",
191
+ required: true,
192
+ type: {
193
+ name: "String"
194
+ }
195
+ },
196
+ billingPlanId: {
197
+ constraints: {
198
+ Pattern: new RegExp("(^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}?)$")
199
+ },
200
+ serializedName: "billingPlanId",
201
+ readOnly: true,
202
+ type: {
203
+ name: "String"
204
+ }
205
+ }
206
+ }
207
+ }
208
+ };
209
+ const Resource = {
210
+ type: {
211
+ name: "Composite",
212
+ className: "Resource",
213
+ modelProperties: {
214
+ id: {
215
+ serializedName: "id",
216
+ readOnly: true,
217
+ type: {
218
+ name: "String"
219
+ }
220
+ },
221
+ name: {
222
+ serializedName: "name",
223
+ readOnly: true,
224
+ type: {
225
+ name: "String"
226
+ }
227
+ },
228
+ type: {
229
+ serializedName: "type",
230
+ readOnly: true,
231
+ type: {
232
+ name: "String"
233
+ }
234
+ },
235
+ location: {
236
+ serializedName: "location",
237
+ type: {
238
+ name: "String"
239
+ }
240
+ },
241
+ tags: {
242
+ serializedName: "tags",
243
+ type: {
244
+ name: "Dictionary",
245
+ value: { type: { name: "String" } }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ };
251
+ const ErrorResponse = {
252
+ type: {
253
+ name: "Composite",
254
+ className: "ErrorResponse",
255
+ modelProperties: {
256
+ error: {
257
+ serializedName: "error",
258
+ type: {
259
+ name: "Composite",
260
+ className: "ErrorDetail"
261
+ }
262
+ }
263
+ }
264
+ }
265
+ };
266
+ const ErrorDetail = {
267
+ type: {
268
+ name: "Composite",
269
+ className: "ErrorDetail",
270
+ modelProperties: {
271
+ code: {
272
+ serializedName: "code",
273
+ readOnly: true,
274
+ type: {
275
+ name: "String"
276
+ }
277
+ },
278
+ message: {
279
+ serializedName: "message",
280
+ readOnly: true,
281
+ type: {
282
+ name: "String"
283
+ }
284
+ },
285
+ target: {
286
+ serializedName: "target",
287
+ readOnly: true,
288
+ type: {
289
+ name: "String"
290
+ }
291
+ },
292
+ details: {
293
+ serializedName: "details",
294
+ readOnly: true,
295
+ type: {
296
+ name: "Sequence",
297
+ element: {
298
+ type: {
299
+ name: "Composite",
300
+ className: "ErrorDetail"
301
+ }
302
+ }
303
+ }
304
+ },
305
+ additionalInfo: {
306
+ serializedName: "additionalInfo",
307
+ readOnly: true,
308
+ type: {
309
+ name: "Sequence",
310
+ element: {
311
+ type: {
312
+ name: "Composite",
313
+ className: "ErrorAdditionalInfo"
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
319
+ }
320
+ };
321
+ const ErrorAdditionalInfo = {
322
+ type: {
323
+ name: "Composite",
324
+ className: "ErrorAdditionalInfo",
325
+ modelProperties: {
326
+ type: {
327
+ serializedName: "type",
328
+ readOnly: true,
329
+ type: {
330
+ name: "String"
331
+ }
332
+ },
333
+ info: {
334
+ serializedName: "info",
335
+ readOnly: true,
336
+ type: {
337
+ name: "Dictionary",
338
+ value: { type: { name: "any" } }
339
+ }
340
+ }
341
+ }
342
+ }
343
+ };
344
+ const TagUpdate = {
345
+ type: {
346
+ name: "Composite",
347
+ className: "TagUpdate",
348
+ modelProperties: {
349
+ tags: {
350
+ serializedName: "tags",
351
+ type: {
352
+ name: "Dictionary",
353
+ value: { type: { name: "String" } }
354
+ }
355
+ }
356
+ }
357
+ }
358
+ };
359
+ const OperationListResult = {
360
+ type: {
361
+ name: "Composite",
362
+ className: "OperationListResult",
363
+ modelProperties: {
364
+ value: {
365
+ serializedName: "value",
366
+ readOnly: true,
367
+ type: {
368
+ name: "Sequence",
369
+ element: {
370
+ type: {
371
+ name: "Composite",
372
+ className: "Operation"
373
+ }
374
+ }
375
+ }
376
+ },
377
+ nextLink: {
378
+ serializedName: "nextLink",
379
+ readOnly: true,
380
+ type: {
381
+ name: "String"
382
+ }
383
+ }
384
+ }
385
+ }
386
+ };
387
+ const Operation = {
388
+ type: {
389
+ name: "Composite",
390
+ className: "Operation",
391
+ modelProperties: {
392
+ name: {
393
+ serializedName: "name",
394
+ readOnly: true,
395
+ type: {
396
+ name: "String"
397
+ }
398
+ },
399
+ isDataAction: {
400
+ serializedName: "isDataAction",
401
+ readOnly: true,
402
+ type: {
403
+ name: "Boolean"
404
+ }
405
+ },
406
+ display: {
407
+ serializedName: "display",
408
+ type: {
409
+ name: "Composite",
410
+ className: "OperationDisplay"
411
+ }
412
+ },
413
+ origin: {
414
+ serializedName: "origin",
415
+ readOnly: true,
416
+ type: {
417
+ name: "String"
418
+ }
419
+ },
420
+ actionType: {
421
+ serializedName: "actionType",
422
+ readOnly: true,
423
+ type: {
424
+ name: "String"
425
+ }
426
+ }
427
+ }
428
+ }
429
+ };
430
+ const OperationDisplay = {
431
+ type: {
432
+ name: "Composite",
433
+ className: "OperationDisplay",
434
+ modelProperties: {
435
+ provider: {
436
+ serializedName: "provider",
437
+ readOnly: true,
438
+ type: {
439
+ name: "String"
440
+ }
441
+ },
442
+ resource: {
443
+ serializedName: "resource",
444
+ readOnly: true,
445
+ type: {
446
+ name: "String"
447
+ }
448
+ },
449
+ operation: {
450
+ serializedName: "operation",
451
+ readOnly: true,
452
+ type: {
453
+ name: "String"
454
+ }
455
+ },
456
+ description: {
457
+ serializedName: "description",
458
+ readOnly: true,
459
+ type: {
460
+ name: "String"
461
+ }
462
+ }
463
+ }
464
+ }
465
+ };
466
+ const AccountResource = {
467
+ type: {
468
+ name: "Composite",
469
+ className: "AccountResource",
470
+ modelProperties: Object.assign(Object.assign({}, Resource.type.modelProperties), { systemData: {
471
+ serializedName: "systemData",
472
+ type: {
473
+ name: "Composite",
474
+ className: "AccountResourceSystemData"
475
+ }
476
+ }, properties: {
477
+ serializedName: "properties",
478
+ type: {
479
+ name: "Composite",
480
+ className: "AccountResourceProperties"
481
+ }
482
+ } })
483
+ }
484
+ };
485
+ const AccountPatchResource = {
486
+ type: {
487
+ name: "Composite",
488
+ className: "AccountPatchResource",
489
+ modelProperties: Object.assign({}, TagUpdate.type.modelProperties)
490
+ }
491
+ };
492
+
493
+ var Mappers = /*#__PURE__*/Object.freeze({
494
+ __proto__: null,
495
+ AccountResourceList: AccountResourceList,
496
+ AccountResourceSystemData: AccountResourceSystemData,
497
+ AccountResourceProperties: AccountResourceProperties,
498
+ Resource: Resource,
499
+ ErrorResponse: ErrorResponse,
500
+ ErrorDetail: ErrorDetail,
501
+ ErrorAdditionalInfo: ErrorAdditionalInfo,
502
+ TagUpdate: TagUpdate,
503
+ OperationListResult: OperationListResult,
504
+ Operation: Operation,
505
+ OperationDisplay: OperationDisplay,
506
+ AccountResource: AccountResource,
507
+ AccountPatchResource: AccountPatchResource
508
+ });
509
+
510
+ /*
511
+ * Copyright (c) Microsoft Corporation.
512
+ * Licensed under the MIT License.
513
+ *
514
+ * Code generated by Microsoft (R) AutoRest Code Generator.
515
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
516
+ */
517
+ const accept = {
518
+ parameterPath: "accept",
519
+ mapper: {
520
+ defaultValue: "application/json",
521
+ isConstant: true,
522
+ serializedName: "Accept",
523
+ type: {
524
+ name: "String"
525
+ }
526
+ }
527
+ };
528
+ const $host = {
529
+ parameterPath: "$host",
530
+ mapper: {
531
+ serializedName: "$host",
532
+ required: true,
533
+ type: {
534
+ name: "String"
535
+ }
536
+ },
537
+ skipEncoding: true
538
+ };
539
+ const apiVersion = {
540
+ parameterPath: "apiVersion",
541
+ mapper: {
542
+ defaultValue: "2022-09-22-preview",
543
+ isConstant: true,
544
+ serializedName: "api-version",
545
+ type: {
546
+ name: "String"
547
+ }
548
+ }
549
+ };
550
+ const subscriptionId = {
551
+ parameterPath: "subscriptionId",
552
+ mapper: {
553
+ constraints: {
554
+ MinLength: 1
555
+ },
556
+ serializedName: "subscriptionId",
557
+ required: true,
558
+ type: {
559
+ name: "String"
560
+ }
561
+ }
562
+ };
563
+ const resourceGroupName = {
564
+ parameterPath: "resourceGroupName",
565
+ mapper: {
566
+ constraints: {
567
+ MaxLength: 90,
568
+ MinLength: 1
569
+ },
570
+ serializedName: "resourceGroupName",
571
+ required: true,
572
+ type: {
573
+ name: "String"
574
+ }
575
+ }
576
+ };
577
+ const nextLink = {
578
+ parameterPath: "nextLink",
579
+ mapper: {
580
+ serializedName: "nextLink",
581
+ required: true,
582
+ type: {
583
+ name: "String"
584
+ }
585
+ },
586
+ skipEncoding: true
587
+ };
588
+ const resourceName = {
589
+ parameterPath: "resourceName",
590
+ mapper: {
591
+ serializedName: "resourceName",
592
+ required: true,
593
+ type: {
594
+ name: "String"
595
+ }
596
+ }
597
+ };
598
+ const contentType = {
599
+ parameterPath: ["options", "contentType"],
600
+ mapper: {
601
+ defaultValue: "application/json",
602
+ isConstant: true,
603
+ serializedName: "Content-Type",
604
+ type: {
605
+ name: "String"
606
+ }
607
+ }
608
+ };
609
+ const accountResource = {
610
+ parameterPath: "accountResource",
611
+ mapper: AccountResource
612
+ };
613
+ const accountResource1 = {
614
+ parameterPath: "accountResource",
615
+ mapper: AccountPatchResource
616
+ };
617
+
618
+ /*
619
+ * Copyright (c) Microsoft Corporation.
620
+ * Licensed under the MIT License.
621
+ *
622
+ * Code generated by Microsoft (R) AutoRest Code Generator.
623
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
624
+ */
625
+ /// <reference lib="esnext.asynciterable" />
626
+ /** Class containing Accounts operations. */
627
+ class AccountsImpl {
628
+ /**
629
+ * Initialize a new instance of the class Accounts class.
630
+ * @param client Reference to the service client
631
+ */
632
+ constructor(client) {
633
+ this.client = client;
634
+ }
635
+ /**
636
+ * Returns list of accounts apps.
637
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
638
+ * @param options The options parameters.
639
+ */
640
+ listByResourceGroup(resourceGroupName, options) {
641
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
642
+ return {
643
+ next() {
644
+ return iter.next();
645
+ },
646
+ [Symbol.asyncIterator]() {
647
+ return this;
648
+ },
649
+ byPage: (settings) => {
650
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
651
+ throw new Error("maxPageSize is not supported by this operation.");
652
+ }
653
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
654
+ }
655
+ };
656
+ }
657
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
658
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
659
+ let result;
660
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
661
+ if (!continuationToken) {
662
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
663
+ let page = result.value || [];
664
+ continuationToken = result.nextLink;
665
+ setContinuationToken(page, continuationToken);
666
+ yield yield tslib.__await(page);
667
+ }
668
+ while (continuationToken) {
669
+ result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
670
+ continuationToken = result.nextLink;
671
+ let page = result.value || [];
672
+ setContinuationToken(page, continuationToken);
673
+ yield yield tslib.__await(page);
674
+ }
675
+ });
676
+ }
677
+ listByResourceGroupPagingAll(resourceGroupName, options) {
678
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
679
+ var e_1, _a;
680
+ try {
681
+ for (var _b = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
682
+ const page = _c.value;
683
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
684
+ }
685
+ }
686
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
687
+ finally {
688
+ try {
689
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
690
+ }
691
+ finally { if (e_1) throw e_1.error; }
692
+ }
693
+ });
694
+ }
695
+ /**
696
+ * Returns list of accounts belonging to a subscription.
697
+ * @param options The options parameters.
698
+ */
699
+ listBySubscription(options) {
700
+ const iter = this.listBySubscriptionPagingAll(options);
701
+ return {
702
+ next() {
703
+ return iter.next();
704
+ },
705
+ [Symbol.asyncIterator]() {
706
+ return this;
707
+ },
708
+ byPage: (settings) => {
709
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
710
+ throw new Error("maxPageSize is not supported by this operation.");
711
+ }
712
+ return this.listBySubscriptionPagingPage(options, settings);
713
+ }
714
+ };
715
+ }
716
+ listBySubscriptionPagingPage(options, settings) {
717
+ return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
718
+ let result;
719
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
720
+ if (!continuationToken) {
721
+ result = yield tslib.__await(this._listBySubscription(options));
722
+ let page = result.value || [];
723
+ continuationToken = result.nextLink;
724
+ setContinuationToken(page, continuationToken);
725
+ yield yield tslib.__await(page);
726
+ }
727
+ while (continuationToken) {
728
+ result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
729
+ continuationToken = result.nextLink;
730
+ let page = result.value || [];
731
+ setContinuationToken(page, continuationToken);
732
+ yield yield tslib.__await(page);
733
+ }
734
+ });
735
+ }
736
+ listBySubscriptionPagingAll(options) {
737
+ return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
738
+ var e_2, _a;
739
+ try {
740
+ for (var _b = tslib.__asyncValues(this.listBySubscriptionPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
741
+ const page = _c.value;
742
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
743
+ }
744
+ }
745
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
746
+ finally {
747
+ try {
748
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
749
+ }
750
+ finally { if (e_2) throw e_2.error; }
751
+ }
752
+ });
753
+ }
754
+ /**
755
+ * Returns list of accounts apps.
756
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
757
+ * @param options The options parameters.
758
+ */
759
+ _listByResourceGroup(resourceGroupName, options) {
760
+ return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
761
+ }
762
+ /**
763
+ * Returns list of accounts belonging to a subscription.
764
+ * @param options The options parameters.
765
+ */
766
+ _listBySubscription(options) {
767
+ return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
768
+ }
769
+ /**
770
+ * ListByResourceGroupNext
771
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
772
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
773
+ * @param options The options parameters.
774
+ */
775
+ _listByResourceGroupNext(resourceGroupName, nextLink, options) {
776
+ return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec);
777
+ }
778
+ /**
779
+ * ListBySubscriptionNext
780
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
781
+ * @param options The options parameters.
782
+ */
783
+ _listBySubscriptionNext(nextLink, options) {
784
+ return this.client.sendOperationRequest({ nextLink, options }, listBySubscriptionNextOperationSpec);
785
+ }
786
+ }
787
+ // Operation Specifications
788
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
789
+ const listByResourceGroupOperationSpec = {
790
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts",
791
+ httpMethod: "GET",
792
+ responses: {
793
+ 200: {
794
+ bodyMapper: AccountResourceList
795
+ },
796
+ default: {
797
+ bodyMapper: ErrorResponse
798
+ }
799
+ },
800
+ queryParameters: [apiVersion],
801
+ urlParameters: [
802
+ $host,
803
+ subscriptionId,
804
+ resourceGroupName
805
+ ],
806
+ headerParameters: [accept],
807
+ serializer: serializer$2
808
+ };
809
+ const listBySubscriptionOperationSpec = {
810
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.GraphServices/accounts",
811
+ httpMethod: "GET",
812
+ responses: {
813
+ 200: {
814
+ bodyMapper: AccountResourceList
815
+ },
816
+ default: {
817
+ bodyMapper: ErrorResponse
818
+ }
819
+ },
820
+ queryParameters: [apiVersion],
821
+ urlParameters: [$host, subscriptionId],
822
+ headerParameters: [accept],
823
+ serializer: serializer$2
824
+ };
825
+ const listByResourceGroupNextOperationSpec = {
826
+ path: "{nextLink}",
827
+ httpMethod: "GET",
828
+ responses: {
829
+ 200: {
830
+ bodyMapper: AccountResourceList
831
+ },
832
+ default: {
833
+ bodyMapper: ErrorResponse
834
+ }
835
+ },
836
+ urlParameters: [
837
+ $host,
838
+ subscriptionId,
839
+ resourceGroupName,
840
+ nextLink
841
+ ],
842
+ headerParameters: [accept],
843
+ serializer: serializer$2
844
+ };
845
+ const listBySubscriptionNextOperationSpec = {
846
+ path: "{nextLink}",
847
+ httpMethod: "GET",
848
+ responses: {
849
+ 200: {
850
+ bodyMapper: AccountResourceList
851
+ },
852
+ default: {
853
+ bodyMapper: ErrorResponse
854
+ }
855
+ },
856
+ urlParameters: [
857
+ $host,
858
+ subscriptionId,
859
+ nextLink
860
+ ],
861
+ headerParameters: [accept],
862
+ serializer: serializer$2
863
+ };
864
+
865
+ /*
866
+ * Copyright (c) Microsoft Corporation.
867
+ * Licensed under the MIT License.
868
+ *
869
+ * Code generated by Microsoft (R) AutoRest Code Generator.
870
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
871
+ */
872
+ function createLroSpec(inputs) {
873
+ const { args, spec, sendOperationFn } = inputs;
874
+ return {
875
+ requestMethod: spec.httpMethod,
876
+ requestPath: spec.path,
877
+ sendInitialRequest: () => sendOperationFn(args, spec),
878
+ sendPollRequest: (path, options) => {
879
+ const restSpec = tslib.__rest(spec, ["requestBody"]);
880
+ return sendOperationFn(args, Object.assign(Object.assign({}, restSpec), { httpMethod: "GET", path, abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }));
881
+ }
882
+ };
883
+ }
884
+
885
+ /*
886
+ * Copyright (c) Microsoft Corporation.
887
+ * Licensed under the MIT License.
888
+ *
889
+ * Code generated by Microsoft (R) AutoRest Code Generator.
890
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
891
+ */
892
+ /** Class containing Account operations. */
893
+ class AccountImpl {
894
+ /**
895
+ * Initialize a new instance of the class Account class.
896
+ * @param client Reference to the service client
897
+ */
898
+ constructor(client) {
899
+ this.client = client;
900
+ }
901
+ /**
902
+ * Returns account resource for a given name.
903
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
904
+ * @param resourceName The name of the resource.
905
+ * @param options The options parameters.
906
+ */
907
+ get(resourceGroupName, resourceName, options) {
908
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, getOperationSpec);
909
+ }
910
+ /**
911
+ * Create or update account resource.
912
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
913
+ * @param resourceName The name of the resource.
914
+ * @param accountResource Account details.
915
+ * @param options The options parameters.
916
+ */
917
+ beginCreateAndUpdate(resourceGroupName, resourceName, accountResource, options) {
918
+ return tslib.__awaiter(this, void 0, void 0, function* () {
919
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
920
+ return this.client.sendOperationRequest(args, spec);
921
+ });
922
+ const sendOperationFn = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
923
+ var _a;
924
+ let currentRawResponse = undefined;
925
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
926
+ const callback = (rawResponse, flatResponse) => {
927
+ currentRawResponse = rawResponse;
928
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
929
+ };
930
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
931
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
932
+ return {
933
+ flatResponse,
934
+ rawResponse: {
935
+ statusCode: currentRawResponse.status,
936
+ body: currentRawResponse.parsedBody,
937
+ headers: currentRawResponse.headers.toJSON()
938
+ }
939
+ };
940
+ });
941
+ const lro = createLroSpec({
942
+ sendOperationFn,
943
+ args: { resourceGroupName, resourceName, accountResource, options },
944
+ spec: createAndUpdateOperationSpec
945
+ });
946
+ const poller = yield coreLro.createHttpPoller(lro, {
947
+ restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
948
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
949
+ resourceLocationConfig: "azure-async-operation"
950
+ });
951
+ yield poller.poll();
952
+ return poller;
953
+ });
954
+ }
955
+ /**
956
+ * Create or update account resource.
957
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
958
+ * @param resourceName The name of the resource.
959
+ * @param accountResource Account details.
960
+ * @param options The options parameters.
961
+ */
962
+ beginCreateAndUpdateAndWait(resourceGroupName, resourceName, accountResource, options) {
963
+ return tslib.__awaiter(this, void 0, void 0, function* () {
964
+ const poller = yield this.beginCreateAndUpdate(resourceGroupName, resourceName, accountResource, options);
965
+ return poller.pollUntilDone();
966
+ });
967
+ }
968
+ /**
969
+ * Update account details.
970
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
971
+ * @param resourceName The name of the resource.
972
+ * @param accountResource Account patch details.
973
+ * @param options The options parameters.
974
+ */
975
+ update(resourceGroupName, resourceName, accountResource, options) {
976
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, accountResource, options }, updateOperationSpec);
977
+ }
978
+ /**
979
+ * Deletes a account resource.
980
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
981
+ * @param resourceName The name of the resource.
982
+ * @param options The options parameters.
983
+ */
984
+ delete(resourceGroupName, resourceName, options) {
985
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, deleteOperationSpec);
986
+ }
987
+ }
988
+ // Operation Specifications
989
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
990
+ const getOperationSpec = {
991
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
992
+ httpMethod: "GET",
993
+ responses: {
994
+ 200: {
995
+ bodyMapper: AccountResource
996
+ },
997
+ default: {
998
+ bodyMapper: ErrorResponse
999
+ }
1000
+ },
1001
+ queryParameters: [apiVersion],
1002
+ urlParameters: [
1003
+ $host,
1004
+ subscriptionId,
1005
+ resourceGroupName,
1006
+ resourceName
1007
+ ],
1008
+ headerParameters: [accept],
1009
+ serializer: serializer$1
1010
+ };
1011
+ const createAndUpdateOperationSpec = {
1012
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
1013
+ httpMethod: "PUT",
1014
+ responses: {
1015
+ 200: {
1016
+ bodyMapper: AccountResource
1017
+ },
1018
+ 201: {
1019
+ bodyMapper: AccountResource
1020
+ },
1021
+ 202: {
1022
+ bodyMapper: AccountResource
1023
+ },
1024
+ 204: {
1025
+ bodyMapper: AccountResource
1026
+ },
1027
+ default: {
1028
+ bodyMapper: ErrorResponse
1029
+ }
1030
+ },
1031
+ requestBody: accountResource,
1032
+ queryParameters: [apiVersion],
1033
+ urlParameters: [
1034
+ $host,
1035
+ subscriptionId,
1036
+ resourceGroupName,
1037
+ resourceName
1038
+ ],
1039
+ headerParameters: [accept, contentType],
1040
+ mediaType: "json",
1041
+ serializer: serializer$1
1042
+ };
1043
+ const updateOperationSpec = {
1044
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
1045
+ httpMethod: "PATCH",
1046
+ responses: {
1047
+ 200: {
1048
+ bodyMapper: AccountResource
1049
+ },
1050
+ default: {
1051
+ bodyMapper: ErrorResponse
1052
+ }
1053
+ },
1054
+ requestBody: accountResource1,
1055
+ queryParameters: [apiVersion],
1056
+ urlParameters: [
1057
+ $host,
1058
+ subscriptionId,
1059
+ resourceGroupName,
1060
+ resourceName
1061
+ ],
1062
+ headerParameters: [accept, contentType],
1063
+ mediaType: "json",
1064
+ serializer: serializer$1
1065
+ };
1066
+ const deleteOperationSpec = {
1067
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName}",
1068
+ httpMethod: "DELETE",
1069
+ responses: {
1070
+ 200: {},
1071
+ 204: {},
1072
+ default: {
1073
+ bodyMapper: ErrorResponse
1074
+ }
1075
+ },
1076
+ queryParameters: [apiVersion],
1077
+ urlParameters: [
1078
+ $host,
1079
+ subscriptionId,
1080
+ resourceGroupName,
1081
+ resourceName
1082
+ ],
1083
+ headerParameters: [accept],
1084
+ serializer: serializer$1
1085
+ };
1086
+
1087
+ /*
1088
+ * Copyright (c) Microsoft Corporation.
1089
+ * Licensed under the MIT License.
1090
+ *
1091
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1092
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1093
+ */
1094
+ /// <reference lib="esnext.asynciterable" />
1095
+ /** Class containing OperationOperations operations. */
1096
+ class OperationOperationsImpl {
1097
+ /**
1098
+ * Initialize a new instance of the class OperationOperations class.
1099
+ * @param client Reference to the service client
1100
+ */
1101
+ constructor(client) {
1102
+ this.client = client;
1103
+ }
1104
+ /**
1105
+ * Returns list of operations.
1106
+ * @param options The options parameters.
1107
+ */
1108
+ list(options) {
1109
+ const iter = this.listPagingAll(options);
1110
+ return {
1111
+ next() {
1112
+ return iter.next();
1113
+ },
1114
+ [Symbol.asyncIterator]() {
1115
+ return this;
1116
+ },
1117
+ byPage: (settings) => {
1118
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1119
+ throw new Error("maxPageSize is not supported by this operation.");
1120
+ }
1121
+ return this.listPagingPage(options, settings);
1122
+ }
1123
+ };
1124
+ }
1125
+ listPagingPage(options, settings) {
1126
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1127
+ let result;
1128
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1129
+ if (!continuationToken) {
1130
+ result = yield tslib.__await(this._list(options));
1131
+ let page = result.value || [];
1132
+ continuationToken = result.nextLink;
1133
+ setContinuationToken(page, continuationToken);
1134
+ yield yield tslib.__await(page);
1135
+ }
1136
+ while (continuationToken) {
1137
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1138
+ continuationToken = result.nextLink;
1139
+ let page = result.value || [];
1140
+ setContinuationToken(page, continuationToken);
1141
+ yield yield tslib.__await(page);
1142
+ }
1143
+ });
1144
+ }
1145
+ listPagingAll(options) {
1146
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1147
+ var e_1, _a;
1148
+ try {
1149
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1150
+ const page = _c.value;
1151
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1152
+ }
1153
+ }
1154
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1155
+ finally {
1156
+ try {
1157
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1158
+ }
1159
+ finally { if (e_1) throw e_1.error; }
1160
+ }
1161
+ });
1162
+ }
1163
+ /**
1164
+ * Returns list of operations.
1165
+ * @param options The options parameters.
1166
+ */
1167
+ _list(options) {
1168
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1169
+ }
1170
+ /**
1171
+ * ListNext
1172
+ * @param nextLink The nextLink from the previous successful call to the List method.
1173
+ * @param options The options parameters.
1174
+ */
1175
+ _listNext(nextLink, options) {
1176
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1177
+ }
1178
+ }
1179
+ // Operation Specifications
1180
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1181
+ const listOperationSpec = {
1182
+ path: "/providers/Microsoft.GraphServices/operations",
1183
+ httpMethod: "GET",
1184
+ responses: {
1185
+ 200: {
1186
+ bodyMapper: OperationListResult
1187
+ },
1188
+ default: {
1189
+ bodyMapper: ErrorResponse
1190
+ }
1191
+ },
1192
+ queryParameters: [apiVersion],
1193
+ urlParameters: [$host],
1194
+ headerParameters: [accept],
1195
+ serializer
1196
+ };
1197
+ const listNextOperationSpec = {
1198
+ path: "{nextLink}",
1199
+ httpMethod: "GET",
1200
+ responses: {
1201
+ 200: {
1202
+ bodyMapper: OperationListResult
1203
+ },
1204
+ default: {
1205
+ bodyMapper: ErrorResponse
1206
+ }
1207
+ },
1208
+ urlParameters: [$host, nextLink],
1209
+ headerParameters: [accept],
1210
+ serializer
1211
+ };
1212
+
1213
+ /*
1214
+ * Copyright (c) Microsoft Corporation.
1215
+ * Licensed under the MIT License.
1216
+ *
1217
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1218
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1219
+ */
1220
+ class GraphServices extends coreClient__namespace.ServiceClient {
1221
+ /**
1222
+ * Initializes a new instance of the GraphServices class.
1223
+ * @param credentials Subscription credentials which uniquely identify client subscription.
1224
+ * @param subscriptionId The ID of the target subscription.
1225
+ * @param options The parameter options
1226
+ */
1227
+ constructor(credentials, subscriptionId, options) {
1228
+ var _a, _b, _c;
1229
+ if (credentials === undefined) {
1230
+ throw new Error("'credentials' cannot be null");
1231
+ }
1232
+ if (subscriptionId === undefined) {
1233
+ throw new Error("'subscriptionId' cannot be null");
1234
+ }
1235
+ // Initializing default values for options
1236
+ if (!options) {
1237
+ options = {};
1238
+ }
1239
+ const defaults = {
1240
+ requestContentType: "application/json; charset=utf-8",
1241
+ credential: credentials
1242
+ };
1243
+ const packageDetails = `azsdk-js-arm-graphservices/1.0.0-beta.1`;
1244
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1245
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1246
+ : `${packageDetails}`;
1247
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1248
+ userAgentPrefix
1249
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1250
+ super(optionsWithDefaults);
1251
+ let bearerTokenAuthenticationPolicyFound = false;
1252
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1253
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1254
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1255
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1256
+ }
1257
+ if (!options ||
1258
+ !options.pipeline ||
1259
+ options.pipeline.getOrderedPolicies().length == 0 ||
1260
+ !bearerTokenAuthenticationPolicyFound) {
1261
+ this.pipeline.removePolicy({
1262
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1263
+ });
1264
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1265
+ credential: credentials,
1266
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
1267
+ challengeCallbacks: {
1268
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1269
+ }
1270
+ }));
1271
+ }
1272
+ // Parameter assignments
1273
+ this.subscriptionId = subscriptionId;
1274
+ // Assigning values to Constant parameters
1275
+ this.$host = options.$host || "https://management.azure.com";
1276
+ this.apiVersion = options.apiVersion || "2022-09-22-preview";
1277
+ this.accounts = new AccountsImpl(this);
1278
+ this.account = new AccountImpl(this);
1279
+ this.operationOperations = new OperationOperationsImpl(this);
1280
+ this.addCustomApiVersionPolicy(options.apiVersion);
1281
+ }
1282
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1283
+ addCustomApiVersionPolicy(apiVersion) {
1284
+ if (!apiVersion) {
1285
+ return;
1286
+ }
1287
+ const apiVersionPolicy = {
1288
+ name: "CustomApiVersionPolicy",
1289
+ sendRequest(request, next) {
1290
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1291
+ const param = request.url.split("?");
1292
+ if (param.length > 1) {
1293
+ const newParams = param[1].split("&").map((item) => {
1294
+ if (item.indexOf("api-version") > -1) {
1295
+ return "api-version=" + apiVersion;
1296
+ }
1297
+ else {
1298
+ return item;
1299
+ }
1300
+ });
1301
+ request.url = param[0] + "?" + newParams.join("&");
1302
+ }
1303
+ return next(request);
1304
+ });
1305
+ }
1306
+ };
1307
+ this.pipeline.addPolicy(apiVersionPolicy);
1308
+ }
1309
+ }
1310
+
1311
+ exports.GraphServices = GraphServices;
1312
+ exports.getContinuationToken = getContinuationToken;
1313
+ //# sourceMappingURL=index.js.map