@azure/arm-streamanalytics 4.1.1-alpha.20240226.1 → 5.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 (239) hide show
  1. package/CHANGELOG.md +170 -8
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/index.js +6060 -3785
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/clustersCreateOrUpdateSample.js +14 -6
  9. package/dist-esm/samples-dev/clustersCreateOrUpdateSample.js.map +1 -1
  10. package/dist-esm/samples-dev/clustersDeleteSample.js +12 -4
  11. package/dist-esm/samples-dev/clustersDeleteSample.js.map +1 -1
  12. package/dist-esm/samples-dev/clustersGetSample.js +12 -4
  13. package/dist-esm/samples-dev/clustersGetSample.js.map +1 -1
  14. package/dist-esm/samples-dev/clustersListByResourceGroupSample.js +12 -4
  15. package/dist-esm/samples-dev/clustersListByResourceGroupSample.js.map +1 -1
  16. package/dist-esm/samples-dev/clustersListBySubscriptionSample.js +11 -3
  17. package/dist-esm/samples-dev/clustersListBySubscriptionSample.js.map +1 -1
  18. package/dist-esm/samples-dev/clustersListStreamingJobsSample.js +12 -4
  19. package/dist-esm/samples-dev/clustersListStreamingJobsSample.js.map +1 -1
  20. package/dist-esm/samples-dev/clustersUpdateSample.js +13 -5
  21. package/dist-esm/samples-dev/clustersUpdateSample.js.map +1 -1
  22. package/dist-esm/samples-dev/functionsCreateOrReplaceSample.js +97 -16
  23. package/dist-esm/samples-dev/functionsCreateOrReplaceSample.js.map +1 -1
  24. package/dist-esm/samples-dev/functionsDeleteSample.js +12 -4
  25. package/dist-esm/samples-dev/functionsDeleteSample.js.map +1 -1
  26. package/dist-esm/samples-dev/functionsGetSample.js +17 -8
  27. package/dist-esm/samples-dev/functionsGetSample.js.map +1 -1
  28. package/dist-esm/samples-dev/functionsListByStreamingJobSample.js +12 -4
  29. package/dist-esm/samples-dev/functionsListByStreamingJobSample.js.map +1 -1
  30. package/dist-esm/samples-dev/functionsRetrieveDefaultDefinitionSample.js +15 -7
  31. package/dist-esm/samples-dev/functionsRetrieveDefaultDefinitionSample.js.map +1 -1
  32. package/dist-esm/samples-dev/functionsTestSample.js +18 -9
  33. package/dist-esm/samples-dev/functionsTestSample.js.map +1 -1
  34. package/dist-esm/samples-dev/functionsUpdateSample.js +26 -14
  35. package/dist-esm/samples-dev/functionsUpdateSample.js.map +1 -1
  36. package/dist-esm/samples-dev/inputsCreateOrReplaceSample.js +147 -31
  37. package/dist-esm/samples-dev/inputsCreateOrReplaceSample.js.map +1 -1
  38. package/dist-esm/samples-dev/inputsDeleteSample.js +12 -4
  39. package/dist-esm/samples-dev/inputsDeleteSample.js.map +1 -1
  40. package/dist-esm/samples-dev/inputsGetSample.js +27 -16
  41. package/dist-esm/samples-dev/inputsGetSample.js.map +1 -1
  42. package/dist-esm/samples-dev/inputsListByStreamingJobSample.js +18 -9
  43. package/dist-esm/samples-dev/inputsListByStreamingJobSample.js.map +1 -1
  44. package/dist-esm/samples-dev/inputsTestSample.js +12 -4
  45. package/dist-esm/samples-dev/inputsTestSample.js.map +1 -1
  46. package/dist-esm/samples-dev/inputsUpdateSample.js +39 -28
  47. package/dist-esm/samples-dev/inputsUpdateSample.js.map +1 -1
  48. package/dist-esm/samples-dev/operationsListSample.js +11 -3
  49. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  50. package/dist-esm/samples-dev/outputsCreateOrReplaceSample.js +261 -56
  51. package/dist-esm/samples-dev/outputsCreateOrReplaceSample.js.map +1 -1
  52. package/dist-esm/samples-dev/outputsDeleteSample.js +12 -4
  53. package/dist-esm/samples-dev/outputsDeleteSample.js.map +1 -1
  54. package/dist-esm/samples-dev/outputsGetSample.js +98 -41
  55. package/dist-esm/samples-dev/outputsGetSample.js.map +1 -1
  56. package/dist-esm/samples-dev/outputsListByStreamingJobSample.js +12 -4
  57. package/dist-esm/samples-dev/outputsListByStreamingJobSample.js.map +1 -1
  58. package/dist-esm/samples-dev/outputsTestSample.js +12 -4
  59. package/dist-esm/samples-dev/outputsTestSample.js.map +1 -1
  60. package/dist-esm/samples-dev/outputsUpdateSample.js +150 -54
  61. package/dist-esm/samples-dev/outputsUpdateSample.js.map +1 -1
  62. package/dist-esm/samples-dev/privateEndpointsCreateOrUpdateSample.js +21 -11
  63. package/dist-esm/samples-dev/privateEndpointsCreateOrUpdateSample.js.map +1 -1
  64. package/dist-esm/samples-dev/privateEndpointsDeleteSample.js +12 -4
  65. package/dist-esm/samples-dev/privateEndpointsDeleteSample.js.map +1 -1
  66. package/dist-esm/samples-dev/privateEndpointsGetSample.js +12 -4
  67. package/dist-esm/samples-dev/privateEndpointsGetSample.js.map +1 -1
  68. package/dist-esm/samples-dev/privateEndpointsListByClusterSample.js +12 -4
  69. package/dist-esm/samples-dev/privateEndpointsListByClusterSample.js.map +1 -1
  70. package/dist-esm/samples-dev/skuListSample.d.ts +2 -0
  71. package/dist-esm/samples-dev/skuListSample.d.ts.map +1 -0
  72. package/dist-esm/samples-dev/skuListSample.js +55 -0
  73. package/dist-esm/samples-dev/skuListSample.js.map +1 -0
  74. package/dist-esm/samples-dev/streamingJobsCreateOrReplaceSample.js +85 -22
  75. package/dist-esm/samples-dev/streamingJobsCreateOrReplaceSample.js.map +1 -1
  76. package/dist-esm/samples-dev/streamingJobsDeleteSample.js +12 -4
  77. package/dist-esm/samples-dev/streamingJobsDeleteSample.js.map +1 -1
  78. package/dist-esm/samples-dev/streamingJobsGetSample.js +18 -9
  79. package/dist-esm/samples-dev/streamingJobsGetSample.js.map +1 -1
  80. package/dist-esm/samples-dev/streamingJobsListByResourceGroupSample.js +18 -9
  81. package/dist-esm/samples-dev/streamingJobsListByResourceGroupSample.js.map +1 -1
  82. package/dist-esm/samples-dev/streamingJobsListSample.js +16 -7
  83. package/dist-esm/samples-dev/streamingJobsListSample.js.map +1 -1
  84. package/dist-esm/samples-dev/streamingJobsScaleSample.js +15 -7
  85. package/dist-esm/samples-dev/streamingJobsScaleSample.js.map +1 -1
  86. package/dist-esm/samples-dev/streamingJobsStartSample.js +26 -16
  87. package/dist-esm/samples-dev/streamingJobsStartSample.js.map +1 -1
  88. package/dist-esm/samples-dev/streamingJobsStopSample.js +12 -4
  89. package/dist-esm/samples-dev/streamingJobsStopSample.js.map +1 -1
  90. package/dist-esm/samples-dev/streamingJobsUpdateSample.js +14 -6
  91. package/dist-esm/samples-dev/streamingJobsUpdateSample.js.map +1 -1
  92. package/dist-esm/samples-dev/subscriptionsCompileQuerySample.d.ts +2 -0
  93. package/dist-esm/samples-dev/subscriptionsCompileQuerySample.d.ts.map +1 -0
  94. package/dist-esm/samples-dev/subscriptionsCompileQuerySample.js +53 -0
  95. package/dist-esm/samples-dev/subscriptionsCompileQuerySample.js.map +1 -0
  96. package/dist-esm/samples-dev/subscriptionsListQuotasSample.js +11 -3
  97. package/dist-esm/samples-dev/subscriptionsListQuotasSample.js.map +1 -1
  98. package/dist-esm/samples-dev/subscriptionsSampleInputSample.d.ts +2 -0
  99. package/dist-esm/samples-dev/subscriptionsSampleInputSample.d.ts.map +1 -0
  100. package/dist-esm/samples-dev/subscriptionsSampleInputSample.js +60 -0
  101. package/dist-esm/samples-dev/subscriptionsSampleInputSample.js.map +1 -0
  102. package/dist-esm/samples-dev/subscriptionsTestInputSample.d.ts +2 -0
  103. package/dist-esm/samples-dev/subscriptionsTestInputSample.d.ts.map +1 -0
  104. package/dist-esm/samples-dev/subscriptionsTestInputSample.js +57 -0
  105. package/dist-esm/samples-dev/subscriptionsTestInputSample.js.map +1 -0
  106. package/dist-esm/samples-dev/subscriptionsTestOutputSample.d.ts +2 -0
  107. package/dist-esm/samples-dev/subscriptionsTestOutputSample.d.ts.map +1 -0
  108. package/dist-esm/samples-dev/subscriptionsTestOutputSample.js +53 -0
  109. package/dist-esm/samples-dev/subscriptionsTestOutputSample.js.map +1 -0
  110. package/dist-esm/samples-dev/subscriptionsTestQuerySample.d.ts +2 -0
  111. package/dist-esm/samples-dev/subscriptionsTestQuerySample.d.ts.map +1 -0
  112. package/dist-esm/samples-dev/subscriptionsTestQuerySample.js +78 -0
  113. package/dist-esm/samples-dev/subscriptionsTestQuerySample.js.map +1 -0
  114. package/dist-esm/samples-dev/transformationsCreateOrReplaceSample.js +14 -6
  115. package/dist-esm/samples-dev/transformationsCreateOrReplaceSample.js.map +1 -1
  116. package/dist-esm/samples-dev/transformationsGetSample.js +12 -4
  117. package/dist-esm/samples-dev/transformationsGetSample.js.map +1 -1
  118. package/dist-esm/samples-dev/transformationsUpdateSample.js +13 -5
  119. package/dist-esm/samples-dev/transformationsUpdateSample.js.map +1 -1
  120. package/dist-esm/src/lroImpl.d.ts +6 -11
  121. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  122. package/dist-esm/src/lroImpl.js +12 -20
  123. package/dist-esm/src/lroImpl.js.map +1 -1
  124. package/dist-esm/src/models/index.d.ts +1320 -469
  125. package/dist-esm/src/models/index.d.ts.map +1 -1
  126. package/dist-esm/src/models/index.js +126 -22
  127. package/dist-esm/src/models/index.js.map +1 -1
  128. package/dist-esm/src/models/mappers.d.ts +108 -42
  129. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  130. package/dist-esm/src/models/mappers.js +3129 -1585
  131. package/dist-esm/src/models/mappers.js.map +1 -1
  132. package/dist-esm/src/models/parameters.d.ts +19 -13
  133. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  134. package/dist-esm/src/models/parameters.js +162 -131
  135. package/dist-esm/src/models/parameters.js.map +1 -1
  136. package/dist-esm/src/operations/clusters.d.ts +4 -4
  137. package/dist-esm/src/operations/clusters.d.ts.map +1 -1
  138. package/dist-esm/src/operations/clusters.js +105 -93
  139. package/dist-esm/src/operations/clusters.js.map +1 -1
  140. package/dist-esm/src/operations/functions.d.ts +2 -2
  141. package/dist-esm/src/operations/functions.d.ts.map +1 -1
  142. package/dist-esm/src/operations/functions.js +64 -60
  143. package/dist-esm/src/operations/functions.js.map +1 -1
  144. package/dist-esm/src/operations/index.d.ts +5 -4
  145. package/dist-esm/src/operations/index.d.ts.map +1 -1
  146. package/dist-esm/src/operations/index.js +5 -4
  147. package/dist-esm/src/operations/index.js.map +1 -1
  148. package/dist-esm/src/operations/inputs.d.ts +2 -2
  149. package/dist-esm/src/operations/inputs.d.ts.map +1 -1
  150. package/dist-esm/src/operations/inputs.js +58 -54
  151. package/dist-esm/src/operations/inputs.js.map +1 -1
  152. package/dist-esm/src/operations/operations.js +9 -9
  153. package/dist-esm/src/operations/outputs.d.ts +2 -2
  154. package/dist-esm/src/operations/outputs.d.ts.map +1 -1
  155. package/dist-esm/src/operations/outputs.js +58 -54
  156. package/dist-esm/src/operations/outputs.js.map +1 -1
  157. package/dist-esm/src/operations/privateEndpoints.d.ts +2 -2
  158. package/dist-esm/src/operations/privateEndpoints.d.ts.map +1 -1
  159. package/dist-esm/src/operations/privateEndpoints.js +47 -43
  160. package/dist-esm/src/operations/privateEndpoints.js.map +1 -1
  161. package/dist-esm/src/operations/skuOperations.d.ts +38 -0
  162. package/dist-esm/src/operations/skuOperations.d.ts.map +1 -0
  163. package/dist-esm/src/operations/skuOperations.js +150 -0
  164. package/dist-esm/src/operations/skuOperations.js.map +1 -0
  165. package/dist-esm/src/operations/streamingJobs.d.ts +6 -6
  166. package/dist-esm/src/operations/streamingJobs.d.ts.map +1 -1
  167. package/dist-esm/src/operations/streamingJobs.js +119 -99
  168. package/dist-esm/src/operations/streamingJobs.js.map +1 -1
  169. package/dist-esm/src/operations/subscriptions.d.ts +79 -4
  170. package/dist-esm/src/operations/subscriptions.d.ts.map +1 -1
  171. package/dist-esm/src/operations/subscriptions.js +401 -8
  172. package/dist-esm/src/operations/subscriptions.js.map +1 -1
  173. package/dist-esm/src/operations/transformations.js +22 -22
  174. package/dist-esm/src/operations/transformations.js.map +1 -1
  175. package/dist-esm/src/operationsInterfaces/clusters.d.ts +4 -4
  176. package/dist-esm/src/operationsInterfaces/clusters.d.ts.map +1 -1
  177. package/dist-esm/src/operationsInterfaces/functions.d.ts +2 -2
  178. package/dist-esm/src/operationsInterfaces/functions.d.ts.map +1 -1
  179. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -4
  180. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  181. package/dist-esm/src/operationsInterfaces/index.js +5 -4
  182. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  183. package/dist-esm/src/operationsInterfaces/inputs.d.ts +2 -2
  184. package/dist-esm/src/operationsInterfaces/inputs.d.ts.map +1 -1
  185. package/dist-esm/src/operationsInterfaces/outputs.d.ts +2 -2
  186. package/dist-esm/src/operationsInterfaces/outputs.d.ts.map +1 -1
  187. package/dist-esm/src/operationsInterfaces/privateEndpoints.d.ts +2 -2
  188. package/dist-esm/src/operationsInterfaces/privateEndpoints.d.ts.map +1 -1
  189. package/dist-esm/src/operationsInterfaces/skuOperations.d.ts +13 -0
  190. package/dist-esm/src/operationsInterfaces/skuOperations.d.ts.map +1 -0
  191. package/dist-esm/src/operationsInterfaces/skuOperations.js +9 -0
  192. package/dist-esm/src/operationsInterfaces/skuOperations.js.map +1 -0
  193. package/dist-esm/src/operationsInterfaces/streamingJobs.d.ts +6 -6
  194. package/dist-esm/src/operationsInterfaces/streamingJobs.d.ts.map +1 -1
  195. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts +79 -4
  196. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts.map +1 -1
  197. package/dist-esm/src/streamAnalyticsManagementClient.d.ts +6 -8
  198. package/dist-esm/src/streamAnalyticsManagementClient.d.ts.map +1 -1
  199. package/dist-esm/src/streamAnalyticsManagementClient.js +12 -41
  200. package/dist-esm/src/streamAnalyticsManagementClient.js.map +1 -1
  201. package/dist-esm/test/streamanalytics_operations_test.spec.d.ts +4 -0
  202. package/dist-esm/test/streamanalytics_operations_test.spec.d.ts.map +1 -0
  203. package/dist-esm/test/streamanalytics_operations_test.spec.js +112 -0
  204. package/dist-esm/test/streamanalytics_operations_test.spec.js.map +1 -0
  205. package/package.json +15 -14
  206. package/review/arm-streamanalytics.api.md +614 -55
  207. package/src/lroImpl.ts +31 -23
  208. package/src/models/index.ts +1514 -538
  209. package/src/models/mappers.ts +3649 -1881
  210. package/src/models/parameters.ts +182 -140
  211. package/src/operations/clusters.ts +189 -189
  212. package/src/operations/functions.ts +115 -113
  213. package/src/operations/index.ts +5 -4
  214. package/src/operations/inputs.ts +103 -103
  215. package/src/operations/operations.ts +16 -16
  216. package/src/operations/outputs.ts +103 -103
  217. package/src/operations/privateEndpoints.ts +83 -84
  218. package/src/operations/skuOperations.ts +193 -0
  219. package/src/operations/streamingJobs.ts +208 -215
  220. package/src/operations/subscriptions.ts +551 -13
  221. package/src/operations/transformations.ts +32 -35
  222. package/src/operationsInterfaces/clusters.ts +17 -17
  223. package/src/operationsInterfaces/functions.ts +14 -11
  224. package/src/operationsInterfaces/index.ts +5 -4
  225. package/src/operationsInterfaces/inputs.ts +10 -10
  226. package/src/operationsInterfaces/operations.ts +1 -1
  227. package/src/operationsInterfaces/outputs.ts +10 -10
  228. package/src/operationsInterfaces/privateEndpoints.ts +8 -8
  229. package/src/operationsInterfaces/skuOperations.ts +26 -0
  230. package/src/operationsInterfaces/streamingJobs.ts +22 -22
  231. package/src/operationsInterfaces/subscriptions.ts +151 -5
  232. package/src/operationsInterfaces/transformations.ts +4 -4
  233. package/src/pagingHelper.ts +1 -1
  234. package/src/streamAnalyticsManagementClient.ts +34 -65
  235. package/types/arm-streamanalytics.d.ts +1129 -109
  236. package/dist-esm/test/sampleTest.d.ts +0 -2
  237. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  238. package/dist-esm/test/sampleTest.js +0 -38
  239. package/dist-esm/test/sampleTest.js.map +0 -1
