@azure-rest/load-testing 1.1.0-beta.1 → 1.2.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 (200) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +1 -1
  3. package/README.md +12 -13
  4. package/dist/browser/azureLoadTesting.js +14 -12
  5. package/dist/browser/azureLoadTesting.js.map +1 -1
  6. package/dist/browser/clientDefinitions.d.ts +66 -34
  7. package/dist/browser/clientDefinitions.js.map +1 -1
  8. package/dist/browser/getFileValidationPoller.js +16 -11
  9. package/dist/browser/getFileValidationPoller.js.map +1 -1
  10. package/dist/browser/getTestProfileRunCompletionPoller.js +16 -11
  11. package/dist/browser/getTestProfileRunCompletionPoller.js.map +1 -1
  12. package/dist/browser/getTestRunCompletionPoller.js +16 -11
  13. package/dist/browser/getTestRunCompletionPoller.js.map +1 -1
  14. package/dist/browser/index.d.ts +6 -6
  15. package/dist/browser/index.js +1 -7
  16. package/dist/browser/index.js.map +1 -1
  17. package/dist/browser/isUnexpected.d.ts +15 -9
  18. package/dist/browser/isUnexpected.js +21 -13
  19. package/dist/browser/isUnexpected.js.map +1 -1
  20. package/dist/browser/models.d.ts +205 -172
  21. package/dist/browser/models.js.map +1 -1
  22. package/dist/browser/outputModels.d.ts +290 -208
  23. package/dist/browser/outputModels.js.map +1 -1
  24. package/dist/browser/paginateHelper.js +43 -73
  25. package/dist/browser/paginateHelper.js.map +1 -1
  26. package/dist/browser/parameters.d.ts +107 -66
  27. package/dist/browser/parameters.js.map +1 -1
  28. package/dist/browser/pollingHelper.d.ts +82 -4
  29. package/dist/browser/pollingHelper.js +119 -15
  30. package/dist/browser/pollingHelper.js.map +1 -1
  31. package/dist/browser/responses.d.ts +234 -121
  32. package/dist/browser/responses.js.map +1 -1
  33. package/dist/commonjs/azureLoadTesting.js +53 -45
  34. package/dist/commonjs/azureLoadTesting.js.map +7 -1
  35. package/dist/commonjs/clientDefinitions.d.ts +66 -34
  36. package/dist/commonjs/clientDefinitions.js +15 -5
  37. package/dist/commonjs/clientDefinitions.js.map +7 -1
  38. package/dist/commonjs/getFileValidationPoller.js +151 -137
  39. package/dist/commonjs/getFileValidationPoller.js.map +7 -1
  40. package/dist/commonjs/getTestProfileRunCompletionPoller.js +139 -127
  41. package/dist/commonjs/getTestProfileRunCompletionPoller.js.map +7 -1
  42. package/dist/commonjs/getTestRunCompletionPoller.js +139 -125
  43. package/dist/commonjs/getTestRunCompletionPoller.js.map +7 -1
  44. package/dist/commonjs/index.d.ts +6 -6
  45. package/dist/commonjs/index.js +46 -20
  46. package/dist/commonjs/index.js.map +7 -1
  47. package/dist/commonjs/isUnexpected.d.ts +15 -9
  48. package/dist/commonjs/isUnexpected.js +118 -105
  49. package/dist/commonjs/isUnexpected.js.map +7 -1
  50. package/dist/commonjs/logger.js +28 -8
  51. package/dist/commonjs/logger.js.map +7 -1
  52. package/dist/commonjs/models.d.ts +205 -172
  53. package/dist/commonjs/models.js +15 -5
  54. package/dist/commonjs/models.js.map +7 -1
  55. package/dist/commonjs/outputModels.d.ts +290 -208
  56. package/dist/commonjs/outputModels.js +15 -5
  57. package/dist/commonjs/outputModels.js.map +7 -1
  58. package/dist/commonjs/paginateHelper.js +118 -158
  59. package/dist/commonjs/paginateHelper.js.map +7 -1
  60. package/dist/commonjs/parameters.d.ts +107 -66
  61. package/dist/commonjs/parameters.js +15 -5
  62. package/dist/commonjs/parameters.js.map +7 -1
  63. package/dist/commonjs/pollingHelper.d.ts +82 -4
  64. package/dist/commonjs/pollingHelper.js +143 -24
  65. package/dist/commonjs/pollingHelper.js.map +7 -1
  66. package/dist/commonjs/responses.d.ts +234 -121
  67. package/dist/commonjs/responses.js +15 -5
  68. package/dist/commonjs/responses.js.map +7 -1
  69. package/dist/commonjs/tsdoc-metadata.json +11 -11
  70. package/dist/commonjs/util/LROUtil.js +76 -54
  71. package/dist/commonjs/util/LROUtil.js.map +7 -1
  72. package/dist/esm/azureLoadTesting.js +32 -40
  73. package/dist/esm/azureLoadTesting.js.map +7 -1
  74. package/dist/esm/clientDefinitions.d.ts +66 -34
  75. package/dist/esm/clientDefinitions.js +0 -4
  76. package/dist/esm/clientDefinitions.js.map +7 -1
  77. package/dist/esm/getFileValidationPoller.js +126 -132
  78. package/dist/esm/getFileValidationPoller.js.map +7 -1
  79. package/dist/esm/getTestProfileRunCompletionPoller.js +114 -122
  80. package/dist/esm/getTestProfileRunCompletionPoller.js.map +7 -1
  81. package/dist/esm/getTestRunCompletionPoller.js +114 -120
  82. package/dist/esm/getTestRunCompletionPoller.js.map +7 -1
  83. package/dist/esm/index.d.ts +6 -6
  84. package/dist/esm/index.js +5 -11
  85. package/dist/esm/index.js.map +7 -1
  86. package/dist/esm/isUnexpected.d.ts +15 -9
  87. package/dist/esm/isUnexpected.js +96 -103
  88. package/dist/esm/isUnexpected.js.map +7 -1
  89. package/dist/esm/logger.js +4 -4
  90. package/dist/esm/logger.js.map +7 -1
  91. package/dist/esm/models.d.ts +205 -172
  92. package/dist/esm/models.js +0 -4
  93. package/dist/esm/models.js.map +7 -1
  94. package/dist/esm/outputModels.d.ts +290 -208
  95. package/dist/esm/outputModels.js +0 -4
  96. package/dist/esm/outputModels.js.map +7 -1
  97. package/dist/esm/paginateHelper.js +95 -155
  98. package/dist/esm/paginateHelper.js.map +7 -1
  99. package/dist/esm/parameters.d.ts +107 -66
  100. package/dist/esm/parameters.js +0 -4
  101. package/dist/esm/parameters.js.map +7 -1
  102. package/dist/esm/pollingHelper.d.ts +82 -4
  103. package/dist/esm/pollingHelper.js +117 -18
  104. package/dist/esm/pollingHelper.js.map +7 -1
  105. package/dist/esm/responses.d.ts +234 -121
  106. package/dist/esm/responses.js +0 -4
  107. package/dist/esm/responses.js.map +7 -1
  108. package/dist/esm/util/LROUtil.js +52 -50
  109. package/dist/esm/util/LROUtil.js.map +7 -1
  110. package/dist/react-native/azureLoadTesting.js +14 -12
  111. package/dist/react-native/azureLoadTesting.js.map +1 -1
  112. package/dist/react-native/clientDefinitions.d.ts +66 -34
  113. package/dist/react-native/clientDefinitions.js.map +1 -1
  114. package/dist/react-native/getFileValidationPoller.js +16 -11
  115. package/dist/react-native/getFileValidationPoller.js.map +1 -1
  116. package/dist/react-native/getTestProfileRunCompletionPoller.js +16 -11
  117. package/dist/react-native/getTestProfileRunCompletionPoller.js.map +1 -1
  118. package/dist/react-native/getTestRunCompletionPoller.js +16 -11
  119. package/dist/react-native/getTestRunCompletionPoller.js.map +1 -1
  120. package/dist/react-native/index.d.ts +6 -6
  121. package/dist/react-native/index.js +1 -7
  122. package/dist/react-native/index.js.map +1 -1
  123. package/dist/react-native/isUnexpected.d.ts +15 -9
  124. package/dist/react-native/isUnexpected.js +21 -13
  125. package/dist/react-native/isUnexpected.js.map +1 -1
  126. package/dist/react-native/models.d.ts +205 -172
  127. package/dist/react-native/models.js.map +1 -1
  128. package/dist/react-native/outputModels.d.ts +290 -208
  129. package/dist/react-native/outputModels.js.map +1 -1
  130. package/dist/react-native/paginateHelper.js +43 -73
  131. package/dist/react-native/paginateHelper.js.map +1 -1
  132. package/dist/react-native/parameters.d.ts +107 -66
  133. package/dist/react-native/parameters.js.map +1 -1
  134. package/dist/react-native/pollingHelper.d.ts +82 -4
  135. package/dist/react-native/pollingHelper.js +119 -15
  136. package/dist/react-native/pollingHelper.js.map +1 -1
  137. package/dist/react-native/responses.d.ts +234 -121
  138. package/dist/react-native/responses.js.map +1 -1
  139. package/package.json +69 -86
  140. package/review/{load-testing.api.md → load-testing-node.api.md} +420 -23
  141. package/dist/browser/azureLoadTesting.d.ts.map +0 -1
  142. package/dist/browser/clientDefinitions.d.ts.map +0 -1
  143. package/dist/browser/getFileValidationPoller.d.ts.map +0 -1
  144. package/dist/browser/getTestProfileRunCompletionPoller.d.ts.map +0 -1
  145. package/dist/browser/getTestRunCompletionPoller.d.ts.map +0 -1
  146. package/dist/browser/index.d.ts.map +0 -1
  147. package/dist/browser/isUnexpected.d.ts.map +0 -1
  148. package/dist/browser/logger.d.ts.map +0 -1
  149. package/dist/browser/models.d.ts.map +0 -1
  150. package/dist/browser/outputModels.d.ts.map +0 -1
  151. package/dist/browser/paginateHelper.d.ts.map +0 -1
  152. package/dist/browser/parameters.d.ts.map +0 -1
  153. package/dist/browser/pollingHelper.d.ts.map +0 -1
  154. package/dist/browser/responses.d.ts.map +0 -1
  155. package/dist/browser/util/LROUtil.d.ts.map +0 -1
  156. package/dist/commonjs/azureLoadTesting.d.ts.map +0 -1
  157. package/dist/commonjs/clientDefinitions.d.ts.map +0 -1
  158. package/dist/commonjs/getFileValidationPoller.d.ts.map +0 -1
  159. package/dist/commonjs/getTestProfileRunCompletionPoller.d.ts.map +0 -1
  160. package/dist/commonjs/getTestRunCompletionPoller.d.ts.map +0 -1
  161. package/dist/commonjs/index.d.ts.map +0 -1
  162. package/dist/commonjs/isUnexpected.d.ts.map +0 -1
  163. package/dist/commonjs/logger.d.ts.map +0 -1
  164. package/dist/commonjs/models.d.ts.map +0 -1
  165. package/dist/commonjs/outputModels.d.ts.map +0 -1
  166. package/dist/commonjs/paginateHelper.d.ts.map +0 -1
  167. package/dist/commonjs/parameters.d.ts.map +0 -1
  168. package/dist/commonjs/pollingHelper.d.ts.map +0 -1
  169. package/dist/commonjs/responses.d.ts.map +0 -1
  170. package/dist/commonjs/util/LROUtil.d.ts.map +0 -1
  171. package/dist/esm/azureLoadTesting.d.ts.map +0 -1
  172. package/dist/esm/clientDefinitions.d.ts.map +0 -1
  173. package/dist/esm/getFileValidationPoller.d.ts.map +0 -1
  174. package/dist/esm/getTestProfileRunCompletionPoller.d.ts.map +0 -1
  175. package/dist/esm/getTestRunCompletionPoller.d.ts.map +0 -1
  176. package/dist/esm/index.d.ts.map +0 -1
  177. package/dist/esm/isUnexpected.d.ts.map +0 -1
  178. package/dist/esm/logger.d.ts.map +0 -1
  179. package/dist/esm/models.d.ts.map +0 -1
  180. package/dist/esm/outputModels.d.ts.map +0 -1
  181. package/dist/esm/paginateHelper.d.ts.map +0 -1
  182. package/dist/esm/parameters.d.ts.map +0 -1
  183. package/dist/esm/pollingHelper.d.ts.map +0 -1
  184. package/dist/esm/responses.d.ts.map +0 -1
  185. package/dist/esm/util/LROUtil.d.ts.map +0 -1
  186. package/dist/react-native/azureLoadTesting.d.ts.map +0 -1
  187. package/dist/react-native/clientDefinitions.d.ts.map +0 -1
  188. package/dist/react-native/getFileValidationPoller.d.ts.map +0 -1
  189. package/dist/react-native/getTestProfileRunCompletionPoller.d.ts.map +0 -1
  190. package/dist/react-native/getTestRunCompletionPoller.d.ts.map +0 -1
  191. package/dist/react-native/index.d.ts.map +0 -1
  192. package/dist/react-native/isUnexpected.d.ts.map +0 -1
  193. package/dist/react-native/logger.d.ts.map +0 -1
  194. package/dist/react-native/models.d.ts.map +0 -1
  195. package/dist/react-native/outputModels.d.ts.map +0 -1
  196. package/dist/react-native/paginateHelper.d.ts.map +0 -1
  197. package/dist/react-native/parameters.d.ts.map +0 -1
  198. package/dist/react-native/pollingHelper.d.ts.map +0 -1
  199. package/dist/react-native/responses.d.ts.map +0 -1
  200. package/dist/react-native/util/LROUtil.d.ts.map +0 -1
