@azure/arm-streamanalytics 3.0.0 → 4.0.0

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 (252) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/{LICENSE.txt → LICENSE} +1 -1
  3. package/README.md +70 -84
  4. package/dist/index.js +6818 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +1940 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +132 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +155 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/{esm → dist-esm/src}/models/mappers.js +1412 -2137
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +34 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +260 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/clusters.d.ts +137 -0
  29. package/dist-esm/src/operations/clusters.d.ts.map +1 -0
  30. package/dist-esm/src/operations/clusters.js +627 -0
  31. package/dist-esm/src/operations/clusters.js.map +1 -0
  32. package/dist-esm/src/operations/functions.d.ts +107 -0
  33. package/dist-esm/src/operations/functions.d.ts.map +1 -0
  34. package/dist-esm/src/operations/functions.js +416 -0
  35. package/dist-esm/src/operations/functions.js.map +1 -0
  36. package/{esm → dist-esm/src}/operations/index.d.ts +4 -4
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +5 -6
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/inputs.d.ts +94 -0
  41. package/dist-esm/src/operations/inputs.d.ts.map +1 -0
  42. package/dist-esm/src/operations/inputs.js +377 -0
  43. package/dist-esm/src/operations/inputs.js.map +1 -0
  44. package/dist-esm/src/operations/operations.d.ts +32 -0
  45. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  46. package/dist-esm/src/operations/operations.js +120 -0
  47. package/dist-esm/src/operations/operations.js.map +1 -0
  48. package/dist-esm/src/operations/outputs.d.ts +95 -0
  49. package/dist-esm/src/operations/outputs.d.ts.map +1 -0
  50. package/dist-esm/src/operations/outputs.js +378 -0
  51. package/dist-esm/src/operations/outputs.js.map +1 -0
  52. package/dist-esm/src/operations/privateEndpoints.d.ts +73 -0
  53. package/dist-esm/src/operations/privateEndpoints.d.ts.map +1 -0
  54. package/dist-esm/src/operations/privateEndpoints.js +295 -0
  55. package/dist-esm/src/operations/privateEndpoints.js.map +1 -0
  56. package/dist-esm/src/operations/streamingJobs.d.ts +151 -0
  57. package/dist-esm/src/operations/streamingJobs.d.ts.map +1 -0
  58. package/dist-esm/src/operations/streamingJobs.js +692 -0
  59. package/dist-esm/src/operations/streamingJobs.js.map +1 -0
  60. package/dist-esm/src/operations/subscriptions.d.ts +21 -0
  61. package/dist-esm/src/operations/subscriptions.d.ts.map +1 -0
  62. package/dist-esm/src/operations/subscriptions.js +53 -0
  63. package/dist-esm/src/operations/subscriptions.js.map +1 -0
  64. package/dist-esm/src/operations/transformations.d.ts +46 -0
  65. package/dist-esm/src/operations/transformations.d.ts.map +1 -0
  66. package/dist-esm/src/operations/transformations.js +160 -0
  67. package/dist-esm/src/operations/transformations.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/clusters.d.ts +84 -0
  69. package/dist-esm/src/operationsInterfaces/clusters.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/clusters.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/clusters.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/functions.d.ts +82 -0
  73. package/dist-esm/src/operationsInterfaces/functions.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/functions.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/functions.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/index.d.ts +10 -0
  77. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/index.js +17 -0
  79. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/inputs.d.ts +69 -0
  81. package/dist-esm/src/operationsInterfaces/inputs.d.ts.map +1 -0
  82. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/inputs.js} +2 -1
  83. package/dist-esm/src/operationsInterfaces/inputs.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  85. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/outputs.d.ts +70 -0
  89. package/dist-esm/src/operationsInterfaces/outputs.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/outputs.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/outputs.js.map +1 -0
  92. package/dist-esm/src/operationsInterfaces/privateEndpoints.d.ts +48 -0
  93. package/dist-esm/src/operationsInterfaces/privateEndpoints.d.ts.map +1 -0
  94. package/dist-esm/src/operationsInterfaces/privateEndpoints.js +9 -0
  95. package/dist-esm/src/operationsInterfaces/privateEndpoints.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/streamingJobs.d.ts +115 -0
  97. package/dist-esm/src/operationsInterfaces/streamingJobs.d.ts.map +1 -0
  98. package/dist-esm/src/operationsInterfaces/streamingJobs.js +9 -0
  99. package/dist-esm/src/operationsInterfaces/streamingJobs.js.map +1 -0
  100. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts +13 -0
  101. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts.map +1 -0
  102. package/dist-esm/src/operationsInterfaces/subscriptions.js +9 -0
  103. package/dist-esm/src/operationsInterfaces/subscriptions.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/transformations.d.ts +38 -0
  105. package/dist-esm/src/operationsInterfaces/transformations.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/transformations.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/transformations.js.map +1 -0
  108. package/dist-esm/src/streamAnalyticsManagementClient.d.ts +26 -0
  109. package/dist-esm/src/streamAnalyticsManagementClient.d.ts.map +1 -0
  110. package/dist-esm/src/streamAnalyticsManagementClient.js +59 -0
  111. package/dist-esm/src/streamAnalyticsManagementClient.js.map +1 -0
  112. package/dist-esm/test/sampleTest.d.ts +2 -0
  113. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  114. package/dist-esm/test/sampleTest.js +40 -0
  115. package/dist-esm/test/sampleTest.js.map +1 -0
  116. package/package.json +65 -32
  117. package/review/arm-streamanalytics.api.md +1598 -0
  118. package/rollup.config.js +181 -30
  119. package/src/{models/operationsMappers.ts → index.ts} +4 -12
  120. package/src/lroImpl.ts +34 -0
  121. package/src/models/index.ts +1943 -4505
  122. package/src/models/mappers.ts +1393 -2127
  123. package/src/models/parameters.ts +180 -90
  124. package/src/operations/clusters.ts +640 -393
  125. package/src/operations/functions.ts +366 -375
  126. package/src/operations/index.ts +5 -6
  127. package/src/operations/inputs.ts +337 -326
  128. package/src/operations/operations.ts +85 -73
  129. package/src/operations/outputs.ts +337 -325
  130. package/src/operations/privateEndpoints.ts +276 -209
  131. package/src/operations/streamingJobs.ts +686 -398
  132. package/src/operations/subscriptions.ts +36 -376
  133. package/src/operations/transformations.ts +104 -162
  134. package/src/operationsInterfaces/clusters.ts +157 -0
  135. package/src/operationsInterfaces/functions.ts +148 -0
  136. package/src/operationsInterfaces/index.ts +17 -0
  137. package/src/operationsInterfaces/inputs.ts +128 -0
  138. package/src/operationsInterfaces/operations.ts +22 -0
  139. package/src/operationsInterfaces/outputs.ts +129 -0
  140. package/src/operationsInterfaces/privateEndpoints.ts +90 -0
  141. package/src/operationsInterfaces/streamingJobs.ts +199 -0
  142. package/src/operationsInterfaces/subscriptions.ts +27 -0
  143. package/src/operationsInterfaces/transformations.ts +71 -0
  144. package/src/streamAnalyticsManagementClient.ts +97 -49
  145. package/tsconfig.json +3 -3
  146. package/types/arm-streamanalytics.d.ts +2730 -0
  147. package/types/tsdoc-metadata.json +11 -0
  148. package/dist/arm-streamanalytics.js +0 -7772
  149. package/dist/arm-streamanalytics.js.map +0 -1
  150. package/dist/arm-streamanalytics.min.js +0 -1
  151. package/dist/arm-streamanalytics.min.js.map +0 -1
  152. package/esm/models/clustersMappers.d.ts +0 -2
  153. package/esm/models/clustersMappers.d.ts.map +0 -1
  154. package/esm/models/clustersMappers.js +0 -9
  155. package/esm/models/clustersMappers.js.map +0 -1
  156. package/esm/models/functionsMappers.d.ts +0 -2
  157. package/esm/models/functionsMappers.d.ts.map +0 -1
  158. package/esm/models/functionsMappers.js +0 -9
  159. package/esm/models/functionsMappers.js.map +0 -1
  160. package/esm/models/index.d.ts +0 -4514
  161. package/esm/models/index.d.ts.map +0 -1
  162. package/esm/models/index.js.map +0 -1
  163. package/esm/models/inputsMappers.d.ts +0 -2
  164. package/esm/models/inputsMappers.d.ts.map +0 -1
  165. package/esm/models/inputsMappers.js +0 -9
  166. package/esm/models/inputsMappers.js.map +0 -1
  167. package/esm/models/mappers.d.ts +0 -185
  168. package/esm/models/mappers.d.ts.map +0 -1
  169. package/esm/models/mappers.js.map +0 -1
  170. package/esm/models/operationsMappers.d.ts +0 -2
  171. package/esm/models/operationsMappers.d.ts.map +0 -1
  172. package/esm/models/operationsMappers.js +0 -9
  173. package/esm/models/operationsMappers.js.map +0 -1
  174. package/esm/models/outputsMappers.d.ts +0 -2
  175. package/esm/models/outputsMappers.d.ts.map +0 -1
  176. package/esm/models/outputsMappers.js +0 -9
  177. package/esm/models/outputsMappers.js.map +0 -1
  178. package/esm/models/parameters.d.ts +0 -20
  179. package/esm/models/parameters.d.ts.map +0 -1
  180. package/esm/models/parameters.js +0 -216
  181. package/esm/models/parameters.js.map +0 -1
  182. package/esm/models/privateEndpointsMappers.d.ts +0 -2
  183. package/esm/models/privateEndpointsMappers.d.ts.map +0 -1
  184. package/esm/models/privateEndpointsMappers.js +0 -9
  185. package/esm/models/privateEndpointsMappers.js.map +0 -1
  186. package/esm/models/streamingJobsMappers.d.ts +0 -2
  187. package/esm/models/streamingJobsMappers.d.ts.map +0 -1
  188. package/esm/models/streamingJobsMappers.js +0 -9
  189. package/esm/models/streamingJobsMappers.js.map +0 -1
  190. package/esm/models/subscriptionsMappers.d.ts +0 -2
  191. package/esm/models/subscriptionsMappers.d.ts.map +0 -1
  192. package/esm/models/subscriptionsMappers.js +0 -9
  193. package/esm/models/subscriptionsMappers.js.map +0 -1
  194. package/esm/models/transformationsMappers.d.ts +0 -2
  195. package/esm/models/transformationsMappers.d.ts.map +0 -1
  196. package/esm/models/transformationsMappers.js +0 -9
  197. package/esm/models/transformationsMappers.js.map +0 -1
  198. package/esm/operations/clusters.d.ts +0 -201
  199. package/esm/operations/clusters.d.ts.map +0 -1
  200. package/esm/operations/clusters.js +0 -406
  201. package/esm/operations/clusters.js.map +0 -1
  202. package/esm/operations/functions.d.ts +0 -215
  203. package/esm/operations/functions.d.ts.map +0 -1
  204. package/esm/operations/functions.js +0 -348
  205. package/esm/operations/functions.js.map +0 -1
  206. package/esm/operations/index.d.ts.map +0 -1
  207. package/esm/operations/index.js.map +0 -1
  208. package/esm/operations/inputs.d.ts +0 -189
  209. package/esm/operations/inputs.d.ts.map +0 -1
  210. package/esm/operations/inputs.js +0 -306
  211. package/esm/operations/inputs.js.map +0 -1
  212. package/esm/operations/operations.d.ts +0 -46
  213. package/esm/operations/operations.d.ts.map +0 -1
  214. package/esm/operations/operations.js +0 -79
  215. package/esm/operations/operations.js.map +0 -1
  216. package/esm/operations/outputs.d.ts +0 -189
  217. package/esm/operations/outputs.d.ts.map +0 -1
  218. package/esm/operations/outputs.js +0 -306
  219. package/esm/operations/outputs.js.map +0 -1
  220. package/esm/operations/privateEndpoints.d.ts +0 -125
  221. package/esm/operations/privateEndpoints.d.ts.map +0 -1
  222. package/esm/operations/privateEndpoints.js +0 -216
  223. package/esm/operations/privateEndpoints.js.map +0 -1
  224. package/esm/operations/streamingJobs.d.ts +0 -210
  225. package/esm/operations/streamingJobs.d.ts.map +0 -1
  226. package/esm/operations/streamingJobs.js +0 -440
  227. package/esm/operations/streamingJobs.js.map +0 -1
  228. package/esm/operations/subscriptions.d.ts +0 -138
  229. package/esm/operations/subscriptions.d.ts.map +0 -1
  230. package/esm/operations/subscriptions.js +0 -311
  231. package/esm/operations/subscriptions.js.map +0 -1
  232. package/esm/operations/transformations.d.ts +0 -106
  233. package/esm/operations/transformations.d.ts.map +0 -1
  234. package/esm/operations/transformations.js +0 -149
  235. package/esm/operations/transformations.js.map +0 -1
  236. package/esm/streamAnalyticsManagementClient.d.ts +0 -32
  237. package/esm/streamAnalyticsManagementClient.d.ts.map +0 -1
  238. package/esm/streamAnalyticsManagementClient.js +0 -45
  239. package/esm/streamAnalyticsManagementClient.js.map +0 -1
  240. package/esm/streamAnalyticsManagementClientContext.d.ts +0 -21
  241. package/esm/streamAnalyticsManagementClientContext.d.ts.map +0 -1
  242. package/esm/streamAnalyticsManagementClientContext.js +0 -59
  243. package/esm/streamAnalyticsManagementClientContext.js.map +0 -1
  244. package/src/models/clustersMappers.ts +0 -96
  245. package/src/models/functionsMappers.ts +0 -104
  246. package/src/models/inputsMappers.ts +0 -99
  247. package/src/models/outputsMappers.ts +0 -99
  248. package/src/models/privateEndpointsMappers.ts +0 -94
  249. package/src/models/streamingJobsMappers.ts +0 -98
  250. package/src/models/subscriptionsMappers.ts +0 -104
  251. package/src/models/transformationsMappers.ts +0 -96
  252. package/src/streamAnalyticsManagementClientContext.ts +0 -65