@@ -11,9 +11,30 @@ import * as coreClient from "@azure/core-client";
11
11
  import * as Mappers from "../models/mappers";
12
12
  import * as Parameters from "../models/parameters";
13
13
  import { StreamAnalyticsManagementClient } from "../streamAnalyticsManagementClient";
14
+ import {
15
+ SimplePollerLike,
16
+ OperationState,
17
+ createHttpPoller,
18
+ } from "@azure/core-lro";
19
+ import { createLroSpec } from "../lroImpl";
14
20
  import {
15
21
  SubscriptionsListQuotasOptionalParams,
16
- SubscriptionsListQuotasResponse
22
+ SubscriptionsListQuotasResponse,
23
+ TestQuery,
24
+ SubscriptionsTestQueryOptionalParams,
25
+ SubscriptionsTestQueryResponse,
26
+ CompileQuery,
27
+ SubscriptionsCompileQueryOptionalParams,
28
+ SubscriptionsCompileQueryResponse,
29
+ SampleInput,
30
+ SubscriptionsSampleInputOptionalParams,
31
+ SubscriptionsSampleInputResponse,
32
+ TestInput,
33
+ SubscriptionsTestInputOptionalParams,
34
+ SubscriptionsTestInputResponse,
35
+ TestOutput,
36
+ SubscriptionsTestOutputOptionalParams,
37
+ SubscriptionsTestOutputResponse,
17
38
  } from "../models";
