@azure/arm-networkfunction 1.0.0-alpha.20220714.3

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 (151) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1809 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.js +44 -0
  11. package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.js.map +1 -0
  12. package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.js +43 -0
  15. package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.js.map +1 -0
  16. package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.js +37 -0
  19. package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.js.map +1 -0
  20. package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.js +31 -0
  23. package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.js.map +1 -0
  24. package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.js +31 -0
  27. package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.js.map +1 -0
  28. package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.js +32 -0
  31. package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.js.map +1 -0
  32. package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.js +32 -0
  35. package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.js.map +1 -0
  36. package/dist-esm/samples-dev/collectorPoliciesDeleteSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/collectorPoliciesDeleteSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/collectorPoliciesDeleteSample.js +32 -0
  39. package/dist-esm/samples-dev/collectorPoliciesDeleteSample.js.map +1 -0
  40. package/dist-esm/samples-dev/collectorPoliciesGetSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/collectorPoliciesGetSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/collectorPoliciesGetSample.js +32 -0
  43. package/dist-esm/samples-dev/collectorPoliciesGetSample.js.map +1 -0
  44. package/dist-esm/samples-dev/collectorPoliciesListSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/collectorPoliciesListSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/collectorPoliciesListSample.js +45 -0
  47. package/dist-esm/samples-dev/collectorPoliciesListSample.js.map +1 -0
  48. package/dist-esm/samples-dev/networkFunctionListOperationsSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/networkFunctionListOperationsSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/networkFunctionListOperationsSample.js +43 -0
  51. package/dist-esm/samples-dev/networkFunctionListOperationsSample.js.map +1 -0
  52. package/dist-esm/src/azureTrafficCollectorClient.d.ts +24 -0
  53. package/dist-esm/src/azureTrafficCollectorClient.d.ts.map +1 -0
  54. package/dist-esm/src/azureTrafficCollectorClient.js +102 -0
  55. package/dist-esm/src/azureTrafficCollectorClient.js.map +1 -0
  56. package/dist-esm/src/index.d.ts +5 -0
  57. package/dist-esm/src/index.d.ts.map +1 -0
  58. package/dist-esm/src/index.js +12 -0
  59. package/dist-esm/src/index.js.map +1 -0
  60. package/dist-esm/src/lroImpl.d.ts +16 -0
  61. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  62. package/dist-esm/src/lroImpl.js +29 -0
  63. package/dist-esm/src/lroImpl.js.map +1 -0
  64. package/dist-esm/src/models/index.d.ts +414 -0
  65. package/dist-esm/src/models/index.d.ts.map +1 -0
  66. package/dist-esm/src/models/index.js +56 -0
  67. package/dist-esm/src/models/index.js.map +1 -0
  68. package/dist-esm/src/models/mappers.d.ts +22 -0
  69. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  70. package/dist-esm/src/models/mappers.js +531 -0
  71. package/dist-esm/src/models/mappers.js.map +1 -0
  72. package/dist-esm/src/models/parameters.d.ts +18 -0
  73. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  74. package/dist-esm/src/models/parameters.js +132 -0
  75. package/dist-esm/src/models/parameters.js.map +1 -0
  76. package/dist-esm/src/operations/azureTrafficCollectors.d.ts +57 -0
  77. package/dist-esm/src/operations/azureTrafficCollectors.d.ts.map +1 -0
  78. package/dist-esm/src/operations/azureTrafficCollectors.js +255 -0
  79. package/dist-esm/src/operations/azureTrafficCollectors.js.map +1 -0
  80. package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.d.ts +35 -0
  81. package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.d.ts.map +1 -0
  82. package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.js +132 -0
  83. package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.js.map +1 -0
  84. package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.d.ts +32 -0
  85. package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.d.ts.map +1 -0
  86. package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.js +124 -0
  87. package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.js.map +1 -0
  88. package/dist-esm/src/operations/collectorPolicies.d.ts +79 -0
  89. package/dist-esm/src/operations/collectorPolicies.d.ts.map +1 -0
  90. package/dist-esm/src/operations/collectorPolicies.js +356 -0
  91. package/dist-esm/src/operations/collectorPolicies.js.map +1 -0
  92. package/dist-esm/src/operations/index.d.ts +6 -0
  93. package/dist-esm/src/operations/index.d.ts.map +1 -0
  94. package/dist-esm/src/operations/index.js +13 -0
  95. package/dist-esm/src/operations/index.js.map +1 -0
  96. package/dist-esm/src/operations/networkFunction.d.ts +26 -0
  97. package/dist-esm/src/operations/networkFunction.d.ts.map +1 -0
  98. package/dist-esm/src/operations/networkFunction.js +90 -0
  99. package/dist-esm/src/operations/networkFunction.js.map +1 -0
  100. package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.d.ts +49 -0
  101. package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.d.ts.map +1 -0
  102. package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.js +9 -0
  103. package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.d.ts +12 -0
  105. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.d.ts +11 -0
  109. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.js +9 -0
  111. package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.js.map +1 -0
  112. package/dist-esm/src/operationsInterfaces/collectorPolicies.d.ts +54 -0
  113. package/dist-esm/src/operationsInterfaces/collectorPolicies.d.ts.map +1 -0
  114. package/dist-esm/src/operationsInterfaces/collectorPolicies.js +9 -0
  115. package/dist-esm/src/operationsInterfaces/collectorPolicies.js.map +1 -0
  116. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  117. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  118. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  119. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/networkFunction.d.ts +11 -0
  121. package/dist-esm/src/operationsInterfaces/networkFunction.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/networkFunction.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/networkFunction.js.map +1 -0
  124. package/dist-esm/test/sampleTest.d.ts +2 -0
  125. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  126. package/dist-esm/test/sampleTest.js +38 -0
  127. package/dist-esm/test/sampleTest.js.map +1 -0
  128. package/package.json +121 -0
  129. package/review/arm-networkfunction.api.md +375 -0
  130. package/rollup.config.js +122 -0
  131. package/src/azureTrafficCollectorClient.ts +158 -0
  132. package/src/index.ts +12 -0
  133. package/src/lroImpl.ts +34 -0
  134. package/src/models/index.ts +477 -0
  135. package/src/models/mappers.ts +569 -0
  136. package/src/models/parameters.ts +157 -0
  137. package/src/operations/azureTrafficCollectors.ts +358 -0
  138. package/src/operations/azureTrafficCollectorsByResourceGroup.ts +163 -0
  139. package/src/operations/azureTrafficCollectorsBySubscription.ts +143 -0
  140. package/src/operations/collectorPolicies.ts +498 -0
  141. package/src/operations/index.ts +13 -0
  142. package/src/operations/networkFunction.ts +101 -0
  143. package/src/operationsInterfaces/azureTrafficCollectors.ts +96 -0
  144. package/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.ts +27 -0
  145. package/src/operationsInterfaces/azureTrafficCollectorsBySubscription.ts +25 -0
  146. package/src/operationsInterfaces/collectorPolicies.ts +105 -0
  147. package/src/operationsInterfaces/index.ts +13 -0
  148. package/src/operationsInterfaces/networkFunction.ts +25 -0
  149. package/tsconfig.json +33 -0
  150. package/types/arm-networkfunction.d.ts +624 -0
  151. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,498 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { CollectorPolicies } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { AzureTrafficCollectorClient } from "../azureTrafficCollectorClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ CollectorPolicy,
