@azure/arm-privatedns 1.0.0 → 3.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 (146) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +21 -21
  4. package/README.md +98 -100
  5. package/dist/index.js +2295 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.min.js +1 -0
  8. package/dist/index.min.js.map +1 -0
  9. package/dist-esm/src/index.d.ts +5 -0
  10. package/dist-esm/src/index.d.ts.map +1 -0
  11. package/dist-esm/src/index.js +12 -0
  12. package/dist-esm/src/index.js.map +1 -0
  13. package/dist-esm/src/lroImpl.d.ts +16 -0
  14. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  15. package/dist-esm/src/lroImpl.js +29 -0
  16. package/dist-esm/src/lroImpl.js.map +1 -0
  17. package/dist-esm/src/models/index.d.ts +470 -0
  18. package/dist-esm/src/models/index.d.ts.map +1 -0
  19. package/dist-esm/src/models/index.js +24 -0
  20. package/dist-esm/src/models/index.js.map +1 -0
  21. package/dist-esm/src/models/mappers.d.ts +22 -0
  22. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  23. package/{esm → dist-esm/src}/models/mappers.js +234 -205
  24. package/dist-esm/src/models/mappers.js.map +1 -0
  25. package/dist-esm/src/models/parameters.d.ts +20 -0
  26. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  27. package/{esm → dist-esm/src}/models/parameters.js +91 -77
  28. package/dist-esm/src/models/parameters.js.map +1 -0
  29. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  30. package/dist-esm/src/operations/index.d.ts.map +1 -0
  31. package/{esm → dist-esm/src}/operations/index.js +3 -5
  32. package/dist-esm/src/operations/index.js.map +1 -0
  33. package/dist-esm/src/operations/privateZones.d.ts +114 -0
  34. package/dist-esm/src/operations/privateZones.d.ts.map +1 -0
  35. package/dist-esm/src/operations/privateZones.js +516 -0
  36. package/dist-esm/src/operations/privateZones.js.map +1 -0
  37. package/dist-esm/src/operations/recordSets.d.ts +105 -0
  38. package/dist-esm/src/operations/recordSets.d.ts.map +1 -0
  39. package/dist-esm/src/operations/recordSets.js +451 -0
  40. package/dist-esm/src/operations/recordSets.js.map +1 -0
  41. package/dist-esm/src/operations/virtualNetworkLinks.d.ts +103 -0
  42. package/dist-esm/src/operations/virtualNetworkLinks.d.ts.map +1 -0
  43. package/dist-esm/src/operations/virtualNetworkLinks.js +442 -0
  44. package/dist-esm/src/operations/virtualNetworkLinks.js.map +1 -0
  45. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  46. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  47. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  48. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  49. package/dist-esm/src/operationsInterfaces/privateZones.d.ts +78 -0
  50. package/dist-esm/src/operationsInterfaces/privateZones.d.ts.map +1 -0
  51. package/dist-esm/src/operationsInterfaces/privateZones.js +9 -0
  52. package/dist-esm/src/operationsInterfaces/privateZones.js.map +1 -0
  53. package/dist-esm/src/operationsInterfaces/recordSets.d.ts +61 -0
  54. package/dist-esm/src/operationsInterfaces/recordSets.d.ts.map +1 -0
  55. package/dist-esm/src/operationsInterfaces/recordSets.js +9 -0
  56. package/dist-esm/src/operationsInterfaces/recordSets.js.map +1 -0
  57. package/dist-esm/src/operationsInterfaces/virtualNetworkLinks.d.ts +78 -0
  58. package/dist-esm/src/operationsInterfaces/virtualNetworkLinks.d.ts.map +1 -0
  59. package/dist-esm/src/operationsInterfaces/virtualNetworkLinks.js +9 -0
  60. package/dist-esm/src/operationsInterfaces/virtualNetworkLinks.js.map +1 -0
  61. package/dist-esm/src/privateDnsManagementClient.d.ts +21 -0
  62. package/dist-esm/src/privateDnsManagementClient.d.ts.map +1 -0
  63. package/dist-esm/src/privateDnsManagementClient.js +54 -0
  64. package/dist-esm/src/privateDnsManagementClient.js.map +1 -0
  65. package/dist-esm/test/sampleTest.d.ts +2 -0
  66. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  67. package/dist-esm/test/sampleTest.js +40 -0
  68. package/dist-esm/test/sampleTest.js.map +1 -0
  69. package/package.json +86 -26
  70. package/review/arm-privatedns.api.md +435 -0
  71. package/rollup.config.js +181 -30
  72. package/src/index.ts +12 -0
  73. package/src/lroImpl.ts +34 -0
  74. package/src/models/index.ts +567 -0
  75. package/{lib → src}/models/mappers.ts +248 -214
  76. package/src/models/parameters.ts +201 -0
  77. package/{lib → src}/operations/index.ts +3 -5
  78. package/src/operations/privateZones.ts +686 -0
  79. package/src/operations/recordSets.ts +602 -0
  80. package/src/operations/virtualNetworkLinks.ts +624 -0
  81. package/src/operationsInterfaces/index.ts +11 -0
  82. package/src/operationsInterfaces/privateZones.ts +145 -0
  83. package/src/operationsInterfaces/recordSets.ts +117 -0
  84. package/src/operationsInterfaces/virtualNetworkLinks.ts +150 -0
  85. package/src/privateDnsManagementClient.ts +88 -0
  86. package/tsconfig.json +20 -7
  87. package/types/arm-privatedns.d.ts +768 -0
  88. package/types/tsdoc-metadata.json +11 -0
  89. package/dist/arm-privatedns.js +0 -1944
  90. package/dist/arm-privatedns.js.map +0 -1
  91. package/dist/arm-privatedns.min.js +0 -1
  92. package/dist/arm-privatedns.min.js.map +0 -1
  93. package/esm/models/index.d.ts +0 -1031
  94. package/esm/models/index.d.ts.map +0 -1
  95. package/esm/models/index.js +0 -8
  96. package/esm/models/index.js.map +0 -1
  97. package/esm/models/mappers.d.ts +0 -22
  98. package/esm/models/mappers.d.ts.map +0 -1
  99. package/esm/models/mappers.js.map +0 -1
  100. package/esm/models/parameters.d.ts +0 -15
  101. package/esm/models/parameters.d.ts.map +0 -1
  102. package/esm/models/parameters.js.map +0 -1
  103. package/esm/models/privateZonesMappers.d.ts +0 -2
  104. package/esm/models/privateZonesMappers.d.ts.map +0 -1
  105. package/esm/models/privateZonesMappers.js +0 -9
  106. package/esm/models/privateZonesMappers.js.map +0 -1
  107. package/esm/models/recordSetsMappers.d.ts +0 -2
  108. package/esm/models/recordSetsMappers.d.ts.map +0 -1
  109. package/esm/models/recordSetsMappers.js +0 -9
  110. package/esm/models/recordSetsMappers.js.map +0 -1
  111. package/esm/models/virtualNetworkLinksMappers.d.ts +0 -2
  112. package/esm/models/virtualNetworkLinksMappers.d.ts.map +0 -1
  113. package/esm/models/virtualNetworkLinksMappers.js +0 -9
  114. package/esm/models/virtualNetworkLinksMappers.js.map +0 -1
  115. package/esm/operations/index.d.ts.map +0 -1
  116. package/esm/operations/index.js.map +0 -1
  117. package/esm/operations/privateZones.d.ts +0 -165
  118. package/esm/operations/privateZones.d.ts.map +0 -1
  119. package/esm/operations/privateZones.js +0 -347
  120. package/esm/operations/privateZones.js.map +0 -1
  121. package/esm/operations/recordSets.d.ts +0 -229
  122. package/esm/operations/recordSets.d.ts.map +0 -1
  123. package/esm/operations/recordSets.js +0 -304
  124. package/esm/operations/recordSets.js.map +0 -1
  125. package/esm/operations/virtualNetworkLinks.d.ts +0 -139
  126. package/esm/operations/virtualNetworkLinks.d.ts.map +0 -1
  127. package/esm/operations/virtualNetworkLinks.js +0 -305
  128. package/esm/operations/virtualNetworkLinks.js.map +0 -1
  129. package/esm/privateDnsManagementClient.d.ts +0 -21
  130. package/esm/privateDnsManagementClient.d.ts.map +0 -1
  131. package/esm/privateDnsManagementClient.js +0 -36
  132. package/esm/privateDnsManagementClient.js.map +0 -1
  133. package/esm/privateDnsManagementClientContext.d.ts +0 -17
  134. package/esm/privateDnsManagementClientContext.d.ts.map +0 -1
  135. package/esm/privateDnsManagementClientContext.js +0 -57
  136. package/esm/privateDnsManagementClientContext.js.map +0 -1
  137. package/lib/models/index.ts +0 -1123
  138. package/lib/models/parameters.ts +0 -162
  139. package/lib/models/privateZonesMappers.ts +0 -28
  140. package/lib/models/recordSetsMappers.ts +0 -28
  141. package/lib/models/virtualNetworkLinksMappers.ts +0 -28
  142. package/lib/operations/privateZones.ts +0 -490
  143. package/lib/operations/recordSets.ts +0 -568
  144. package/lib/operations/virtualNetworkLinks.ts +0 -410
  145. package/lib/privateDnsManagementClient.ts +0 -47
  146. package/lib/privateDnsManagementClientContext.ts +0 -63