18
39
 
19
40
  /** Class containing Subscriptions operations. */
@@ -30,42 +51,559 @@ export class SubscriptionsImpl implements Subscriptions {
30
51
 
31
52
  /**
32
53
  * Retrieves the subscription's current quota information in a particular region.
33
- * @param location The region in which to retrieve the subscription's quota information. You can find
34
- * out which regions Azure Stream Analytics is supported in here:
35
- * https://azure.microsoft.com/en-us/regions/
54
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
55
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
36
56
  * @param options The options parameters.
37
57
  */
38
58
  listQuotas(
39
59
  location: string,
40
- options?: SubscriptionsListQuotasOptionalParams
60
+ options?: SubscriptionsListQuotasOptionalParams,
41
61
  ): Promise<SubscriptionsListQuotasResponse> {
42
62
  return this.client.sendOperationRequest(
43
63
  { location, options },
44
- listQuotasOperationSpec
64
+ listQuotasOperationSpec,
65
+ );
66
+ }
67
+
68
+ /**
69
+ * Test the Stream Analytics query on a sample input.
70
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
71
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
72
+ * @param testQuery The query testing object that defines the input, output, and transformation for the
73
+ * query testing.
74
+ * @param options The options parameters.
75
+ */
76
+ async beginTestQuery(
77
+ location: string,
78
+ testQuery: TestQuery,
79
+ options?: SubscriptionsTestQueryOptionalParams,
80
+ ): Promise<
81
+ SimplePollerLike<
82
+ OperationState<SubscriptionsTestQueryResponse>,
83
+ SubscriptionsTestQueryResponse
84
+ >
85
+ > {
86
+ const directSendOperation = async (
87
+ args: coreClient.OperationArguments,
88
+ spec: coreClient.OperationSpec,
89
+ ): Promise<SubscriptionsTestQueryResponse> => {
90
+ return this.client.sendOperationRequest(args, spec);
91
+ };
92
+ const sendOperationFn = async (
93
+ args: coreClient.OperationArguments,
94
+ spec: coreClient.OperationSpec,
95
+ ) => {
96
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
97
+ undefined;
98
+ const providedCallback = args.options?.onResponse;
99
+ const callback: coreClient.RawResponseCallback = (
100
+ rawResponse: coreClient.FullOperationResponse,
101
+ flatResponse: unknown,
102
+ ) => {
103
+ currentRawResponse = rawResponse;
104
+ providedCallback?.(rawResponse, flatResponse);
105
+ };
106
+ const updatedArgs = {
107
+ ...args,
108
+ options: {
109
+ ...args.options,
110
+ onResponse: callback,
111
+ },
112
+ };
113
+ const flatResponse = await directSendOperation(updatedArgs, spec);
114
+ return {
115
+ flatResponse,
116
+ rawResponse: {
117
+ statusCode: currentRawResponse!.status,
118
+ body: currentRawResponse!.parsedBody,
119
+ headers: currentRawResponse!.headers.toJSON(),
120
+ },
121
+ };
122
+ };
123
+
124
+ const lro = createLroSpec({
125
+ sendOperationFn,
126
+ args: { location, testQuery, options },
127
+ spec: testQueryOperationSpec,
128
+ });
129
+ const poller = await createHttpPoller<
130
+ SubscriptionsTestQueryResponse,
131
+ OperationState<SubscriptionsTestQueryResponse>
132
+ >(lro, {
133
+ restoreFrom: options?.resumeFrom,
134
+ intervalInMs: options?.updateIntervalInMs,
135
+ resourceLocationConfig: "location",
136
+ });
137
+ await poller.poll();
138
+ return poller;
139
+ }
140
+
141
+ /**
142
+ * Test the Stream Analytics query on a sample input.
143
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
144
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
145
+ * @param testQuery The query testing object that defines the input, output, and transformation for the
146
+ * query testing.
147
+ * @param options The options parameters.
148
+ */
149
+ async beginTestQueryAndWait(
150
+ location: string,
151
+ testQuery: TestQuery,
152
+ options?: SubscriptionsTestQueryOptionalParams,
153
+ ): Promise<SubscriptionsTestQueryResponse> {
154
+ const poller = await this.beginTestQuery(location, testQuery, options);
155
+ return poller.pollUntilDone();
156
+ }
157
+
158
+ /**
159
+ * Compile the Stream Analytics query.
160
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
161
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
162
+ * @param compileQuery The query compilation object which defines the input, output, and transformation
163
+ * for the query compilation.
164
+ * @param options The options parameters.
165
+ */
166
+ compileQuery(
167
+ location: string,
168
+ compileQuery: CompileQuery,
169
+ options?: SubscriptionsCompileQueryOptionalParams,
170
+ ): Promise<SubscriptionsCompileQueryResponse> {
171
+ return this.client.sendOperationRequest(
172
+ { location, compileQuery, options },
173
+ compileQueryOperationSpec,
45
174
  );
46
175
  }
176
+
177
+ /**
178
+ * Sample the Stream Analytics input data.
179
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
180
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
181
+ * @param sampleInput Defines the necessary parameters for sampling the Stream Analytics input data.
182
+ * @param options The options parameters.
183
+ */
184
+ async beginSampleInput(
185
+ location: string,
186
+ sampleInput: SampleInput,
187
+ options?: SubscriptionsSampleInputOptionalParams,
188
+ ): Promise<
189
+ SimplePollerLike<
190
+ OperationState<SubscriptionsSampleInputResponse>,
191
+ SubscriptionsSampleInputResponse
192
+ >
193
+ > {
194
+ const directSendOperation = async (
195
+ args: coreClient.OperationArguments,
196
+ spec: coreClient.OperationSpec,
197
+ ): Promise<SubscriptionsSampleInputResponse> => {
198
+ return this.client.sendOperationRequest(args, spec);
199
+ };
200
+ const sendOperationFn = async (
201
+ args: coreClient.OperationArguments,
202
+ spec: coreClient.OperationSpec,
203
+ ) => {
204
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
205
+ undefined;
206
+ const providedCallback = args.options?.onResponse;
207
+ const callback: coreClient.RawResponseCallback = (
208
+ rawResponse: coreClient.FullOperationResponse,
209
+ flatResponse: unknown,
210
+ ) => {
211
+ currentRawResponse = rawResponse;
212
+ providedCallback?.(rawResponse, flatResponse);
213
+ };
214
+ const updatedArgs = {
215
+ ...args,
216
+ options: {
217
+ ...args.options,
218
+ onResponse: callback,
219
+ },
220
+ };
221
+ const flatResponse = await directSendOperation(updatedArgs, spec);
222
+ return {
223
+ flatResponse,
224
+ rawResponse: {
225
+ statusCode: currentRawResponse!.status,
226
+ body: currentRawResponse!.parsedBody,
227
+ headers: currentRawResponse!.headers.toJSON(),
228
+ },
229
+ };
230
+ };
231
+
232
+ const lro = createLroSpec({
233
+ sendOperationFn,
234
+ args: { location, sampleInput, options },
235
+ spec: sampleInputOperationSpec,
236
+ });
237
+ const poller = await createHttpPoller<
238
+ SubscriptionsSampleInputResponse,
239
+ OperationState<SubscriptionsSampleInputResponse>
240
+ >(lro, {
241
+ restoreFrom: options?.resumeFrom,
242
+ intervalInMs: options?.updateIntervalInMs,
243
+ resourceLocationConfig: "location",
244
+ });
245
+ await poller.poll();
246
+ return poller;
247
+ }
248
+
249
+ /**
250
+ * Sample the Stream Analytics input data.
251
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
252
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
253
+ * @param sampleInput Defines the necessary parameters for sampling the Stream Analytics input data.
254
+ * @param options The options parameters.
255
+ */
256
+ async beginSampleInputAndWait(
257
+ location: string,
258
+ sampleInput: SampleInput,
259
+ options?: SubscriptionsSampleInputOptionalParams,
260
+ ): Promise<SubscriptionsSampleInputResponse> {
261
+ const poller = await this.beginSampleInput(location, sampleInput, options);
262
+ return poller.pollUntilDone();
263
+ }
264
+
265
+ /**
266
+ * Test the Stream Analytics input.
267
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
268
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
269
+ * @param testInput Defines the necessary parameters for testing the Stream Analytics input.
270
+ * @param options The options parameters.
271
+ */
272
+ async beginTestInput(
273
+ location: string,
274
+ testInput: TestInput,
275
+ options?: SubscriptionsTestInputOptionalParams,
276
+ ): Promise<
277
+ SimplePollerLike<
278
+ OperationState<SubscriptionsTestInputResponse>,
279
+ SubscriptionsTestInputResponse
280
+ >
281
+ > {
282
+ const directSendOperation = async (
283
+ args: coreClient.OperationArguments,
284
+ spec: coreClient.OperationSpec,
285
+ ): Promise<SubscriptionsTestInputResponse> => {
286
+ return this.client.sendOperationRequest(args, spec);
287
+ };
288
+ const sendOperationFn = async (
289
+ args: coreClient.OperationArguments,
290
+ spec: coreClient.OperationSpec,
291
+ ) => {
292
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
293
+ undefined;
294
+ const providedCallback = args.options?.onResponse;
295
+ const callback: coreClient.RawResponseCallback = (
296
+ rawResponse: coreClient.FullOperationResponse,
297
+ flatResponse: unknown,
298
+ ) => {
299
+ currentRawResponse = rawResponse;
300
+ providedCallback?.(rawResponse, flatResponse);
301
+ };
302
+ const updatedArgs = {
303
+ ...args,
304
+ options: {
305
+ ...args.options,
306
+ onResponse: callback,
307
+ },
308
+ };
309
+ const flatResponse = await directSendOperation(updatedArgs, spec);
310
+ return {
311
+ flatResponse,
312
+ rawResponse: {
313
+ statusCode: currentRawResponse!.status,
314
+ body: currentRawResponse!.parsedBody,
315
+ headers: currentRawResponse!.headers.toJSON(),
316
+ },
317
+ };
318
+ };
319
+
320
+ const lro = createLroSpec({
321
+ sendOperationFn,
322
+ args: { location, testInput, options },
323
+ spec: testInputOperationSpec,
324
+ });
325
+ const poller = await createHttpPoller<
326
+ SubscriptionsTestInputResponse,
327
+ OperationState<SubscriptionsTestInputResponse>
328
+ >(lro, {
329
+ restoreFrom: options?.resumeFrom,
330
+ intervalInMs: options?.updateIntervalInMs,
331
+ resourceLocationConfig: "location",
332
+ });
333
+ await poller.poll();
334
+ return poller;
335
+ }
336
+
337
+ /**
338
+ * Test the Stream Analytics input.
339
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
340
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
341
+ * @param testInput Defines the necessary parameters for testing the Stream Analytics input.
342
+ * @param options The options parameters.
343
+ */
344
+ async beginTestInputAndWait(
345
+ location: string,
346
+ testInput: TestInput,
347
+ options?: SubscriptionsTestInputOptionalParams,
348
+ ): Promise<SubscriptionsTestInputResponse> {
349
+ const poller = await this.beginTestInput(location, testInput, options);
350
+ return poller.pollUntilDone();
351
+ }
352
+
353
+ /**
354
+ * Test the Stream Analytics output.
355
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
356
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
357
+ * @param testOutput Defines the necessary parameters for testing the Stream Analytics output.
358
+ * @param options The options parameters.
359
+ */
360
+ async beginTestOutput(
361
+ location: string,
362
+ testOutput: TestOutput,
363
+ options?: SubscriptionsTestOutputOptionalParams,
364
+ ): Promise<
365
+ SimplePollerLike<
366
+ OperationState<SubscriptionsTestOutputResponse>,
367
+ SubscriptionsTestOutputResponse
368
+ >
369
+ > {
370
+ const directSendOperation = async (
371
+ args: coreClient.OperationArguments,
372
+ spec: coreClient.OperationSpec,
373
+ ): Promise<SubscriptionsTestOutputResponse> => {
374
+ return this.client.sendOperationRequest(args, spec);
375
+ };
376
+ const sendOperationFn = async (
377
+ args: coreClient.OperationArguments,
378
+ spec: coreClient.OperationSpec,
379
+ ) => {
380
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
381
+ undefined;
382
+ const providedCallback = args.options?.onResponse;
383
+ const callback: coreClient.RawResponseCallback = (
384
+ rawResponse: coreClient.FullOperationResponse,
385
+ flatResponse: unknown,
386
+ ) => {
387
+ currentRawResponse = rawResponse;
388
+ providedCallback?.(rawResponse, flatResponse);
389
+ };
390
+ const updatedArgs = {
391
+ ...args,
392
+ options: {
393
+ ...args.options,
394
+ onResponse: callback,
395
+ },
396
+ };
397
+ const flatResponse = await directSendOperation(updatedArgs, spec);
398
+ return {
399
+ flatResponse,
400
+ rawResponse: {
401
+ statusCode: currentRawResponse!.status,
402
+ body: currentRawResponse!.parsedBody,
403
+ headers: currentRawResponse!.headers.toJSON(),
404
+ },
405
+ };
406
+ };
407
+
408
+ const lro = createLroSpec({
409
+ sendOperationFn,
410
+ args: { location, testOutput, options },
411
+ spec: testOutputOperationSpec,
412
+ });
413
+ const poller = await createHttpPoller<
414
+ SubscriptionsTestOutputResponse,
415
+ OperationState<SubscriptionsTestOutputResponse>
416
+ >(lro, {
417
+ restoreFrom: options?.resumeFrom,
418
+ intervalInMs: options?.updateIntervalInMs,
419
+ resourceLocationConfig: "location",
420
+ });
421
+ await poller.poll();
422
+ return poller;
423
+ }
424
+
425
+ /**
426
+ * Test the Stream Analytics output.
427
+ * @param location The region to which the request is sent. You can find out which regions Azure Stream
428
+ * Analytics is supported in here: https://azure.microsoft.com/en-us/regions/
429
+ * @param testOutput Defines the necessary parameters for testing the Stream Analytics output.
430
+ * @param options The options parameters.
431
+ */
432
+ async beginTestOutputAndWait(
433
+ location: string,
434
+ testOutput: TestOutput,
435
+ options?: SubscriptionsTestOutputOptionalParams,
436
+ ): Promise<SubscriptionsTestOutputResponse> {
437
+ const poller = await this.beginTestOutput(location, testOutput, options);
438
+ return poller.pollUntilDone();
439
+ }
47
440
  }