19
+ CollectorPoliciesListNextOptionalParams,
20
+ CollectorPoliciesListOptionalParams,
21
+ CollectorPoliciesListResponse,
22
+ CollectorPoliciesGetOptionalParams,
23
+ CollectorPoliciesGetResponse,
24
+ CollectorPoliciesCreateOrUpdateOptionalParams,
25
+ CollectorPoliciesCreateOrUpdateResponse,
26
+ CollectorPoliciesDeleteOptionalParams,
27
+ CollectorPoliciesListNextResponse
28
+ } from "../models";
29
+
30
+ /// <reference lib="esnext.asynciterable" />
31
+ /** Class containing CollectorPolicies operations. */
32
+ export class CollectorPoliciesImpl implements CollectorPolicies {
33
+ private readonly client: AzureTrafficCollectorClient;
34
+
35
+ /**
36
+ * Initialize a new instance of the class CollectorPolicies class.
37
+ * @param client Reference to the service client
38
+ */
39
+ constructor(client: AzureTrafficCollectorClient) {
40
+ this.client = client;
41
+ }
42
+
43
+ /**
44
+ * Return list of Collector policies in a Azure Traffic Collector
45
+ * @param resourceGroupName The name of the resource group.
46
+ * @param azureTrafficCollectorName Azure Traffic Collector name
47
+ * @param options The options parameters.
48
+ */
49
+ public list(
50
+ resourceGroupName: string,
51
+ azureTrafficCollectorName: string,
52
+ options?: CollectorPoliciesListOptionalParams
53
+ ): PagedAsyncIterableIterator<CollectorPolicy> {
54
+ const iter = this.listPagingAll(
55
+ resourceGroupName,
56
+ azureTrafficCollectorName,
57
+ options
58
+ );
59
+ return {
60
+ next() {
61
+ return iter.next();
62
+ },
63
+ [Symbol.asyncIterator]() {
64
+ return this;
65
+ },
66
+ byPage: () => {
67
+ return this.listPagingPage(
68
+ resourceGroupName,
69
+ azureTrafficCollectorName,
70
+ options
71
+ );
72
+ }
73
+ };
74
+ }
75
+
76
+ private async *listPagingPage(
77
+ resourceGroupName: string,
78
+ azureTrafficCollectorName: string,
79
+ options?: CollectorPoliciesListOptionalParams
80
+ ): AsyncIterableIterator<CollectorPolicy[]> {
81
+ let result = await this._list(
82
+ resourceGroupName,
83
+ azureTrafficCollectorName,
84
+ options
85
+ );
86
+ yield result.value || [];
87
+ let continuationToken = result.nextLink;
88
+ while (continuationToken) {
89
+ result = await this._listNext(
90
+ resourceGroupName,
91
+ azureTrafficCollectorName,
92
+ continuationToken,
93
+ options
94
+ );
95
+ continuationToken = result.nextLink;
96
+ yield result.value || [];
97
+ }
98
+ }
99
+
100
+ private async *listPagingAll(
101
+ resourceGroupName: string,
102
+ azureTrafficCollectorName: string,
103
+ options?: CollectorPoliciesListOptionalParams
104
+ ): AsyncIterableIterator<CollectorPolicy> {
105
+ for await (const page of this.listPagingPage(
106
+ resourceGroupName,
107
+ azureTrafficCollectorName,
108
+ options
109
+ )) {
110
+ yield* page;
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Return list of Collector policies in a Azure Traffic Collector
116
+ * @param resourceGroupName The name of the resource group.
117
+ * @param azureTrafficCollectorName Azure Traffic Collector name
118
+ * @param options The options parameters.
119
+ */
120
+ private _list(
121
+ resourceGroupName: string,
122
+ azureTrafficCollectorName: string,
123
+ options?: CollectorPoliciesListOptionalParams
124
+ ): Promise<CollectorPoliciesListResponse> {
125
+ return this.client.sendOperationRequest(
126
+ { resourceGroupName, azureTrafficCollectorName, options },
127
+ listOperationSpec
128
+ );
129
+ }
130
+
131
+ /**
132
+ * Gets the collector policy in a specified Traffic Collector
133
+ * @param resourceGroupName The name of the resource group.
134
+ * @param azureTrafficCollectorName Azure Traffic Collector name
135
+ * @param collectorPolicyName Collector Policy Name
136
+ * @param options The options parameters.
137
+ */
138
+ get(
139
+ resourceGroupName: string,
140
+ azureTrafficCollectorName: string,
141
+ collectorPolicyName: string,
142
+ options?: CollectorPoliciesGetOptionalParams
143
+ ): Promise<CollectorPoliciesGetResponse> {
144
+ return this.client.sendOperationRequest(
145
+ {
146
+ resourceGroupName,
147
+ azureTrafficCollectorName,
148
+ collectorPolicyName,
149
+ options
150
+ },
151
+ getOperationSpec
152
+ );
153
+ }
154
+
155
+ /**
156
+ * Creates or updates a Collector Policy resource
157
+ * @param resourceGroupName The name of the resource group.
158
+ * @param azureTrafficCollectorName Azure Traffic Collector name
159
+ * @param collectorPolicyName Collector Policy Name
160
+ * @param options The options parameters.
161
+ */
162
+ async beginCreateOrUpdate(
163
+ resourceGroupName: string,
164
+ azureTrafficCollectorName: string,
165
+ collectorPolicyName: string,
166
+ options?: CollectorPoliciesCreateOrUpdateOptionalParams
167
+ ): Promise<
168
+ PollerLike<
169
+ PollOperationState<CollectorPoliciesCreateOrUpdateResponse>,
170
+ CollectorPoliciesCreateOrUpdateResponse
171
+ >
172
+ > {
173
+ const directSendOperation = async (
174
+ args: coreClient.OperationArguments,
175
+ spec: coreClient.OperationSpec
176
+ ): Promise<CollectorPoliciesCreateOrUpdateResponse> => {
177
+ return this.client.sendOperationRequest(args, spec);
178
+ };
179
+ const sendOperation = async (
180
+ args: coreClient.OperationArguments,
181
+ spec: coreClient.OperationSpec
182
+ ) => {
183
+ let currentRawResponse:
184
+ | coreClient.FullOperationResponse
185
+ | undefined = undefined;
186
+ const providedCallback = args.options?.onResponse;
187
+ const callback: coreClient.RawResponseCallback = (
188
+ rawResponse: coreClient.FullOperationResponse,
189
+ flatResponse: unknown
190
+ ) => {
191
+ currentRawResponse = rawResponse;
192
+ providedCallback?.(rawResponse, flatResponse);
193
+ };
194
+ const updatedArgs = {
195
+ ...args,
196
+ options: {
197
+ ...args.options,
198
+ onResponse: callback
199
+ }
200
+ };
201
+ const flatResponse = await directSendOperation(updatedArgs, spec);
202
+ return {
203
+ flatResponse,
204
+ rawResponse: {
205
+ statusCode: currentRawResponse!.status,
206
+ body: currentRawResponse!.parsedBody,
207
+ headers: currentRawResponse!.headers.toJSON()
208
+ }
209
+ };
210
+ };
211
+
212
+ const lro = new LroImpl(
213
+ sendOperation,
214
+ {
215
+ resourceGroupName,
216
+ azureTrafficCollectorName,
217
+ collectorPolicyName,
218
+ options
219
+ },
220
+ createOrUpdateOperationSpec
221
+ );
222
+ const poller = new LroEngine(lro, {
223
+ resumeFrom: options?.resumeFrom,
224
+ intervalInMs: options?.updateIntervalInMs,
225
+ lroResourceLocationConfig: "azure-async-operation"
226
+ });
227
+ await poller.poll();
228
+ return poller;
229
+ }
230
+
231
+ /**
232
+ * Creates or updates a Collector Policy resource
233
+ * @param resourceGroupName The name of the resource group.
234
+ * @param azureTrafficCollectorName Azure Traffic Collector name
235
+ * @param collectorPolicyName Collector Policy Name
236
+ * @param options The options parameters.
237
+ */
238
+ async beginCreateOrUpdateAndWait(
239
+ resourceGroupName: string,
240
+ azureTrafficCollectorName: string,
241
+ collectorPolicyName: string,
242
+ options?: CollectorPoliciesCreateOrUpdateOptionalParams
243
+ ): Promise<CollectorPoliciesCreateOrUpdateResponse> {
244
+ const poller = await this.beginCreateOrUpdate(
245
+ resourceGroupName,
246
+ azureTrafficCollectorName,
247
+ collectorPolicyName,
248
+ options
249
+ );
250
+ return poller.pollUntilDone();
251
+ }
252
+
253
+ /**
254
+ * Deletes a specified Collector Policy resource.
255
+ * @param resourceGroupName The name of the resource group.
256
+ * @param azureTrafficCollectorName Azure Traffic Collector name
257
+ * @param collectorPolicyName Collector Policy Name
258
+ * @param options The options parameters.
259
+ */
260
+ async beginDelete(
261
+ resourceGroupName: string,
262
+ azureTrafficCollectorName: string,
263
+ collectorPolicyName: string,
264
+ options?: CollectorPoliciesDeleteOptionalParams
265
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
266
+ const directSendOperation = async (
267
+ args: coreClient.OperationArguments,
268
+ spec: coreClient.OperationSpec
269
+ ): Promise<void> => {
270
+ return this.client.sendOperationRequest(args, spec);
271
+ };
272
+ const sendOperation = async (
273
+ args: coreClient.OperationArguments,
274
+ spec: coreClient.OperationSpec
275
+ ) => {
276
+ let currentRawResponse:
277
+ | coreClient.FullOperationResponse
278
+ | undefined = undefined;
279
+ const providedCallback = args.options?.onResponse;
280
+ const callback: coreClient.RawResponseCallback = (
281
+ rawResponse: coreClient.FullOperationResponse,
282
+ flatResponse: unknown
283
+ ) => {
284
+ currentRawResponse = rawResponse;
285
+ providedCallback?.(rawResponse, flatResponse);
286
+ };
287
+ const updatedArgs = {
288
+ ...args,
289
+ options: {
290
+ ...args.options,
291
+ onResponse: callback
292
+ }
293
+ };
294
+ const flatResponse = await directSendOperation(updatedArgs, spec);
295
+ return {
296
+ flatResponse,
297
+ rawResponse: {
298
+ statusCode: currentRawResponse!.status,
299
+ body: currentRawResponse!.parsedBody,
300
+ headers: currentRawResponse!.headers.toJSON()
301
+ }
302
+ };
303
+ };
304
+
305
+ const lro = new LroImpl(
306
+ sendOperation,
307
+ {
308
+ resourceGroupName,
309
+ azureTrafficCollectorName,
310
+ collectorPolicyName,
311
+ options
312
+ },
313
+ deleteOperationSpec
314
+ );
315
+ const poller = new LroEngine(lro, {
316
+ resumeFrom: options?.resumeFrom,
317
+ intervalInMs: options?.updateIntervalInMs,
318
+ lroResourceLocationConfig: "location"
319
+ });
320
+ await poller.poll();
321
+ return poller;
322
+ }
323
+
324
+ /**
325
+ * Deletes a specified Collector Policy resource.
326
+ * @param resourceGroupName The name of the resource group.
327
+ * @param azureTrafficCollectorName Azure Traffic Collector name
328
+ * @param collectorPolicyName Collector Policy Name
329
+ * @param options The options parameters.
330
+ */
331
+ async beginDeleteAndWait(
332
+ resourceGroupName: string,
333
+ azureTrafficCollectorName: string,
334
+ collectorPolicyName: string,
335
+ options?: CollectorPoliciesDeleteOptionalParams
336
+ ): Promise<void> {
337
+ const poller = await this.beginDelete(
338
+ resourceGroupName,
339
+ azureTrafficCollectorName,
340
+ collectorPolicyName,
341
+ options
342
+ );
343
+ return poller.pollUntilDone();
344
+ }
345
+
346
+ /**
347
+ * ListNext
348
+ * @param resourceGroupName The name of the resource group.
349
+ * @param azureTrafficCollectorName Azure Traffic Collector name
350
+ * @param nextLink The nextLink from the previous successful call to the List method.
351
+ * @param options The options parameters.
352
+ */
353
+ private _listNext(
354
+ resourceGroupName: string,
355
+ azureTrafficCollectorName: string,
356
+ nextLink: string,
357
+ options?: CollectorPoliciesListNextOptionalParams
358
+ ): Promise<CollectorPoliciesListNextResponse> {
359
+ return this.client.sendOperationRequest(
360
+ { resourceGroupName, azureTrafficCollectorName, nextLink, options },
361
+ listNextOperationSpec
362
+ );
363
+ }
364
+ }
365
+ // Operation Specifications
366
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
367
+
368
+ const listOperationSpec: coreClient.OperationSpec = {
369
+ path:
370
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies",
371
+ httpMethod: "GET",
372
+ responses: {
373
+ 200: {
374
+ bodyMapper: Mappers.CollectorPolicyListResult
375
+ },
376
+ default: {
377
+ bodyMapper: Mappers.CloudError
378
+ }
379
+ },
380
+ queryParameters: [Parameters.apiVersion],
381
+ urlParameters: [
382
+ Parameters.$host,
383
+ Parameters.subscriptionId,
384
+ Parameters.resourceGroupName,
385
+ Parameters.azureTrafficCollectorName
386
+ ],
387
+ headerParameters: [Parameters.accept],
388
+ serializer
389
+ };
390
+ const getOperationSpec: coreClient.OperationSpec = {
391
+ path:
392
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}",
393
+ httpMethod: "GET",
394
+ responses: {
395
+ 200: {
396
+ bodyMapper: Mappers.CollectorPolicy
397
+ },
398
+ default: {
399
+ bodyMapper: Mappers.CloudError
400
+ }
401
+ },
402
+ queryParameters: [Parameters.apiVersion],
403
+ urlParameters: [
404
+ Parameters.$host,
405
+ Parameters.subscriptionId,
406
+ Parameters.resourceGroupName,
407
+ Parameters.azureTrafficCollectorName,
408
+ Parameters.collectorPolicyName
409
+ ],
410
+ headerParameters: [Parameters.accept],
411
+ serializer
412
+ };
413
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
414
+ path:
415
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}",
416
+ httpMethod: "PUT",
417
+ responses: {
418
+ 200: {
419
+ bodyMapper: Mappers.CollectorPolicy
420
+ },
421
+ 201: {
422
+ bodyMapper: Mappers.CollectorPolicy
423
+ },
424
+ 202: {
425
+ bodyMapper: Mappers.CollectorPolicy
426
+ },
427
+ 204: {
428
+ bodyMapper: Mappers.CollectorPolicy
429
+ },
430
+ default: {
431
+ bodyMapper: Mappers.CloudError
432
+ }
433
+ },
434
+ requestBody: {
435
+ parameterPath: {
436
+ ingestionPolicy: ["options", "ingestionPolicy"],
437
+ emissionPolicies: ["options", "emissionPolicies"]
438
+ },
439
+ mapper: { ...Mappers.CollectorPolicy, required: true }
440
+ },
441
+ queryParameters: [Parameters.apiVersion],
442
+ urlParameters: [
443
+ Parameters.$host,
444
+ Parameters.subscriptionId,
445
+ Parameters.resourceGroupName,
446
+ Parameters.azureTrafficCollectorName,
447
+ Parameters.collectorPolicyName
448
+ ],
449
+ headerParameters: [Parameters.accept, Parameters.contentType],
450
+ mediaType: "json",
451
+ serializer
452
+ };
453
+ const deleteOperationSpec: coreClient.OperationSpec = {
454
+ path:
455
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}",
456
+ httpMethod: "DELETE",
457
+ responses: {
458
+ 200: {},
459
+ 201: {},
460
+ 202: {},
461
+ 204: {},
462
+ default: {
463
+ bodyMapper: Mappers.CloudError
464
+ }
465
+ },
466
+ queryParameters: [Parameters.apiVersion],
467
+ urlParameters: [
468
+ Parameters.$host,
469
+ Parameters.subscriptionId,
470
+ Parameters.resourceGroupName,
471
+ Parameters.azureTrafficCollectorName,
472
+ Parameters.collectorPolicyName
473
+ ],
474
+ headerParameters: [Parameters.accept],
475
+ serializer
476
+ };
477
+ const listNextOperationSpec: coreClient.OperationSpec = {
478
+ path: "{nextLink}",
479
+ httpMethod: "GET",
480
+ responses: {
481
+ 200: {
482
+ bodyMapper: Mappers.CollectorPolicyListResult
483
+ },
484
+ default: {
485
+ bodyMapper: Mappers.CloudError
486
+ }
487
+ },
488
+ queryParameters: [Parameters.apiVersion],
489
+ urlParameters: [
490
+ Parameters.$host,
491
+ Parameters.subscriptionId,
492
+ Parameters.nextLink,
493
+ Parameters.resourceGroupName,
494
+ Parameters.azureTrafficCollectorName
495
+ ],
496
+ headerParameters: [Parameters.accept],
497
+ serializer
498
+ };
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export * from "./networkFunction";
10
+ export * from "./azureTrafficCollectorsBySubscription";
11
+ export * from "./azureTrafficCollectorsByResourceGroup";
12
+ export * from "./azureTrafficCollectors";
13
+ export * from "./collectorPolicies";
@@ -0,0 +1,101 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { NetworkFunction } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { AzureTrafficCollectorClient } from "../azureTrafficCollectorClient";
15
+ import {
16
+ Operation,
17
+ NetworkFunctionListOperationsOptionalParams,
18
+ NetworkFunctionListOperationsResponse
19
+ } from "../models";
20
+
21
+ /// <reference lib="esnext.asynciterable" />
22
+ /** Class containing NetworkFunction operations. */
23
+ export class NetworkFunctionImpl implements NetworkFunction {
24
+ private readonly client: AzureTrafficCollectorClient;
25
+
26
+ /**
27
+ * Initialize a new instance of the class NetworkFunction class.
28
+ * @param client Reference to the service client
29
+ */
30
+ constructor(client: AzureTrafficCollectorClient) {
31
+ this.client = client;
32
+ }
33
+
34
+ /**
35
+ * Lists all of the available NetworkFunction Rest API operations.
36
+ * @param options The options parameters.
37
+ */
38
+ public listOperations(
39
+ options?: NetworkFunctionListOperationsOptionalParams
40
+ ): PagedAsyncIterableIterator<Operation> {
41
+ const iter = this.listOperationsPagingAll(options);
42
+ return {
43
+ next() {
44
+ return iter.next();
45
+ },
46
+ [Symbol.asyncIterator]() {
47
+ return this;
48
+ },
49
+ byPage: () => {
50
+ return this.listOperationsPagingPage(options);
51
+ }
52
+ };
53
+ }
54
+
55
+ private async *listOperationsPagingPage(
56
+ options?: NetworkFunctionListOperationsOptionalParams
57
+ ): AsyncIterableIterator<Operation[]> {
58
+ let result = await this._listOperations(options);
59
+ yield result.value || [];
60
+ }
61
+
62
+ private async *listOperationsPagingAll(
63
+ options?: NetworkFunctionListOperationsOptionalParams
64
+ ): AsyncIterableIterator<Operation> {
65
+ for await (const page of this.listOperationsPagingPage(options)) {
66
+ yield* page;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Lists all of the available NetworkFunction Rest API operations.
72
+ * @param options The options parameters.
73
+ */
74
+ private _listOperations(
75
+ options?: NetworkFunctionListOperationsOptionalParams
76
+ ): Promise<NetworkFunctionListOperationsResponse> {
77
+ return this.client.sendOperationRequest(
78
+ { options },
79
+ listOperationsOperationSpec
80
+ );
81
+ }
82
+ }
83
+ // Operation Specifications
84
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
85
+
86
+ const listOperationsOperationSpec: coreClient.OperationSpec = {
87
+ path: "/providers/Microsoft.NetworkFunction/operations",
88
+ httpMethod: "GET",
89
+ responses: {
90
+ 200: {
91
+ bodyMapper: Mappers.OperationListResult
92
+ },
93
+ default: {
94
+ bodyMapper: Mappers.CloudError
95
+ }
96
+ },
97
+ queryParameters: [Parameters.apiVersion],
98
+ urlParameters: [Parameters.$host],
99
+ headerParameters: [Parameters.accept],
100
+ serializer
101
+ };
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PollerLike, PollOperationState } from "@azure/core-lro";
10
+ import {
11
+ AzureTrafficCollectorsGetOptionalParams,
12
+ AzureTrafficCollectorsGetResponse,
13
+ AzureTrafficCollectorsCreateOrUpdateOptionalParams,
14
+ AzureTrafficCollectorsCreateOrUpdateResponse,
15
+ AzureTrafficCollectorsDeleteOptionalParams,
16
+ TagsObject,
17
+ AzureTrafficCollectorsUpdateTagsOptionalParams,
18
+ AzureTrafficCollectorsUpdateTagsResponse
19
+ } from "../models";
20
+
21
+ /** Interface representing a AzureTrafficCollectors. */
22
+ export interface AzureTrafficCollectors {
23
+ /**
24
+ * Gets the specified Azure Traffic Collector in a specified resource group
25
+ * @param resourceGroupName The name of the resource group.
26
+ * @param azureTrafficCollectorName Azure Traffic Collector name
27
+ * @param options The options parameters.
28
+ */
29
+ get(
30
+ resourceGroupName: string,
31
+ azureTrafficCollectorName: string,
32
+ options?: AzureTrafficCollectorsGetOptionalParams
33
+ ): Promise<AzureTrafficCollectorsGetResponse>;
34
+ /**
35
+ * Creates or updates a Azure Traffic Collector resource
36
+ * @param resourceGroupName The name of the resource group.
37
+ * @param azureTrafficCollectorName Azure Traffic Collector name
38
+ * @param options The options parameters.
39
+ */
40
+ beginCreateOrUpdate(
41
+ resourceGroupName: string,
42
+ azureTrafficCollectorName: string,
43
+ options?: AzureTrafficCollectorsCreateOrUpdateOptionalParams
44
+ ): Promise<
45
+ PollerLike<
46
+ PollOperationState<AzureTrafficCollectorsCreateOrUpdateResponse>,
47
+ AzureTrafficCollectorsCreateOrUpdateResponse
48
+ >
49
+ >;
50
+ /**
51
+ * Creates or updates a Azure Traffic Collector resource
52
+ * @param resourceGroupName The name of the resource group.
53
+ * @param azureTrafficCollectorName Azure Traffic Collector name
54
+ * @param options The options parameters.
55
+ */
56
+ beginCreateOrUpdateAndWait(
57
+ resourceGroupName: string,
58
+ azureTrafficCollectorName: string,
59
+ options?: AzureTrafficCollectorsCreateOrUpdateOptionalParams
60
+ ): Promise<AzureTrafficCollectorsCreateOrUpdateResponse>;
61
+ /**
62
+ * Deletes a specified Azure Traffic Collector resource.
63
+ * @param resourceGroupName The name of the resource group.
64
+ * @param azureTrafficCollectorName Azure Traffic Collector name
65
+ * @param options The options parameters.
66
+ */
67
+ beginDelete(
68
+ resourceGroupName: string,
69
+ azureTrafficCollectorName: string,
70
+ options?: AzureTrafficCollectorsDeleteOptionalParams
71
+ ): Promise<PollerLike<PollOperationState<void>, void>>;
72
+ /**
73
+ * Deletes a specified Azure Traffic Collector resource.
74
+ * @param resourceGroupName The name of the resource group.
75
+ * @param azureTrafficCollectorName Azure Traffic Collector name
76
+ * @param options The options parameters.
77
+ */
78
+ beginDeleteAndWait(
79
+ resourceGroupName: string,
80
+ azureTrafficCollectorName: string,
81
+ options?: AzureTrafficCollectorsDeleteOptionalParams
82
+ ): Promise<void>;
83
+ /**
84
+ * Updates the specified Azure Traffic Collector tags.
85
+ * @param resourceGroupName The name of the resource group.
86
+ * @param azureTrafficCollectorName Azure Traffic Collector name
87
+ * @param parameters Parameters supplied to update Azure Traffic Collector tags.
88
+ * @param options The options parameters.
89
+ */
90
+ updateTags(
91
+ resourceGroupName: string,
92
+ azureTrafficCollectorName: string,
93
+ parameters: TagsObject,
94
+ options?: AzureTrafficCollectorsUpdateTagsOptionalParams
95
+ ): Promise<AzureTrafficCollectorsUpdateTagsResponse>;
96
+ }