@azure/arm-rediscache 30.0.0-alpha.20210928.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 (133) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +21 -0
  4. package/README.md +94 -0
  5. package/dist/index.js +4051 -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 +6 -0
  10. package/dist-esm/src/index.d.ts.map +1 -0
  11. package/dist-esm/src/index.js +13 -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 +1016 -0
  18. package/dist-esm/src/models/index.d.ts.map +1 -0
  19. package/dist-esm/src/models/index.js +77 -0
  20. package/dist-esm/src/models/index.js.map +1 -0
  21. package/dist-esm/src/models/mappers.d.ts +49 -0
  22. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  23. package/dist-esm/src/models/mappers.js +1580 -0
  24. package/dist-esm/src/models/mappers.js.map +1 -0
  25. package/dist-esm/src/models/parameters.d.ts +27 -0
  26. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  27. package/dist-esm/src/models/parameters.js +198 -0
  28. package/dist-esm/src/models/parameters.js.map +1 -0
  29. package/dist-esm/src/operations/firewallRules.d.ts +63 -0
  30. package/dist-esm/src/operations/firewallRules.d.ts.map +1 -0
  31. package/dist-esm/src/operations/firewallRules.js +238 -0
  32. package/dist-esm/src/operations/firewallRules.js.map +1 -0
  33. package/dist-esm/src/operations/index.d.ts +8 -0
  34. package/dist-esm/src/operations/index.d.ts.map +1 -0
  35. package/dist-esm/src/operations/index.js +15 -0
  36. package/dist-esm/src/operations/index.js.map +1 -0
  37. package/dist-esm/src/operations/linkedServer.d.ts +73 -0
  38. package/dist-esm/src/operations/linkedServer.d.ts.map +1 -0
  39. package/dist-esm/src/operations/linkedServer.js +288 -0
  40. package/dist-esm/src/operations/linkedServer.js.map +1 -0
  41. package/dist-esm/src/operations/operations.d.ts +32 -0
  42. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  43. package/dist-esm/src/operations/operations.js +120 -0
  44. package/dist-esm/src/operations/operations.js.map +1 -0
  45. package/dist-esm/src/operations/patchSchedules.d.ts +63 -0
  46. package/dist-esm/src/operations/patchSchedules.d.ts.map +1 -0
  47. package/dist-esm/src/operations/patchSchedules.js +238 -0
  48. package/dist-esm/src/operations/patchSchedules.js.map +1 -0
  49. package/dist-esm/src/operations/privateEndpointConnections.d.ts +69 -0
  50. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  51. package/dist-esm/src/operations/privateEndpointConnections.js +260 -0
  52. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  53. package/dist-esm/src/operations/privateLinkResources.d.ts +30 -0
  54. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  55. package/dist-esm/src/operations/privateLinkResources.js +99 -0
  56. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  57. package/dist-esm/src/operations/redis.d.ts +192 -0
  58. package/dist-esm/src/operations/redis.d.ts.map +1 -0
  59. package/dist-esm/src/operations/redis.js +840 -0
  60. package/dist-esm/src/operations/redis.js.map +1 -0
  61. package/dist-esm/src/operationsInterfaces/firewallRules.d.ts +38 -0
  62. package/dist-esm/src/operationsInterfaces/firewallRules.d.ts.map +1 -0
  63. package/dist-esm/src/operationsInterfaces/firewallRules.js +9 -0
  64. package/dist-esm/src/operationsInterfaces/firewallRules.js.map +1 -0
  65. package/dist-esm/src/operationsInterfaces/index.d.ts +8 -0
  66. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  67. package/dist-esm/src/operationsInterfaces/index.js +15 -0
  68. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  69. package/dist-esm/src/operationsInterfaces/linkedServer.d.ts +48 -0
  70. package/dist-esm/src/operationsInterfaces/linkedServer.d.ts.map +1 -0
  71. package/dist-esm/src/operationsInterfaces/linkedServer.js +9 -0
  72. package/dist-esm/src/operationsInterfaces/linkedServer.js.map +1 -0
  73. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  74. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  75. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  76. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  77. package/dist-esm/src/operationsInterfaces/patchSchedules.d.ts +38 -0
  78. package/dist-esm/src/operationsInterfaces/patchSchedules.d.ts.map +1 -0
  79. package/dist-esm/src/operationsInterfaces/patchSchedules.js +9 -0
  80. package/dist-esm/src/operationsInterfaces/patchSchedules.js.map +1 -0
  81. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +52 -0
  82. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  83. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  84. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  85. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +13 -0
  86. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  87. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  88. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  89. package/dist-esm/src/operationsInterfaces/redis.d.ts +136 -0
  90. package/dist-esm/src/operationsInterfaces/redis.d.ts.map +1 -0
  91. package/dist-esm/src/operationsInterfaces/redis.js +9 -0
  92. package/dist-esm/src/operationsInterfaces/redis.js.map +1 -0
  93. package/dist-esm/src/redisManagementClient.d.ts +22 -0
  94. package/dist-esm/src/redisManagementClient.d.ts.map +1 -0
  95. package/dist-esm/src/redisManagementClient.js +29 -0
  96. package/dist-esm/src/redisManagementClient.js.map +1 -0
  97. package/dist-esm/src/redisManagementClientContext.d.ts +17 -0
  98. package/dist-esm/src/redisManagementClientContext.d.ts.map +1 -0
  99. package/dist-esm/src/redisManagementClientContext.js +50 -0
  100. package/dist-esm/src/redisManagementClientContext.js.map +1 -0
  101. package/dist-esm/test/redis_examples.d.ts +2 -0
  102. package/dist-esm/test/redis_examples.d.ts.map +1 -0
  103. package/dist-esm/test/redis_examples.js +209 -0
  104. package/dist-esm/test/redis_examples.js.map +1 -0
  105. package/package.json +103 -0
  106. package/review/arm-rediscache.api.md +879 -0
  107. package/rollup.config.js +188 -0
  108. package/src/index.ts +13 -0
  109. package/src/lroImpl.ts +34 -0
  110. package/src/models/index.ts +1154 -0
  111. package/src/models/mappers.ts +1709 -0
  112. package/src/models/parameters.ts +240 -0
  113. package/src/operations/firewallRules.ts +314 -0
  114. package/src/operations/index.ts +15 -0
  115. package/src/operations/linkedServer.ts +397 -0
  116. package/src/operations/operations.ts +137 -0
  117. package/src/operations/patchSchedules.ts +327 -0
  118. package/src/operations/privateEndpointConnections.ts +353 -0
  119. package/src/operations/privateLinkResources.ts +135 -0
  120. package/src/operations/redis.ts +1152 -0
  121. package/src/operationsInterfaces/firewallRules.ts +75 -0
  122. package/src/operationsInterfaces/index.ts +15 -0
  123. package/src/operationsInterfaces/linkedServer.ts +97 -0
  124. package/src/operationsInterfaces/operations.ts +22 -0
  125. package/src/operationsInterfaces/patchSchedules.ts +76 -0
  126. package/src/operationsInterfaces/privateEndpointConnections.ts +100 -0
  127. package/src/operationsInterfaces/privateLinkResources.ts +29 -0
  128. package/src/operationsInterfaces/redis.ts +250 -0
  129. package/src/redisManagementClient.ts +61 -0
  130. package/src/redisManagementClientContext.ts +71 -0
  131. package/tsconfig.json +19 -0
  132. package/types/arm-rediscache.d.ts +1509 -0
  133. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,327 @@
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 { PatchSchedules } 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 { RedisManagementClientContext } from "../redisManagementClientContext";
15
+ import {
16
+ RedisPatchSchedule,
17
+ PatchSchedulesListByRedisResourceNextOptionalParams,
18
+ PatchSchedulesListByRedisResourceOptionalParams,
19
+ PatchSchedulesListByRedisResourceResponse,
20
+ DefaultName,
21
+ PatchSchedulesCreateOrUpdateOptionalParams,
22
+ PatchSchedulesCreateOrUpdateResponse,
23
+ PatchSchedulesDeleteOptionalParams,
24
+ PatchSchedulesGetOptionalParams,
25
+ PatchSchedulesGetResponse,
26
+ PatchSchedulesListByRedisResourceNextResponse
27
+ } from "../models";
28
+
29
+ /// <reference lib="esnext.asynciterable" />
30
+ /** Class containing PatchSchedules operations. */
31
+ export class PatchSchedulesImpl implements PatchSchedules {
32
+ private readonly client: RedisManagementClientContext;
33
+
34
+ /**
35
+ * Initialize a new instance of the class PatchSchedules class.
36
+ * @param client Reference to the service client
37
+ */
38
+ constructor(client: RedisManagementClientContext) {
39
+ this.client = client;
40
+ }
41
+
42
+ /**
43
+ * Gets all patch schedules in the specified redis cache (there is only one).
44
+ * @param resourceGroupName The name of the resource group.
45
+ * @param cacheName The name of the Redis cache.
46
+ * @param options The options parameters.
47
+ */
48
+ public listByRedisResource(
49
+ resourceGroupName: string,
50
+ cacheName: string,
51
+ options?: PatchSchedulesListByRedisResourceOptionalParams
52
+ ): PagedAsyncIterableIterator<RedisPatchSchedule> {
53
+ const iter = this.listByRedisResourcePagingAll(
54
+ resourceGroupName,
55
+ cacheName,
56
+ options
57
+ );
58
+ return {
59
+ next() {
60
+ return iter.next();
61
+ },
62
+ [Symbol.asyncIterator]() {
63
+ return this;
64
+ },
65
+ byPage: () => {
66
+ return this.listByRedisResourcePagingPage(
67
+ resourceGroupName,
68
+ cacheName,
69
+ options
70
+ );
71
+ }
72
+ };
73
+ }
74
+
75
+ private async *listByRedisResourcePagingPage(
76
+ resourceGroupName: string,
77
+ cacheName: string,
78
+ options?: PatchSchedulesListByRedisResourceOptionalParams
79
+ ): AsyncIterableIterator<RedisPatchSchedule[]> {
80
+ let result = await this._listByRedisResource(
81
+ resourceGroupName,
82
+ cacheName,
83
+ options
84
+ );
85
+ yield result.value || [];
86
+ let continuationToken = result.nextLink;
87
+ while (continuationToken) {
88
+ result = await this._listByRedisResourceNext(
89
+ resourceGroupName,
90
+ cacheName,
91
+ continuationToken,
92
+ options
93
+ );
94
+ continuationToken = result.nextLink;
95
+ yield result.value || [];
96
+ }
97
+ }
98
+
99
+ private async *listByRedisResourcePagingAll(
100
+ resourceGroupName: string,
101
+ cacheName: string,
102
+ options?: PatchSchedulesListByRedisResourceOptionalParams
103
+ ): AsyncIterableIterator<RedisPatchSchedule> {
104
+ for await (const page of this.listByRedisResourcePagingPage(
105
+ resourceGroupName,
106
+ cacheName,
107
+ options
108
+ )) {
109
+ yield* page;
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Gets all patch schedules in the specified redis cache (there is only one).
115
+ * @param resourceGroupName The name of the resource group.
116
+ * @param cacheName The name of the Redis cache.
117
+ * @param options The options parameters.
118
+ */
119
+ private _listByRedisResource(
120
+ resourceGroupName: string,
121
+ cacheName: string,
122
+ options?: PatchSchedulesListByRedisResourceOptionalParams
123
+ ): Promise<PatchSchedulesListByRedisResourceResponse> {
124
+ return this.client.sendOperationRequest(
125
+ { resourceGroupName, cacheName, options },
126
+ listByRedisResourceOperationSpec
127
+ );
128
+ }
129
+
130
+ /**
131
+ * Create or replace the patching schedule for Redis cache.
132
+ * @param resourceGroupName The name of the resource group.
133
+ * @param name The name of the Redis cache.
134
+ * @param parameters Parameters to set the patching schedule for Redis cache.
135
+ * @param defaultParam Default string modeled as parameter for auto generation to work correctly.
136
+ * @param options The options parameters.
137
+ */
138
+ createOrUpdate(
139
+ resourceGroupName: string,
140
+ name: string,
141
+ parameters: RedisPatchSchedule,
142
+ defaultParam: DefaultName,
143
+ options?: PatchSchedulesCreateOrUpdateOptionalParams
144
+ ): Promise<PatchSchedulesCreateOrUpdateResponse> {
145
+ return this.client.sendOperationRequest(
146
+ { resourceGroupName, name, parameters, defaultParam, options },
147
+ createOrUpdateOperationSpec
148
+ );
149
+ }
150
+
151
+ /**
152
+ * Deletes the patching schedule of a redis cache.
153
+ * @param resourceGroupName The name of the resource group.
154
+ * @param name The name of the redis cache.
155
+ * @param defaultParam Default string modeled as parameter for auto generation to work correctly.
156
+ * @param options The options parameters.
157
+ */
158
+ delete(
159
+ resourceGroupName: string,
160
+ name: string,
161
+ defaultParam: DefaultName,
162
+ options?: PatchSchedulesDeleteOptionalParams
163
+ ): Promise<void> {
164
+ return this.client.sendOperationRequest(
165
+ { resourceGroupName, name, defaultParam, options },
166
+ deleteOperationSpec
167
+ );
168
+ }
169
+
170
+ /**
171
+ * Gets the patching schedule of a redis cache.
172
+ * @param resourceGroupName The name of the resource group.
173
+ * @param name The name of the redis cache.
174
+ * @param defaultParam Default string modeled as parameter for auto generation to work correctly.
175
+ * @param options The options parameters.
176
+ */
177
+ get(
178
+ resourceGroupName: string,
179
+ name: string,
180
+ defaultParam: DefaultName,
181
+ options?: PatchSchedulesGetOptionalParams
182
+ ): Promise<PatchSchedulesGetResponse> {
183
+ return this.client.sendOperationRequest(
184
+ { resourceGroupName, name, defaultParam, options },
185
+ getOperationSpec
186
+ );
187
+ }
188
+
189
+ /**
190
+ * ListByRedisResourceNext
191
+ * @param resourceGroupName The name of the resource group.
192
+ * @param cacheName The name of the Redis cache.
193
+ * @param nextLink The nextLink from the previous successful call to the ListByRedisResource method.
194
+ * @param options The options parameters.
195
+ */
196
+ private _listByRedisResourceNext(
197
+ resourceGroupName: string,
198
+ cacheName: string,
199
+ nextLink: string,
200
+ options?: PatchSchedulesListByRedisResourceNextOptionalParams
201
+ ): Promise<PatchSchedulesListByRedisResourceNextResponse> {
202
+ return this.client.sendOperationRequest(
203
+ { resourceGroupName, cacheName, nextLink, options },
204
+ listByRedisResourceNextOperationSpec
205
+ );
206
+ }
207
+ }
208
+ // Operation Specifications
209
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
210
+
211
+ const listByRedisResourceOperationSpec: coreClient.OperationSpec = {
212
+ path:
213
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/patchSchedules",
214
+ httpMethod: "GET",
215
+ responses: {
216
+ 200: {
217
+ bodyMapper: Mappers.RedisPatchScheduleListResult
218
+ },
219
+ default: {
220
+ bodyMapper: Mappers.ErrorResponse
221
+ }
222
+ },
223
+ queryParameters: [Parameters.apiVersion],
224
+ urlParameters: [
225
+ Parameters.$host,
226
+ Parameters.subscriptionId,
227
+ Parameters.resourceGroupName,
228
+ Parameters.cacheName
229
+ ],
230
+ headerParameters: [Parameters.accept],
231
+ serializer
232
+ };
233
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
234
+ path:
235
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}",
236
+ httpMethod: "PUT",
237
+ responses: {
238
+ 200: {
239
+ bodyMapper: Mappers.RedisPatchSchedule
240
+ },
241
+ 201: {
242
+ bodyMapper: Mappers.RedisPatchSchedule
243
+ },
244
+ default: {
245
+ bodyMapper: Mappers.ErrorResponse
246
+ }
247
+ },
248
+ requestBody: Parameters.parameters8,
249
+ queryParameters: [Parameters.apiVersion],
250
+ urlParameters: [
251
+ Parameters.$host,
252
+ Parameters.subscriptionId,
253
+ Parameters.resourceGroupName,
254
+ Parameters.name,
255
+ Parameters.defaultParam
256
+ ],
257
+ headerParameters: [Parameters.accept, Parameters.contentType],
258
+ mediaType: "json",
259
+ serializer
260
+ };
261
+ const deleteOperationSpec: coreClient.OperationSpec = {
262
+ path:
263
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}",
264
+ httpMethod: "DELETE",
265
+ responses: {
266
+ 200: {},
267
+ 204: {},
268
+ default: {
269
+ bodyMapper: Mappers.ErrorResponse
270
+ }
271
+ },
272
+ queryParameters: [Parameters.apiVersion],
273
+ urlParameters: [
274
+ Parameters.$host,
275
+ Parameters.subscriptionId,
276
+ Parameters.resourceGroupName,
277
+ Parameters.name,
278
+ Parameters.defaultParam
279
+ ],
280
+ headerParameters: [Parameters.accept],
281
+ serializer
282
+ };
283
+ const getOperationSpec: coreClient.OperationSpec = {
284
+ path:
285
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}",
286
+ httpMethod: "GET",
287
+ responses: {
288
+ 200: {
289
+ bodyMapper: Mappers.RedisPatchSchedule
290
+ },
291
+ default: {
292
+ bodyMapper: Mappers.ErrorResponse
293
+ }
294
+ },
295
+ queryParameters: [Parameters.apiVersion],
296
+ urlParameters: [
297
+ Parameters.$host,
298
+ Parameters.subscriptionId,
299
+ Parameters.resourceGroupName,
300
+ Parameters.name,
301
+ Parameters.defaultParam
302
+ ],
303
+ headerParameters: [Parameters.accept],
304
+ serializer
305
+ };
306
+ const listByRedisResourceNextOperationSpec: coreClient.OperationSpec = {
307
+ path: "{nextLink}",
308
+ httpMethod: "GET",
309
+ responses: {
310
+ 200: {
311
+ bodyMapper: Mappers.RedisPatchScheduleListResult
312
+ },
313
+ default: {
314
+ bodyMapper: Mappers.ErrorResponse
315
+ }
316
+ },
317
+ queryParameters: [Parameters.apiVersion],
318
+ urlParameters: [
319
+ Parameters.$host,
320
+ Parameters.nextLink,
321
+ Parameters.subscriptionId,
322
+ Parameters.resourceGroupName,
323
+ Parameters.cacheName
324
+ ],
325
+ headerParameters: [Parameters.accept],
326
+ serializer
327
+ };
@@ -0,0 +1,353 @@
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 { PrivateEndpointConnections } 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 { RedisManagementClientContext } from "../redisManagementClientContext";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ PrivateEndpointConnection,
19
+ PrivateEndpointConnectionsListOptionalParams,
20
+ PrivateEndpointConnectionsListResponse,
21
+ PrivateEndpointConnectionsGetOptionalParams,
22
+ PrivateEndpointConnectionsGetResponse,
23
+ PrivateEndpointConnectionsPutOptionalParams,
24
+ PrivateEndpointConnectionsPutResponse,
25
+ PrivateEndpointConnectionsDeleteOptionalParams
26
+ } from "../models";
27
+
28
+ /// <reference lib="esnext.asynciterable" />
29
+ /** Class containing PrivateEndpointConnections operations. */
30
+ export class PrivateEndpointConnectionsImpl
31
+ implements PrivateEndpointConnections {
32
+ private readonly client: RedisManagementClientContext;
33
+
34
+ /**
35
+ * Initialize a new instance of the class PrivateEndpointConnections class.
36
+ * @param client Reference to the service client
37
+ */
38
+ constructor(client: RedisManagementClientContext) {
39
+ this.client = client;
40
+ }
41
+
42
+ /**
43
+ * List all the private endpoint connections associated with the redis cache.
44
+ * @param resourceGroupName The name of the resource group.
45
+ * @param cacheName The name of the Redis cache.
46
+ * @param options The options parameters.
47
+ */
48
+ public list(
49
+ resourceGroupName: string,
50
+ cacheName: string,
51
+ options?: PrivateEndpointConnectionsListOptionalParams
52
+ ): PagedAsyncIterableIterator<PrivateEndpointConnection> {
53
+ const iter = this.listPagingAll(resourceGroupName, cacheName, options);
54
+ return {
55
+ next() {
56
+ return iter.next();
57
+ },
58
+ [Symbol.asyncIterator]() {
59
+ return this;
60
+ },
61
+ byPage: () => {
62
+ return this.listPagingPage(resourceGroupName, cacheName, options);
63
+ }
64
+ };
65
+ }
66
+
67
+ private async *listPagingPage(
68
+ resourceGroupName: string,
69
+ cacheName: string,
70
+ options?: PrivateEndpointConnectionsListOptionalParams
71
+ ): AsyncIterableIterator<PrivateEndpointConnection[]> {
72
+ let result = await this._list(resourceGroupName, cacheName, options);
73
+ yield result.value || [];
74
+ }
75
+
76
+ private async *listPagingAll(
77
+ resourceGroupName: string,
78
+ cacheName: string,
79
+ options?: PrivateEndpointConnectionsListOptionalParams
80
+ ): AsyncIterableIterator<PrivateEndpointConnection> {
81
+ for await (const page of this.listPagingPage(
82
+ resourceGroupName,
83
+ cacheName,
84
+ options
85
+ )) {
86
+ yield* page;
87
+ }
88
+ }
89
+
90
+ /**
91
+ * List all the private endpoint connections associated with the redis cache.
92
+ * @param resourceGroupName The name of the resource group.
93
+ * @param cacheName The name of the Redis cache.
94
+ * @param options The options parameters.
95
+ */
96
+ private _list(
97
+ resourceGroupName: string,
98
+ cacheName: string,
99
+ options?: PrivateEndpointConnectionsListOptionalParams
100
+ ): Promise<PrivateEndpointConnectionsListResponse> {
101
+ return this.client.sendOperationRequest(
102
+ { resourceGroupName, cacheName, options },
103
+ listOperationSpec
104
+ );
105
+ }
106
+
107
+ /**
108
+ * Gets the specified private endpoint connection associated with the redis cache.
109
+ * @param resourceGroupName The name of the resource group.
110
+ * @param cacheName The name of the Redis cache.
111
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
112
+ * Azure resource
113
+ * @param options The options parameters.
114
+ */
115
+ get(
116
+ resourceGroupName: string,
117
+ cacheName: string,
118
+ privateEndpointConnectionName: string,
119
+ options?: PrivateEndpointConnectionsGetOptionalParams
120
+ ): Promise<PrivateEndpointConnectionsGetResponse> {
121
+ return this.client.sendOperationRequest(
122
+ { resourceGroupName, cacheName, privateEndpointConnectionName, options },
123
+ getOperationSpec
124
+ );
125
+ }
126
+
127
+ /**
128
+ * Update the state of specified private endpoint connection associated with the redis cache.
129
+ * @param resourceGroupName The name of the resource group.
130
+ * @param cacheName The name of the Redis cache.
131
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
132
+ * Azure resource
133
+ * @param properties The private endpoint connection properties.
134
+ * @param options The options parameters.
135
+ */
136
+ async beginPut(
137
+ resourceGroupName: string,
138
+ cacheName: string,
139
+ privateEndpointConnectionName: string,
140
+ properties: PrivateEndpointConnection,
141
+ options?: PrivateEndpointConnectionsPutOptionalParams
142
+ ): Promise<
143
+ PollerLike<
144
+ PollOperationState<PrivateEndpointConnectionsPutResponse>,
145
+ PrivateEndpointConnectionsPutResponse
146
+ >
147
+ > {
148
+ const directSendOperation = async (
149
+ args: coreClient.OperationArguments,
150
+ spec: coreClient.OperationSpec
151
+ ): Promise<PrivateEndpointConnectionsPutResponse> => {
152
+ return this.client.sendOperationRequest(args, spec);
153
+ };
154
+ const sendOperation = async (
155
+ args: coreClient.OperationArguments,
156
+ spec: coreClient.OperationSpec
157
+ ) => {
158
+ let currentRawResponse:
159
+ | coreClient.FullOperationResponse
160
+ | undefined = undefined;
161
+ const providedCallback = args.options?.onResponse;
162
+ const callback: coreClient.RawResponseCallback = (
163
+ rawResponse: coreClient.FullOperationResponse,
164
+ flatResponse: unknown
165
+ ) => {
166
+ currentRawResponse = rawResponse;
167
+ providedCallback?.(rawResponse, flatResponse);
168
+ };
169
+ const updatedArgs = {
170
+ ...args,
171
+ options: {
172
+ ...args.options,
173
+ onResponse: callback
174
+ }
175
+ };
176
+ const flatResponse = await directSendOperation(updatedArgs, spec);
177
+ return {
178
+ flatResponse,
179
+ rawResponse: {
180
+ statusCode: currentRawResponse!.status,
181
+ body: currentRawResponse!.parsedBody,
182
+ headers: currentRawResponse!.headers.toJSON()
183
+ }
184
+ };
185
+ };
186
+
187
+ const lro = new LroImpl(
188
+ sendOperation,
189
+ {
190
+ resourceGroupName,
191
+ cacheName,
192
+ privateEndpointConnectionName,
193
+ properties,
194
+ options
195
+ },
196
+ putOperationSpec
197
+ );
198
+ return new LroEngine(lro, {
199
+ resumeFrom: options?.resumeFrom,
200
+ intervalInMs: options?.updateIntervalInMs
201
+ });
202
+ }
203
+
204
+ /**
205
+ * Update the state of specified private endpoint connection associated with the redis cache.
206
+ * @param resourceGroupName The name of the resource group.
207
+ * @param cacheName The name of the Redis cache.
208
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
209
+ * Azure resource
210
+ * @param properties The private endpoint connection properties.
211
+ * @param options The options parameters.
212
+ */
213
+ async beginPutAndWait(
214
+ resourceGroupName: string,
215
+ cacheName: string,
216
+ privateEndpointConnectionName: string,
217
+ properties: PrivateEndpointConnection,
218
+ options?: PrivateEndpointConnectionsPutOptionalParams
219
+ ): Promise<PrivateEndpointConnectionsPutResponse> {
220
+ const poller = await this.beginPut(
221
+ resourceGroupName,
222
+ cacheName,
223
+ privateEndpointConnectionName,
224
+ properties,
225
+ options
226
+ );
227
+ return poller.pollUntilDone();
228
+ }
229
+
230
+ /**
231
+ * Deletes the specified private endpoint connection associated with the redis cache.
232
+ * @param resourceGroupName The name of the resource group.
233
+ * @param cacheName The name of the Redis cache.
234
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
235
+ * Azure resource
236
+ * @param options The options parameters.
237
+ */
238
+ delete(
239
+ resourceGroupName: string,
240
+ cacheName: string,
241
+ privateEndpointConnectionName: string,
242
+ options?: PrivateEndpointConnectionsDeleteOptionalParams
243
+ ): Promise<void> {
244
+ return this.client.sendOperationRequest(
245
+ { resourceGroupName, cacheName, privateEndpointConnectionName, options },
246
+ deleteOperationSpec
247
+ );
248
+ }
249
+ }
250
+ // Operation Specifications
251
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
252
+
253
+ const listOperationSpec: coreClient.OperationSpec = {
254
+ path:
255
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections",
256
+ httpMethod: "GET",
257
+ responses: {
258
+ 200: {
259
+ bodyMapper: Mappers.PrivateEndpointConnectionListResult
260
+ },
261
+ default: {
262
+ bodyMapper: Mappers.ErrorResponse
263
+ }
264
+ },
265
+ queryParameters: [Parameters.apiVersion],
266
+ urlParameters: [
267
+ Parameters.$host,
268
+ Parameters.subscriptionId,
269
+ Parameters.resourceGroupName,
270
+ Parameters.cacheName
271
+ ],
272
+ headerParameters: [Parameters.accept],
273
+ serializer
274
+ };
275
+ const getOperationSpec: coreClient.OperationSpec = {
276
+ path:
277
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}",
278
+ httpMethod: "GET",
279
+ responses: {
280
+ 200: {
281
+ bodyMapper: Mappers.PrivateEndpointConnection
282
+ },
283
+ default: {
284
+ bodyMapper: Mappers.ErrorResponse
285
+ }
286
+ },
287
+ queryParameters: [Parameters.apiVersion],
288
+ urlParameters: [
289
+ Parameters.$host,
290
+ Parameters.subscriptionId,
291
+ Parameters.resourceGroupName,
292
+ Parameters.cacheName,
293
+ Parameters.privateEndpointConnectionName
294
+ ],
295
+ headerParameters: [Parameters.accept],
296
+ serializer
297
+ };
298
+ const putOperationSpec: coreClient.OperationSpec = {
299
+ path:
300
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}",
301
+ httpMethod: "PUT",
302
+ responses: {
303
+ 200: {
304
+ bodyMapper: Mappers.PrivateEndpointConnection
305
+ },
306
+ 201: {
307
+ bodyMapper: Mappers.PrivateEndpointConnection
308
+ },
309
+ 202: {
310
+ bodyMapper: Mappers.PrivateEndpointConnection
311
+ },
312
+ 204: {
313
+ bodyMapper: Mappers.PrivateEndpointConnection
314
+ },
315
+ default: {
316
+ bodyMapper: Mappers.ErrorResponse
317
+ }
318
+ },
319
+ requestBody: Parameters.properties,
320
+ queryParameters: [Parameters.apiVersion],
321
+ urlParameters: [
322
+ Parameters.$host,
323
+ Parameters.subscriptionId,
324
+ Parameters.resourceGroupName,
325
+ Parameters.cacheName,
326
+ Parameters.privateEndpointConnectionName
327
+ ],
328
+ headerParameters: [Parameters.accept, Parameters.contentType],
329
+ mediaType: "json",
330
+ serializer
331
+ };
332
+ const deleteOperationSpec: coreClient.OperationSpec = {
333
+ path:
334
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}",
335
+ httpMethod: "DELETE",
336
+ responses: {
337
+ 200: {},
338
+ 204: {},
339
+ default: {
340
+ bodyMapper: Mappers.ErrorResponse
341
+ }
342
+ },
343
+ queryParameters: [Parameters.apiVersion],
344
+ urlParameters: [
345
+ Parameters.$host,
346
+ Parameters.subscriptionId,
347
+ Parameters.resourceGroupName,
348
+ Parameters.cacheName,
349
+ Parameters.privateEndpointConnectionName
350
+ ],
351
+ headerParameters: [Parameters.accept],
352
+ serializer
353
+ };