@azure/arm-deviceupdate 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 (225) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +3665 -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/accountsCreateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/accountsCreateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/accountsCreateSample.js +32 -0
  11. package/dist-esm/samples-dev/accountsCreateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/accountsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/accountsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/accountsDeleteSample.js +31 -0
  15. package/dist-esm/samples-dev/accountsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/accountsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/accountsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/accountsGetSample.js +31 -0
  19. package/dist-esm/samples-dev/accountsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/accountsHeadSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/accountsHeadSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/accountsHeadSample.js +31 -0
  23. package/dist-esm/samples-dev/accountsHeadSample.js.map +1 -0
  24. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +44 -0
  27. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -0
  28. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +43 -0
  31. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -0
  32. package/dist-esm/samples-dev/accountsUpdateSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/accountsUpdateSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/accountsUpdateSample.js +32 -0
  35. package/dist-esm/samples-dev/accountsUpdateSample.js.map +1 -0
  36. package/dist-esm/samples-dev/checkNameAvailabilitySample.d.ts +2 -0
  37. package/dist-esm/samples-dev/checkNameAvailabilitySample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/checkNameAvailabilitySample.js +53 -0
  39. package/dist-esm/samples-dev/checkNameAvailabilitySample.js.map +1 -0
  40. package/dist-esm/samples-dev/instancesCreateSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/instancesCreateSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/instancesCreateSample.js +46 -0
  43. package/dist-esm/samples-dev/instancesCreateSample.js.map +1 -0
  44. package/dist-esm/samples-dev/instancesDeleteSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/instancesDeleteSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/instancesDeleteSample.js +32 -0
  47. package/dist-esm/samples-dev/instancesDeleteSample.js.map +1 -0
  48. package/dist-esm/samples-dev/instancesGetSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/instancesGetSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/instancesGetSample.js +32 -0
  51. package/dist-esm/samples-dev/instancesGetSample.js.map +1 -0
  52. package/dist-esm/samples-dev/instancesHeadSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/instancesHeadSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/instancesHeadSample.js +32 -0
  55. package/dist-esm/samples-dev/instancesHeadSample.js.map +1 -0
  56. package/dist-esm/samples-dev/instancesListByAccountSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/instancesListByAccountSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/instancesListByAccountSample.js +45 -0
  59. package/dist-esm/samples-dev/instancesListByAccountSample.js.map +1 -0
  60. package/dist-esm/samples-dev/instancesUpdateSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/instancesUpdateSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/instancesUpdateSample.js +33 -0
  63. package/dist-esm/samples-dev/instancesUpdateSample.js.map +1 -0
  64. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/operationsListSample.js +43 -0
  67. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  68. package/dist-esm/samples-dev/privateEndpointConnectionProxiesCreateOrUpdateSample.d.ts +2 -0
  69. package/dist-esm/samples-dev/privateEndpointConnectionProxiesCreateOrUpdateSample.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/privateEndpointConnectionProxiesCreateOrUpdateSample.js +53 -0
  71. package/dist-esm/samples-dev/privateEndpointConnectionProxiesCreateOrUpdateSample.js.map +1 -0
  72. package/dist-esm/samples-dev/privateEndpointConnectionProxiesDeleteSample.d.ts +2 -0
  73. package/dist-esm/samples-dev/privateEndpointConnectionProxiesDeleteSample.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/privateEndpointConnectionProxiesDeleteSample.js +32 -0
  75. package/dist-esm/samples-dev/privateEndpointConnectionProxiesDeleteSample.js.map +1 -0
  76. package/dist-esm/samples-dev/privateEndpointConnectionProxiesGetSample.d.ts +2 -0
  77. package/dist-esm/samples-dev/privateEndpointConnectionProxiesGetSample.d.ts.map +1 -0
  78. package/dist-esm/samples-dev/privateEndpointConnectionProxiesGetSample.js +32 -0
  79. package/dist-esm/samples-dev/privateEndpointConnectionProxiesGetSample.js.map +1 -0
  80. package/dist-esm/samples-dev/privateEndpointConnectionProxiesListByAccountSample.d.ts +2 -0
  81. package/dist-esm/samples-dev/privateEndpointConnectionProxiesListByAccountSample.d.ts.map +1 -0
  82. package/dist-esm/samples-dev/privateEndpointConnectionProxiesListByAccountSample.js +45 -0
  83. package/dist-esm/samples-dev/privateEndpointConnectionProxiesListByAccountSample.js.map +1 -0
  84. package/dist-esm/samples-dev/privateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesSample.d.ts +2 -0
  85. package/dist-esm/samples-dev/privateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesSample.d.ts.map +1 -0
  86. package/dist-esm/samples-dev/privateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesSample.js +39 -0
  87. package/dist-esm/samples-dev/privateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesSample.js.map +1 -0
  88. package/dist-esm/samples-dev/privateEndpointConnectionProxiesValidateSample.d.ts +2 -0
  89. package/dist-esm/samples-dev/privateEndpointConnectionProxiesValidateSample.d.ts.map +1 -0
  90. package/dist-esm/samples-dev/privateEndpointConnectionProxiesValidateSample.js +53 -0
  91. package/dist-esm/samples-dev/privateEndpointConnectionProxiesValidateSample.js.map +1 -0
  92. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.d.ts +2 -0
  93. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.d.ts.map +1 -0
  94. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js +38 -0
  95. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js.map +1 -0
  96. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.d.ts +2 -0
  97. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.d.ts.map +1 -0
  98. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +32 -0
  99. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js.map +1 -0
  100. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.d.ts +2 -0
  101. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.d.ts.map +1 -0
  102. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +32 -0
  103. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js.map +1 -0
  104. package/dist-esm/samples-dev/privateEndpointConnectionsListByAccountSample.d.ts +2 -0
  105. package/dist-esm/samples-dev/privateEndpointConnectionsListByAccountSample.d.ts.map +1 -0
  106. package/dist-esm/samples-dev/privateEndpointConnectionsListByAccountSample.js +45 -0
  107. package/dist-esm/samples-dev/privateEndpointConnectionsListByAccountSample.js.map +1 -0
  108. package/dist-esm/samples-dev/privateLinkResourcesGetSample.d.ts +2 -0
  109. package/dist-esm/samples-dev/privateLinkResourcesGetSample.d.ts.map +1 -0
  110. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js +32 -0
  111. package/dist-esm/samples-dev/privateLinkResourcesGetSample.js.map +1 -0
  112. package/dist-esm/samples-dev/privateLinkResourcesListByAccountSample.d.ts +2 -0
  113. package/dist-esm/samples-dev/privateLinkResourcesListByAccountSample.d.ts.map +1 -0
  114. package/dist-esm/samples-dev/privateLinkResourcesListByAccountSample.js +45 -0
  115. package/dist-esm/samples-dev/privateLinkResourcesListByAccountSample.js.map +1 -0
  116. package/dist-esm/src/deviceUpdate.d.ts +31 -0
  117. package/dist-esm/src/deviceUpdate.d.ts.map +1 -0
  118. package/dist-esm/src/deviceUpdate.js +133 -0
  119. package/dist-esm/src/deviceUpdate.js.map +1 -0
  120. package/dist-esm/src/index.d.ts +5 -0
  121. package/dist-esm/src/index.d.ts.map +1 -0
  122. package/dist-esm/src/index.js +12 -0
  123. package/dist-esm/src/index.js.map +1 -0
  124. package/dist-esm/src/lroImpl.d.ts +16 -0
  125. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  126. package/dist-esm/src/lroImpl.js +29 -0
  127. package/dist-esm/src/lroImpl.js.map +1 -0
  128. package/dist-esm/src/models/index.d.ts +941 -0
  129. package/dist-esm/src/models/index.d.ts.map +1 -0
  130. package/dist-esm/src/models/index.js +105 -0
  131. package/dist-esm/src/models/index.js.map +1 -0
  132. package/dist-esm/src/models/mappers.d.ts +44 -0
  133. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  134. package/dist-esm/src/models/mappers.js +1266 -0
  135. package/dist-esm/src/models/mappers.js.map +1 -0
  136. package/dist-esm/src/models/parameters.d.ts +22 -0
  137. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  138. package/dist-esm/src/models/parameters.js +176 -0
  139. package/dist-esm/src/models/parameters.js.map +1 -0
  140. package/dist-esm/src/operations/accounts.d.ts +114 -0
  141. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  142. package/dist-esm/src/operations/accounts.js +537 -0
  143. package/dist-esm/src/operations/accounts.js.map +1 -0
  144. package/dist-esm/src/operations/index.d.ts +7 -0
  145. package/dist-esm/src/operations/index.d.ts.map +1 -0
  146. package/dist-esm/src/operations/index.js +14 -0
  147. package/dist-esm/src/operations/index.js.map +1 -0
  148. package/dist-esm/src/operations/instances.d.ts +98 -0
  149. package/dist-esm/src/operations/instances.d.ts.map +1 -0
  150. package/dist-esm/src/operations/instances.js +408 -0
  151. package/dist-esm/src/operations/instances.js.map +1 -0
  152. package/dist-esm/src/operations/operations.d.ts +32 -0
  153. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  154. package/dist-esm/src/operations/operations.js +120 -0
  155. package/dist-esm/src/operations/operations.js.map +1 -0
  156. package/dist-esm/src/operations/privateEndpointConnectionProxies.d.ts +100 -0
  157. package/dist-esm/src/operations/privateEndpointConnectionProxies.d.ts.map +1 -0
  158. package/dist-esm/src/operations/privateEndpointConnectionProxies.js +402 -0
  159. package/dist-esm/src/operations/privateEndpointConnectionProxies.js.map +1 -0
  160. package/dist-esm/src/operations/privateEndpointConnections.d.ts +78 -0
  161. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  162. package/dist-esm/src/operations/privateEndpointConnections.js +320 -0
  163. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  164. package/dist-esm/src/operations/privateLinkResources.d.ts +38 -0
  165. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  166. package/dist-esm/src/operations/privateLinkResources.js +131 -0
  167. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  168. package/dist-esm/src/operationsInterfaces/accounts.d.ts +78 -0
  169. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  170. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  171. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  172. package/dist-esm/src/operationsInterfaces/index.d.ts +7 -0
  173. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  174. package/dist-esm/src/operationsInterfaces/index.js +14 -0
  175. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  176. package/dist-esm/src/operationsInterfaces/instances.d.ts +73 -0
  177. package/dist-esm/src/operationsInterfaces/instances.d.ts.map +1 -0
  178. package/dist-esm/src/operationsInterfaces/instances.js +9 -0
  179. package/dist-esm/src/operationsInterfaces/instances.js.map +1 -0
  180. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  181. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  182. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  183. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  184. package/dist-esm/src/operationsInterfaces/privateEndpointConnectionProxies.d.ts +83 -0
  185. package/dist-esm/src/operationsInterfaces/privateEndpointConnectionProxies.d.ts.map +1 -0
  186. package/dist-esm/src/operationsInterfaces/privateEndpointConnectionProxies.js +9 -0
  187. package/dist-esm/src/operationsInterfaces/privateEndpointConnectionProxies.js.map +1 -0
  188. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +61 -0
  189. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  190. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  191. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  192. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +21 -0
  193. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  194. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  195. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  196. package/dist-esm/test/sampleTest.d.ts +2 -0
  197. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  198. package/dist-esm/test/sampleTest.js +38 -0
  199. package/dist-esm/test/sampleTest.js.map +1 -0
  200. package/package.json +122 -0
  201. package/review/arm-deviceupdate.api.md +805 -0
  202. package/rollup.config.js +122 -0
  203. package/src/deviceUpdate.ts +204 -0
  204. package/src/index.ts +12 -0
  205. package/src/lroImpl.ts +34 -0
  206. package/src/models/index.ts +1080 -0
  207. package/src/models/mappers.ts +1356 -0
  208. package/src/models/parameters.ts +210 -0
  209. package/src/operations/accounts.ts +722 -0
  210. package/src/operations/index.ts +14 -0
  211. package/src/operations/instances.ts +579 -0
  212. package/src/operations/operations.ts +137 -0
  213. package/src/operations/privateEndpointConnectionProxies.ts +559 -0
  214. package/src/operations/privateEndpointConnections.ts +450 -0
  215. package/src/operations/privateLinkResources.ts +179 -0
  216. package/src/operationsInterfaces/accounts.ts +152 -0
  217. package/src/operationsInterfaces/index.ts +14 -0
  218. package/src/operationsInterfaces/instances.ts +142 -0
  219. package/src/operationsInterfaces/operations.ts +22 -0
  220. package/src/operationsInterfaces/privateEndpointConnectionProxies.ts +153 -0
  221. package/src/operationsInterfaces/privateEndpointConnections.ts +114 -0
  222. package/src/operationsInterfaces/privateLinkResources.ts +44 -0
  223. package/tsconfig.json +33 -0
  224. package/types/arm-deviceupdate.d.ts +1412 -0
  225. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,137 @@
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 { Operations } 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 { DeviceUpdate } from "../deviceUpdate";
15
+ import {
16
+ Operation,
17
+ OperationsListNextOptionalParams,
18
+ OperationsListOptionalParams,
19
+ OperationsListResponse,
20
+ OperationsListNextResponse
21
+ } from "../models";
22
+
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing Operations operations. */
25
+ export class OperationsImpl implements Operations {
26
+ private readonly client: DeviceUpdate;
27
+
28
+ /**
29
+ * Initialize a new instance of the class Operations class.
30
+ * @param client Reference to the service client
31
+ */
32
+ constructor(client: DeviceUpdate) {
33
+ this.client = client;
34
+ }
35
+
36
+ /**
37
+ * Returns list of operations for Microsoft.DeviceUpdate resource provider.
38
+ * @param options The options parameters.
39
+ */
40
+ public list(
41
+ options?: OperationsListOptionalParams
42
+ ): PagedAsyncIterableIterator<Operation> {
43
+ const iter = this.listPagingAll(options);
44
+ return {
45
+ next() {
46
+ return iter.next();
47
+ },
48
+ [Symbol.asyncIterator]() {
49
+ return this;
50
+ },
51
+ byPage: () => {
52
+ return this.listPagingPage(options);
53
+ }
54
+ };
55
+ }
56
+
57
+ private async *listPagingPage(
58
+ options?: OperationsListOptionalParams
59
+ ): AsyncIterableIterator<Operation[]> {
60
+ let result = await this._list(options);
61
+ yield result.value || [];
62
+ let continuationToken = result.nextLink;
63
+ while (continuationToken) {
64
+ result = await this._listNext(continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ yield result.value || [];
67
+ }
68
+ }
69
+
70
+ private async *listPagingAll(
71
+ options?: OperationsListOptionalParams
72
+ ): AsyncIterableIterator<Operation> {
73
+ for await (const page of this.listPagingPage(options)) {
74
+ yield* page;
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Returns list of operations for Microsoft.DeviceUpdate resource provider.
80
+ * @param options The options parameters.
81
+ */
82
+ private _list(
83
+ options?: OperationsListOptionalParams
84
+ ): Promise<OperationsListResponse> {
85
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
86
+ }
87
+
88
+ /**
89
+ * ListNext
90
+ * @param nextLink The nextLink from the previous successful call to the List method.
91
+ * @param options The options parameters.
92
+ */
93
+ private _listNext(
94
+ nextLink: string,
95
+ options?: OperationsListNextOptionalParams
96
+ ): Promise<OperationsListNextResponse> {
97
+ return this.client.sendOperationRequest(
98
+ { nextLink, options },
99
+ listNextOperationSpec
100
+ );
101
+ }
102
+ }
103
+ // Operation Specifications
104
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
105
+
106
+ const listOperationSpec: coreClient.OperationSpec = {
107
+ path: "/providers/Microsoft.DeviceUpdate/operations",
108
+ httpMethod: "GET",
109
+ responses: {
110
+ 200: {
111
+ bodyMapper: Mappers.OperationListResult
112
+ },
113
+ default: {
114
+ bodyMapper: Mappers.ErrorResponse
115
+ }
116
+ },
117
+ queryParameters: [Parameters.apiVersion],
118
+ urlParameters: [Parameters.$host],
119
+ headerParameters: [Parameters.accept],
120
+ serializer
121
+ };
122
+ const listNextOperationSpec: coreClient.OperationSpec = {
123
+ path: "{nextLink}",
124
+ httpMethod: "GET",
125
+ responses: {
126
+ 200: {
127
+ bodyMapper: Mappers.OperationListResult
128
+ },
129
+ default: {
130
+ bodyMapper: Mappers.ErrorResponse
131
+ }
132
+ },
133
+ queryParameters: [Parameters.apiVersion],
134
+ urlParameters: [Parameters.$host, Parameters.nextLink],
135
+ headerParameters: [Parameters.accept],
136
+ serializer
137
+ };
@@ -0,0 +1,559 @@
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 { PrivateEndpointConnectionProxies } 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 { DeviceUpdate } from "../deviceUpdate";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ PrivateEndpointConnectionProxy,
19
+ PrivateEndpointConnectionProxiesListByAccountOptionalParams,
20
+ PrivateEndpointConnectionProxiesListByAccountResponse,
21
+ PrivateEndpointConnectionProxiesValidateOptionalParams,
22
+ PrivateEndpointUpdate,
23
+ PrivateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesOptionalParams,
24
+ PrivateEndpointConnectionProxiesGetOptionalParams,
25
+ PrivateEndpointConnectionProxiesGetResponse,
26
+ PrivateEndpointConnectionProxiesCreateOrUpdateOptionalParams,
27
+ PrivateEndpointConnectionProxiesCreateOrUpdateResponse,
28
+ PrivateEndpointConnectionProxiesDeleteOptionalParams
29
+ } from "../models";
30
+
31
+ /// <reference lib="esnext.asynciterable" />
32
+ /** Class containing PrivateEndpointConnectionProxies operations. */
33
+ export class PrivateEndpointConnectionProxiesImpl
34
+ implements PrivateEndpointConnectionProxies {
35
+ private readonly client: DeviceUpdate;
36
+
37
+ /**
38
+ * Initialize a new instance of the class PrivateEndpointConnectionProxies class.
39
+ * @param client Reference to the service client
40
+ */
41
+ constructor(client: DeviceUpdate) {
42
+ this.client = client;
43
+ }
44
+
45
+ /**
46
+ * (INTERNAL - DO NOT USE) List all private endpoint connection proxies in a device update account.
47
+ * @param resourceGroupName The resource group name.
48
+ * @param accountName Account name.
49
+ * @param options The options parameters.
50
+ */
51
+ public listByAccount(
52
+ resourceGroupName: string,
53
+ accountName: string,
54
+ options?: PrivateEndpointConnectionProxiesListByAccountOptionalParams
55
+ ): PagedAsyncIterableIterator<PrivateEndpointConnectionProxy> {
56
+ const iter = this.listByAccountPagingAll(
57
+ resourceGroupName,
58
+ accountName,
59
+ options
60
+ );
61
+ return {
62
+ next() {
63
+ return iter.next();
64
+ },
65
+ [Symbol.asyncIterator]() {
66
+ return this;
67
+ },
68
+ byPage: () => {
69
+ return this.listByAccountPagingPage(
70
+ resourceGroupName,
71
+ accountName,
72
+ options
73
+ );
74
+ }
75
+ };
76
+ }
77
+
78
+ private async *listByAccountPagingPage(
79
+ resourceGroupName: string,
80
+ accountName: string,
81
+ options?: PrivateEndpointConnectionProxiesListByAccountOptionalParams
82
+ ): AsyncIterableIterator<PrivateEndpointConnectionProxy[]> {
83
+ let result = await this._listByAccount(
84
+ resourceGroupName,
85
+ accountName,
86
+ options
87
+ );
88
+ yield result.value || [];
89
+ }
90
+
91
+ private async *listByAccountPagingAll(
92
+ resourceGroupName: string,
93
+ accountName: string,
94
+ options?: PrivateEndpointConnectionProxiesListByAccountOptionalParams
95
+ ): AsyncIterableIterator<PrivateEndpointConnectionProxy> {
96
+ for await (const page of this.listByAccountPagingPage(
97
+ resourceGroupName,
98
+ accountName,
99
+ options
100
+ )) {
101
+ yield* page;
102
+ }
103
+ }
104
+
105
+ /**
106
+ * (INTERNAL - DO NOT USE) List all private endpoint connection proxies in a device update account.
107
+ * @param resourceGroupName The resource group name.
108
+ * @param accountName Account name.
109
+ * @param options The options parameters.
110
+ */
111
+ private _listByAccount(
112
+ resourceGroupName: string,
113
+ accountName: string,
114
+ options?: PrivateEndpointConnectionProxiesListByAccountOptionalParams
115
+ ): Promise<PrivateEndpointConnectionProxiesListByAccountResponse> {
116
+ return this.client.sendOperationRequest(
117
+ { resourceGroupName, accountName, options },
118
+ listByAccountOperationSpec
119
+ );
120
+ }
121
+
122
+ /**
123
+ * (INTERNAL - DO NOT USE) Validates a private endpoint connection proxy object.
124
+ * @param resourceGroupName The resource group name.
125
+ * @param accountName Account name.
126
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
127
+ * @param privateEndpointConnectionProxy The parameters for creating a private endpoint connection
128
+ * proxy.
129
+ * @param options The options parameters.
130
+ */
131
+ validate(
132
+ resourceGroupName: string,
133
+ accountName: string,
134
+ privateEndpointConnectionProxyId: string,
135
+ privateEndpointConnectionProxy: PrivateEndpointConnectionProxy,
136
+ options?: PrivateEndpointConnectionProxiesValidateOptionalParams
137
+ ): Promise<void> {
138
+ return this.client.sendOperationRequest(
139
+ {
140
+ resourceGroupName,
141
+ accountName,
142
+ privateEndpointConnectionProxyId,
143
+ privateEndpointConnectionProxy,
144
+ options
145
+ },
146
+ validateOperationSpec
147
+ );
148
+ }
149
+
150
+ /**
151
+ * (INTERNAL - DO NOT USE) Updates a private endpoint inside the private endpoint connection proxy
152
+ * object.
153
+ * @param resourceGroupName The resource group name.
154
+ * @param accountName Account name.
155
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
156
+ * @param privateEndpointUpdate The parameters for updating a private endpoint connection proxy.
157
+ * @param options The options parameters.
158
+ */
159
+ updatePrivateEndpointProperties(
160
+ resourceGroupName: string,
161
+ accountName: string,
162
+ privateEndpointConnectionProxyId: string,
163
+ privateEndpointUpdate: PrivateEndpointUpdate,
164
+ options?: PrivateEndpointConnectionProxiesUpdatePrivateEndpointPropertiesOptionalParams
165
+ ): Promise<void> {
166
+ return this.client.sendOperationRequest(
167
+ {
168
+ resourceGroupName,
169
+ accountName,
170
+ privateEndpointConnectionProxyId,
171
+ privateEndpointUpdate,
172
+ options
173
+ },
174
+ updatePrivateEndpointPropertiesOperationSpec
175
+ );
176
+ }
177
+
178
+ /**
179
+ * (INTERNAL - DO NOT USE) Get the specified private endpoint connection proxy associated with the
180
+ * device update account.
181
+ * @param resourceGroupName The resource group name.
182
+ * @param accountName Account name.
183
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
184
+ * @param options The options parameters.
185
+ */
186
+ get(
187
+ resourceGroupName: string,
188
+ accountName: string,
189
+ privateEndpointConnectionProxyId: string,
190
+ options?: PrivateEndpointConnectionProxiesGetOptionalParams
191
+ ): Promise<PrivateEndpointConnectionProxiesGetResponse> {
192
+ return this.client.sendOperationRequest(
193
+ {
194
+ resourceGroupName,
195
+ accountName,
196
+ privateEndpointConnectionProxyId,
197
+ options
198
+ },
199
+ getOperationSpec
200
+ );
201
+ }
202
+
203
+ /**
204
+ * (INTERNAL - DO NOT USE) Creates or updates the specified private endpoint connection proxy resource
205
+ * associated with the device update account.
206
+ * @param resourceGroupName The resource group name.
207
+ * @param accountName Account name.
208
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
209
+ * @param privateEndpointConnectionProxy The parameters for creating a private endpoint connection
210
+ * proxy.
211
+ * @param options The options parameters.
212
+ */
213
+ async beginCreateOrUpdate(
214
+ resourceGroupName: string,
215
+ accountName: string,
216
+ privateEndpointConnectionProxyId: string,
217
+ privateEndpointConnectionProxy: PrivateEndpointConnectionProxy,
218
+ options?: PrivateEndpointConnectionProxiesCreateOrUpdateOptionalParams
219
+ ): Promise<
220
+ PollerLike<
221
+ PollOperationState<
222
+ PrivateEndpointConnectionProxiesCreateOrUpdateResponse
223
+ >,
224
+ PrivateEndpointConnectionProxiesCreateOrUpdateResponse
225
+ >
226
+ > {
227
+ const directSendOperation = async (
228
+ args: coreClient.OperationArguments,
229
+ spec: coreClient.OperationSpec
230
+ ): Promise<PrivateEndpointConnectionProxiesCreateOrUpdateResponse> => {
231
+ return this.client.sendOperationRequest(args, spec);
232
+ };
233
+ const sendOperation = async (
234
+ args: coreClient.OperationArguments,
235
+ spec: coreClient.OperationSpec
236
+ ) => {
237
+ let currentRawResponse:
238
+ | coreClient.FullOperationResponse
239
+ | undefined = undefined;
240
+ const providedCallback = args.options?.onResponse;
241
+ const callback: coreClient.RawResponseCallback = (
242
+ rawResponse: coreClient.FullOperationResponse,
243
+ flatResponse: unknown
244
+ ) => {
245
+ currentRawResponse = rawResponse;
246
+ providedCallback?.(rawResponse, flatResponse);
247
+ };
248
+ const updatedArgs = {
249
+ ...args,
250
+ options: {
251
+ ...args.options,
252
+ onResponse: callback
253
+ }
254
+ };
255
+ const flatResponse = await directSendOperation(updatedArgs, spec);
256
+ return {
257
+ flatResponse,
258
+ rawResponse: {
259
+ statusCode: currentRawResponse!.status,
260
+ body: currentRawResponse!.parsedBody,
261
+ headers: currentRawResponse!.headers.toJSON()
262
+ }
263
+ };
264
+ };
265
+
266
+ const lro = new LroImpl(
267
+ sendOperation,
268
+ {
269
+ resourceGroupName,
270
+ accountName,
271
+ privateEndpointConnectionProxyId,
272
+ privateEndpointConnectionProxy,
273
+ options
274
+ },
275
+ createOrUpdateOperationSpec
276
+ );
277
+ const poller = new LroEngine(lro, {
278
+ resumeFrom: options?.resumeFrom,
279
+ intervalInMs: options?.updateIntervalInMs,
280
+ lroResourceLocationConfig: "azure-async-operation"
281
+ });
282
+ await poller.poll();
283
+ return poller;
284
+ }
285
+
286
+ /**
287
+ * (INTERNAL - DO NOT USE) Creates or updates the specified private endpoint connection proxy resource
288
+ * associated with the device update account.
289
+ * @param resourceGroupName The resource group name.
290
+ * @param accountName Account name.
291
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
292
+ * @param privateEndpointConnectionProxy The parameters for creating a private endpoint connection
293
+ * proxy.
294
+ * @param options The options parameters.
295
+ */
296
+ async beginCreateOrUpdateAndWait(
297
+ resourceGroupName: string,
298
+ accountName: string,
299
+ privateEndpointConnectionProxyId: string,
300
+ privateEndpointConnectionProxy: PrivateEndpointConnectionProxy,
301
+ options?: PrivateEndpointConnectionProxiesCreateOrUpdateOptionalParams
302
+ ): Promise<PrivateEndpointConnectionProxiesCreateOrUpdateResponse> {
303
+ const poller = await this.beginCreateOrUpdate(
304
+ resourceGroupName,
305
+ accountName,
306
+ privateEndpointConnectionProxyId,
307
+ privateEndpointConnectionProxy,
308
+ options
309
+ );
310
+ return poller.pollUntilDone();
311
+ }
312
+
313
+ /**
314
+ * (INTERNAL - DO NOT USE) Deletes the specified private endpoint connection proxy associated with the
315
+ * device update account.
316
+ * @param resourceGroupName The resource group name.
317
+ * @param accountName Account name.
318
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
319
+ * @param options The options parameters.
320
+ */
321
+ async beginDelete(
322
+ resourceGroupName: string,
323
+ accountName: string,
324
+ privateEndpointConnectionProxyId: string,
325
+ options?: PrivateEndpointConnectionProxiesDeleteOptionalParams
326
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
327
+ const directSendOperation = async (
328
+ args: coreClient.OperationArguments,
329
+ spec: coreClient.OperationSpec
330
+ ): Promise<void> => {
331
+ return this.client.sendOperationRequest(args, spec);
332
+ };
333
+ const sendOperation = async (
334
+ args: coreClient.OperationArguments,
335
+ spec: coreClient.OperationSpec
336
+ ) => {
337
+ let currentRawResponse:
338
+ | coreClient.FullOperationResponse
339
+ | undefined = undefined;
340
+ const providedCallback = args.options?.onResponse;
341
+ const callback: coreClient.RawResponseCallback = (
342
+ rawResponse: coreClient.FullOperationResponse,
343
+ flatResponse: unknown
344
+ ) => {
345
+ currentRawResponse = rawResponse;
346
+ providedCallback?.(rawResponse, flatResponse);
347
+ };
348
+ const updatedArgs = {
349
+ ...args,
350
+ options: {
351
+ ...args.options,
352
+ onResponse: callback
353
+ }
354
+ };
355
+ const flatResponse = await directSendOperation(updatedArgs, spec);
356
+ return {
357
+ flatResponse,
358
+ rawResponse: {
359
+ statusCode: currentRawResponse!.status,
360
+ body: currentRawResponse!.parsedBody,
361
+ headers: currentRawResponse!.headers.toJSON()
362
+ }
363
+ };
364
+ };
365
+
366
+ const lro = new LroImpl(
367
+ sendOperation,
368
+ {
369
+ resourceGroupName,
370
+ accountName,
371
+ privateEndpointConnectionProxyId,
372
+ options
373
+ },
374
+ deleteOperationSpec
375
+ );
376
+ const poller = new LroEngine(lro, {
377
+ resumeFrom: options?.resumeFrom,
378
+ intervalInMs: options?.updateIntervalInMs,
379
+ lroResourceLocationConfig: "location"
380
+ });
381
+ await poller.poll();
382
+ return poller;
383
+ }
384
+
385
+ /**
386
+ * (INTERNAL - DO NOT USE) Deletes the specified private endpoint connection proxy associated with the
387
+ * device update account.
388
+ * @param resourceGroupName The resource group name.
389
+ * @param accountName Account name.
390
+ * @param privateEndpointConnectionProxyId The ID of the private endpoint connection proxy object.
391
+ * @param options The options parameters.
392
+ */
393
+ async beginDeleteAndWait(
394
+ resourceGroupName: string,
395
+ accountName: string,
396
+ privateEndpointConnectionProxyId: string,
397
+ options?: PrivateEndpointConnectionProxiesDeleteOptionalParams
398
+ ): Promise<void> {
399
+ const poller = await this.beginDelete(
400
+ resourceGroupName,
401
+ accountName,
402
+ privateEndpointConnectionProxyId,
403
+ options
404
+ );
405
+ return poller.pollUntilDone();
406
+ }
407
+ }
408
+ // Operation Specifications
409
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
410
+
411
+ const listByAccountOperationSpec: coreClient.OperationSpec = {
412
+ path:
413
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies",
414
+ httpMethod: "GET",
415
+ responses: {
416
+ 200: {
417
+ bodyMapper: Mappers.PrivateEndpointConnectionProxyListResult
418
+ },
419
+ default: {
420
+ bodyMapper: Mappers.ErrorResponse
421
+ }
422
+ },
423
+ queryParameters: [Parameters.apiVersion],
424
+ urlParameters: [
425
+ Parameters.$host,
426
+ Parameters.subscriptionId,
427
+ Parameters.resourceGroupName,
428
+ Parameters.accountName
429
+ ],
430
+ headerParameters: [Parameters.accept],
431
+ serializer
432
+ };
433
+ const validateOperationSpec: coreClient.OperationSpec = {
434
+ path:
435
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}/validate",
436
+ httpMethod: "POST",
437
+ responses: {
438
+ 200: {},
439
+ default: {
440
+ bodyMapper: Mappers.ErrorResponse
441
+ }
442
+ },
443
+ requestBody: Parameters.privateEndpointConnectionProxy,
444
+ queryParameters: [Parameters.apiVersion],
445
+ urlParameters: [
446
+ Parameters.$host,
447
+ Parameters.subscriptionId,
448
+ Parameters.resourceGroupName,
449
+ Parameters.accountName,
450
+ Parameters.privateEndpointConnectionProxyId
451
+ ],
452
+ headerParameters: [Parameters.contentType, Parameters.accept],
453
+ mediaType: "json",
454
+ serializer
455
+ };
456
+ const updatePrivateEndpointPropertiesOperationSpec: coreClient.OperationSpec = {
457
+ path:
458
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}/updatePrivateEndpointProperties",
459
+ httpMethod: "POST",
460
+ responses: {
461
+ 200: {},
462
+ default: {
463
+ bodyMapper: Mappers.ErrorResponse
464
+ }
465
+ },
466
+ requestBody: Parameters.privateEndpointUpdate,
467
+ queryParameters: [Parameters.apiVersion],
468
+ urlParameters: [
469
+ Parameters.$host,
470
+ Parameters.subscriptionId,
471
+ Parameters.resourceGroupName,
472
+ Parameters.accountName,
473
+ Parameters.privateEndpointConnectionProxyId
474
+ ],
475
+ headerParameters: [Parameters.contentType, Parameters.accept],
476
+ mediaType: "json",
477
+ serializer
478
+ };
479
+ const getOperationSpec: coreClient.OperationSpec = {
480
+ path:
481
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}",
482
+ httpMethod: "GET",
483
+ responses: {
484
+ 200: {
485
+ bodyMapper: Mappers.PrivateEndpointConnectionProxy
486
+ },
487
+ default: {
488
+ bodyMapper: Mappers.ErrorResponse
489
+ }
490
+ },
491
+ queryParameters: [Parameters.apiVersion],
492
+ urlParameters: [
493
+ Parameters.$host,
494
+ Parameters.subscriptionId,
495
+ Parameters.resourceGroupName,
496
+ Parameters.accountName,
497
+ Parameters.privateEndpointConnectionProxyId
498
+ ],
499
+ headerParameters: [Parameters.accept],
500
+ serializer
501
+ };
502
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
503
+ path:
504
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}",
505
+ httpMethod: "PUT",
506
+ responses: {
507
+ 200: {
508
+ bodyMapper: Mappers.PrivateEndpointConnectionProxy
509
+ },
510
+ 201: {
511
+ bodyMapper: Mappers.PrivateEndpointConnectionProxy
512
+ },
513
+ 202: {
514
+ bodyMapper: Mappers.PrivateEndpointConnectionProxy
515
+ },
516
+ 204: {
517
+ bodyMapper: Mappers.PrivateEndpointConnectionProxy
518
+ },
519
+ default: {
520
+ bodyMapper: Mappers.ErrorResponse
521
+ }
522
+ },
523
+ requestBody: Parameters.privateEndpointConnectionProxy,
524
+ queryParameters: [Parameters.apiVersion],
525
+ urlParameters: [
526
+ Parameters.$host,
527
+ Parameters.subscriptionId,
528
+ Parameters.resourceGroupName,
529
+ Parameters.accountName,
530
+ Parameters.privateEndpointConnectionProxyId
531
+ ],
532
+ headerParameters: [Parameters.contentType, Parameters.accept],
533
+ mediaType: "json",
534
+ serializer
535
+ };
536
+ const deleteOperationSpec: coreClient.OperationSpec = {
537
+ path:
538
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}",
539
+ httpMethod: "DELETE",
540
+ responses: {
541
+ 200: {},
542
+ 201: {},
543
+ 202: {},
544
+ 204: {},
545
+ default: {
546
+ bodyMapper: Mappers.ErrorResponse
547
+ }
548
+ },
549
+ queryParameters: [Parameters.apiVersion],
550
+ urlParameters: [
551
+ Parameters.$host,
552
+ Parameters.subscriptionId,
553
+ Parameters.resourceGroupName,
554
+ Parameters.accountName,
555
+ Parameters.privateEndpointConnectionProxyId
556
+ ],
557
+ headerParameters: [Parameters.accept],
558
+ serializer
559
+ };