48
441
  // Operation Specifications
49
442
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
50
443
 
51
444
  const listQuotasOperationSpec: coreClient.OperationSpec = {
52
- path:
53
- "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/quotas",
445
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/quotas",
54
446
  httpMethod: "GET",
55
447
  responses: {
56
448
  200: {
57
- bodyMapper: Mappers.SubscriptionQuotasListResult
449
+ bodyMapper: Mappers.SubscriptionQuotasListResult,
58
450
  },
59
451
  default: {
60
- bodyMapper: Mappers.ErrorModel
61
- }
452
+ bodyMapper: Mappers.ErrorModel,
453
+ },
62
454
  },
63
455
  queryParameters: [Parameters.apiVersion],
64
456
  urlParameters: [
65
457
  Parameters.$host,
66
458
  Parameters.subscriptionId,
67
- Parameters.location
459
+ Parameters.location,
68
460
  ],
69
461
  headerParameters: [Parameters.accept],
70
- serializer
462
+ serializer,
463
+ };
464
+ const testQueryOperationSpec: coreClient.OperationSpec = {
465
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testQuery",
466
+ httpMethod: "POST",
467
+ responses: {
468
+ 200: {
469
+ bodyMapper: Mappers.QueryTestingResult,
470
+ },
471
+ 201: {
472
+ bodyMapper: Mappers.QueryTestingResult,
473
+ },
474
+ 202: {
475
+ bodyMapper: Mappers.QueryTestingResult,
476
+ },
477
+ 204: {
478
+ bodyMapper: Mappers.QueryTestingResult,
479
+ },
480
+ default: {
481
+ bodyMapper: Mappers.ErrorModel,
482
+ },
483
+ },
484
+ requestBody: Parameters.testQuery,
485
+ queryParameters: [Parameters.apiVersion],
486
+ urlParameters: [
487
+ Parameters.$host,
488
+ Parameters.subscriptionId,
489
+ Parameters.location,
490
+ ],
491
+ headerParameters: [Parameters.contentType, Parameters.accept],
492
+ mediaType: "json",
493
+ serializer,
494
+ };
495
+ const compileQueryOperationSpec: coreClient.OperationSpec = {
496
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/compileQuery",
497
+ httpMethod: "POST",
498
+ responses: {
499
+ 200: {
500
+ bodyMapper: Mappers.QueryCompilationResult,
501
+ },
502
+ default: {
503
+ bodyMapper: Mappers.ErrorModel,
504
+ },
505
+ },
506
+ requestBody: Parameters.compileQuery,
507
+ queryParameters: [Parameters.apiVersion],
508
+ urlParameters: [
509
+ Parameters.$host,
510
+ Parameters.subscriptionId,
511
+ Parameters.location,
512
+ ],
513
+ headerParameters: [Parameters.contentType, Parameters.accept],
514
+ mediaType: "json",
515
+ serializer,
516
+ };
517
+ const sampleInputOperationSpec: coreClient.OperationSpec = {
518
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/sampleInput",
519
+ httpMethod: "POST",
520
+ responses: {
521
+ 200: {
522
+ bodyMapper: Mappers.SampleInputResult,
523
+ },
524
+ 201: {
525
+ bodyMapper: Mappers.SampleInputResult,
526
+ },
527
+ 202: {
528
+ bodyMapper: Mappers.SampleInputResult,
529
+ },
530
+ 204: {
531
+ bodyMapper: Mappers.SampleInputResult,
532
+ },
533
+ default: {
534
+ bodyMapper: Mappers.ErrorModel,
535
+ },
536
+ },
537
+ requestBody: Parameters.sampleInput,
538
+ queryParameters: [Parameters.apiVersion],
539
+ urlParameters: [
540
+ Parameters.$host,
541
+ Parameters.subscriptionId,
542
+ Parameters.location,
543
+ ],
544
+ headerParameters: [Parameters.contentType, Parameters.accept],
545
+ mediaType: "json",
546
+ serializer,
547
+ };
548
+ const testInputOperationSpec: coreClient.OperationSpec = {
549
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testInput",
550
+ httpMethod: "POST",
551
+ responses: {
552
+ 200: {
553
+ bodyMapper: Mappers.TestDatasourceResult,
554
+ },
555
+ 201: {
556
+ bodyMapper: Mappers.TestDatasourceResult,
557
+ },
558
+ 202: {
559
+ bodyMapper: Mappers.TestDatasourceResult,
560
+ },
561
+ 204: {
562
+ bodyMapper: Mappers.TestDatasourceResult,
563
+ },
564
+ default: {
565
+ bodyMapper: Mappers.ErrorModel,
566
+ },
567
+ },
568
+ requestBody: Parameters.testInput,
569
+ queryParameters: [Parameters.apiVersion],
570
+ urlParameters: [
571
+ Parameters.$host,
572
+ Parameters.subscriptionId,
573
+ Parameters.location,
574
+ ],
575
+ headerParameters: [Parameters.contentType, Parameters.accept],
576
+ mediaType: "json",
577
+ serializer,
578
+ };
579
+ const testOutputOperationSpec: coreClient.OperationSpec = {
580
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testOutput",
581
+ httpMethod: "POST",
582
+ responses: {
583
+ 200: {
584
+ bodyMapper: Mappers.TestDatasourceResult,
585
+ },
586
+ 201: {
587
+ bodyMapper: Mappers.TestDatasourceResult,
588
+ },
589
+ 202: {
590
+ bodyMapper: Mappers.TestDatasourceResult,
591
+ },
592
+ 204: {
593
+ bodyMapper: Mappers.TestDatasourceResult,
594
+ },
595
+ default: {
596
+ bodyMapper: Mappers.ErrorModel,
597
+ },
598
+ },
599
+ requestBody: Parameters.testOutput,
600
+ queryParameters: [Parameters.apiVersion],
601
+ urlParameters: [
602
+ Parameters.$host,
603
+ Parameters.subscriptionId,
604
+ Parameters.location,
605
+ ],
606
+ headerParameters: [Parameters.contentType, Parameters.accept],
607
+ mediaType: "json",
608
+ serializer,
71
609
  };