@@ -1,30 +1,149 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getLongRunningPoller = getLongRunningPoller;
6
- const getFileValidationPoller_js_1 = require("./getFileValidationPoller.js");
7
- const getTestRunCompletionPoller_js_1 = require("./getTestRunCompletionPoller.js");
8
- const getTestProfileRunCompletionPoller_js_1 = require("./getTestProfileRunCompletionPoller.js");
9
- async function getLongRunningPoller(client, initialResponse) {
10
- if (isFileUpload(initialResponse)) {
11
- return (0, getFileValidationPoller_js_1.getFileValidationPoller)(client, initialResponse);
12
- }
13
- else if (isTestRunCreation(initialResponse)) {
14
- return (0, getTestRunCompletionPoller_js_1.getTestRunCompletionPoller)(client, initialResponse);
15
- }
16
- else if (isTestProfileRunCreation(initialResponse)) {
17
- return (0, getTestProfileRunCompletionPoller_js_1.getTestProfileRunCompletionPoller)(client, initialResponse);
18
- }
19
- throw new Error("The Operation is not a long running operation.");
20
- }
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var pollingHelper_exports = {};
19
+ __export(pollingHelper_exports, {
20
+ getLongRunningPoller: () => getLongRunningPoller
21
+ });
22
+ module.exports = __toCommonJS(pollingHelper_exports);
23
+ var import_core_lro = require("@azure/core-lro");
24
+ var import_getFileValidationPoller = require("./getFileValidationPoller.js");
25
+ var import_getTestRunCompletionPoller = require("./getTestRunCompletionPoller.js");
26
+ var import_getTestProfileRunCompletionPoller = require("./getTestProfileRunCompletionPoller.js");
21
27
  function isFileUpload(response) {
22
- return response.request.url.includes("/files/");
28
+ const url = response.request?.url ?? "";
29
+ return url.includes("/files/") && url.includes("/tests/") && !url.includes("/test-runs/");
23
30
  }