@@ -3,183 +3,378 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as msRestAzure from "@azure/ms-rest-azure-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/streamingJobsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { StreamingJobs } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { StreamAnalyticsManagementClientContext } from "../streamAnalyticsManagementClientContext";
14
+ import { StreamAnalyticsManagementClient } from "../streamAnalyticsManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ StreamingJob,
19
+ StreamingJobsListByResourceGroupNextOptionalParams,
20
+ StreamingJobsListByResourceGroupOptionalParams,
21
+ StreamingJobsListNextOptionalParams,
22
+ StreamingJobsListOptionalParams,
23
+ StreamingJobsCreateOrReplaceOptionalParams,
24
+ StreamingJobsCreateOrReplaceResponse,
25
+ StreamingJobsUpdateOptionalParams,
26
+ StreamingJobsUpdateResponse,
27
+ StreamingJobsDeleteOptionalParams,
28
+ StreamingJobsGetOptionalParams,
29
+ StreamingJobsGetResponse,
30
+ StreamingJobsListByResourceGroupResponse,
31
+ StreamingJobsListResponse,
32
+ StreamingJobsStartOptionalParams,
33
+ StreamingJobsStopOptionalParams,
34
+ StreamingJobsScaleOptionalParams,
35
+ StreamingJobsListByResourceGroupNextResponse,
36
+ StreamingJobsListNextResponse
37
+ } from "../models";
16
38
 