@@ -0,0 +1,686 @@
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 { PrivateZones } 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 { PrivateDnsManagementClient } from "../privateDnsManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ PrivateZone,
19
+ PrivateZonesListNextOptionalParams,
20
+ PrivateZonesListOptionalParams,
21
+ PrivateZonesListByResourceGroupNextOptionalParams,
22
+ PrivateZonesListByResourceGroupOptionalParams,
23
+ PrivateZonesCreateOrUpdateOptionalParams,
24
+ PrivateZonesCreateOrUpdateResponse,
25
+ PrivateZonesUpdateOptionalParams,
26
+ PrivateZonesUpdateResponse,
27
+ PrivateZonesDeleteOptionalParams,
28
+ PrivateZonesGetOptionalParams,
29
+ PrivateZonesGetResponse,
30
+ PrivateZonesListResponse,
31
+ PrivateZonesListByResourceGroupResponse,
32
+ PrivateZonesListNextResponse,
33
+ PrivateZonesListByResourceGroupNextResponse
34
+ } from "../models";
35
+
36
+ /// <reference lib="esnext.asynciterable" />
37
+ /** Class containing PrivateZones operations. */
38
+ export class PrivateZonesImpl implements PrivateZones {
39
+ private readonly client: PrivateDnsManagementClient;
40
+
41
+ /**
42
+ * Initialize a new instance of the class PrivateZones class.
43
+ * @param client Reference to the service client
44
+ */
45
+ constructor(client: PrivateDnsManagementClient) {
46
+ this.client = client;
47
+ }
48
+
49
+ /**
50
+ * Lists the Private DNS zones in all resource groups in a subscription.
51
+ * @param options The options parameters.
52
+ */
53
+ public list(
54
+ options?: PrivateZonesListOptionalParams
55
+ ): PagedAsyncIterableIterator<PrivateZone> {
56
+ const iter = this.listPagingAll(options);
57
+ return {
58
+ next() {
59
+ return iter.next();
60
+ },
61
+ [Symbol.asyncIterator]() {
62
+ return this;
63
+ },
64
+ byPage: () => {
65
+ return this.listPagingPage(options);
66
+ }
67
+ };
68
+ }
69
+
70
+ private async *listPagingPage(
71
+ options?: PrivateZonesListOptionalParams
72
+ ): AsyncIterableIterator<PrivateZone[]> {
73
+ let result = await this._list(options);
74
+ yield result.value || [];
75
+ let continuationToken = result.nextLink;
76
+ while (continuationToken) {
77
+ result = await this._listNext(continuationToken, options);
78
+ continuationToken = result.nextLink;
79
+ yield result.value || [];
80
+ }
81
+ }
82
+
83
+ private async *listPagingAll(
84
+ options?: PrivateZonesListOptionalParams
85
+ ): AsyncIterableIterator<PrivateZone> {
86
+ for await (const page of this.listPagingPage(options)) {
87
+ yield* page;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Lists the Private DNS zones within a resource group.
93
+ * @param resourceGroupName The name of the resource group.
94
+ * @param options The options parameters.
95
+ */
96
+ public listByResourceGroup(
97
+ resourceGroupName: string,
98
+ options?: PrivateZonesListByResourceGroupOptionalParams
99
+ ): PagedAsyncIterableIterator<PrivateZone> {
100
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
101
+ return {
102
+ next() {
103
+ return iter.next();
104
+ },
105
+ [Symbol.asyncIterator]() {
106
+ return this;
107
+ },
108
+ byPage: () => {
109
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
110
+ }
111
+ };
112
+ }
113
+
114
+ private async *listByResourceGroupPagingPage(
115
+ resourceGroupName: string,
116
+ options?: PrivateZonesListByResourceGroupOptionalParams
117
+ ): AsyncIterableIterator<PrivateZone[]> {
118
+ let result = await this._listByResourceGroup(resourceGroupName, options);
119
+ yield result.value || [];
120
+ let continuationToken = result.nextLink;
121
+ while (continuationToken) {
122
+ result = await this._listByResourceGroupNext(
123
+ resourceGroupName,
124
+ continuationToken,
125
+ options
126
+ );
127
+ continuationToken = result.nextLink;
128
+ yield result.value || [];
129
+ }
130
+ }
131
+
132
+ private async *listByResourceGroupPagingAll(
133
+ resourceGroupName: string,
134
+ options?: PrivateZonesListByResourceGroupOptionalParams
135
+ ): AsyncIterableIterator<PrivateZone> {
136
+ for await (const page of this.listByResourceGroupPagingPage(
137
+ resourceGroupName,
138
+ options
139
+ )) {
140
+ yield* page;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records
146
+ * within the zone.
147
+ * @param resourceGroupName The name of the resource group.
148
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
149
+ * @param parameters Parameters supplied to the CreateOrUpdate operation.
150
+ * @param options The options parameters.
151
+ */
152
+ async beginCreateOrUpdate(
153
+ resourceGroupName: string,
154
+ privateZoneName: string,
155
+ parameters: PrivateZone,
156
+ options?: PrivateZonesCreateOrUpdateOptionalParams
157
+ ): Promise<
158
+ PollerLike<
159
+ PollOperationState<PrivateZonesCreateOrUpdateResponse>,
160
+ PrivateZonesCreateOrUpdateResponse
161
+ >
162
+ > {
163
+ const directSendOperation = async (
164
+ args: coreClient.OperationArguments,
165
+ spec: coreClient.OperationSpec
166
+ ): Promise<PrivateZonesCreateOrUpdateResponse> => {
167
+ return this.client.sendOperationRequest(args, spec);
168
+ };
169
+ const sendOperation = async (
170
+ args: coreClient.OperationArguments,
171
+ spec: coreClient.OperationSpec
172
+ ) => {
173
+ let currentRawResponse:
174
+ | coreClient.FullOperationResponse
175
+ | undefined = undefined;
176
+ const providedCallback = args.options?.onResponse;
177
+ const callback: coreClient.RawResponseCallback = (
178
+ rawResponse: coreClient.FullOperationResponse,
179
+ flatResponse: unknown
180
+ ) => {
181
+ currentRawResponse = rawResponse;
182
+ providedCallback?.(rawResponse, flatResponse);
183
+ };
184
+ const updatedArgs = {
185
+ ...args,
186
+ options: {
187
+ ...args.options,
188
+ onResponse: callback
189
+ }
190
+ };
191
+ const flatResponse = await directSendOperation(updatedArgs, spec);
192
+ return {
193
+ flatResponse,
194
+ rawResponse: {
195
+ statusCode: currentRawResponse!.status,
196
+ body: currentRawResponse!.parsedBody,
197
+ headers: currentRawResponse!.headers.toJSON()
198
+ }
199
+ };
200
+ };
201
+
202
+ const lro = new LroImpl(
203
+ sendOperation,
204
+ { resourceGroupName, privateZoneName, parameters, options },
205
+ createOrUpdateOperationSpec
206
+ );
207
+ return new LroEngine(lro, {
208
+ resumeFrom: options?.resumeFrom,
209
+ intervalInMs: options?.updateIntervalInMs
210
+ });
211
+ }
212
+
213
+ /**
214
+ * Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records
215
+ * within the zone.
216
+ * @param resourceGroupName The name of the resource group.
217
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
218
+ * @param parameters Parameters supplied to the CreateOrUpdate operation.
219
+ * @param options The options parameters.
220
+ */
221
+ async beginCreateOrUpdateAndWait(
222
+ resourceGroupName: string,
223
+ privateZoneName: string,
224
+ parameters: PrivateZone,
225
+ options?: PrivateZonesCreateOrUpdateOptionalParams
226
+ ): Promise<PrivateZonesCreateOrUpdateResponse> {
227
+ const poller = await this.beginCreateOrUpdate(
228
+ resourceGroupName,
229
+ privateZoneName,
230
+ parameters,
231
+ options
232
+ );
233
+ return poller.pollUntilDone();
234
+ }
235
+
236
+ /**
237
+ * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.
238
+ * @param resourceGroupName The name of the resource group.
239
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
240
+ * @param parameters Parameters supplied to the Update operation.
241
+ * @param options The options parameters.
242
+ */
243
+ async beginUpdate(
244
+ resourceGroupName: string,
245
+ privateZoneName: string,
246
+ parameters: PrivateZone,
247
+ options?: PrivateZonesUpdateOptionalParams
248
+ ): Promise<
249
+ PollerLike<
250
+ PollOperationState<PrivateZonesUpdateResponse>,
251
+ PrivateZonesUpdateResponse
252
+ >
253
+ > {
254
+ const directSendOperation = async (
255
+ args: coreClient.OperationArguments,
256
+ spec: coreClient.OperationSpec
257
+ ): Promise<PrivateZonesUpdateResponse> => {
258
+ return this.client.sendOperationRequest(args, spec);
259
+ };
260
+ const sendOperation = async (
261
+ args: coreClient.OperationArguments,
262
+ spec: coreClient.OperationSpec
263
+ ) => {
264
+ let currentRawResponse:
265
+ | coreClient.FullOperationResponse
266
+ | undefined = undefined;
267
+ const providedCallback = args.options?.onResponse;
268
+ const callback: coreClient.RawResponseCallback = (
269
+ rawResponse: coreClient.FullOperationResponse,
270
+ flatResponse: unknown
271
+ ) => {
272
+ currentRawResponse = rawResponse;
273
+ providedCallback?.(rawResponse, flatResponse);
274
+ };
275
+ const updatedArgs = {
276
+ ...args,
277
+ options: {
278
+ ...args.options,
279
+ onResponse: callback
280
+ }
281
+ };
282
+ const flatResponse = await directSendOperation(updatedArgs, spec);
283
+ return {
284
+ flatResponse,
285
+ rawResponse: {
286
+ statusCode: currentRawResponse!.status,
287
+ body: currentRawResponse!.parsedBody,
288
+ headers: currentRawResponse!.headers.toJSON()
289
+ }
290
+ };
291
+ };
292
+
293
+ const lro = new LroImpl(
294
+ sendOperation,
295
+ { resourceGroupName, privateZoneName, parameters, options },
296
+ updateOperationSpec
297
+ );
298
+ return new LroEngine(lro, {
299
+ resumeFrom: options?.resumeFrom,
300
+ intervalInMs: options?.updateIntervalInMs
301
+ });
302
+ }
303
+
304
+ /**
305
+ * Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.
306
+ * @param resourceGroupName The name of the resource group.
307
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
308
+ * @param parameters Parameters supplied to the Update operation.
309
+ * @param options The options parameters.
310
+ */
311
+ async beginUpdateAndWait(
312
+ resourceGroupName: string,
313
+ privateZoneName: string,
314
+ parameters: PrivateZone,
315
+ options?: PrivateZonesUpdateOptionalParams
316
+ ): Promise<PrivateZonesUpdateResponse> {
317
+ const poller = await this.beginUpdate(
318
+ resourceGroupName,
319
+ privateZoneName,
320
+ parameters,
321
+ options
322
+ );
323
+ return poller.pollUntilDone();
324
+ }
325
+
326
+ /**
327
+ * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This
328
+ * operation cannot be undone. Private DNS zone cannot be deleted unless all virtual network links to
329
+ * it are removed.
330
+ * @param resourceGroupName The name of the resource group.
331
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
332
+ * @param options The options parameters.
333
+ */
334
+ async beginDelete(
335
+ resourceGroupName: string,
336
+ privateZoneName: string,
337
+ options?: PrivateZonesDeleteOptionalParams
338
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
339
+ const directSendOperation = async (
340
+ args: coreClient.OperationArguments,
341
+ spec: coreClient.OperationSpec
342
+ ): Promise<void> => {
343
+ return this.client.sendOperationRequest(args, spec);
344
+ };
345
+ const sendOperation = async (
346
+ args: coreClient.OperationArguments,
347
+ spec: coreClient.OperationSpec
348
+ ) => {
349
+ let currentRawResponse:
350
+ | coreClient.FullOperationResponse
351
+ | undefined = undefined;
352
+ const providedCallback = args.options?.onResponse;
353
+ const callback: coreClient.RawResponseCallback = (
354
+ rawResponse: coreClient.FullOperationResponse,
355
+ flatResponse: unknown
356
+ ) => {
357
+ currentRawResponse = rawResponse;
358
+ providedCallback?.(rawResponse, flatResponse);
359
+ };
360
+ const updatedArgs = {
361
+ ...args,
362
+ options: {
363
+ ...args.options,
364
+ onResponse: callback
365
+ }
366
+ };
367
+ const flatResponse = await directSendOperation(updatedArgs, spec);
368
+ return {
369
+ flatResponse,
370
+ rawResponse: {
371
+ statusCode: currentRawResponse!.status,
372
+ body: currentRawResponse!.parsedBody,
373
+ headers: currentRawResponse!.headers.toJSON()
374
+ }
375
+ };
376
+ };
377
+
378
+ const lro = new LroImpl(
379
+ sendOperation,
380
+ { resourceGroupName, privateZoneName, options },
381
+ deleteOperationSpec
382
+ );
383
+ return new LroEngine(lro, {
384
+ resumeFrom: options?.resumeFrom,
385
+ intervalInMs: options?.updateIntervalInMs
386
+ });
387
+ }
388
+
389
+ /**
390
+ * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This
391
+ * operation cannot be undone. Private DNS zone cannot be deleted unless all virtual network links to
392
+ * it are removed.
393
+ * @param resourceGroupName The name of the resource group.
394
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
395
+ * @param options The options parameters.
396
+ */
397
+ async beginDeleteAndWait(
398
+ resourceGroupName: string,
399
+ privateZoneName: string,
400
+ options?: PrivateZonesDeleteOptionalParams
401
+ ): Promise<void> {
402
+ const poller = await this.beginDelete(
403
+ resourceGroupName,
404
+ privateZoneName,
405
+ options
406
+ );
407
+ return poller.pollUntilDone();
408
+ }
409
+
410
+ /**
411
+ * Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the
412
+ * record sets within the zone.
413
+ * @param resourceGroupName The name of the resource group.
414
+ * @param privateZoneName The name of the Private DNS zone (without a terminating dot).
415
+ * @param options The options parameters.
416
+ */
417
+ get(
418
+ resourceGroupName: string,
419
+ privateZoneName: string,
420
+ options?: PrivateZonesGetOptionalParams
421
+ ): Promise<PrivateZonesGetResponse> {
422
+ return this.client.sendOperationRequest(
423
+ { resourceGroupName, privateZoneName, options },
424
+ getOperationSpec
425
+ );
426
+ }
427
+
428
+ /**
429
+ * Lists the Private DNS zones in all resource groups in a subscription.
430
+ * @param options The options parameters.
431
+ */
432
+ private _list(
433
+ options?: PrivateZonesListOptionalParams
434
+ ): Promise<PrivateZonesListResponse> {
435
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
436
+ }
437
+
438
+ /**
439
+ * Lists the Private DNS zones within a resource group.
440
+ * @param resourceGroupName The name of the resource group.
441
+ * @param options The options parameters.
442
+ */
443
+ private _listByResourceGroup(
444
+ resourceGroupName: string,
445
+ options?: PrivateZonesListByResourceGroupOptionalParams
446
+ ): Promise<PrivateZonesListByResourceGroupResponse> {
447
+ return this.client.sendOperationRequest(
448
+ { resourceGroupName, options },
449
+ listByResourceGroupOperationSpec
450
+ );
451
+ }
452
+
453
+ /**
454
+ * ListNext
455
+ * @param nextLink The nextLink from the previous successful call to the List method.
456
+ * @param options The options parameters.
457
+ */
458
+ private _listNext(
459
+ nextLink: string,
460
+ options?: PrivateZonesListNextOptionalParams
461
+ ): Promise<PrivateZonesListNextResponse> {
462
+ return this.client.sendOperationRequest(
463
+ { nextLink, options },
464
+ listNextOperationSpec
465
+ );
466
+ }
467
+
468
+ /**
469
+ * ListByResourceGroupNext
470
+ * @param resourceGroupName The name of the resource group.
471
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
472
+ * @param options The options parameters.
473
+ */
474
+ private _listByResourceGroupNext(
475
+ resourceGroupName: string,
476
+ nextLink: string,
477
+ options?: PrivateZonesListByResourceGroupNextOptionalParams
478
+ ): Promise<PrivateZonesListByResourceGroupNextResponse> {
479
+ return this.client.sendOperationRequest(
480
+ { resourceGroupName, nextLink, options },
481
+ listByResourceGroupNextOperationSpec
482
+ );
483
+ }
484
+ }
485
+ // Operation Specifications
486
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
487
+
488
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
489
+ path:
490
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}",
491
+ httpMethod: "PUT",
492
+ responses: {
493
+ 200: {
494
+ bodyMapper: Mappers.PrivateZone
495
+ },
496
+ 201: {
497
+ bodyMapper: Mappers.PrivateZone
498
+ },
499
+ 202: {
500
+ bodyMapper: Mappers.PrivateZone
501
+ },
502
+ 204: {
503
+ bodyMapper: Mappers.PrivateZone
504
+ },
505
+ default: {
506
+ bodyMapper: Mappers.CloudError
507
+ }
508
+ },
509
+ requestBody: Parameters.parameters,
510
+ queryParameters: [Parameters.apiVersion],
511
+ urlParameters: [
512
+ Parameters.$host,
513
+ Parameters.resourceGroupName,
514
+ Parameters.privateZoneName,
515
+ Parameters.subscriptionId
516
+ ],
517
+ headerParameters: [
518
+ Parameters.contentType,
519
+ Parameters.accept,
520
+ Parameters.ifMatch,
521
+ Parameters.ifNoneMatch
522
+ ],
523
+ mediaType: "json",
524
+ serializer
525
+ };
526
+ const updateOperationSpec: coreClient.OperationSpec = {
527
+ path:
528
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}",
529
+ httpMethod: "PATCH",
530
+ responses: {
531
+ 200: {
532
+ bodyMapper: Mappers.PrivateZone
533
+ },
534
+ 201: {
535
+ bodyMapper: Mappers.PrivateZone
536
+ },
537
+ 202: {
538
+ bodyMapper: Mappers.PrivateZone
539
+ },
540
+ 204: {
541
+ bodyMapper: Mappers.PrivateZone
542
+ },
543
+ default: {
544
+ bodyMapper: Mappers.CloudError
545
+ }
546
+ },
547
+ requestBody: Parameters.parameters,
548
+ queryParameters: [Parameters.apiVersion],
549
+ urlParameters: [
550
+ Parameters.$host,
551
+ Parameters.resourceGroupName,
552
+ Parameters.privateZoneName,
553
+ Parameters.subscriptionId
554
+ ],
555
+ headerParameters: [
556
+ Parameters.contentType,
557
+ Parameters.accept,
558
+ Parameters.ifMatch
559
+ ],
560
+ mediaType: "json",
561
+ serializer
562
+ };
563
+ const deleteOperationSpec: coreClient.OperationSpec = {
564
+ path:
565
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}",
566
+ httpMethod: "DELETE",
567
+ responses: {
568
+ 200: {},
569
+ 201: {},
570
+ 202: {},
571
+ 204: {},
572
+ default: {
573
+ bodyMapper: Mappers.CloudError
574
+ }
575
+ },
576
+ queryParameters: [Parameters.apiVersion],
577
+ urlParameters: [
578
+ Parameters.$host,
579
+ Parameters.resourceGroupName,
580
+ Parameters.privateZoneName,
581
+ Parameters.subscriptionId
582
+ ],
583
+ headerParameters: [Parameters.accept, Parameters.ifMatch],
584
+ serializer
585
+ };
586
+ const getOperationSpec: coreClient.OperationSpec = {
587
+ path:
588
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}",
589
+ httpMethod: "GET",
590
+ responses: {
591
+ 200: {
592
+ bodyMapper: Mappers.PrivateZone
593
+ },
594
+ default: {
595
+ bodyMapper: Mappers.CloudError
596
+ }
597
+ },
598
+ queryParameters: [Parameters.apiVersion],
599
+ urlParameters: [
600
+ Parameters.$host,
601
+ Parameters.resourceGroupName,
602
+ Parameters.privateZoneName,
603
+ Parameters.subscriptionId
604
+ ],
605
+ headerParameters: [Parameters.accept],
606
+ serializer
607
+ };
608
+ const listOperationSpec: coreClient.OperationSpec = {
609
+ path:
610
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateDnsZones",
611
+ httpMethod: "GET",
612
+ responses: {
613
+ 200: {
614
+ bodyMapper: Mappers.PrivateZoneListResult
615
+ },
616
+ default: {
617
+ bodyMapper: Mappers.CloudError
618
+ }
619
+ },
620
+ queryParameters: [Parameters.apiVersion, Parameters.top],
621
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
622
+ headerParameters: [Parameters.accept],
623
+ serializer
624
+ };
625
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
626
+ path:
627
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones",
628
+ httpMethod: "GET",
629
+ responses: {
630
+ 200: {
631
+ bodyMapper: Mappers.PrivateZoneListResult
632
+ },
633
+ default: {
634
+ bodyMapper: Mappers.CloudError
635
+ }
636
+ },
637
+ queryParameters: [Parameters.apiVersion, Parameters.top],
638
+ urlParameters: [
639
+ Parameters.$host,
640
+ Parameters.resourceGroupName,
641
+ Parameters.subscriptionId
642
+ ],
643
+ headerParameters: [Parameters.accept],
644
+ serializer
645
+ };
646
+ const listNextOperationSpec: coreClient.OperationSpec = {
647
+ path: "{nextLink}",
648
+ httpMethod: "GET",
649
+ responses: {
650
+ 200: {
651
+ bodyMapper: Mappers.PrivateZoneListResult
652
+ },
653
+ default: {
654
+ bodyMapper: Mappers.CloudError
655
+ }
656
+ },
657
+ queryParameters: [Parameters.apiVersion, Parameters.top],
658
+ urlParameters: [
659
+ Parameters.$host,
660
+ Parameters.subscriptionId,
661
+ Parameters.nextLink
662
+ ],
663
+ headerParameters: [Parameters.accept],
664
+ serializer
665
+ };
666
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
667
+ path: "{nextLink}",
668
+ httpMethod: "GET",
669
+ responses: {
670
+ 200: {
671
+ bodyMapper: Mappers.PrivateZoneListResult
672
+ },
673
+ default: {
674
+ bodyMapper: Mappers.CloudError
675
+ }
676
+ },
677
+ queryParameters: [Parameters.apiVersion, Parameters.top],
678
+ urlParameters: [
679
+ Parameters.$host,
680
+ Parameters.resourceGroupName,
681
+ Parameters.subscriptionId,
682
+ Parameters.nextLink
683
+ ],
684
+ headerParameters: [Parameters.accept],
685
+ serializer
686
+ };