24
31
  function isTestRunCreation(response) {
25
- return response.request.url.includes("/test-runs/");
32
+ const url = response.request?.url ?? "";
33
+ const method = response.request?.method.toUpperCase() ?? "";
34
+ return url.includes("/test-runs/") && !url.includes("/test-profile-runs/") && method === "PATCH";
26
35
  }
27
36
  function isTestProfileRunCreation(response) {
28
- return response.request.url.includes("/test-profile-runs/");
37
+ const url = response.request?.url ?? "";
38
+ return url.includes("/test-profile-runs/");
39
+ }
40
+ async function getLongRunningPoller(client, initialResponse, options = {}) {
41
+ if (isFileUpload(initialResponse)) {
42
+ return (0, import_getFileValidationPoller.getFileValidationPoller)(
43
+ client,
44
+ initialResponse,
45
+ options
46
+ );
47
+ }
48
+ if (isTestRunCreation(initialResponse)) {
49
+ return (0, import_getTestRunCompletionPoller.getTestRunCompletionPoller)(
50
+ client,
51
+ initialResponse,
52
+ options
53
+ );
54
+ }
55
+ if (isTestProfileRunCreation(initialResponse)) {
56
+ return (0, import_getTestProfileRunCompletionPoller.getTestProfileRunCompletionPoller)(
57
+ client,
58
+ initialResponse,
59
+ options
60
+ );
61
+ }
62
+ const httpPollerOptions = options;
63
+ const abortController = new AbortController();
64
+ const poller = {
65
+ sendInitialRequest: async () => {
66
+ return getLroResponse(initialResponse);
67
+ },
68
+ sendPollRequest: async (path, pollOptions) => {
69
+ function abortListener() {
70
+ abortController.abort();
71
+ }
72
+ const inputAbortSignal = pollOptions?.abortSignal;
73
+ const abortSignal = abortController.signal;
74
+ if (inputAbortSignal?.aborted) {
75
+ abortController.abort();
76
+ } else if (!abortSignal.aborted) {
77
+ inputAbortSignal?.addEventListener("abort", abortListener, {
78
+ once: true
79
+ });
80
+ }
81
+ let response;
82
+ try {
83
+ response = await client.pathUnchecked(path ?? initialResponse.request.url).get({ abortSignal });
84
+ } finally {
85
+ inputAbortSignal?.removeEventListener("abort", abortListener);
86
+ }
87
+ const lroResponse = getLroResponse(response);
88
+ lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
89
+ return lroResponse;
90
+ }
91
+ };
92
+ httpPollerOptions.resolveOnUnsuccessful = httpPollerOptions.resolveOnUnsuccessful ?? true;
93
+ const httpPoller = (0, import_core_lro.createHttpPoller)(poller, httpPollerOptions);
94
+ const simplePoller = {
95
+ isDone() {
96
+ return httpPoller.isDone;
97
+ },
98
+ isStopped() {
99
+ return abortController.signal.aborted;
100
+ },
101
+ getOperationState() {
102
+ if (!httpPoller.operationState) {
103
+ throw new Error(
104
+ "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState()."
105
+ );
106
+ }
107
+ return httpPoller.operationState;
108
+ },
109
+ getResult() {
110
+ return httpPoller.result;
111
+ },
112
+ toString() {
113
+ if (!httpPoller.operationState) {
114
+ throw new Error(
115
+ "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState()."
116
+ );
117
+ }
118
+ return JSON.stringify({
119
+ state: httpPoller.operationState
120
+ });
121
+ },
122
+ stopPolling() {
123
+ abortController.abort();
124
+ },
125
+ onProgress: httpPoller.onProgress,
126
+ poll: httpPoller.poll,
127
+ pollUntilDone: httpPoller.pollUntilDone,
128
+ serialize: httpPoller.serialize,
129
+ submitted: httpPoller.submitted
130
+ };
131
+ return simplePoller;
132
+ }
133
+ function getLroResponse(response) {
134
+ if (Number.isNaN(response.status)) {
135
+ throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
136
+ }
137
+ return {
138
+ flatResponse: response,
139
+ rawResponse: {
140
+ ...response,
141
+ statusCode: Number.parseInt(response.status),
142
+ body: response.body
143
+ }
144
+ };
29
145
  }
