@azure/arm-datadog 3.1.0-alpha.20250717.1 → 3.1.0-alpha.20250718.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/browser/lroImpl.js +7 -3
  2. package/dist/browser/lroImpl.js.map +1 -1
  3. package/dist/browser/microsoftDatadogClient.js +20 -5
  4. package/dist/browser/microsoftDatadogClient.js.map +1 -1
  5. package/dist/browser/operations/creationSupported.js +10 -27
  6. package/dist/browser/operations/creationSupported.js.map +1 -1
  7. package/dist/browser/operations/marketplaceAgreements.js +23 -40
  8. package/dist/browser/operations/marketplaceAgreements.js.map +1 -1
  9. package/dist/browser/operations/monitoredSubscriptions.js +43 -45
  10. package/dist/browser/operations/monitoredSubscriptions.js.map +1 -1
  11. package/dist/browser/operations/monitors.js +166 -253
  12. package/dist/browser/operations/monitors.js.map +1 -1
  13. package/dist/browser/operations/operations.js +23 -40
  14. package/dist/browser/operations/operations.js.map +1 -1
  15. package/dist/browser/operations/singleSignOnConfigurations.js +34 -46
  16. package/dist/browser/operations/singleSignOnConfigurations.js.map +1 -1
  17. package/dist/browser/operations/tagRules.js +23 -40
  18. package/dist/browser/operations/tagRules.js.map +1 -1
  19. package/dist/browser/pagingHelper.js +2 -4
  20. package/dist/browser/pagingHelper.js.map +1 -1
  21. package/dist/commonjs/lroImpl.js +7 -3
  22. package/dist/commonjs/lroImpl.js.map +1 -1
  23. package/dist/commonjs/microsoftDatadogClient.js +20 -5
  24. package/dist/commonjs/microsoftDatadogClient.js.map +1 -1
  25. package/dist/commonjs/operations/creationSupported.js +10 -26
  26. package/dist/commonjs/operations/creationSupported.js.map +1 -1
  27. package/dist/commonjs/operations/marketplaceAgreements.js +23 -39
  28. package/dist/commonjs/operations/marketplaceAgreements.js.map +1 -1
  29. package/dist/commonjs/operations/monitoredSubscriptions.js +43 -44
  30. package/dist/commonjs/operations/monitoredSubscriptions.js.map +1 -1
  31. package/dist/commonjs/operations/monitors.js +166 -252
  32. package/dist/commonjs/operations/monitors.js.map +1 -1
  33. package/dist/commonjs/operations/operations.js +23 -39
  34. package/dist/commonjs/operations/operations.js.map +1 -1
  35. package/dist/commonjs/operations/singleSignOnConfigurations.js +34 -45
  36. package/dist/commonjs/operations/singleSignOnConfigurations.js.map +1 -1
  37. package/dist/commonjs/operations/tagRules.js +23 -39
  38. package/dist/commonjs/operations/tagRules.js.map +1 -1
  39. package/dist/commonjs/pagingHelper.js +2 -4
  40. package/dist/commonjs/pagingHelper.js.map +1 -1
  41. package/dist/commonjs/tsdoc-metadata.json +11 -11
  42. package/dist/esm/lroImpl.js +7 -3
  43. package/dist/esm/lroImpl.js.map +1 -1
  44. package/dist/esm/microsoftDatadogClient.js +20 -5
  45. package/dist/esm/microsoftDatadogClient.js.map +1 -1
  46. package/dist/esm/operations/creationSupported.js +10 -27
  47. package/dist/esm/operations/creationSupported.js.map +1 -1
  48. package/dist/esm/operations/marketplaceAgreements.js +23 -40
  49. package/dist/esm/operations/marketplaceAgreements.js.map +1 -1
  50. package/dist/esm/operations/monitoredSubscriptions.js +43 -45
  51. package/dist/esm/operations/monitoredSubscriptions.js.map +1 -1
  52. package/dist/esm/operations/monitors.js +166 -253
  53. package/dist/esm/operations/monitors.js.map +1 -1
  54. package/dist/esm/operations/operations.js +23 -40
  55. package/dist/esm/operations/operations.js.map +1 -1
  56. package/dist/esm/operations/singleSignOnConfigurations.js +34 -46
  57. package/dist/esm/operations/singleSignOnConfigurations.js.map +1 -1
  58. package/dist/esm/operations/tagRules.js +23 -40
  59. package/dist/esm/operations/tagRules.js.map +1 -1
  60. package/dist/esm/pagingHelper.js +2 -4
  61. package/dist/esm/pagingHelper.js.map +1 -1
  62. package/dist/react-native/lroImpl.js +7 -3
  63. package/dist/react-native/lroImpl.js.map +1 -1
  64. package/dist/react-native/microsoftDatadogClient.js +20 -5
  65. package/dist/react-native/microsoftDatadogClient.js.map +1 -1
  66. package/dist/react-native/operations/creationSupported.js +10 -27
  67. package/dist/react-native/operations/creationSupported.js.map +1 -1
  68. package/dist/react-native/operations/marketplaceAgreements.js +23 -40
  69. package/dist/react-native/operations/marketplaceAgreements.js.map +1 -1
  70. package/dist/react-native/operations/monitoredSubscriptions.js +43 -45
  71. package/dist/react-native/operations/monitoredSubscriptions.js.map +1 -1
  72. package/dist/react-native/operations/monitors.js +166 -253
  73. package/dist/react-native/operations/monitors.js.map +1 -1
  74. package/dist/react-native/operations/operations.js +23 -40
  75. package/dist/react-native/operations/operations.js.map +1 -1
  76. package/dist/react-native/operations/singleSignOnConfigurations.js +34 -46
  77. package/dist/react-native/operations/singleSignOnConfigurations.js.map +1 -1
  78. package/dist/react-native/operations/tagRules.js +23 -40
  79. package/dist/react-native/operations/tagRules.js.map +1 -1
  80. package/dist/react-native/pagingHelper.js +2 -4
  81. package/dist/react-native/pagingHelper.js.map +1 -1
  82. package/package.json +2 -2
  83. package/review/arm-datadog-node.api.md +867 -867
