@azure/arm-servicenetworking 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +2566 -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/associationsInterfaceCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/associationsInterfaceCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/associationsInterfaceCreateOrUpdateSample.js +44 -0
  11. package/dist-esm/samples-dev/associationsInterfaceCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/associationsInterfaceDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/associationsInterfaceDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/associationsInterfaceDeleteSample.js +39 -0
  15. package/dist-esm/samples-dev/associationsInterfaceDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/associationsInterfaceGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/associationsInterfaceGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/associationsInterfaceGetSample.js +39 -0
  19. package/dist-esm/samples-dev/associationsInterfaceGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/associationsInterfaceListByTrafficControllerSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/associationsInterfaceListByTrafficControllerSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/associationsInterfaceListByTrafficControllerSample.js +52 -0
  23. package/dist-esm/samples-dev/associationsInterfaceListByTrafficControllerSample.js.map +1 -0
  24. package/dist-esm/samples-dev/associationsInterfaceUpdateSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/associationsInterfaceUpdateSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/associationsInterfaceUpdateSample.js +42 -0
  27. package/dist-esm/samples-dev/associationsInterfaceUpdateSample.js.map +1 -0
  28. package/dist-esm/samples-dev/frontendsInterfaceCreateOrUpdateSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/frontendsInterfaceCreateOrUpdateSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/frontendsInterfaceCreateOrUpdateSample.js +45 -0
  31. package/dist-esm/samples-dev/frontendsInterfaceCreateOrUpdateSample.js.map +1 -0
  32. package/dist-esm/samples-dev/frontendsInterfaceDeleteSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/frontendsInterfaceDeleteSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/frontendsInterfaceDeleteSample.js +39 -0
  35. package/dist-esm/samples-dev/frontendsInterfaceDeleteSample.js.map +1 -0
  36. package/dist-esm/samples-dev/frontendsInterfaceGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/frontendsInterfaceGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/frontendsInterfaceGetSample.js +39 -0
  39. package/dist-esm/samples-dev/frontendsInterfaceGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/frontendsInterfaceListByTrafficControllerSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/frontendsInterfaceListByTrafficControllerSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/frontendsInterfaceListByTrafficControllerSample.js +52 -0
  43. package/dist-esm/samples-dev/frontendsInterfaceListByTrafficControllerSample.js.map +1 -0
  44. package/dist-esm/samples-dev/frontendsInterfaceUpdateSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/frontendsInterfaceUpdateSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/frontendsInterfaceUpdateSample.js +46 -0
  47. package/dist-esm/samples-dev/frontendsInterfaceUpdateSample.js.map +1 -0
  48. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/operationsListSample.js +51 -0
  51. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  52. package/dist-esm/samples-dev/trafficControllerInterfaceCreateOrUpdateSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/trafficControllerInterfaceCreateOrUpdateSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/trafficControllerInterfaceCreateOrUpdateSample.js +42 -0
  55. package/dist-esm/samples-dev/trafficControllerInterfaceCreateOrUpdateSample.js.map +1 -0
  56. package/dist-esm/samples-dev/trafficControllerInterfaceDeleteSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/trafficControllerInterfaceDeleteSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/trafficControllerInterfaceDeleteSample.js +38 -0
  59. package/dist-esm/samples-dev/trafficControllerInterfaceDeleteSample.js.map +1 -0
  60. package/dist-esm/samples-dev/trafficControllerInterfaceGetSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/trafficControllerInterfaceGetSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/trafficControllerInterfaceGetSample.js +38 -0
  63. package/dist-esm/samples-dev/trafficControllerInterfaceGetSample.js.map +1 -0
  64. package/dist-esm/samples-dev/trafficControllerInterfaceListByResourceGroupSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/trafficControllerInterfaceListByResourceGroupSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/trafficControllerInterfaceListByResourceGroupSample.js +51 -0
  67. package/dist-esm/samples-dev/trafficControllerInterfaceListByResourceGroupSample.js.map +1 -0
  68. package/dist-esm/samples-dev/trafficControllerInterfaceListBySubscriptionSample.d.ts +2 -0
  69. package/dist-esm/samples-dev/trafficControllerInterfaceListBySubscriptionSample.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/trafficControllerInterfaceListBySubscriptionSample.js +50 -0
  71. package/dist-esm/samples-dev/trafficControllerInterfaceListBySubscriptionSample.js.map +1 -0
  72. package/dist-esm/samples-dev/trafficControllerInterfaceUpdateSample.d.ts +2 -0
  73. package/dist-esm/samples-dev/trafficControllerInterfaceUpdateSample.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/trafficControllerInterfaceUpdateSample.js +43 -0
  75. package/dist-esm/samples-dev/trafficControllerInterfaceUpdateSample.js.map +1 -0
  76. package/dist-esm/src/index.d.ts +6 -0
  77. package/dist-esm/src/index.d.ts.map +1 -0
  78. package/dist-esm/src/index.js +13 -0
  79. package/dist-esm/src/index.js.map +1 -0
  80. package/dist-esm/src/lroImpl.d.ts +16 -0
  81. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  82. package/dist-esm/src/lroImpl.js +29 -0
  83. package/dist-esm/src/lroImpl.js.map +1 -0
  84. package/dist-esm/src/models/index.d.ts +541 -0
  85. package/dist-esm/src/models/index.d.ts.map +1 -0
  86. package/dist-esm/src/models/index.js +54 -0
  87. package/dist-esm/src/models/index.js.map +1 -0
  88. package/dist-esm/src/models/mappers.d.ts +31 -0
  89. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  90. package/dist-esm/src/models/mappers.js +760 -0
  91. package/dist-esm/src/models/mappers.js.map +1 -0
  92. package/dist-esm/src/models/parameters.d.ts +18 -0
  93. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  94. package/dist-esm/src/models/parameters.js +154 -0
  95. package/dist-esm/src/models/parameters.js.map +1 -0
  96. package/dist-esm/src/operations/associationsInterface.d.ts +91 -0
  97. package/dist-esm/src/operations/associationsInterface.d.ts.map +1 -0
  98. package/dist-esm/src/operations/associationsInterface.js +396 -0
  99. package/dist-esm/src/operations/associationsInterface.js.map +1 -0
  100. package/dist-esm/src/operations/frontendsInterface.d.ts +91 -0
  101. package/dist-esm/src/operations/frontendsInterface.d.ts.map +1 -0
  102. package/dist-esm/src/operations/frontendsInterface.js +396 -0
  103. package/dist-esm/src/operations/frontendsInterface.js.map +1 -0
  104. package/dist-esm/src/operations/index.d.ts +5 -0
  105. package/dist-esm/src/operations/index.d.ts.map +1 -0
  106. package/dist-esm/src/operations/index.js +12 -0
  107. package/dist-esm/src/operations/index.js.map +1 -0
  108. package/dist-esm/src/operations/operations.d.ts +32 -0
  109. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  110. package/dist-esm/src/operations/operations.js +131 -0
  111. package/dist-esm/src/operations/operations.js.map +1 -0
  112. package/dist-esm/src/operations/trafficControllerInterface.d.ts +99 -0
  113. package/dist-esm/src/operations/trafficControllerInterface.d.ts.map +1 -0
  114. package/dist-esm/src/operations/trafficControllerInterface.js +477 -0
  115. package/dist-esm/src/operations/trafficControllerInterface.js.map +1 -0
  116. package/dist-esm/src/operationsInterfaces/associationsInterface.d.ts +65 -0
  117. package/dist-esm/src/operationsInterfaces/associationsInterface.d.ts.map +1 -0
  118. package/dist-esm/src/operationsInterfaces/associationsInterface.js +9 -0
  119. package/dist-esm/src/operationsInterfaces/associationsInterface.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/frontendsInterface.d.ts +65 -0
  121. package/dist-esm/src/operationsInterfaces/frontendsInterface.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/frontendsInterface.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/frontendsInterface.js.map +1 -0
  124. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
  125. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  126. package/dist-esm/src/operationsInterfaces/index.js +12 -0
  127. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  128. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  129. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  130. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  131. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  132. package/dist-esm/src/operationsInterfaces/trafficControllerInterface.d.ts +63 -0
  133. package/dist-esm/src/operationsInterfaces/trafficControllerInterface.d.ts.map +1 -0
  134. package/dist-esm/src/operationsInterfaces/trafficControllerInterface.js +9 -0
  135. package/dist-esm/src/operationsInterfaces/trafficControllerInterface.js.map +1 -0
  136. package/dist-esm/src/pagingHelper.d.ts +13 -0
  137. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  138. package/dist-esm/src/pagingHelper.js +32 -0
  139. package/dist-esm/src/pagingHelper.js.map +1 -0
  140. package/dist-esm/src/serviceNetworkingManagementClient.d.ts +23 -0
  141. package/dist-esm/src/serviceNetworkingManagementClient.d.ts.map +1 -0
  142. package/dist-esm/src/serviceNetworkingManagementClient.js +103 -0
  143. package/dist-esm/src/serviceNetworkingManagementClient.js.map +1 -0
  144. package/dist-esm/test/servicenetworking_operations_test.spec.d.ts +4 -0
  145. package/dist-esm/test/servicenetworking_operations_test.spec.d.ts.map +1 -0
  146. package/dist-esm/test/servicenetworking_operations_test.spec.js +107 -0
  147. package/dist-esm/test/servicenetworking_operations_test.spec.js.map +1 -0
  148. package/package.json +123 -0
  149. package/review/arm-servicenetworking.api.md +484 -0
  150. package/rollup.config.js +122 -0
  151. package/src/index.ts +13 -0
  152. package/src/lroImpl.ts +34 -0
  153. package/src/models/index.ts +626 -0
  154. package/src/models/mappers.ts +811 -0
  155. package/src/models/parameters.ts +182 -0
  156. package/src/operations/associationsInterface.ts +557 -0
  157. package/src/operations/frontendsInterface.ts +557 -0
  158. package/src/operations/index.ts +12 -0
  159. package/src/operations/operations.ts +149 -0
  160. package/src/operations/trafficControllerInterface.ts +628 -0
  161. package/src/operationsInterfaces/associationsInterface.ts +127 -0
  162. package/src/operationsInterfaces/frontendsInterface.ts +127 -0
  163. package/src/operationsInterfaces/index.ts +12 -0
  164. package/src/operationsInterfaces/operations.ts +22 -0
  165. package/src/operationsInterfaces/trafficControllerInterface.ts +121 -0
  166. package/src/pagingHelper.ts +39 -0
  167. package/src/serviceNetworkingManagementClient.ts +156 -0
  168. package/tsconfig.json +33 -0
  169. package/types/arm-servicenetworking.d.ts +847 -0
  170. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,557 @@
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, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { AssociationsInterface } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { ServiceNetworkingManagementClient } from "../serviceNetworkingManagementClient";
16
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
+ import { LroImpl } from "../lroImpl";
18
+ import {
19
+ Association,
20
+ AssociationsInterfaceListByTrafficControllerNextOptionalParams,
21
+ AssociationsInterfaceListByTrafficControllerOptionalParams,
22
+ AssociationsInterfaceListByTrafficControllerResponse,
23
+ AssociationsInterfaceGetOptionalParams,
24
+ AssociationsInterfaceGetResponse,
25
+ AssociationsInterfaceCreateOrUpdateOptionalParams,
26
+ AssociationsInterfaceCreateOrUpdateResponse,
27
+ AssociationUpdate,
28
+ AssociationsInterfaceUpdateOptionalParams,
29
+ AssociationsInterfaceUpdateResponse,
30
+ AssociationsInterfaceDeleteOptionalParams,
31
+ AssociationsInterfaceListByTrafficControllerNextResponse
32
+ } from "../models";
33
+
34
+ /// <reference lib="esnext.asynciterable" />
35
+ /** Class containing AssociationsInterface operations. */
36
+ export class AssociationsInterfaceImpl implements AssociationsInterface {
37
+ private readonly client: ServiceNetworkingManagementClient;
38
+
39
+ /**
40
+ * Initialize a new instance of the class AssociationsInterface class.
41
+ * @param client Reference to the service client
42
+ */
43
+ constructor(client: ServiceNetworkingManagementClient) {
44
+ this.client = client;
45
+ }
46
+
47
+ /**
48
+ * List Association resources by TrafficController
49
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
50
+ * @param trafficControllerName traffic controller name for path
51
+ * @param options The options parameters.
52
+ */
53
+ public listByTrafficController(
54
+ resourceGroupName: string,
55
+ trafficControllerName: string,
56
+ options?: AssociationsInterfaceListByTrafficControllerOptionalParams
57
+ ): PagedAsyncIterableIterator<Association> {
58
+ const iter = this.listByTrafficControllerPagingAll(
59
+ resourceGroupName,
60
+ trafficControllerName,
61
+ options
62
+ );
63
+ return {
64
+ next() {
65
+ return iter.next();
66
+ },
67
+ [Symbol.asyncIterator]() {
68
+ return this;
69
+ },
70
+ byPage: (settings?: PageSettings) => {
71
+ if (settings?.maxPageSize) {
72
+ throw new Error("maxPageSize is not supported by this operation.");
73
+ }
74
+ return this.listByTrafficControllerPagingPage(
75
+ resourceGroupName,
76
+ trafficControllerName,
77
+ options,
78
+ settings
79
+ );
80
+ }
81
+ };
82
+ }
83
+
84
+ private async *listByTrafficControllerPagingPage(
85
+ resourceGroupName: string,
86
+ trafficControllerName: string,
87
+ options?: AssociationsInterfaceListByTrafficControllerOptionalParams,
88
+ settings?: PageSettings
89
+ ): AsyncIterableIterator<Association[]> {
90
+ let result: AssociationsInterfaceListByTrafficControllerResponse;
91
+ let continuationToken = settings?.continuationToken;
92
+ if (!continuationToken) {
93
+ result = await this._listByTrafficController(
94
+ resourceGroupName,
95
+ trafficControllerName,
96
+ options
97
+ );
98
+ let page = result.value || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
103
+ while (continuationToken) {
104
+ result = await this._listByTrafficControllerNext(
105
+ resourceGroupName,
106
+ trafficControllerName,
107
+ continuationToken,
108
+ options
109
+ );
110
+ continuationToken = result.nextLink;
111
+ let page = result.value || [];
112
+ setContinuationToken(page, continuationToken);
113
+ yield page;
114
+ }
115
+ }
116
+
117
+ private async *listByTrafficControllerPagingAll(
118
+ resourceGroupName: string,
119
+ trafficControllerName: string,
120
+ options?: AssociationsInterfaceListByTrafficControllerOptionalParams
121
+ ): AsyncIterableIterator<Association> {
122
+ for await (const page of this.listByTrafficControllerPagingPage(
123
+ resourceGroupName,
124
+ trafficControllerName,
125
+ options
126
+ )) {
127
+ yield* page;
128
+ }
129
+ }
130
+
131
+ /**
132
+ * List Association resources by TrafficController
133
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
134
+ * @param trafficControllerName traffic controller name for path
135
+ * @param options The options parameters.
136
+ */
137
+ private _listByTrafficController(
138
+ resourceGroupName: string,
139
+ trafficControllerName: string,
140
+ options?: AssociationsInterfaceListByTrafficControllerOptionalParams
141
+ ): Promise<AssociationsInterfaceListByTrafficControllerResponse> {
142
+ return this.client.sendOperationRequest(
143
+ { resourceGroupName, trafficControllerName, options },
144
+ listByTrafficControllerOperationSpec
145
+ );
146
+ }
147
+
148
+ /**
149
+ * Get a Traffic Controller Association
150
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
151
+ * @param trafficControllerName traffic controller name for path
152
+ * @param associationName Name of Association
153
+ * @param options The options parameters.
154
+ */
155
+ get(
156
+ resourceGroupName: string,
157
+ trafficControllerName: string,
158
+ associationName: string,
159
+ options?: AssociationsInterfaceGetOptionalParams
160
+ ): Promise<AssociationsInterfaceGetResponse> {
161
+ return this.client.sendOperationRequest(
162
+ { resourceGroupName, trafficControllerName, associationName, options },
163
+ getOperationSpec
164
+ );
165
+ }
166
+
167
+ /**
168
+ * Create a Traffic Controller Association
169
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
170
+ * @param trafficControllerName traffic controller name for path
171
+ * @param associationName Name of Association
172
+ * @param resource Resource create parameters.
173
+ * @param options The options parameters.
174
+ */
175
+ async beginCreateOrUpdate(
176
+ resourceGroupName: string,
177
+ trafficControllerName: string,
178
+ associationName: string,
179
+ resource: Association,
180
+ options?: AssociationsInterfaceCreateOrUpdateOptionalParams
181
+ ): Promise<
182
+ PollerLike<
183
+ PollOperationState<AssociationsInterfaceCreateOrUpdateResponse>,
184
+ AssociationsInterfaceCreateOrUpdateResponse
185
+ >
186
+ > {
187
+ const directSendOperation = async (
188
+ args: coreClient.OperationArguments,
189
+ spec: coreClient.OperationSpec
190
+ ): Promise<AssociationsInterfaceCreateOrUpdateResponse> => {
191
+ return this.client.sendOperationRequest(args, spec);
192
+ };
193
+ const sendOperation = async (
194
+ args: coreClient.OperationArguments,
195
+ spec: coreClient.OperationSpec
196
+ ) => {
197
+ let currentRawResponse:
198
+ | coreClient.FullOperationResponse
199
+ | undefined = undefined;
200
+ const providedCallback = args.options?.onResponse;
201
+ const callback: coreClient.RawResponseCallback = (
202
+ rawResponse: coreClient.FullOperationResponse,
203
+ flatResponse: unknown
204
+ ) => {
205
+ currentRawResponse = rawResponse;
206
+ providedCallback?.(rawResponse, flatResponse);
207
+ };
208
+ const updatedArgs = {
209
+ ...args,
210
+ options: {
211
+ ...args.options,
212
+ onResponse: callback
213
+ }
214
+ };
215
+ const flatResponse = await directSendOperation(updatedArgs, spec);
216
+ return {
217
+ flatResponse,
218
+ rawResponse: {
219
+ statusCode: currentRawResponse!.status,
220
+ body: currentRawResponse!.parsedBody,
221
+ headers: currentRawResponse!.headers.toJSON()
222
+ }
223
+ };
224
+ };
225
+
226
+ const lro = new LroImpl(
227
+ sendOperation,
228
+ {
229
+ resourceGroupName,
230
+ trafficControllerName,
231
+ associationName,
232
+ resource,
233
+ options
234
+ },
235
+ createOrUpdateOperationSpec
236
+ );
237
+ const poller = new LroEngine(lro, {
238
+ resumeFrom: options?.resumeFrom,
239
+ intervalInMs: options?.updateIntervalInMs,
240
+ lroResourceLocationConfig: "azure-async-operation"
241
+ });
242
+ await poller.poll();
243
+ return poller;
244
+ }
245
+
246
+ /**
247
+ * Create a Traffic Controller Association
248
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
249
+ * @param trafficControllerName traffic controller name for path
250
+ * @param associationName Name of Association
251
+ * @param resource Resource create parameters.
252
+ * @param options The options parameters.
253
+ */
254
+ async beginCreateOrUpdateAndWait(
255
+ resourceGroupName: string,
256
+ trafficControllerName: string,
257
+ associationName: string,
258
+ resource: Association,
259
+ options?: AssociationsInterfaceCreateOrUpdateOptionalParams
260
+ ): Promise<AssociationsInterfaceCreateOrUpdateResponse> {
261
+ const poller = await this.beginCreateOrUpdate(
262
+ resourceGroupName,
263
+ trafficControllerName,
264
+ associationName,
265
+ resource,
266
+ options
267
+ );
268
+ return poller.pollUntilDone();
269
+ }
270
+
271
+ /**
272
+ * Update a Traffic Controller Association
273
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
274
+ * @param trafficControllerName traffic controller name for path
275
+ * @param associationName Name of Association
276
+ * @param properties The resource properties to be updated.
277
+ * @param options The options parameters.
278
+ */
279
+ update(
280
+ resourceGroupName: string,
281
+ trafficControllerName: string,
282
+ associationName: string,
283
+ properties: AssociationUpdate,
284
+ options?: AssociationsInterfaceUpdateOptionalParams
285
+ ): Promise<AssociationsInterfaceUpdateResponse> {
286
+ return this.client.sendOperationRequest(
287
+ {
288
+ resourceGroupName,
289
+ trafficControllerName,
290
+ associationName,
291
+ properties,
292
+ options
293
+ },
294
+ updateOperationSpec
295
+ );
296
+ }
297
+
298
+ /**
299
+ * Delete a Traffic Controller Association
300
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
301
+ * @param trafficControllerName traffic controller name for path
302
+ * @param associationName Name of Association
303
+ * @param options The options parameters.
304
+ */
305
+ async beginDelete(
306
+ resourceGroupName: string,
307
+ trafficControllerName: string,
308
+ associationName: string,
309
+ options?: AssociationsInterfaceDeleteOptionalParams
310
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
311
+ const directSendOperation = async (
312
+ args: coreClient.OperationArguments,
313
+ spec: coreClient.OperationSpec
314
+ ): Promise<void> => {
315
+ return this.client.sendOperationRequest(args, spec);
316
+ };
317
+ const sendOperation = async (
318
+ args: coreClient.OperationArguments,
319
+ spec: coreClient.OperationSpec
320
+ ) => {
321
+ let currentRawResponse:
322
+ | coreClient.FullOperationResponse
323
+ | undefined = undefined;
324
+ const providedCallback = args.options?.onResponse;
325
+ const callback: coreClient.RawResponseCallback = (
326
+ rawResponse: coreClient.FullOperationResponse,
327
+ flatResponse: unknown
328
+ ) => {
329
+ currentRawResponse = rawResponse;
330
+ providedCallback?.(rawResponse, flatResponse);
331
+ };
332
+ const updatedArgs = {
333
+ ...args,
334
+ options: {
335
+ ...args.options,
336
+ onResponse: callback
337
+ }
338
+ };
339
+ const flatResponse = await directSendOperation(updatedArgs, spec);
340
+ return {
341
+ flatResponse,
342
+ rawResponse: {
343
+ statusCode: currentRawResponse!.status,
344
+ body: currentRawResponse!.parsedBody,
345
+ headers: currentRawResponse!.headers.toJSON()
346
+ }
347
+ };
348
+ };
349
+
350
+ const lro = new LroImpl(
351
+ sendOperation,
352
+ { resourceGroupName, trafficControllerName, associationName, options },
353
+ deleteOperationSpec
354
+ );
355
+ const poller = new LroEngine(lro, {
356
+ resumeFrom: options?.resumeFrom,
357
+ intervalInMs: options?.updateIntervalInMs,
358
+ lroResourceLocationConfig: "location"
359
+ });
360
+ await poller.poll();
361
+ return poller;
362
+ }
363
+
364
+ /**
365
+ * Delete a Traffic Controller Association
366
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
367
+ * @param trafficControllerName traffic controller name for path
368
+ * @param associationName Name of Association
369
+ * @param options The options parameters.
370
+ */
371
+ async beginDeleteAndWait(
372
+ resourceGroupName: string,
373
+ trafficControllerName: string,
374
+ associationName: string,
375
+ options?: AssociationsInterfaceDeleteOptionalParams
376
+ ): Promise<void> {
377
+ const poller = await this.beginDelete(
378
+ resourceGroupName,
379
+ trafficControllerName,
380
+ associationName,
381
+ options
382
+ );
383
+ return poller.pollUntilDone();
384
+ }
385
+
386
+ /**
387
+ * ListByTrafficControllerNext
388
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
389
+ * @param trafficControllerName traffic controller name for path
390
+ * @param nextLink The nextLink from the previous successful call to the ListByTrafficController
391
+ * method.
392
+ * @param options The options parameters.
393
+ */
394
+ private _listByTrafficControllerNext(
395
+ resourceGroupName: string,
396
+ trafficControllerName: string,
397
+ nextLink: string,
398
+ options?: AssociationsInterfaceListByTrafficControllerNextOptionalParams
399
+ ): Promise<AssociationsInterfaceListByTrafficControllerNextResponse> {
400
+ return this.client.sendOperationRequest(
401
+ { resourceGroupName, trafficControllerName, nextLink, options },
402
+ listByTrafficControllerNextOperationSpec
403
+ );
404
+ }
405
+ }
406
+ // Operation Specifications
407
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
408
+
409
+ const listByTrafficControllerOperationSpec: coreClient.OperationSpec = {
410
+ path:
411
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations",
412
+ httpMethod: "GET",
413
+ responses: {
414
+ 200: {
415
+ bodyMapper: Mappers.AssociationListResult
416
+ },
417
+ default: {
418
+ bodyMapper: Mappers.ErrorResponse
419
+ }
420
+ },
421
+ queryParameters: [Parameters.apiVersion],
422
+ urlParameters: [
423
+ Parameters.$host,
424
+ Parameters.subscriptionId,
425
+ Parameters.resourceGroupName,
426
+ Parameters.trafficControllerName
427
+ ],
428
+ headerParameters: [Parameters.accept],
429
+ serializer
430
+ };
431
+ const getOperationSpec: coreClient.OperationSpec = {
432
+ path:
433
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}",
434
+ httpMethod: "GET",
435
+ responses: {
436
+ 200: {
437
+ bodyMapper: Mappers.Association
438
+ },
439
+ default: {
440
+ bodyMapper: Mappers.ErrorResponse
441
+ }
442
+ },
443
+ queryParameters: [Parameters.apiVersion],
444
+ urlParameters: [
445
+ Parameters.$host,
446
+ Parameters.subscriptionId,
447
+ Parameters.resourceGroupName,
448
+ Parameters.trafficControllerName,
449
+ Parameters.associationName
450
+ ],
451
+ headerParameters: [Parameters.accept],
452
+ serializer
453
+ };
454
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
455
+ path:
456
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}",
457
+ httpMethod: "PUT",
458
+ responses: {
459
+ 200: {
460
+ bodyMapper: Mappers.Association
461
+ },
462
+ 201: {
463
+ bodyMapper: Mappers.Association
464
+ },
465
+ 202: {
466
+ bodyMapper: Mappers.Association
467
+ },
468
+ 204: {
469
+ bodyMapper: Mappers.Association
470
+ },
471
+ default: {
472
+ bodyMapper: Mappers.ErrorResponse
473
+ }
474
+ },
475
+ requestBody: Parameters.resource1,
476
+ queryParameters: [Parameters.apiVersion],
477
+ urlParameters: [
478
+ Parameters.$host,
479
+ Parameters.subscriptionId,
480
+ Parameters.resourceGroupName,
481
+ Parameters.trafficControllerName,
482
+ Parameters.associationName
483
+ ],
484
+ headerParameters: [Parameters.accept, Parameters.contentType],
485
+ mediaType: "json",
486
+ serializer
487
+ };
488
+ const updateOperationSpec: coreClient.OperationSpec = {
489
+ path:
490
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}",
491
+ httpMethod: "PATCH",
492
+ responses: {
493
+ 200: {
494
+ bodyMapper: Mappers.Association
495
+ },
496
+ default: {
497
+ bodyMapper: Mappers.ErrorResponse
498
+ }
499
+ },
500
+ requestBody: Parameters.properties1,
501
+ queryParameters: [Parameters.apiVersion],
502
+ urlParameters: [
503
+ Parameters.$host,
504
+ Parameters.subscriptionId,
505
+ Parameters.resourceGroupName,
506
+ Parameters.trafficControllerName,
507
+ Parameters.associationName
508
+ ],
509
+ headerParameters: [Parameters.accept, Parameters.contentType],
510
+ mediaType: "json",
511
+ serializer
512
+ };
513
+ const deleteOperationSpec: coreClient.OperationSpec = {
514
+ path:
515
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}",
516
+ httpMethod: "DELETE",
517
+ responses: {
518
+ 200: {},
519
+ 201: {},
520
+ 202: {},
521
+ 204: {},
522
+ default: {
523
+ bodyMapper: Mappers.ErrorResponse
524
+ }
525
+ },
526
+ queryParameters: [Parameters.apiVersion],
527
+ urlParameters: [
528
+ Parameters.$host,
529
+ Parameters.subscriptionId,
530
+ Parameters.resourceGroupName,
531
+ Parameters.trafficControllerName,
532
+ Parameters.associationName
533
+ ],
534
+ headerParameters: [Parameters.accept],
535
+ serializer
536
+ };
537
+ const listByTrafficControllerNextOperationSpec: coreClient.OperationSpec = {
538
+ path: "{nextLink}",
539
+ httpMethod: "GET",
540
+ responses: {
541
+ 200: {
542
+ bodyMapper: Mappers.AssociationListResult
543
+ },
544
+ default: {
545
+ bodyMapper: Mappers.ErrorResponse
546
+ }
547
+ },
548
+ urlParameters: [
549
+ Parameters.$host,
550
+ Parameters.nextLink,
551
+ Parameters.subscriptionId,
552
+ Parameters.resourceGroupName,
553
+ Parameters.trafficControllerName
554
+ ],
555
+ headerParameters: [Parameters.accept],
556
+ serializer
557
+ };