30
- //# sourceMappingURL=pollingHelper.js.map
146
+ // Annotate the CommonJS export names for ESM import in node:
147
+ 0 && (module.exports = {
148
+ getLongRunningPoller
149
+ });
@@ -1 +1,7 @@
1
- {"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,oDAgBC;AAxCD,6EAAuE;AACvE,mFAA6E;AAC7E,iGAA2F;AAsBpF,KAAK,UAAU,oBAAoB,CACxC,MAA8B,EAC9B,eAG+C;IAE/C,IAAI,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,OAAO,IAAA,oDAAuB,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;SAAM,IAAI,iBAAiB,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9C,OAAO,IAAA,0DAA0B,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7D,CAAC;SAAM,IAAI,wBAAwB,CAAC,eAAe,CAAC,EAAE,CAAC;QACrD,OAAO,IAAA,wEAAiC,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,YAAY,CAAC,QAAa;IACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAa;IACtC,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,wBAAwB,CAC/B,QAAa;IAEb,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzureLoadTestingClient } from \"./clientDefinitions.js\";\nimport { getFileValidationPoller } from \"./getFileValidationPoller.js\";\nimport { getTestRunCompletionPoller } from \"./getTestRunCompletionPoller.js\";\nimport { getTestProfileRunCompletionPoller } from \"./getTestProfileRunCompletionPoller.js\";\nimport type {\n FileUploadAndValidatePoller,\n TestUploadFileSuccessResponse,\n TestRunCompletionPoller,\n TestRunCreateOrUpdateSuccessResponse,\n TestProfileRunCreateOrUpdateSuccessResponse,\n TestProfileRunCompletionPoller,\n} from \"./models.js\";\n\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse: TestUploadFileSuccessResponse,\n): Promise<FileUploadAndValidatePoller>;\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse: TestRunCreateOrUpdateSuccessResponse,\n): Promise<TestRunCompletionPoller>;\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse: TestProfileRunCreateOrUpdateSuccessResponse,\n): Promise<TestProfileRunCompletionPoller>;\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse:\n | TestRunCreateOrUpdateSuccessResponse\n | TestUploadFileSuccessResponse\n | TestProfileRunCreateOrUpdateSuccessResponse,\n): Promise<TestRunCompletionPoller | FileUploadAndValidatePoller | TestProfileRunCompletionPoller> {\n if (isFileUpload(initialResponse)) {\n return getFileValidationPoller(client, initialResponse);\n } else if (isTestRunCreation(initialResponse)) {\n return getTestRunCompletionPoller(client, initialResponse);\n } else if (isTestProfileRunCreation(initialResponse)) {\n return getTestProfileRunCompletionPoller(client, initialResponse);\n }\n\n throw new Error(\"The Operation is not a long running operation.\");\n}\n\nfunction isFileUpload(response: any): response is TestUploadFileSuccessResponse {\n return response.request.url.includes(\"/files/\");\n}\n\nfunction isTestRunCreation(response: any): response is TestRunCreateOrUpdateSuccessResponse {\n return response.request.url.includes(\"/test-runs/\");\n}\n\nfunction isTestProfileRunCreation(\n response: any,\n): response is TestProfileRunCreateOrUpdateSuccessResponse {\n return response.request.url.includes(\"/test-profile-runs/\");\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/load-testing-rest/src/pollingHelper.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n CancelOnProgress,\n CreateHttpPollerOptions,\n RunningOperation,\n OperationResponse,\n OperationState,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\nimport type { AzureLoadTestingClient } from \"./clientDefinitions.js\";\nimport type {\n LoadTestAdministrationCloneTest202Response,\n LoadTestAdministrationCloneTestDefaultResponse,\n LoadTestAdministrationCloneTestLogicalResponse,\n LoadTestAdministrationGenerateTestPlanRecommendations202Response,\n LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse,\n LoadTestAdministrationGenerateTestPlanRecommendationsLogicalResponse,\n LoadTestRunGenerateInsights202Response,\n LoadTestRunGenerateInsightsDefaultResponse,\n LoadTestRunGenerateInsightsLogicalResponse,\n} from \"./responses.js\";\nimport { getFileValidationPoller } from \"./getFileValidationPoller.js\";\nimport { getTestRunCompletionPoller } from \"./getTestRunCompletionPoller.js\";\nimport { getTestProfileRunCompletionPoller } from \"./getTestProfileRunCompletionPoller.js\";\nimport type {\n FileUploadAndValidatePoller,\n TestUploadFileSuccessResponse,\n TestRunCompletionPoller,\n TestRunCreateOrUpdateSuccessResponse,\n TestProfileRunCreateOrUpdateSuccessResponse,\n TestProfileRunCompletionPoller,\n PolledOperationOptions,\n} from \"./models.js\";\n\n/**\n * A simple poller that can be used to poll a long running operation.\n */\nexport interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Returns the state of the operation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n\n /**\n * Returns a promise that could be used for serialized version of the poller's operation\n * by invoking the operation's serialize method.\n */\n serialize(): Promise<string>;\n\n /**\n * Wait the poller to be submitted.\n */\n submitted(): Promise<void>;\n\n /**\n * Returns a string representation of the poller's operation. Similar to serialize but returns a string.\n * @deprecated Use serialize() instead.\n */\n toString(): string;\n\n /**\n * Stops the poller from continuing to poll. Please note this will only stop the client-side polling\n * @deprecated Use abortSignal to stop polling instead.\n */\n stopPolling(): void;\n\n /**\n * Returns true if the poller is stopped.\n * @deprecated Use abortSignal status to track this instead.\n */\n isStopped(): boolean;\n}\n\n// Helper for custom pollers\nfunction isFileUpload(response: HttpResponse): response is TestUploadFileSuccessResponse {\n const url = response.request?.url ?? \"\";\n // Match: /tests/{testId}/files/{fileName} but NOT /test-runs/\n return url.includes(\"/files/\") && url.includes(\"/tests/\") && !url.includes(\"/test-runs/\");\n}\n\nfunction isTestRunCreation(\n response: HttpResponse,\n): response is TestRunCreateOrUpdateSuccessResponse {\n const url = response.request?.url ?? \"\";\n const method = response.request?.method.toUpperCase() ?? \"\";\n // Match: /test-runs/{testRunId}\n return url.includes(\"/test-runs/\") && !url.includes(\"/test-profile-runs/\") && method === \"PATCH\";\n}\n\nfunction isTestProfileRunCreation(\n response: HttpResponse,\n): response is TestProfileRunCreateOrUpdateSuccessResponse {\n const url = response.request?.url ?? \"\";\n // Match: /test-profile-runs/{testProfileRunId}\n return url.includes(\"/test-profile-runs/\");\n}\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\n// Custom overload signatures\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse: TestUploadFileSuccessResponse,\n polledOperationOptions?: PolledOperationOptions,\n): Promise<FileUploadAndValidatePoller>;\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse: TestRunCreateOrUpdateSuccessResponse,\n polledOperationOptions?: PolledOperationOptions,\n): Promise<TestRunCompletionPoller>;\nexport async function getLongRunningPoller(\n client: AzureLoadTestingClient,\n initialResponse: TestProfileRunCreateOrUpdateSuccessResponse,\n polledOperationOptions?: PolledOperationOptions,\n): Promise<TestProfileRunCompletionPoller>;\nexport async function getLongRunningPoller<\n TResult extends\n | LoadTestAdministrationCloneTestLogicalResponse\n | LoadTestAdministrationCloneTestDefaultResponse,\n>(\n client: Client,\n initialResponse:\n | LoadTestAdministrationCloneTest202Response\n | LoadTestAdministrationCloneTestDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>,\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends\n | LoadTestAdministrationGenerateTestPlanRecommendationsLogicalResponse\n | LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse,\n>(\n client: Client,\n initialResponse:\n | LoadTestAdministrationGenerateTestPlanRecommendations202Response\n | LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>,\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\nexport async function getLongRunningPoller<\n TResult extends\n | LoadTestRunGenerateInsightsLogicalResponse\n | LoadTestRunGenerateInsightsDefaultResponse,\n>(\n client: Client,\n initialResponse:\n | LoadTestRunGenerateInsights202Response\n | LoadTestRunGenerateInsightsDefaultResponse,\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>,\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\n\nexport async function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> | PolledOperationOptions = {},\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {\n // Route to custom pollers based on response type\n if (isFileUpload(initialResponse)) {\n return getFileValidationPoller(\n client as AzureLoadTestingClient,\n initialResponse as unknown as TestUploadFileSuccessResponse,\n options as PolledOperationOptions,\n ) as unknown as SimplePollerLike<OperationState<TResult>, TResult>;\n }\n\n if (isTestRunCreation(initialResponse)) {\n return getTestRunCompletionPoller(\n client as AzureLoadTestingClient,\n initialResponse as unknown as TestRunCreateOrUpdateSuccessResponse,\n options as PolledOperationOptions,\n ) as unknown as SimplePollerLike<OperationState<TResult>, TResult>;\n }\n\n if (isTestProfileRunCreation(initialResponse)) {\n return getTestProfileRunCompletionPoller(\n client as AzureLoadTestingClient,\n initialResponse as unknown as TestProfileRunCreateOrUpdateSuccessResponse,\n options as PolledOperationOptions,\n ) as unknown as SimplePollerLike<OperationState<TResult>, TResult>;\n }\n\n const httpPollerOptions = options as CreateHttpPollerOptions<TResult, OperationState<TResult>>;\n\n const abortController = new AbortController();\n const poller: RunningOperation<TResult> = {\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path: string, pollOptions?: { abortSignal?: AbortSignalLike }) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get({ abortSignal });\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n httpPollerOptions.resolveOnUnsuccessful = httpPollerOptions.resolveOnUnsuccessful ?? true;\n const httpPoller = createHttpPoller(poller, httpPollerOptions);\n const simplePoller: SimplePollerLike<OperationState<TResult>, TResult> = {\n isDone() {\n return httpPoller.isDone;\n },\n isStopped() {\n return abortController.signal.aborted;\n },\n getOperationState() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return httpPoller.operationState;\n },\n getResult() {\n return httpPoller.result;\n },\n toString() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return JSON.stringify({\n state: httpPoller.operationState,\n });\n },\n stopPolling() {\n abortController.abort();\n },\n onProgress: httpPoller.onProgress,\n poll: httpPoller.poll,\n pollUntilDone: httpPoller.pollUntilDone,\n serialize: httpPoller.serialize,\n submitted: httpPoller.submitted,\n };\n return simplePoller;\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult,\n): OperationResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -1,6 +1,20 @@
1
1
  import type { RawHttpHeaders } from "@azure/core-rest-pipeline";
2
2
  import type { HttpResponse, ErrorResponse } from "@azure-rest/core-client";
3
- import type { TestOutput, PagedTestOutput, TestFileInfoOutput, PagedTestFileInfoOutput, TestAppComponentsOutput, TestServerMetricsConfigurationOutput, TestProfileOutput, PagedTestProfileOutput, TestRunOutput, PagedTestRunOutput, TestRunFileInfoOutput, MetricNamespaceCollectionOutput, MetricDefinitionCollectionOutput, MetricsOutput, DimensionValueListOutput, TestRunAppComponentsOutput, TestRunServerMetricsConfigurationOutput, TestProfileRunOutput, PagedTestProfileRunOutput, TriggerOutput, PagedTriggerOutput, NotificationRuleOutput, PagedNotificationRuleOutput } from "./outputModels.js";
3
+ import type { OperationStatusOutput, TestOutput, PagedTestOutput, ResourceOperationStatusTestErrorOutput, TestFileInfoOutput, PagedTestFileInfoOutput, TestAppComponentsOutput, TestServerMetricsConfigurationOutput, TestProfileOutput, PagedTestProfileOutput, TriggerOutput, PagedTriggerOutput, NotificationRuleOutput, PagedNotificationRuleOutput, TestRunOutput, PagedTestRunOutput, TestRunFileInfoOutput, TestRunInsightsOutput, MetricNamespaceCollectionOutput, MetricDefinitionCollectionOutput, MetricsOutput, DimensionValueListOutput, TestRunAppComponentsOutput, TestRunServerMetricsConfigurationOutput, TestProfileRunOutput, PagedTestProfileRunOutput } from "./outputModels.js";
4
+ /** The request has succeeded. */
5
+ export interface OperationsGetStatus200Response extends HttpResponse {
6
+ status: "200";
7
+ body: OperationStatusOutput;
8
+ }
9
+ export interface OperationsGetStatusDefaultHeaders {
10
+ /** String error code indicating what went wrong. */
11
+ "x-ms-error-code"?: string;
12
+ }
13
+ export interface OperationsGetStatusDefaultResponse extends HttpResponse {
14
+ status: string;
15
+ body: ErrorResponse;
16
+ headers: RawHttpHeaders & OperationsGetStatusDefaultHeaders;
17
+ }
4
18
  /** The request has succeeded. */
5
19
  export interface LoadTestAdministrationCreateOrUpdateTest200Response extends HttpResponse {
6
20
  status: "200";
@@ -61,6 +75,54 @@ export interface LoadTestAdministrationListTestsDefaultResponse extends HttpResp
61
75
  body: ErrorResponse;
62
76
  headers: RawHttpHeaders & LoadTestAdministrationListTestsDefaultHeaders;
63
77
  }
78
+ export interface LoadTestAdministrationCloneTest202Headers {
79
+ /** The location for monitoring the operation state. */
80
+ "operation-location": string;
81
+ }
82
+ /** The request has been accepted for processing, but processing has not yet completed. */
83
+ export interface LoadTestAdministrationCloneTest202Response extends HttpResponse {
84
+ status: "202";
85
+ body: ResourceOperationStatusTestErrorOutput;
86
+ headers: RawHttpHeaders & LoadTestAdministrationCloneTest202Headers;
87
+ }
88
+ export interface LoadTestAdministrationCloneTestDefaultHeaders {
89
+ /** String error code indicating what went wrong. */
90
+ "x-ms-error-code"?: string;
91
+ }
92
+ export interface LoadTestAdministrationCloneTestDefaultResponse extends HttpResponse {
93
+ status: string;
94
+ body: ErrorResponse;
95
+ headers: RawHttpHeaders & LoadTestAdministrationCloneTestDefaultHeaders;
96
+ }
97
+ /** The final response for long-running cloneTest operation */
98
+ export interface LoadTestAdministrationCloneTestLogicalResponse extends HttpResponse {
99
+ status: "200";
100
+ body: ResourceOperationStatusTestErrorOutput;
101
+ }
102
+ export interface LoadTestAdministrationGenerateTestPlanRecommendations202Headers {
103
+ /** The location for monitoring the operation state. */
104
+ "operation-location": string;
105
+ }
106
+ /** The request has been accepted for processing, but processing has not yet completed. */
107
+ export interface LoadTestAdministrationGenerateTestPlanRecommendations202Response extends HttpResponse {
108
+ status: "202";
109
+ body: ResourceOperationStatusTestErrorOutput;
110
+ headers: RawHttpHeaders & LoadTestAdministrationGenerateTestPlanRecommendations202Headers;
111
+ }
112
+ export interface LoadTestAdministrationGenerateTestPlanRecommendationsDefaultHeaders {
113
+ /** String error code indicating what went wrong. */
114
+ "x-ms-error-code"?: string;
115
+ }
116
+ export interface LoadTestAdministrationGenerateTestPlanRecommendationsDefaultResponse extends HttpResponse {
117
+ status: string;
118
+ body: ErrorResponse;
119
+ headers: RawHttpHeaders & LoadTestAdministrationGenerateTestPlanRecommendationsDefaultHeaders;
120
+ }
121
+ /** The final response for long-running generateTestPlanRecommendations operation */
122
+ export interface LoadTestAdministrationGenerateTestPlanRecommendationsLogicalResponse extends HttpResponse {
123
+ status: "200";
124
+ body: ResourceOperationStatusTestErrorOutput;
125
+ }
64
126
  /** The request has succeeded and a new resource has been created as a result. */
65
127
  export interface LoadTestAdministrationUploadTestFile201Response extends HttpResponse {
66
128
  status: "201";
@@ -243,6 +305,126 @@ export interface TestProfileAdministrationListTestProfilesDefaultResponse extend
243
305
  headers: RawHttpHeaders & TestProfileAdministrationListTestProfilesDefaultHeaders;
244
306
  }
245
307
  /** The request has succeeded. */
308
+ export interface TriggerAdministrationGetTrigger200Response extends HttpResponse {
309
+ status: "200";
310
+ body: TriggerOutput;
311
+ }
312
+ export interface TriggerAdministrationGetTriggerDefaultHeaders {
313
+ /** String error code indicating what went wrong. */
314
+ "x-ms-error-code"?: string;
315
+ }
316
+ export interface TriggerAdministrationGetTriggerDefaultResponse extends HttpResponse {
317
+ status: string;
318
+ body: ErrorResponse;
319
+ headers: RawHttpHeaders & TriggerAdministrationGetTriggerDefaultHeaders;
320
+ }
321
+ /** The request has succeeded. */
322
+ export interface TriggerAdministrationCreateOrUpdateTrigger200Response extends HttpResponse {
323
+ status: "200";
324
+ body: TriggerOutput;
325
+ }
326
+ /** The request has succeeded and a new resource has been created as a result. */
327
+ export interface TriggerAdministrationCreateOrUpdateTrigger201Response extends HttpResponse {
328
+ status: "201";
329
+ body: TriggerOutput;
330
+ }
331
+ export interface TriggerAdministrationCreateOrUpdateTriggerDefaultHeaders {
332
+ /** String error code indicating what went wrong. */
333
+ "x-ms-error-code"?: string;
334
+ }
335
+ export interface TriggerAdministrationCreateOrUpdateTriggerDefaultResponse extends HttpResponse {
336
+ status: string;
337
+ body: ErrorResponse;
338
+ headers: RawHttpHeaders & TriggerAdministrationCreateOrUpdateTriggerDefaultHeaders;
339
+ }
340
+ /** There is no content to send for this request, but the headers may be useful. */
341
+ export interface TriggerAdministrationDeleteTrigger204Response extends HttpResponse {
342
+ status: "204";
343
+ }
344
+ export interface TriggerAdministrationDeleteTriggerDefaultHeaders {
345
+ /** String error code indicating what went wrong. */
346
+ "x-ms-error-code"?: string;
347
+ }
348
+ export interface TriggerAdministrationDeleteTriggerDefaultResponse extends HttpResponse {
349
+ status: string;
350
+ body: ErrorResponse;
351
+ headers: RawHttpHeaders & TriggerAdministrationDeleteTriggerDefaultHeaders;
352
+ }
353
+ /** The request has succeeded. */
354
+ export interface TriggerAdministrationListTrigger200Response extends HttpResponse {
355
+ status: "200";
356
+ body: PagedTriggerOutput;
357
+ }
358
+ export interface TriggerAdministrationListTriggerDefaultHeaders {
359
+ /** String error code indicating what went wrong. */
360
+ "x-ms-error-code"?: string;
361
+ }
362
+ export interface TriggerAdministrationListTriggerDefaultResponse extends HttpResponse {
363
+ status: string;
364
+ body: ErrorResponse;
365
+ headers: RawHttpHeaders & TriggerAdministrationListTriggerDefaultHeaders;
366
+ }
367
+ /** The request has succeeded. */
368
+ export interface NotificationRuleAdministrationGetNotificationRule200Response extends HttpResponse {
369
+ status: "200";
370
+ body: NotificationRuleOutput;
371
+ }
372
+ export interface NotificationRuleAdministrationGetNotificationRuleDefaultHeaders {
373
+ /** String error code indicating what went wrong. */
374
+ "x-ms-error-code"?: string;
375
+ }
376
+ export interface NotificationRuleAdministrationGetNotificationRuleDefaultResponse extends HttpResponse {
377
+ status: string;
378
+ body: ErrorResponse;
379
+ headers: RawHttpHeaders & NotificationRuleAdministrationGetNotificationRuleDefaultHeaders;
380
+ }
381
+ /** The request has succeeded. */
382
+ export interface NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response extends HttpResponse {
383
+ status: "200";
384
+ body: NotificationRuleOutput;
385
+ }
386
+ /** The request has succeeded and a new resource has been created as a result. */
387
+ export interface NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response extends HttpResponse {
388
+ status: "201";
389
+ body: NotificationRuleOutput;
390
+ }
391
+ export interface NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultHeaders {
392
+ /** String error code indicating what went wrong. */
393
+ "x-ms-error-code"?: string;
394
+ }
395
+ export interface NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse extends HttpResponse {
396
+ status: string;
397
+ body: ErrorResponse;
398
+ headers: RawHttpHeaders & NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultHeaders;
399
+ }
400
+ /** There is no content to send for this request, but the headers may be useful. */
401
+ export interface NotificationRuleAdministrationDeleteNotificationRule204Response extends HttpResponse {
402
+ status: "204";
403
+ }
404
+ export interface NotificationRuleAdministrationDeleteNotificationRuleDefaultHeaders {
405
+ /** String error code indicating what went wrong. */
406
+ "x-ms-error-code"?: string;
407
+ }
408
+ export interface NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse extends HttpResponse {
409
+ status: string;
410
+ body: ErrorResponse;
411
+ headers: RawHttpHeaders & NotificationRuleAdministrationDeleteNotificationRuleDefaultHeaders;
412
+ }
413
+ /** The request has succeeded. */
414
+ export interface NotificationRuleAdministrationListNotificationRule200Response extends HttpResponse {
415
+ status: "200";
416
+ body: PagedNotificationRuleOutput;
417
+ }
418
+ export interface NotificationRuleAdministrationListNotificationRuleDefaultHeaders {
419
+ /** String error code indicating what went wrong. */
420
+ "x-ms-error-code"?: string;
421
+ }
422
+ export interface NotificationRuleAdministrationListNotificationRuleDefaultResponse extends HttpResponse {
423
+ status: string;
424
+ body: ErrorResponse;
425
+ headers: RawHttpHeaders & NotificationRuleAdministrationListNotificationRuleDefaultHeaders;
426
+ }
427
+ /** The request has succeeded. */
246
428
  export interface LoadTestRunGetTestRun200Response extends HttpResponse {
247
429
  status: "200";
248
430
  body: TestRunOutput;
@@ -331,6 +513,57 @@ export interface LoadTestRunStopDefaultResponse extends HttpResponse {
331
513
  headers: RawHttpHeaders & LoadTestRunStopDefaultHeaders;
332
514
  }
333
515
  /** The request has succeeded. */
516
+ export interface LoadTestRunGetLatestInsights200Response extends HttpResponse {
517
+ status: "200";
518
+ body: TestRunInsightsOutput;
519
+ }
520
+ export interface LoadTestRunGetLatestInsightsDefaultHeaders {
521
+ /** String error code indicating what went wrong. */
522
+ "x-ms-error-code"?: string;
523
+ }
524
+ export interface LoadTestRunGetLatestInsightsDefaultResponse extends HttpResponse {
525
+ status: string;
526
+ body: ErrorResponse;
527
+ headers: RawHttpHeaders & LoadTestRunGetLatestInsightsDefaultHeaders;
528
+ }
529
+ /** The request has succeeded. */
530
+ export interface LoadTestRunUpdateLatestInsights200Response extends HttpResponse {
531
+ status: "200";
532
+ body: TestRunInsightsOutput;
533
+ }
534
+ export interface LoadTestRunUpdateLatestInsightsDefaultHeaders {
535
+ /** String error code indicating what went wrong. */
536
+ "x-ms-error-code"?: string;
537
+ }
538
+ export interface LoadTestRunUpdateLatestInsightsDefaultResponse extends HttpResponse {
539
+ status: string;
540
+ body: ErrorResponse;
541
+ headers: RawHttpHeaders & LoadTestRunUpdateLatestInsightsDefaultHeaders;
542
+ }
543
+ export interface LoadTestRunGenerateInsights202Headers {
544
+ "operation-location": string;
545
+ }
546
+ /** The request has been accepted for processing, but processing has not yet completed. */
547
+ export interface LoadTestRunGenerateInsights202Response extends HttpResponse {
548
+ status: "202";
549
+ body: OperationStatusOutput;
550
+ headers: RawHttpHeaders & LoadTestRunGenerateInsights202Headers;
551
+ }
552
+ export interface LoadTestRunGenerateInsightsDefaultHeaders {
553
+ /** String error code indicating what went wrong. */
554
+ "x-ms-error-code"?: string;
555
+ }
556
+ export interface LoadTestRunGenerateInsightsDefaultResponse extends HttpResponse {
557
+ status: string;
558
+ body: ErrorResponse;
559
+ headers: RawHttpHeaders & LoadTestRunGenerateInsightsDefaultHeaders;
560
+ }
561
+ /** The final response for long-running generateInsights operation */
562
+ export interface LoadTestRunGenerateInsightsLogicalResponse extends HttpResponse {
563
+ status: "200";
564
+ body: OperationStatusOutput;
565
+ }
566
+ /** The request has succeeded. */
334
567
  export interface LoadTestRunListMetricNamespaces200Response extends HttpResponse {
335
568
  status: "200";
336
569
  body: MetricNamespaceCollectionOutput;
@@ -526,124 +759,4 @@ export interface TestProfileRunAdministrationListTestProfileRunsDefaultResponse
526
759
  body: ErrorResponse;
527
760
  headers: RawHttpHeaders & TestProfileRunAdministrationListTestProfileRunsDefaultHeaders;
528
761
  }
529
- /** The request has succeeded. */
530
- export interface TriggerAdministrationGetTrigger200Response extends HttpResponse {
531
- status: "200";
532
- body: TriggerOutput;
533
- }
534
- export interface TriggerAdministrationGetTriggerDefaultHeaders {
535
- /** String error code indicating what went wrong. */
536
- "x-ms-error-code"?: string;
537
- }
538
- export interface TriggerAdministrationGetTriggerDefaultResponse extends HttpResponse {
539
- status: string;
540
- body: ErrorResponse;
541
- headers: RawHttpHeaders & TriggerAdministrationGetTriggerDefaultHeaders;
542
- }
543
- /** The request has succeeded. */
544
- export interface TriggerAdministrationCreateOrUpdateTrigger200Response extends HttpResponse {
545
- status: "200";
546
- body: TriggerOutput;
547
- }
548
- /** The request has succeeded and a new resource has been created as a result. */
549
- export interface TriggerAdministrationCreateOrUpdateTrigger201Response extends HttpResponse {
550
- status: "201";
551
- body: TriggerOutput;
552
- }
553
- export interface TriggerAdministrationCreateOrUpdateTriggerDefaultHeaders {
554
- /** String error code indicating what went wrong. */
555
- "x-ms-error-code"?: string;
556
- }
557
- export interface TriggerAdministrationCreateOrUpdateTriggerDefaultResponse extends HttpResponse {
558
- status: string;
559
- body: ErrorResponse;
560
- headers: RawHttpHeaders & TriggerAdministrationCreateOrUpdateTriggerDefaultHeaders;
561
- }
562
- /** There is no content to send for this request, but the headers may be useful. */
563
- export interface TriggerAdministrationDeleteTrigger204Response extends HttpResponse {
564
- status: "204";
565
- }
566
- export interface TriggerAdministrationDeleteTriggerDefaultHeaders {
567
- /** String error code indicating what went wrong. */
568
- "x-ms-error-code"?: string;
569
- }
570
- export interface TriggerAdministrationDeleteTriggerDefaultResponse extends HttpResponse {
571
- status: string;
572
- body: ErrorResponse;
573
- headers: RawHttpHeaders & TriggerAdministrationDeleteTriggerDefaultHeaders;
574
- }
575
- /** The request has succeeded. */
576
- export interface TriggerAdministrationListTrigger200Response extends HttpResponse {
577
- status: "200";
578
- body: PagedTriggerOutput;
579
- }
580
- export interface TriggerAdministrationListTriggerDefaultHeaders {
581
- /** String error code indicating what went wrong. */
582
- "x-ms-error-code"?: string;
583
- }
584
- export interface TriggerAdministrationListTriggerDefaultResponse extends HttpResponse {
585
- status: string;
586
- body: ErrorResponse;
587
- headers: RawHttpHeaders & TriggerAdministrationListTriggerDefaultHeaders;
588
- }
589
- /** The request has succeeded. */
590
- export interface NotificationRuleAdministrationGetNotificationRule200Response extends HttpResponse {
591
- status: "200";
592
- body: NotificationRuleOutput;
593
- }
594
- export interface NotificationRuleAdministrationGetNotificationRuleDefaultHeaders {
595
- /** String error code indicating what went wrong. */
596
- "x-ms-error-code"?: string;
597
- }
598
- export interface NotificationRuleAdministrationGetNotificationRuleDefaultResponse extends HttpResponse {
599
- status: string;
600
- body: ErrorResponse;
601
- headers: RawHttpHeaders & NotificationRuleAdministrationGetNotificationRuleDefaultHeaders;
602
- }
603
- /** The request has succeeded. */
604
- export interface NotificationRuleAdministrationCreateOrUpdateNotificationRule200Response extends HttpResponse {
605
- status: "200";
606
- body: NotificationRuleOutput;
607
- }
608
- /** The request has succeeded and a new resource has been created as a result. */
609
- export interface NotificationRuleAdministrationCreateOrUpdateNotificationRule201Response extends HttpResponse {
610
- status: "201";
611
- body: NotificationRuleOutput;
612
- }
613
- export interface NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultHeaders {
614
- /** String error code indicating what went wrong. */
615
- "x-ms-error-code"?: string;
616
- }
617
- export interface NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultResponse extends HttpResponse {
618
- status: string;
619
- body: ErrorResponse;
620
- headers: RawHttpHeaders & NotificationRuleAdministrationCreateOrUpdateNotificationRuleDefaultHeaders;
621
- }
622
- /** There is no content to send for this request, but the headers may be useful. */
623
- export interface NotificationRuleAdministrationDeleteNotificationRule204Response extends HttpResponse {
624
- status: "204";
625
- }
626
- export interface NotificationRuleAdministrationDeleteNotificationRuleDefaultHeaders {
627
- /** String error code indicating what went wrong. */
628
- "x-ms-error-code"?: string;
629
- }
630
- export interface NotificationRuleAdministrationDeleteNotificationRuleDefaultResponse extends HttpResponse {
631
- status: string;
632
- body: ErrorResponse;
633
- headers: RawHttpHeaders & NotificationRuleAdministrationDeleteNotificationRuleDefaultHeaders;
634
- }
635
- /** The request has succeeded. */
636
- export interface NotificationRuleAdministrationListNotificationRule200Response extends HttpResponse {
637
- status: "200";
638
- body: PagedNotificationRuleOutput;
639
- }
640
- export interface NotificationRuleAdministrationListNotificationRuleDefaultHeaders {
641
- /** String error code indicating what went wrong. */
642
- "x-ms-error-code"?: string;
643
- }
644
- export interface NotificationRuleAdministrationListNotificationRuleDefaultResponse extends HttpResponse {
645
- status: string;
646
- body: ErrorResponse;
647
- headers: RawHttpHeaders & NotificationRuleAdministrationListNotificationRuleDefaultHeaders;
648
- }
649
762
  //# sourceMappingURL=responses.d.ts.map
@@ -1,5 +1,15 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=responses.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var responses_exports = {};
15
+ module.exports = __toCommonJS(responses_exports);