17
- /** Class representing a StreamingJobs. */
18
- export class StreamingJobs {
19
- private readonly client: StreamAnalyticsManagementClientContext;
39
+ /// <reference lib="esnext.asynciterable" />
40
+ /** Class containing StreamingJobs operations. */
41
+ export class StreamingJobsImpl implements StreamingJobs {
42
+ private readonly client: StreamAnalyticsManagementClient;
20
43
 
21
44
  /**
22
- * Create a StreamingJobs.
23
- * @param {StreamAnalyticsManagementClientContext} client Reference to the service client.
45
+ * Initialize a new instance of the class StreamingJobs class.
46
+ * @param client Reference to the service client
24
47
  */
25
- constructor(client: StreamAnalyticsManagementClientContext) {
48
+ constructor(client: StreamAnalyticsManagementClient) {
26
49
  this.client = client;
27
50
  }
28
51
 
29
52
  /**
30
- * Creates a streaming job or replaces an already existing streaming job.
31
- * @param streamingJob The definition of the streaming job that will be used to create a new
32
- * streaming job or replace the existing one.
53
+ * Lists all of the streaming jobs in the specified resource group.
33
54
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
34
- * @param jobName The name of the streaming job.
35
- * @param [options] The optional parameters
36
- * @returns Promise<Models.StreamingJobsCreateOrReplaceResponse>
55
+ * @param options The options parameters.
37
56
  */
38
- createOrReplace(streamingJob: Models.StreamingJob, resourceGroupName: string, jobName: string, options?: Models.StreamingJobsCreateOrReplaceOptionalParams): Promise<Models.StreamingJobsCreateOrReplaceResponse> {
39
- return this.beginCreateOrReplace(streamingJob,resourceGroupName,jobName,options)
40
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.StreamingJobsCreateOrReplaceResponse>;
57
+ public listByResourceGroup(
58
+ resourceGroupName: string,
59
+ options?: StreamingJobsListByResourceGroupOptionalParams
60
+ ): PagedAsyncIterableIterator<StreamingJob> {
61
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
62
+ return {
63
+ next() {
64
+ return iter.next();
65
+ },
66
+ [Symbol.asyncIterator]() {
67
+ return this;
68
+ },
69
+ byPage: () => {
70
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
71
+ }
72
+ };
73
+ }
74
+
75
+ private async *listByResourceGroupPagingPage(
76
+ resourceGroupName: string,
77
+ options?: StreamingJobsListByResourceGroupOptionalParams
78
+ ): AsyncIterableIterator<StreamingJob[]> {
79
+ let result = await this._listByResourceGroup(resourceGroupName, options);
80
+ yield result.value || [];
81
+ let continuationToken = result.nextLink;
82
+ while (continuationToken) {
83
+ result = await this._listByResourceGroupNext(
84
+ resourceGroupName,
85
+ continuationToken,
86
+ options
87
+ );
88
+ continuationToken = result.nextLink;
89
+ yield result.value || [];
90
+ }
91
+ }
92
+
93
+ private async *listByResourceGroupPagingAll(
94
+ resourceGroupName: string,
95
+ options?: StreamingJobsListByResourceGroupOptionalParams
96
+ ): AsyncIterableIterator<StreamingJob> {
97
+ for await (const page of this.listByResourceGroupPagingPage(
98
+ resourceGroupName,
99
+ options
100
+ )) {
101
+ yield* page;
102
+ }
41
103
  }
42
104
 
43
105
  /**
44
- * Updates an existing streaming job. This can be used to partially update (ie. update one or two
45
- * properties) a streaming job without affecting the rest the job definition.
46
- * @param streamingJob A streaming job object. The properties specified here will overwrite the
47
- * corresponding properties in the existing streaming job (ie. Those properties will be updated).
48
- * Any properties that are set to null here will mean that the corresponding property in the
49
- * existing input will remain the same and not change as a result of this PATCH operation.
50
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
51
- * @param jobName The name of the streaming job.
52
- * @param [options] The optional parameters
53
- * @returns Promise<Models.StreamingJobsUpdateResponse>
106
+ * Lists all of the streaming jobs in the given subscription.
107
+ * @param options The options parameters.
54
108
  */
55
- update(streamingJob: Models.StreamingJob, resourceGroupName: string, jobName: string, options?: Models.StreamingJobsUpdateOptionalParams): Promise<Models.StreamingJobsUpdateResponse>;
109
+ public list(
110
+ options?: StreamingJobsListOptionalParams
111
+ ): PagedAsyncIterableIterator<StreamingJob> {
112
+ const iter = this.listPagingAll(options);
113
+ return {
114
+ next() {
115
+ return iter.next();
116
+ },
117
+ [Symbol.asyncIterator]() {
118
+ return this;
119
+ },
120
+ byPage: () => {
121
+ return this.listPagingPage(options);
122
+ }
123
+ };
124
+ }
125
+
126
+ private async *listPagingPage(
127
+ options?: StreamingJobsListOptionalParams
128
+ ): AsyncIterableIterator<StreamingJob[]> {
129
+ let result = await this._list(options);
130
+ yield result.value || [];
131
+ let continuationToken = result.nextLink;
132
+ while (continuationToken) {
133
+ result = await this._listNext(continuationToken, options);
134
+ continuationToken = result.nextLink;
135
+ yield result.value || [];
136
+ }
137
+ }
138
+
139
+ private async *listPagingAll(
140
+ options?: StreamingJobsListOptionalParams
141
+ ): AsyncIterableIterator<StreamingJob> {
142
+ for await (const page of this.listPagingPage(options)) {
143
+ yield* page;
144
+ }
145
+ }
146
+
56
147
  /**
57
- * @param streamingJob A streaming job object. The properties specified here will overwrite the
58
- * corresponding properties in the existing streaming job (ie. Those properties will be updated).
59
- * Any properties that are set to null here will mean that the corresponding property in the
60
- * existing input will remain the same and not change as a result of this PATCH operation.
148
+ * Creates a streaming job or replaces an already existing streaming job.
61
149
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
62
150
  * @param jobName The name of the streaming job.
63
- * @param callback The callback
151
+ * @param streamingJob The definition of the streaming job that will be used to create a new streaming
152
+ * job or replace the existing one.
153
+ * @param options The options parameters.
64
154
  */
65
- update(streamingJob: Models.StreamingJob, resourceGroupName: string, jobName: string, callback: msRest.ServiceCallback<Models.StreamingJob>): void;
155
+ async beginCreateOrReplace(
156
+ resourceGroupName: string,
157
+ jobName: string,
158
+ streamingJob: StreamingJob,
159
+ options?: StreamingJobsCreateOrReplaceOptionalParams
160
+ ): Promise<
161
+ PollerLike<
162
+ PollOperationState<StreamingJobsCreateOrReplaceResponse>,
163
+ StreamingJobsCreateOrReplaceResponse
164
+ >
165
+ > {
166
+ const directSendOperation = async (
167
+ args: coreClient.OperationArguments,
168
+ spec: coreClient.OperationSpec
169
+ ): Promise<StreamingJobsCreateOrReplaceResponse> => {
170
+ return this.client.sendOperationRequest(args, spec);
171
+ };
172
+ const sendOperation = async (
173
+ args: coreClient.OperationArguments,
174
+ spec: coreClient.OperationSpec
175
+ ) => {
176
+ let currentRawResponse:
177
+ | coreClient.FullOperationResponse
178
+ | undefined = undefined;
179
+ const providedCallback = args.options?.onResponse;
180
+ const callback: coreClient.RawResponseCallback = (
181
+ rawResponse: coreClient.FullOperationResponse,
182
+ flatResponse: unknown
183
+ ) => {
184
+ currentRawResponse = rawResponse;
185
+ providedCallback?.(rawResponse, flatResponse);
186
+ };
187
+ const updatedArgs = {
188
+ ...args,
189
+ options: {
190
+ ...args.options,
191
+ onResponse: callback
192
+ }
193
+ };
194
+ const flatResponse = await directSendOperation(updatedArgs, spec);
195
+ return {
196
+ flatResponse,
197
+ rawResponse: {
198
+ statusCode: currentRawResponse!.status,
199
+ body: currentRawResponse!.parsedBody,
200
+ headers: currentRawResponse!.headers.toJSON()
201
+ }
202
+ };
203
+ };
204
+
205
+ const lro = new LroImpl(
206
+ sendOperation,
207
+ { resourceGroupName, jobName, streamingJob, options },
208
+ createOrReplaceOperationSpec
209
+ );
210
+ return new LroEngine(lro, {
211
+ resumeFrom: options?.resumeFrom,
212
+ intervalInMs: options?.updateIntervalInMs
213
+ });
214
+ }
215
+
66
216
  /**
67
- * @param streamingJob A streaming job object. The properties specified here will overwrite the
68
- * corresponding properties in the existing streaming job (ie. Those properties will be updated).
69
- * Any properties that are set to null here will mean that the corresponding property in the
70
- * existing input will remain the same and not change as a result of this PATCH operation.
217
+ * Creates a streaming job or replaces an already existing streaming job.
71
218
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
72
219
  * @param jobName The name of the streaming job.
73
- * @param options The optional parameters
74
- * @param callback The callback
220
+ * @param streamingJob The definition of the streaming job that will be used to create a new streaming
221
+ * job or replace the existing one.
222
+ * @param options The options parameters.
75
223
  */
76
- update(streamingJob: Models.StreamingJob, resourceGroupName: string, jobName: string, options: Models.StreamingJobsUpdateOptionalParams, callback: msRest.ServiceCallback<Models.StreamingJob>): void;
77
- update(streamingJob: Models.StreamingJob, resourceGroupName: string, jobName: string, options?: Models.StreamingJobsUpdateOptionalParams | msRest.ServiceCallback<Models.StreamingJob>, callback?: msRest.ServiceCallback<Models.StreamingJob>): Promise<Models.StreamingJobsUpdateResponse> {
78
- return this.client.sendOperationRequest(
79
- {
80
- streamingJob,
81
- resourceGroupName,
82
- jobName,
83
- options
84
- },
85
- updateOperationSpec,
86
- callback) as Promise<Models.StreamingJobsUpdateResponse>;
224
+ async beginCreateOrReplaceAndWait(
225
+ resourceGroupName: string,
226
+ jobName: string,
227
+ streamingJob: StreamingJob,
228
+ options?: StreamingJobsCreateOrReplaceOptionalParams
229
+ ): Promise<StreamingJobsCreateOrReplaceResponse> {
230
+ const poller = await this.beginCreateOrReplace(
231
+ resourceGroupName,
232
+ jobName,
233
+ streamingJob,
234
+ options
235
+ );
236
+ return poller.pollUntilDone();
87
237
  }
88
238
 
89
239
  /**
90
- * Deletes a streaming job.
240
+ * Updates an existing streaming job. This can be used to partially update (ie. update one or two
241
+ * properties) a streaming job without affecting the rest the job definition.
91
242
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
92
243
  * @param jobName The name of the streaming job.
93
- * @param [options] The optional parameters
94
- * @returns Promise<msRest.RestResponse>
244
+ * @param streamingJob A streaming job object. The properties specified here will overwrite the
245
+ * corresponding properties in the existing streaming job (ie. Those properties will be updated). Any
246
+ * properties that are set to null here will mean that the corresponding property in the existing input
247
+ * will remain the same and not change as a result of this PATCH operation.
248
+ * @param options The options parameters.
95
249
  */
96
- deleteMethod(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
97
- return this.beginDeleteMethod(resourceGroupName,jobName,options)
98
- .then(lroPoller => lroPoller.pollUntilFinished());
250
+ update(
251
+ resourceGroupName: string,
252
+ jobName: string,
253
+ streamingJob: StreamingJob,
254
+ options?: StreamingJobsUpdateOptionalParams
255
+ ): Promise<StreamingJobsUpdateResponse> {
256
+ return this.client.sendOperationRequest(
257
+ { resourceGroupName, jobName, streamingJob, options },
258
+ updateOperationSpec
259
+ );
99
260
  }
100
261
 
101
262
  /**
102
- * Gets details about the specified streaming job.
263
+ * Deletes a streaming job.
103
264
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
104
265
  * @param jobName The name of the streaming job.
105
- * @param [options] The optional parameters
106
- * @returns Promise<Models.StreamingJobsGetResponse>
266
+ * @param options The options parameters.
107
267
  */
108
- get(resourceGroupName: string, jobName: string, options?: Models.StreamingJobsGetOptionalParams): Promise<Models.StreamingJobsGetResponse>;
268
+ async beginDelete(
269
+ resourceGroupName: string,
270
+ jobName: string,
271
+ options?: StreamingJobsDeleteOptionalParams
272
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
273
+ const directSendOperation = async (
274
+ args: coreClient.OperationArguments,
275
+ spec: coreClient.OperationSpec
276
+ ): Promise<void> => {
277
+ return this.client.sendOperationRequest(args, spec);
278
+ };
279
+ const sendOperation = async (
280
+ args: coreClient.OperationArguments,
281
+ spec: coreClient.OperationSpec
282
+ ) => {
283
+ let currentRawResponse:
284
+ | coreClient.FullOperationResponse
285
+ | undefined = undefined;
286
+ const providedCallback = args.options?.onResponse;
287
+ const callback: coreClient.RawResponseCallback = (
288
+ rawResponse: coreClient.FullOperationResponse,
289
+ flatResponse: unknown
290
+ ) => {
291
+ currentRawResponse = rawResponse;
292
+ providedCallback?.(rawResponse, flatResponse);
293
+ };
294
+ const updatedArgs = {
295
+ ...args,
296
+ options: {
297
+ ...args.options,
298
+ onResponse: callback
299
+ }
300
+ };
301
+ const flatResponse = await directSendOperation(updatedArgs, spec);
302
+ return {
303
+ flatResponse,
304
+ rawResponse: {
305
+ statusCode: currentRawResponse!.status,
306
+ body: currentRawResponse!.parsedBody,
307
+ headers: currentRawResponse!.headers.toJSON()
308
+ }
309
+ };
310
+ };
311
+
312
+ const lro = new LroImpl(
313
+ sendOperation,
314
+ { resourceGroupName, jobName, options },
315
+ deleteOperationSpec
316
+ );
317
+ return new LroEngine(lro, {
318
+ resumeFrom: options?.resumeFrom,
319
+ intervalInMs: options?.updateIntervalInMs
320
+ });
321
+ }
322
+
109
323
  /**
324
+ * Deletes a streaming job.
110
325
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
111
326
  * @param jobName The name of the streaming job.
112
- * @param callback The callback
327
+ * @param options The options parameters.
113
328
  */
114
- get(resourceGroupName: string, jobName: string, callback: msRest.ServiceCallback<Models.StreamingJob>): void;
329
+ async beginDeleteAndWait(
330
+ resourceGroupName: string,
331
+ jobName: string,
332
+ options?: StreamingJobsDeleteOptionalParams
333
+ ): Promise<void> {
334
+ const poller = await this.beginDelete(resourceGroupName, jobName, options);
335
+ return poller.pollUntilDone();
336
+ }
337
+
115
338
  /**
339
+ * Gets details about the specified streaming job.
116
340
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
117
341
  * @param jobName The name of the streaming job.
118
- * @param options The optional parameters
119
- * @param callback The callback
342
+ * @param options The options parameters.
120
343
  */
121
- get(resourceGroupName: string, jobName: string, options: Models.StreamingJobsGetOptionalParams, callback: msRest.ServiceCallback<Models.StreamingJob>): void;
122
- get(resourceGroupName: string, jobName: string, options?: Models.StreamingJobsGetOptionalParams | msRest.ServiceCallback<Models.StreamingJob>, callback?: msRest.ServiceCallback<Models.StreamingJob>): Promise<Models.StreamingJobsGetResponse> {
344
+ get(
345
+ resourceGroupName: string,
346
+ jobName: string,
347
+ options?: StreamingJobsGetOptionalParams
348
+ ): Promise<StreamingJobsGetResponse> {
123
349
  return this.client.sendOperationRequest(
124
- {
125
- resourceGroupName,
126
- jobName,
127
- options
128
- },
129
- getOperationSpec,
130
- callback) as Promise<Models.StreamingJobsGetResponse>;
350
+ { resourceGroupName, jobName, options },
351
+ getOperationSpec
352
+ );
131
353
  }
132
354
 
133
355
  /**
134
356
  * Lists all of the streaming jobs in the specified resource group.
135
357
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
136
- * @param [options] The optional parameters
137
- * @returns Promise<Models.StreamingJobsListByResourceGroupResponse>
358
+ * @param options The options parameters.
138
359
  */
139
- listByResourceGroup(resourceGroupName: string, options?: Models.StreamingJobsListByResourceGroupOptionalParams): Promise<Models.StreamingJobsListByResourceGroupResponse>;
140
- /**
141
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
142
- * @param callback The callback
143
- */
144
- listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
145
- /**
146
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
147
- * @param options The optional parameters
148
- * @param callback The callback
149
- */
150
- listByResourceGroup(resourceGroupName: string, options: Models.StreamingJobsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
151
- listByResourceGroup(resourceGroupName: string, options?: Models.StreamingJobsListByResourceGroupOptionalParams | msRest.ServiceCallback<Models.StreamingJobListResult>, callback?: msRest.ServiceCallback<Models.StreamingJobListResult>): Promise<Models.StreamingJobsListByResourceGroupResponse> {
360
+ private _listByResourceGroup(
361
+ resourceGroupName: string,
362
+ options?: StreamingJobsListByResourceGroupOptionalParams
363
+ ): Promise<StreamingJobsListByResourceGroupResponse> {
152
364
  return this.client.sendOperationRequest(
153
- {
154
- resourceGroupName,
155
- options
156
- },
157
- listByResourceGroupOperationSpec,
158
- callback) as Promise<Models.StreamingJobsListByResourceGroupResponse>;
365
+ { resourceGroupName, options },
366
+ listByResourceGroupOperationSpec
367
+ );
159
368
  }
160
369
 
161
370
  /**
162
371
  * Lists all of the streaming jobs in the given subscription.
163
- * @param [options] The optional parameters
164
- * @returns Promise<Models.StreamingJobsListResponse>
165
- */
166
- list(options?: Models.StreamingJobsListOptionalParams): Promise<Models.StreamingJobsListResponse>;
167
- /**
168
- * @param callback The callback
169
- */
170
- list(callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
171
- /**
172
- * @param options The optional parameters
173
- * @param callback The callback
372
+ * @param options The options parameters.
174
373
  */
175
- list(options: Models.StreamingJobsListOptionalParams, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
176
- list(options?: Models.StreamingJobsListOptionalParams | msRest.ServiceCallback<Models.StreamingJobListResult>, callback?: msRest.ServiceCallback<Models.StreamingJobListResult>): Promise<Models.StreamingJobsListResponse> {
177
- return this.client.sendOperationRequest(
178
- {
179
- options
180
- },
181
- listOperationSpec,
182
- callback) as Promise<Models.StreamingJobsListResponse>;
374
+ private _list(
375
+ options?: StreamingJobsListOptionalParams
376
+ ): Promise<StreamingJobsListResponse> {
377
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
183
378
  }
184
379
 
185
380
  /**
@@ -187,264 +382,389 @@ export class StreamingJobs {
187
382
  * output.
188
383
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
189
384
  * @param jobName The name of the streaming job.
190
- * @param [options] The optional parameters
191
- * @returns Promise<msRest.RestResponse>
385
+ * @param options The options parameters.
192
386
  */
193
- start(resourceGroupName: string, jobName: string, options?: Models.StreamingJobsStartOptionalParams): Promise<msRest.RestResponse> {
194
- return this.beginStart(resourceGroupName,jobName,options)
195
- .then(lroPoller => lroPoller.pollUntilFinished());
387
+ async beginStart(
388
+ resourceGroupName: string,
389
+ jobName: string,
390
+ options?: StreamingJobsStartOptionalParams
391
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
392
+ const directSendOperation = async (
393
+ args: coreClient.OperationArguments,
394
+ spec: coreClient.OperationSpec
395
+ ): Promise<void> => {
396
+ return this.client.sendOperationRequest(args, spec);
397
+ };
398
+ const sendOperation = async (
399
+ args: coreClient.OperationArguments,
400
+ spec: coreClient.OperationSpec
401
+ ) => {
402
+ let currentRawResponse:
403
+ | coreClient.FullOperationResponse
404
+ | undefined = undefined;
405
+ const providedCallback = args.options?.onResponse;
406
+ const callback: coreClient.RawResponseCallback = (
407
+ rawResponse: coreClient.FullOperationResponse,
408
+ flatResponse: unknown
409
+ ) => {
410
+ currentRawResponse = rawResponse;
411
+ providedCallback?.(rawResponse, flatResponse);
412
+ };
413
+ const updatedArgs = {
414
+ ...args,
415
+ options: {
416
+ ...args.options,
417
+ onResponse: callback
418
+ }
419
+ };
420
+ const flatResponse = await directSendOperation(updatedArgs, spec);
421
+ return {
422
+ flatResponse,
423
+ rawResponse: {
424
+ statusCode: currentRawResponse!.status,
425
+ body: currentRawResponse!.parsedBody,
426
+ headers: currentRawResponse!.headers.toJSON()
427
+ }
428
+ };
429
+ };
430
+
431
+ const lro = new LroImpl(
432
+ sendOperation,
433
+ { resourceGroupName, jobName, options },
434
+ startOperationSpec
435
+ );
436
+ return new LroEngine(lro, {
437
+ resumeFrom: options?.resumeFrom,
438
+ intervalInMs: options?.updateIntervalInMs
439
+ });
196
440
  }
197
441
 
198
442
  /**
199
- * Stops a running streaming job. This will cause a running streaming job to stop processing input
200
- * events and producing output.
443
+ * Starts a streaming job. Once a job is started it will start processing input events and produce
444
+ * output.
201
445
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
202
446
  * @param jobName The name of the streaming job.
203
- * @param [options] The optional parameters
204
- * @returns Promise<msRest.RestResponse>
447
+ * @param options The options parameters.
205
448
  */
206
- stop(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
207
- return this.beginStop(resourceGroupName,jobName,options)
208
- .then(lroPoller => lroPoller.pollUntilFinished());
449
+ async beginStartAndWait(
450
+ resourceGroupName: string,
451
+ jobName: string,
452
+ options?: StreamingJobsStartOptionalParams
453
+ ): Promise<void> {
454
+ const poller = await this.beginStart(resourceGroupName, jobName, options);
455
+ return poller.pollUntilDone();
209
456
  }
210
457
 
211
458
  /**
212
- * Creates a streaming job or replaces an already existing streaming job.
213
- * @param streamingJob The definition of the streaming job that will be used to create a new
214
- * streaming job or replace the existing one.
459
+ * Stops a running streaming job. This will cause a running streaming job to stop processing input
460
+ * events and producing output.
215
461
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
216
462
  * @param jobName The name of the streaming job.
217
- * @param [options] The optional parameters
218
- * @returns Promise<msRestAzure.LROPoller>
463
+ * @param options The options parameters.
219
464
  */
220
- beginCreateOrReplace(streamingJob: Models.StreamingJob, resourceGroupName: string, jobName: string, options?: Models.StreamingJobsBeginCreateOrReplaceOptionalParams): Promise<msRestAzure.LROPoller> {
221
- return this.client.sendLRORequest(
222
- {
223
- streamingJob,
224
- resourceGroupName,
225
- jobName,
226
- options
227
- },
228
- beginCreateOrReplaceOperationSpec,
229
- options);
465
+ async beginStop(
466
+ resourceGroupName: string,
467
+ jobName: string,
468
+ options?: StreamingJobsStopOptionalParams
469
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
470
+ const directSendOperation = async (
471
+ args: coreClient.OperationArguments,
472
+ spec: coreClient.OperationSpec
473
+ ): Promise<void> => {
474
+ return this.client.sendOperationRequest(args, spec);
475
+ };
476
+ const sendOperation = async (
477
+ args: coreClient.OperationArguments,
478
+ spec: coreClient.OperationSpec
479
+ ) => {
480
+ let currentRawResponse:
481
+ | coreClient.FullOperationResponse
482
+ | undefined = undefined;
483
+ const providedCallback = args.options?.onResponse;
484
+ const callback: coreClient.RawResponseCallback = (
485
+ rawResponse: coreClient.FullOperationResponse,
486
+ flatResponse: unknown
487
+ ) => {
488
+ currentRawResponse = rawResponse;
489
+ providedCallback?.(rawResponse, flatResponse);
490
+ };
491
+ const updatedArgs = {
492
+ ...args,
493
+ options: {
494
+ ...args.options,
495
+ onResponse: callback
496
+ }
497
+ };
498
+ const flatResponse = await directSendOperation(updatedArgs, spec);
499
+ return {
500
+ flatResponse,
501
+ rawResponse: {
502
+ statusCode: currentRawResponse!.status,
503
+ body: currentRawResponse!.parsedBody,
504
+ headers: currentRawResponse!.headers.toJSON()
505
+ }
506
+ };
507
+ };
508
+
509
+ const lro = new LroImpl(
510
+ sendOperation,
511
+ { resourceGroupName, jobName, options },
512
+ stopOperationSpec
513
+ );
514
+ return new LroEngine(lro, {
515
+ resumeFrom: options?.resumeFrom,
516
+ intervalInMs: options?.updateIntervalInMs
517
+ });
230
518
  }
231
519
 
232
520
  /**
233
- * Deletes a streaming job.
521
+ * Stops a running streaming job. This will cause a running streaming job to stop processing input
522
+ * events and producing output.
234
523
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
235
524
  * @param jobName The name of the streaming job.
236
- * @param [options] The optional parameters
237
- * @returns Promise<msRestAzure.LROPoller>
525
+ * @param options The options parameters.
238
526
  */
239
- beginDeleteMethod(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
240
- return this.client.sendLRORequest(
241
- {
242
- resourceGroupName,
243
- jobName,
244
- options
245
- },
246
- beginDeleteMethodOperationSpec,
247
- options);
527
+ async beginStopAndWait(
528
+ resourceGroupName: string,
529
+ jobName: string,
530
+ options?: StreamingJobsStopOptionalParams
531
+ ): Promise<void> {
532
+ const poller = await this.beginStop(resourceGroupName, jobName, options);
533
+ return poller.pollUntilDone();
248
534
  }
249
535
 
250
536
  /**
251
- * Starts a streaming job. Once a job is started it will start processing input events and produce
252
- * output.
537
+ * Scales a streaming job when the job is running.
253
538
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
254
539
  * @param jobName The name of the streaming job.
255
- * @param [options] The optional parameters
256
- * @returns Promise<msRestAzure.LROPoller>
540
+ * @param options The options parameters.
257
541
  */
258
- beginStart(resourceGroupName: string, jobName: string, options?: Models.StreamingJobsBeginStartOptionalParams): Promise<msRestAzure.LROPoller> {
259
- return this.client.sendLRORequest(
260
- {
261
- resourceGroupName,
262
- jobName,
263
- options
264
- },
265
- beginStartOperationSpec,
266
- options);
542
+ async beginScale(
543
+ resourceGroupName: string,
544
+ jobName: string,
545
+ options?: StreamingJobsScaleOptionalParams
546
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
547
+ const directSendOperation = async (
548
+ args: coreClient.OperationArguments,
549
+ spec: coreClient.OperationSpec
550
+ ): Promise<void> => {
551
+ return this.client.sendOperationRequest(args, spec);
552
+ };
553
+ const sendOperation = async (
554
+ args: coreClient.OperationArguments,
555
+ spec: coreClient.OperationSpec
556
+ ) => {
557
+ let currentRawResponse:
558
+ | coreClient.FullOperationResponse
559
+ | undefined = undefined;
560
+ const providedCallback = args.options?.onResponse;
561
+ const callback: coreClient.RawResponseCallback = (
562
+ rawResponse: coreClient.FullOperationResponse,
563
+ flatResponse: unknown
564
+ ) => {
565
+ currentRawResponse = rawResponse;
566
+ providedCallback?.(rawResponse, flatResponse);
567
+ };
568
+ const updatedArgs = {
569
+ ...args,
570
+ options: {
571
+ ...args.options,
572
+ onResponse: callback
573
+ }
574
+ };
575
+ const flatResponse = await directSendOperation(updatedArgs, spec);
576
+ return {
577
+ flatResponse,
578
+ rawResponse: {
579
+ statusCode: currentRawResponse!.status,
580
+ body: currentRawResponse!.parsedBody,
581
+ headers: currentRawResponse!.headers.toJSON()
582
+ }
583
+ };
584
+ };
585
+
586
+ const lro = new LroImpl(
587
+ sendOperation,
588
+ { resourceGroupName, jobName, options },
589
+ scaleOperationSpec
590
+ );
591
+ return new LroEngine(lro, {
592
+ resumeFrom: options?.resumeFrom,
593
+ intervalInMs: options?.updateIntervalInMs
594
+ });
267
595
  }
268
596
 
269
597
  /**
270
- * Stops a running streaming job. This will cause a running streaming job to stop processing input
271
- * events and producing output.
598
+ * Scales a streaming job when the job is running.
272
599
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
273
600
  * @param jobName The name of the streaming job.
274
- * @param [options] The optional parameters
275
- * @returns Promise<msRestAzure.LROPoller>
601
+ * @param options The options parameters.
276
602
  */
277
- beginStop(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
278
- return this.client.sendLRORequest(
279
- {
280
- resourceGroupName,
281
- jobName,
282
- options
283
- },
284
- beginStopOperationSpec,
285
- options);
603
+ async beginScaleAndWait(
604
+ resourceGroupName: string,
605
+ jobName: string,
606
+ options?: StreamingJobsScaleOptionalParams
607
+ ): Promise<void> {
608
+ const poller = await this.beginScale(resourceGroupName, jobName, options);
609
+ return poller.pollUntilDone();
286
610
  }
287
611
 
288
612
  /**
289
- * Lists all of the streaming jobs in the specified resource group.
290
- * @param nextPageLink The NextLink from the previous successful call to List operation.
291
- * @param [options] The optional parameters
292
- * @returns Promise<Models.StreamingJobsListByResourceGroupNextResponse>
293
- */
294
- listByResourceGroupNext(nextPageLink: string, options?: Models.StreamingJobsListByResourceGroupNextOptionalParams): Promise<Models.StreamingJobsListByResourceGroupNextResponse>;
295
- /**
296
- * @param nextPageLink The NextLink from the previous successful call to List operation.
297
- * @param callback The callback
298
- */
299
- listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
300
- /**
301
- * @param nextPageLink The NextLink from the previous successful call to List operation.
302
- * @param options The optional parameters
303
- * @param callback The callback
613
+ * ListByResourceGroupNext
614
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
615
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
616
+ * @param options The options parameters.
304
617
  */
305
- listByResourceGroupNext(nextPageLink: string, options: Models.StreamingJobsListByResourceGroupNextOptionalParams, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
306
- listByResourceGroupNext(nextPageLink: string, options?: Models.StreamingJobsListByResourceGroupNextOptionalParams | msRest.ServiceCallback<Models.StreamingJobListResult>, callback?: msRest.ServiceCallback<Models.StreamingJobListResult>): Promise<Models.StreamingJobsListByResourceGroupNextResponse> {
618
+ private _listByResourceGroupNext(
619
+ resourceGroupName: string,
620
+ nextLink: string,
621
+ options?: StreamingJobsListByResourceGroupNextOptionalParams
622
+ ): Promise<StreamingJobsListByResourceGroupNextResponse> {
307
623
  return this.client.sendOperationRequest(
308
- {
309
- nextPageLink,
310
- options
311
- },
312
- listByResourceGroupNextOperationSpec,
313
- callback) as Promise<Models.StreamingJobsListByResourceGroupNextResponse>;
624
+ { resourceGroupName, nextLink, options },
625
+ listByResourceGroupNextOperationSpec
626
+ );
314
627
  }
315
628
 
316
629
  /**
317
- * Lists all of the streaming jobs in the given subscription.
318
- * @param nextPageLink The NextLink from the previous successful call to List operation.
319
- * @param [options] The optional parameters
320
- * @returns Promise<Models.StreamingJobsListNextResponse>
321
- */
322
- listNext(nextPageLink: string, options?: Models.StreamingJobsListNextOptionalParams): Promise<Models.StreamingJobsListNextResponse>;
323
- /**
324
- * @param nextPageLink The NextLink from the previous successful call to List operation.
325
- * @param callback The callback
326
- */
327
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
328
- /**
329
- * @param nextPageLink The NextLink from the previous successful call to List operation.
330
- * @param options The optional parameters
331
- * @param callback The callback
630
+ * ListNext
631
+ * @param nextLink The nextLink from the previous successful call to the List method.
632
+ * @param options The options parameters.
332
633
  */
333
- listNext(nextPageLink: string, options: Models.StreamingJobsListNextOptionalParams, callback: msRest.ServiceCallback<Models.StreamingJobListResult>): void;
334
- listNext(nextPageLink: string, options?: Models.StreamingJobsListNextOptionalParams | msRest.ServiceCallback<Models.StreamingJobListResult>, callback?: msRest.ServiceCallback<Models.StreamingJobListResult>): Promise<Models.StreamingJobsListNextResponse> {
634
+ private _listNext(
635
+ nextLink: string,
636
+ options?: StreamingJobsListNextOptionalParams
637
+ ): Promise<StreamingJobsListNextResponse> {
335
638
  return this.client.sendOperationRequest(
336
- {
337
- nextPageLink,
338
- options
339
- },
340
- listNextOperationSpec,
341
- callback) as Promise<Models.StreamingJobsListNextResponse>;
639
+ { nextLink, options },
640
+ listNextOperationSpec
641
+ );
342
642
  }
343
643
  }
344
-
345
644
  // Operation Specifications
346
- const serializer = new msRest.Serializer(Mappers);
347
- const updateOperationSpec: msRest.OperationSpec = {
348
- httpMethod: "PATCH",
349
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
645
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
646
+
647
+ const createOrReplaceOperationSpec: coreClient.OperationSpec = {
648
+ path:
649
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
650
+ httpMethod: "PUT",
651
+ responses: {
652
+ 200: {
653
+ bodyMapper: Mappers.StreamingJob,
654
+ headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
655
+ },
656
+ 201: {
657
+ bodyMapper: Mappers.StreamingJob,
658
+ headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
659
+ },
660
+ 202: {
661
+ bodyMapper: Mappers.StreamingJob,
662
+ headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
663
+ },
664
+ 204: {
665
+ bodyMapper: Mappers.StreamingJob,
666
+ headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
667
+ },
668
+ default: {
669
+ bodyMapper: Mappers.ErrorModel
670
+ }
671
+ },
672
+ requestBody: Parameters.streamingJob,
673
+ queryParameters: [Parameters.apiVersion],
350
674
  urlParameters: [
675
+ Parameters.$host,
351
676
  Parameters.subscriptionId,
352
677
  Parameters.resourceGroupName,
353
678
  Parameters.jobName
354
679
  ],
355
- queryParameters: [
356
- Parameters.apiVersion0
357
- ],
358
680
  headerParameters: [
681
+ Parameters.accept,
682
+ Parameters.contentType,
359
683
  Parameters.ifMatch,
360
- Parameters.acceptLanguage
684
+ Parameters.ifNoneMatch
361
685
  ],
362
- requestBody: {
363
- parameterPath: "streamingJob",
364
- mapper: {
365
- ...Mappers.StreamingJob,
366
- required: true
367
- }
368
- },
686
+ mediaType: "json",
687
+ serializer
688
+ };
689
+ const updateOperationSpec: coreClient.OperationSpec = {
690
+ path:
691
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
692
+ httpMethod: "PATCH",
369
693
  responses: {
370
694
  200: {
371
695
  bodyMapper: Mappers.StreamingJob,
372
696
  headersMapper: Mappers.StreamingJobsUpdateHeaders
373
697
  },
374
698
  default: {
375
- bodyMapper: Mappers.ErrorModel,
376
- headersMapper: Mappers.StreamingJobsUpdateHeaders
699
+ bodyMapper: Mappers.ErrorModel
377
700
  }
378
701
  },
379
- serializer
380
- };
381
-
382
- const getOperationSpec: msRest.OperationSpec = {
383
- httpMethod: "GET",
384
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
702
+ requestBody: Parameters.streamingJob,
703
+ queryParameters: [Parameters.apiVersion],
385
704
  urlParameters: [
705
+ Parameters.$host,
386
706
  Parameters.subscriptionId,
387
707
  Parameters.resourceGroupName,
388
708
  Parameters.jobName
389
709
  ],
390
- queryParameters: [
391
- Parameters.expand,
392
- Parameters.apiVersion0
393
- ],
394
710
  headerParameters: [
395
- Parameters.acceptLanguage
711
+ Parameters.accept,
712
+ Parameters.contentType,
713
+ Parameters.ifMatch
396
714
  ],
715
+ mediaType: "json",
716
+ serializer
717
+ };
718
+ const deleteOperationSpec: coreClient.OperationSpec = {
719
+ path:
720
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
721
+ httpMethod: "DELETE",
397
722
  responses: {
398
- 200: {
399
- bodyMapper: Mappers.StreamingJob,
400
- headersMapper: Mappers.StreamingJobsGetHeaders
401
- },
723
+ 200: {},
724
+ 201: {},
725
+ 202: {},
726
+ 204: {},
402
727
  default: {
403
- bodyMapper: Mappers.ErrorModel,
404
- headersMapper: Mappers.StreamingJobsGetHeaders
728
+ bodyMapper: Mappers.ErrorModel
405
729
  }
406
730
  },
407
- serializer
408
- };
409
-
410
- const listByResourceGroupOperationSpec: msRest.OperationSpec = {
411
- httpMethod: "GET",
412
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs",
731
+ queryParameters: [Parameters.apiVersion],
413
732
  urlParameters: [
733
+ Parameters.$host,
414
734
  Parameters.subscriptionId,
415
- Parameters.resourceGroupName
416
- ],
417
- queryParameters: [
418
- Parameters.expand,
419
- Parameters.apiVersion0
420
- ],
421
- headerParameters: [
422
- Parameters.acceptLanguage
735
+ Parameters.resourceGroupName,
736
+ Parameters.jobName
423
737
  ],
738
+ headerParameters: [Parameters.accept],
739
+ serializer
740
+ };
741
+ const getOperationSpec: coreClient.OperationSpec = {
742
+ path:
743
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
744
+ httpMethod: "GET",
424
745
  responses: {
425
746
  200: {
426
- bodyMapper: Mappers.StreamingJobListResult
747
+ bodyMapper: Mappers.StreamingJob,
748
+ headersMapper: Mappers.StreamingJobsGetHeaders
427
749
  },
428
750
  default: {
429
751
  bodyMapper: Mappers.ErrorModel
430
752
  }
431
753
  },
754
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
755
+ urlParameters: [
756
+ Parameters.$host,
757
+ Parameters.subscriptionId,
758
+ Parameters.resourceGroupName,
759
+ Parameters.jobName
760
+ ],
761
+ headerParameters: [Parameters.accept],
432
762
  serializer
433
763
  };
434
-
435
- const listOperationSpec: msRest.OperationSpec = {
764
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
765
+ path:
766
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs",
436
767
  httpMethod: "GET",
437
- path: "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/streamingjobs",
438
- urlParameters: [
439
- Parameters.subscriptionId
440
- ],
441
- queryParameters: [
442
- Parameters.expand,
443
- Parameters.apiVersion0
444
- ],
445
- headerParameters: [
446
- Parameters.acceptLanguage
447
- ],
448
768
  responses: {
449
769
  200: {
450
770
  bodyMapper: Mappers.StreamingJobListResult
@@ -453,143 +773,108 @@ const listOperationSpec: msRest.OperationSpec = {
453
773
  bodyMapper: Mappers.ErrorModel
454
774
  }
455
775
  },
456
- serializer
457
- };
458
-
459
- const beginCreateOrReplaceOperationSpec: msRest.OperationSpec = {
460
- httpMethod: "PUT",
461
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
776
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
462
777
  urlParameters: [
778
+ Parameters.$host,
463
779
  Parameters.subscriptionId,
464
- Parameters.resourceGroupName,
465
- Parameters.jobName
466
- ],
467
- queryParameters: [
468
- Parameters.apiVersion0
469
- ],
470
- headerParameters: [
471
- Parameters.ifMatch,
472
- Parameters.ifNoneMatch,
473
- Parameters.acceptLanguage
780
+ Parameters.resourceGroupName
474
781
  ],
475
- requestBody: {
476
- parameterPath: "streamingJob",
477
- mapper: {
478
- ...Mappers.StreamingJob,
479
- required: true
480
- }
481
- },
782
+ headerParameters: [Parameters.accept],
783
+ serializer
784
+ };
785
+ const listOperationSpec: coreClient.OperationSpec = {
786
+ path:
787
+ "/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/streamingjobs",
788
+ httpMethod: "GET",
482
789
  responses: {
483
790
  200: {
484
- bodyMapper: Mappers.StreamingJob,
485
- headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
486
- },
487
- 201: {
488
- bodyMapper: Mappers.StreamingJob,
489
- headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
791
+ bodyMapper: Mappers.StreamingJobListResult
490
792
  },
491
793
  default: {
492
- bodyMapper: Mappers.ErrorModel,
493
- headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders
794
+ bodyMapper: Mappers.ErrorModel
494
795
  }
495
796
  },
797
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
798
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
799
+ headerParameters: [Parameters.accept],
496
800
  serializer
497
801
  };
498
-
499
- const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
500
- httpMethod: "DELETE",
501
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}",
502
- urlParameters: [
503
- Parameters.subscriptionId,
504
- Parameters.resourceGroupName,
505
- Parameters.jobName
506
- ],
507
- queryParameters: [
508
- Parameters.apiVersion0
509
- ],
510
- headerParameters: [
511
- Parameters.acceptLanguage
512
- ],
802
+ const startOperationSpec: coreClient.OperationSpec = {
803
+ path:
804
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/start",
805
+ httpMethod: "POST",
513
806
  responses: {
514
807
  200: {},
808
+ 201: {},
515
809
  202: {},
516
810
  204: {},
517
811
  default: {
518
812
  bodyMapper: Mappers.ErrorModel
519
813
  }
520
814
  },
521
- serializer
522
- };
523
-
524
- const beginStartOperationSpec: msRest.OperationSpec = {
525
- httpMethod: "POST",
526
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/start",
815
+ requestBody: Parameters.startJobParameters,
816
+ queryParameters: [Parameters.apiVersion],
527
817
  urlParameters: [
818
+ Parameters.$host,
528
819
  Parameters.subscriptionId,
529
820
  Parameters.resourceGroupName,
530
821
  Parameters.jobName
531
822
  ],
532
- queryParameters: [
533
- Parameters.apiVersion0
534
- ],
535
- headerParameters: [
536
- Parameters.acceptLanguage
537
- ],
538
- requestBody: {
539
- parameterPath: [
540
- "options",
541
- "startJobParameters"
542
- ],
543
- mapper: Mappers.StartStreamingJobParameters
544
- },
823
+ headerParameters: [Parameters.accept, Parameters.contentType],
824
+ mediaType: "json",
825
+ serializer
826
+ };
827
+ const stopOperationSpec: coreClient.OperationSpec = {
828
+ path:
829
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/stop",
830
+ httpMethod: "POST",
545
831
  responses: {
546
832
  200: {},
833
+ 201: {},
547
834
  202: {},
835
+ 204: {},
548
836
  default: {
549
837
  bodyMapper: Mappers.ErrorModel
550
838
  }
551
839
  },
552
- serializer
553
- };
554
-
555
- const beginStopOperationSpec: msRest.OperationSpec = {
556
- httpMethod: "POST",
557
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/stop",
840
+ queryParameters: [Parameters.apiVersion],
558
841
  urlParameters: [
842
+ Parameters.$host,
559
843
  Parameters.subscriptionId,
560
844
  Parameters.resourceGroupName,
561
845
  Parameters.jobName
562
846
  ],
563
- queryParameters: [
564
- Parameters.apiVersion0
565
- ],
566
- headerParameters: [
567
- Parameters.acceptLanguage
568
- ],
847
+ headerParameters: [Parameters.accept],
848
+ serializer
849
+ };
850
+ const scaleOperationSpec: coreClient.OperationSpec = {
851
+ path:
852
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/scale",
853
+ httpMethod: "POST",
569
854
  responses: {
570
855
  200: {},
856
+ 201: {},
571
857
  202: {},
858
+ 204: {},
572
859
  default: {
573
860
  bodyMapper: Mappers.ErrorModel
574
861
  }
575
862
  },
863
+ requestBody: Parameters.scaleJobParameters,
864
+ queryParameters: [Parameters.apiVersion],
865
+ urlParameters: [
866
+ Parameters.$host,
867
+ Parameters.subscriptionId,
868
+ Parameters.resourceGroupName,
869
+ Parameters.jobName
870
+ ],
871
+ headerParameters: [Parameters.accept, Parameters.contentType],
872
+ mediaType: "json",
576
873
  serializer
577
874
  };
578
-
579
- const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
580
- httpMethod: "GET",
581
- baseUrl: "https://management.azure.com",
875
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
582
876
  path: "{nextLink}",
583
- urlParameters: [
584
- Parameters.nextPageLink
585
- ],
586
- queryParameters: [
587
- Parameters.expand,
588
- Parameters.apiVersion0
589
- ],
590
- headerParameters: [
591
- Parameters.acceptLanguage
592
- ],
877
+ httpMethod: "GET",
593
878
  responses: {
594
879
  200: {
595
880
  bodyMapper: Mappers.StreamingJobListResult
@@ -598,23 +883,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
598
883
  bodyMapper: Mappers.ErrorModel
599
884
  }
600
885
  },
886
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
887
+ urlParameters: [
888
+ Parameters.$host,
889
+ Parameters.nextLink,
890
+ Parameters.subscriptionId,
891
+ Parameters.resourceGroupName
892
+ ],
893
+ headerParameters: [Parameters.accept],
601
894
  serializer
602
895
  };
603
-
604
- const listNextOperationSpec: msRest.OperationSpec = {
605
- httpMethod: "GET",
606
- baseUrl: "https://management.azure.com",
896
+ const listNextOperationSpec: coreClient.OperationSpec = {
607
897
  path: "{nextLink}",
608
- urlParameters: [
609
- Parameters.nextPageLink
610
- ],
611
- queryParameters: [
612
- Parameters.expand,
613
- Parameters.apiVersion0
614
- ],
615
- headerParameters: [
616
- Parameters.acceptLanguage
617
- ],
898
+ httpMethod: "GET",
618
899
  responses: {
619
900
  200: {
620
901
  bodyMapper: Mappers.StreamingJobListResult
@@ -623,5 +904,12 @@ const listNextOperationSpec: msRest.OperationSpec = {
623
904
  bodyMapper: Mappers.ErrorModel
624
905
  }
625
906
  },
907
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
908
+ urlParameters: [
909
+ Parameters.$host,
910
+ Parameters.nextLink,
911
+ Parameters.subscriptionId
912
+ ],
913
+ headerParameters: [Parameters.accept],
626
914
  serializer
627
915
  };