@@ -18,6 +18,7 @@ const lroImpl_js_1 = require("../lroImpl.js");
18
18
  /// <reference lib="esnext.asynciterable" />
19
19
  /** Class containing Monitors operations. */
20
20
  class MonitorsImpl {
21
+ client;
21
22
  /**
22
23
  * Initialize a new instance of the class Monitors class.
23
24
  * @param client Reference to the service client
@@ -41,52 +42,35 @@ class MonitorsImpl {
41
42
  return this;
42
43
  },
43
44
  byPage: (settings) => {
44
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
45
+ if (settings?.maxPageSize) {
45
46
  throw new Error("maxPageSize is not supported by this operation.");
46
47
  }
47
48
  return this.listApiKeysPagingPage(resourceGroupName, monitorName, options, settings);
48
49
  }
49
50
  };
50
51
  }
51
- listApiKeysPagingPage(resourceGroupName, monitorName, options, settings) {
52
- return tslib_1.__asyncGenerator(this, arguments, function* listApiKeysPagingPage_1() {
53
- let result;
54
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
55
- if (!continuationToken) {
56
- result = yield tslib_1.__await(this._listApiKeys(resourceGroupName, monitorName, options));
57
- let page = result.value || [];
58
- continuationToken = result.nextLink;
59
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
60
- yield yield tslib_1.__await(page);
61
- }
62
- while (continuationToken) {
63
- result = yield tslib_1.__await(this._listApiKeysNext(resourceGroupName, monitorName, continuationToken, options));
64
- continuationToken = result.nextLink;
65
- let page = result.value || [];
66
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
67
- yield yield tslib_1.__await(page);
68
- }
69
- });
52
+ async *listApiKeysPagingPage(resourceGroupName, monitorName, options, settings) {
53
+ let result;
54
+ let continuationToken = settings?.continuationToken;
55
+ if (!continuationToken) {
56
+ result = await this._listApiKeys(resourceGroupName, monitorName, options);
57
+ let page = result.value || [];
58
+ continuationToken = result.nextLink;
59
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
60
+ yield page;
61
+ }
62
+ while (continuationToken) {
63
+ result = await this._listApiKeysNext(resourceGroupName, monitorName, continuationToken, options);
64
+ continuationToken = result.nextLink;
65
+ let page = result.value || [];
66
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
67
+ yield page;
68
+ }
70
69
  }
71
- listApiKeysPagingAll(resourceGroupName, monitorName, options) {
72
- return tslib_1.__asyncGenerator(this, arguments, function* listApiKeysPagingAll_1() {
73
- var _a, e_1, _b, _c;
74
- try {
75
- for (var _d = true, _e = tslib_1.__asyncValues(this.listApiKeysPagingPage(resourceGroupName, monitorName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
76
- _c = _f.value;
77
- _d = false;
78
- const page = _c;
79
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
80
- }
81
- }
82
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
83
- finally {
84
- try {
85
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
86
- }
87
- finally { if (e_1) throw e_1.error; }
88
- }
89
- });
70
+ async *listApiKeysPagingAll(resourceGroupName, monitorName, options) {
71
+ for await (const page of this.listApiKeysPagingPage(resourceGroupName, monitorName, options)) {
72
+ yield* page;
73
+ }
90
74
  }
91
75
  /**
92
76
  * List the hosts for a given monitor resource.
@@ -104,52 +88,35 @@ class MonitorsImpl {
104
88
  return this;
105
89
  },
106
90
  byPage: (settings) => {
107
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
91
+ if (settings?.maxPageSize) {
108
92
  throw new Error("maxPageSize is not supported by this operation.");
109
93
  }
110
94
  return this.listHostsPagingPage(resourceGroupName, monitorName, options, settings);
111
95
  }
112
96
  };
113
97
  }
114
- listHostsPagingPage(resourceGroupName, monitorName, options, settings) {
115
- return tslib_1.__asyncGenerator(this, arguments, function* listHostsPagingPage_1() {
116
- let result;
117
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
118
- if (!continuationToken) {
119
- result = yield tslib_1.__await(this._listHosts(resourceGroupName, monitorName, options));
120
- let page = result.value || [];
121
- continuationToken = result.nextLink;
122
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
123
- yield yield tslib_1.__await(page);
124
- }
125
- while (continuationToken) {
126
- result = yield tslib_1.__await(this._listHostsNext(resourceGroupName, monitorName, continuationToken, options));
127
- continuationToken = result.nextLink;
128
- let page = result.value || [];
129
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
130
- yield yield tslib_1.__await(page);
131
- }
132
- });
98
+ async *listHostsPagingPage(resourceGroupName, monitorName, options, settings) {
99
+ let result;
100
+ let continuationToken = settings?.continuationToken;
101
+ if (!continuationToken) {
102
+ result = await this._listHosts(resourceGroupName, monitorName, options);
103
+ let page = result.value || [];
104
+ continuationToken = result.nextLink;
105
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
106
+ yield page;
107
+ }
108
+ while (continuationToken) {
109
+ result = await this._listHostsNext(resourceGroupName, monitorName, continuationToken, options);
110
+ continuationToken = result.nextLink;
111
+ let page = result.value || [];
112
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
113
+ yield page;
114
+ }
133
115
  }
134
- listHostsPagingAll(resourceGroupName, monitorName, options) {
135
- return tslib_1.__asyncGenerator(this, arguments, function* listHostsPagingAll_1() {
136
- var _a, e_2, _b, _c;
137
- try {
138
- for (var _d = true, _e = tslib_1.__asyncValues(this.listHostsPagingPage(resourceGroupName, monitorName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
139
- _c = _f.value;
140
- _d = false;
141
- const page = _c;
142
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
143
- }
144
- }
145
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
146
- finally {
147
- try {
148
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
149
- }
150
- finally { if (e_2) throw e_2.error; }
151
- }
152
- });
116
+ async *listHostsPagingAll(resourceGroupName, monitorName, options) {
117
+ for await (const page of this.listHostsPagingPage(resourceGroupName, monitorName, options)) {
118
+ yield* page;
119
+ }
153
120
  }
154
121
  /**
155
122
  * List all Azure resources associated to the same Datadog organization as the target resource.
@@ -167,52 +134,35 @@ class MonitorsImpl {
167
134
  return this;
168
135
  },
169
136
  byPage: (settings) => {
170
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
137
+ if (settings?.maxPageSize) {
171
138
  throw new Error("maxPageSize is not supported by this operation.");
172
139
  }
173
140
  return this.listLinkedResourcesPagingPage(resourceGroupName, monitorName, options, settings);
174
141
  }
175
142
  };
176
143
  }
177
- listLinkedResourcesPagingPage(resourceGroupName, monitorName, options, settings) {
178
- return tslib_1.__asyncGenerator(this, arguments, function* listLinkedResourcesPagingPage_1() {
179
- let result;
180
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
181
- if (!continuationToken) {
182
- result = yield tslib_1.__await(this._listLinkedResources(resourceGroupName, monitorName, options));
183
- let page = result.value || [];
184
- continuationToken = result.nextLink;
185
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
186
- yield yield tslib_1.__await(page);
187
- }
188
- while (continuationToken) {
189
- result = yield tslib_1.__await(this._listLinkedResourcesNext(resourceGroupName, monitorName, continuationToken, options));
190
- continuationToken = result.nextLink;
191
- let page = result.value || [];
192
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
193
- yield yield tslib_1.__await(page);
194
- }
195
- });
144
+ async *listLinkedResourcesPagingPage(resourceGroupName, monitorName, options, settings) {
145
+ let result;
146
+ let continuationToken = settings?.continuationToken;
147
+ if (!continuationToken) {
148
+ result = await this._listLinkedResources(resourceGroupName, monitorName, options);
149
+ let page = result.value || [];
150
+ continuationToken = result.nextLink;
151
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
152
+ yield page;
153
+ }
154
+ while (continuationToken) {
155
+ result = await this._listLinkedResourcesNext(resourceGroupName, monitorName, continuationToken, options);
156
+ continuationToken = result.nextLink;
157
+ let page = result.value || [];
158
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
159
+ yield page;
160
+ }
196
161
  }
197
- listLinkedResourcesPagingAll(resourceGroupName, monitorName, options) {
198
- return tslib_1.__asyncGenerator(this, arguments, function* listLinkedResourcesPagingAll_1() {
199
- var _a, e_3, _b, _c;
200
- try {
201
- for (var _d = true, _e = tslib_1.__asyncValues(this.listLinkedResourcesPagingPage(resourceGroupName, monitorName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
202
- _c = _f.value;
203
- _d = false;
204
- const page = _c;
205
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
206
- }
207
- }
208
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
209
- finally {
210
- try {
211
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
212
- }
213
- finally { if (e_3) throw e_3.error; }
214
- }
215
- });
162
+ async *listLinkedResourcesPagingAll(resourceGroupName, monitorName, options) {
163
+ for await (const page of this.listLinkedResourcesPagingPage(resourceGroupName, monitorName, options)) {
164
+ yield* page;
165
+ }
216
166
  }
217
167
  /**
218
168
  * List the resources currently being monitored by the Datadog monitor resource.
@@ -230,52 +180,35 @@ class MonitorsImpl {
230
180
  return this;
231
181
  },
232
182
  byPage: (settings) => {
233
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
183
+ if (settings?.maxPageSize) {
234
184
  throw new Error("maxPageSize is not supported by this operation.");
235
185
  }
236
186
  return this.listMonitoredResourcesPagingPage(resourceGroupName, monitorName, options, settings);
237
187
  }
238
188
  };
239
189
  }
240
- listMonitoredResourcesPagingPage(resourceGroupName, monitorName, options, settings) {
241
- return tslib_1.__asyncGenerator(this, arguments, function* listMonitoredResourcesPagingPage_1() {
242
- let result;
243
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
244
- if (!continuationToken) {
245
- result = yield tslib_1.__await(this._listMonitoredResources(resourceGroupName, monitorName, options));
246
- let page = result.value || [];
247
- continuationToken = result.nextLink;
248
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
249
- yield yield tslib_1.__await(page);
250
- }
251
- while (continuationToken) {
252
- result = yield tslib_1.__await(this._listMonitoredResourcesNext(resourceGroupName, monitorName, continuationToken, options));
253
- continuationToken = result.nextLink;
254
- let page = result.value || [];
255
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
256
- yield yield tslib_1.__await(page);
257
- }
258
- });
190
+ async *listMonitoredResourcesPagingPage(resourceGroupName, monitorName, options, settings) {
191
+ let result;
192
+ let continuationToken = settings?.continuationToken;
193
+ if (!continuationToken) {
194
+ result = await this._listMonitoredResources(resourceGroupName, monitorName, options);
195
+ let page = result.value || [];
196
+ continuationToken = result.nextLink;
197
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
198
+ yield page;
199
+ }
200
+ while (continuationToken) {
201
+ result = await this._listMonitoredResourcesNext(resourceGroupName, monitorName, continuationToken, options);
202
+ continuationToken = result.nextLink;
203
+ let page = result.value || [];
204
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
205
+ yield page;
206
+ }
259
207
  }
260
- listMonitoredResourcesPagingAll(resourceGroupName, monitorName, options) {
261
- return tslib_1.__asyncGenerator(this, arguments, function* listMonitoredResourcesPagingAll_1() {
262
- var _a, e_4, _b, _c;
263
- try {
264
- for (var _d = true, _e = tslib_1.__asyncValues(this.listMonitoredResourcesPagingPage(resourceGroupName, monitorName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
265
- _c = _f.value;
266
- _d = false;
267
- const page = _c;
268
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
269
- }
270
- }
271
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
272
- finally {
273
- try {
274
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
275
- }
276
- finally { if (e_4) throw e_4.error; }
277
- }
278
- });
208
+ async *listMonitoredResourcesPagingAll(resourceGroupName, monitorName, options) {
209
+ for await (const page of this.listMonitoredResourcesPagingPage(resourceGroupName, monitorName, options)) {
210
+ yield* page;
211
+ }
279
212
  }
280
213
  /**
281
214
  * List all monitors under the specified subscription.
@@ -291,52 +224,35 @@ class MonitorsImpl {
291
224
  return this;
292
225
  },
293
226
  byPage: (settings) => {
294
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
227
+ if (settings?.maxPageSize) {
295
228
  throw new Error("maxPageSize is not supported by this operation.");
296
229
  }
297
230
  return this.listPagingPage(options, settings);
298
231
  }
299
232
  };
300
233
  }
301
- listPagingPage(options, settings) {
302
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
303
- let result;
304
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
305
- if (!continuationToken) {
306
- result = yield tslib_1.__await(this._list(options));
307
- let page = result.value || [];
308
- continuationToken = result.nextLink;
309
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
310
- yield yield tslib_1.__await(page);
311
- }
312
- while (continuationToken) {
313
- result = yield tslib_1.__await(this._listNext(continuationToken, options));
314
- continuationToken = result.nextLink;
315
- let page = result.value || [];
316
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
317
- yield yield tslib_1.__await(page);
318
- }
319
- });
234
+ async *listPagingPage(options, settings) {
235
+ let result;
236
+ let continuationToken = settings?.continuationToken;
237
+ if (!continuationToken) {
238
+ result = await this._list(options);
239
+ let page = result.value || [];
240
+ continuationToken = result.nextLink;
241
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
242
+ yield page;
243
+ }
244
+ while (continuationToken) {
245
+ result = await this._listNext(continuationToken, options);
246
+ continuationToken = result.nextLink;
247
+ let page = result.value || [];
248
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
249
+ yield page;
250
+ }
320
251
  }
321
- listPagingAll(options) {
322
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
323
- var _a, e_5, _b, _c;
324
- try {
325
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
326
- _c = _f.value;
327
- _d = false;
328
- const page = _c;
329
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
330
- }
331
- }
332
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
333
- finally {
334
- try {
335
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
336
- }
337
- finally { if (e_5) throw e_5.error; }
338
- }
339
- });
252
+ async *listPagingAll(options) {
253
+ for await (const page of this.listPagingPage(options)) {
254
+ yield* page;
255
+ }
340
256
  }
341
257
  /**
342
258
  * List all monitors under the specified resource group.
@@ -353,52 +269,35 @@ class MonitorsImpl {
353
269
  return this;
354
270
  },
355
271
  byPage: (settings) => {
356
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
272
+ if (settings?.maxPageSize) {
357
273
  throw new Error("maxPageSize is not supported by this operation.");
358
274
  }
359
275
  return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
360
276
  }
361
277
  };
362
278
  }
363
- listByResourceGroupPagingPage(resourceGroupName, options, settings) {
364
- return tslib_1.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
365
- let result;
366
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
367
- if (!continuationToken) {
368
- result = yield tslib_1.__await(this._listByResourceGroup(resourceGroupName, options));
369
- let page = result.value || [];
370
- continuationToken = result.nextLink;
371
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
372
- yield yield tslib_1.__await(page);
373
- }
374
- while (continuationToken) {
375
- result = yield tslib_1.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
376
- continuationToken = result.nextLink;
377
- let page = result.value || [];
378
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
379
- yield yield tslib_1.__await(page);
380
- }
381
- });
279
+ async *listByResourceGroupPagingPage(resourceGroupName, options, settings) {
280
+ let result;
281
+ let continuationToken = settings?.continuationToken;
282
+ if (!continuationToken) {
283
+ result = await this._listByResourceGroup(resourceGroupName, options);
284
+ let page = result.value || [];
285
+ continuationToken = result.nextLink;
286
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
287
+ yield page;
288
+ }
289
+ while (continuationToken) {
290
+ result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options);
291
+ continuationToken = result.nextLink;
292
+ let page = result.value || [];
293
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
294
+ yield page;
295
+ }
382
296
  }
383
- listByResourceGroupPagingAll(resourceGroupName, options) {
384
- return tslib_1.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
385
- var _a, e_6, _b, _c;
386
- try {
387
- for (var _d = true, _e = tslib_1.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
388
- _c = _f.value;
389
- _d = false;
390
- const page = _c;
391
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
392
- }
393
- }
394
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
395
- finally {
396
- try {
397
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
398
- }
399
- finally { if (e_6) throw e_6.error; }
400
- }
401
- });
297
+ async *listByResourceGroupPagingAll(resourceGroupName, options) {
298
+ for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) {
299
+ yield* page;
300
+ }
402
301
  }
403
302
  /**
404
303
  * List the api keys for a given monitor resource.
@@ -489,14 +388,19 @@ class MonitorsImpl {
489
388
  return this.client.sendOperationRequest(args, spec);
490
389
  };
491
390
  const sendOperationFn = async (args, spec) => {
492
- var _a;
493
391
  let currentRawResponse = undefined;
494
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
392
+ const providedCallback = args.options?.onResponse;
495
393
  const callback = (rawResponse, flatResponse) => {
496
394
  currentRawResponse = rawResponse;
497
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
395
+ providedCallback?.(rawResponse, flatResponse);
396
+ };
397
+ const updatedArgs = {
398
+ ...args,
399
+ options: {
400
+ ...args.options,
401
+ onResponse: callback
402
+ }
498
403
  };
499
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
500
404
  const flatResponse = await directSendOperation(updatedArgs, spec);
501
405
  return {
502
406
  flatResponse,
@@ -513,8 +417,8 @@ class MonitorsImpl {
513
417
  spec: createOperationSpec
514
418
  });
515
419
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
516
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
517
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
420
+ restoreFrom: options?.resumeFrom,
421
+ intervalInMs: options?.updateIntervalInMs,
518
422
  resourceLocationConfig: "azure-async-operation"
519
423
  });
520
424
  await poller.poll();
@@ -541,14 +445,19 @@ class MonitorsImpl {
541
445
  return this.client.sendOperationRequest(args, spec);
542
446
  };
543
447
  const sendOperationFn = async (args, spec) => {
544
- var _a;
545
448
  let currentRawResponse = undefined;
546
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
449
+ const providedCallback = args.options?.onResponse;
547
450
  const callback = (rawResponse, flatResponse) => {
548
451
  currentRawResponse = rawResponse;
549
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
452
+ providedCallback?.(rawResponse, flatResponse);
453
+ };
454
+ const updatedArgs = {
455
+ ...args,
456
+ options: {
457
+ ...args.options,
458
+ onResponse: callback
459
+ }
550
460
  };
551
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
552
461
  const flatResponse = await directSendOperation(updatedArgs, spec);
553
462
  return {
554
463
  flatResponse,
@@ -565,8 +474,8 @@ class MonitorsImpl {
565
474
  spec: updateOperationSpec
566
475
  });
567
476
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
568
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
569
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
477
+ restoreFrom: options?.resumeFrom,
478
+ intervalInMs: options?.updateIntervalInMs
570
479
  });
571
480
  await poller.poll();
572
481
  return poller;
@@ -592,14 +501,19 @@ class MonitorsImpl {
592
501
  return this.client.sendOperationRequest(args, spec);
593
502
  };
594
503
  const sendOperationFn = async (args, spec) => {
595
- var _a;
596
504
  let currentRawResponse = undefined;
597
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
505
+ const providedCallback = args.options?.onResponse;
598
506
  const callback = (rawResponse, flatResponse) => {
599
507
  currentRawResponse = rawResponse;
600
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
508
+ providedCallback?.(rawResponse, flatResponse);
509
+ };
510
+ const updatedArgs = {
511
+ ...args,
512
+ options: {
513
+ ...args.options,
514
+ onResponse: callback
515
+ }
601
516
  };
602
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
603
517
  const flatResponse = await directSendOperation(updatedArgs, spec);
604
518
  return {
605
519
  flatResponse,
@@ -616,8 +530,8 @@ class MonitorsImpl {
616
530
  spec: deleteOperationSpec
617
531
  });
618
532
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
619
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
620
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
533
+ restoreFrom: options?.resumeFrom,
534
+ intervalInMs: options?.updateIntervalInMs
621
535
  });
622
536
  await poller.poll();
623
537
  return poller;