@azure/arm-eventgrid 30.0.0-alpha.20210929.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 (222) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +94 -0
  4. package/dist/index.js +10620 -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/src/eventGridManagementClient.d.ts +31 -0
  9. package/dist-esm/src/eventGridManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/eventGridManagementClient.js +38 -0
  11. package/dist-esm/src/eventGridManagementClient.js.map +1 -0
  12. package/dist-esm/src/eventGridManagementClientContext.d.ts +17 -0
  13. package/dist-esm/src/eventGridManagementClientContext.d.ts.map +1 -0
  14. package/dist-esm/src/eventGridManagementClientContext.js +50 -0
  15. package/dist-esm/src/eventGridManagementClientContext.js.map +1 -0
  16. package/dist-esm/src/index.d.ts +6 -0
  17. package/dist-esm/src/index.d.ts.map +1 -0
  18. package/dist-esm/src/index.js +13 -0
  19. package/dist-esm/src/index.js.map +1 -0
  20. package/dist-esm/src/lroImpl.d.ts +16 -0
  21. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  22. package/dist-esm/src/lroImpl.js +29 -0
  23. package/dist-esm/src/lroImpl.js.map +1 -0
  24. package/dist-esm/src/models/index.d.ts +2765 -0
  25. package/dist-esm/src/models/index.d.ts.map +1 -0
  26. package/dist-esm/src/models/index.js +289 -0
  27. package/dist-esm/src/models/index.js.map +1 -0
  28. package/dist-esm/src/models/mappers.d.ts +139 -0
  29. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  30. package/dist-esm/src/models/mappers.js +2979 -0
  31. package/dist-esm/src/models/mappers.js.map +1 -0
  32. package/dist-esm/src/models/parameters.d.ts +53 -0
  33. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  34. package/dist-esm/src/models/parameters.js +415 -0
  35. package/dist-esm/src/models/parameters.js.map +1 -0
  36. package/dist-esm/src/operations/domainTopics.d.ts +79 -0
  37. package/dist-esm/src/operations/domainTopics.d.ts.map +1 -0
  38. package/dist-esm/src/operations/domainTopics.js +310 -0
  39. package/dist-esm/src/operations/domainTopics.js.map +1 -0
  40. package/dist-esm/src/operations/domains.d.ts +122 -0
  41. package/dist-esm/src/operations/domains.d.ts.map +1 -0
  42. package/dist-esm/src/operations/domains.js +522 -0
  43. package/dist-esm/src/operations/domains.js.map +1 -0
  44. package/dist-esm/src/operations/eventChannels.d.ts +72 -0
  45. package/dist-esm/src/operations/eventChannels.d.ts.map +1 -0
  46. package/dist-esm/src/operations/eventChannels.js +269 -0
  47. package/dist-esm/src/operations/eventChannels.js.map +1 -0
  48. package/dist-esm/src/operations/eventSubscriptions.d.ts +404 -0
  49. package/dist-esm/src/operations/eventSubscriptions.d.ts.map +1 -0
  50. package/dist-esm/src/operations/eventSubscriptions.js +1504 -0
  51. package/dist-esm/src/operations/eventSubscriptions.js.map +1 -0
  52. package/dist-esm/src/operations/extensionTopics.d.ts +24 -0
  53. package/dist-esm/src/operations/extensionTopics.d.ts.map +1 -0
  54. package/dist-esm/src/operations/extensionTopics.js +50 -0
  55. package/dist-esm/src/operations/extensionTopics.js.map +1 -0
  56. package/dist-esm/src/operations/index.d.ts +17 -0
  57. package/dist-esm/src/operations/index.d.ts.map +1 -0
  58. package/dist-esm/src/operations/index.js +24 -0
  59. package/dist-esm/src/operations/index.js.map +1 -0
  60. package/dist-esm/src/operations/operations.d.ts +26 -0
  61. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  62. package/dist-esm/src/operations/operations.js +88 -0
  63. package/dist-esm/src/operations/operations.js.map +1 -0
  64. package/dist-esm/src/operations/partnerNamespaces.d.ts +122 -0
  65. package/dist-esm/src/operations/partnerNamespaces.d.ts.map +1 -0
  66. package/dist-esm/src/operations/partnerNamespaces.js +537 -0
  67. package/dist-esm/src/operations/partnerNamespaces.js.map +1 -0
  68. package/dist-esm/src/operations/partnerRegistrations.d.ts +83 -0
  69. package/dist-esm/src/operations/partnerRegistrations.d.ts.map +1 -0
  70. package/dist-esm/src/operations/partnerRegistrations.js +349 -0
  71. package/dist-esm/src/operations/partnerRegistrations.js.map +1 -0
  72. package/dist-esm/src/operations/partnerTopicEventSubscriptions.d.ts +128 -0
  73. package/dist-esm/src/operations/partnerTopicEventSubscriptions.d.ts.map +1 -0
  74. package/dist-esm/src/operations/partnerTopicEventSubscriptions.js +483 -0
  75. package/dist-esm/src/operations/partnerTopicEventSubscriptions.js.map +1 -0
  76. package/dist-esm/src/operations/partnerTopics.d.ts +97 -0
  77. package/dist-esm/src/operations/partnerTopics.d.ts.map +1 -0
  78. package/dist-esm/src/operations/partnerTopics.js +408 -0
  79. package/dist-esm/src/operations/partnerTopics.js.map +1 -0
  80. package/dist-esm/src/operations/privateEndpointConnections.d.ts +105 -0
  81. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  82. package/dist-esm/src/operations/privateEndpointConnections.js +362 -0
  83. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  84. package/dist-esm/src/operations/privateLinkResources.d.ts +58 -0
  85. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  86. package/dist-esm/src/operations/privateLinkResources.js +184 -0
  87. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  88. package/dist-esm/src/operations/systemTopicEventSubscriptions.d.ts +128 -0
  89. package/dist-esm/src/operations/systemTopicEventSubscriptions.d.ts.map +1 -0
  90. package/dist-esm/src/operations/systemTopicEventSubscriptions.js +483 -0
  91. package/dist-esm/src/operations/systemTopicEventSubscriptions.js.map +1 -0
  92. package/dist-esm/src/operations/systemTopics.d.ts +107 -0
  93. package/dist-esm/src/operations/systemTopics.d.ts.map +1 -0
  94. package/dist-esm/src/operations/systemTopics.js +482 -0
  95. package/dist-esm/src/operations/systemTopics.js.map +1 -0
  96. package/dist-esm/src/operations/topicTypes.d.ts +46 -0
  97. package/dist-esm/src/operations/topicTypes.d.ts.map +1 -0
  98. package/dist-esm/src/operations/topicTypes.js +175 -0
  99. package/dist-esm/src/operations/topicTypes.js.map +1 -0
  100. package/dist-esm/src/operations/topics.d.ts +150 -0
  101. package/dist-esm/src/operations/topics.d.ts.map +1 -0
  102. package/dist-esm/src/operations/topics.js +656 -0
  103. package/dist-esm/src/operations/topics.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/domainTopics.d.ts +54 -0
  105. package/dist-esm/src/operationsInterfaces/domainTopics.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/domainTopics.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/domainTopics.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/domains.d.ts +86 -0
  109. package/dist-esm/src/operationsInterfaces/domains.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/domains.js +9 -0
  111. package/dist-esm/src/operationsInterfaces/domains.js.map +1 -0
  112. package/dist-esm/src/operationsInterfaces/eventChannels.d.ts +47 -0
  113. package/dist-esm/src/operationsInterfaces/eventChannels.d.ts.map +1 -0
  114. package/dist-esm/src/operationsInterfaces/eventChannels.js +9 -0
  115. package/dist-esm/src/operationsInterfaces/eventChannels.js.map +1 -0
  116. package/dist-esm/src/operationsInterfaces/eventSubscriptions.d.ts +217 -0
  117. package/dist-esm/src/operationsInterfaces/eventSubscriptions.d.ts.map +1 -0
  118. package/dist-esm/src/operationsInterfaces/eventSubscriptions.js +9 -0
  119. package/dist-esm/src/operationsInterfaces/eventSubscriptions.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/extensionTopics.d.ts +16 -0
  121. package/dist-esm/src/operationsInterfaces/extensionTopics.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/extensionTopics.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/extensionTopics.js.map +1 -0
  124. package/dist-esm/src/operationsInterfaces/index.d.ts +17 -0
  125. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  126. package/dist-esm/src/operationsInterfaces/index.js +24 -0
  127. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  128. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  129. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  130. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  131. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  132. package/dist-esm/src/operationsInterfaces/partnerNamespaces.d.ts +86 -0
  133. package/dist-esm/src/operationsInterfaces/partnerNamespaces.d.ts.map +1 -0
  134. package/dist-esm/src/operationsInterfaces/partnerNamespaces.js +9 -0
  135. package/dist-esm/src/operationsInterfaces/partnerNamespaces.js.map +1 -0
  136. package/dist-esm/src/operationsInterfaces/partnerRegistrations.d.ts +47 -0
  137. package/dist-esm/src/operationsInterfaces/partnerRegistrations.d.ts.map +1 -0
  138. package/dist-esm/src/operationsInterfaces/partnerRegistrations.js +9 -0
  139. package/dist-esm/src/operationsInterfaces/partnerRegistrations.js.map +1 -0
  140. package/dist-esm/src/operationsInterfaces/partnerTopicEventSubscriptions.d.ts +103 -0
  141. package/dist-esm/src/operationsInterfaces/partnerTopicEventSubscriptions.d.ts.map +1 -0
  142. package/dist-esm/src/operationsInterfaces/partnerTopicEventSubscriptions.js +9 -0
  143. package/dist-esm/src/operationsInterfaces/partnerTopicEventSubscriptions.js.map +1 -0
  144. package/dist-esm/src/operationsInterfaces/partnerTopics.d.ts +61 -0
  145. package/dist-esm/src/operationsInterfaces/partnerTopics.d.ts.map +1 -0
  146. package/dist-esm/src/operationsInterfaces/partnerTopics.js +9 -0
  147. package/dist-esm/src/operationsInterfaces/partnerTopics.js.map +1 -0
  148. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +74 -0
  149. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  150. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  151. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  152. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +27 -0
  153. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  154. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  155. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  156. package/dist-esm/src/operationsInterfaces/systemTopicEventSubscriptions.d.ts +103 -0
  157. package/dist-esm/src/operationsInterfaces/systemTopicEventSubscriptions.d.ts.map +1 -0
  158. package/dist-esm/src/operationsInterfaces/systemTopicEventSubscriptions.js +9 -0
  159. package/dist-esm/src/operationsInterfaces/systemTopicEventSubscriptions.js.map +1 -0
  160. package/dist-esm/src/operationsInterfaces/systemTopics.d.ts +71 -0
  161. package/dist-esm/src/operationsInterfaces/systemTopics.d.ts.map +1 -0
  162. package/dist-esm/src/operationsInterfaces/systemTopics.js +9 -0
  163. package/dist-esm/src/operationsInterfaces/systemTopics.js.map +1 -0
  164. package/dist-esm/src/operationsInterfaces/topicTypes.d.ts +23 -0
  165. package/dist-esm/src/operationsInterfaces/topicTypes.d.ts.map +1 -0
  166. package/dist-esm/src/operationsInterfaces/topicTypes.js +9 -0
  167. package/dist-esm/src/operationsInterfaces/topicTypes.js.map +1 -0
  168. package/dist-esm/src/operationsInterfaces/topics.d.ts +103 -0
  169. package/dist-esm/src/operationsInterfaces/topics.d.ts.map +1 -0
  170. package/dist-esm/src/operationsInterfaces/topics.js +9 -0
  171. package/dist-esm/src/operationsInterfaces/topics.js.map +1 -0
  172. package/dist-esm/test/eventgrid_examples.d.ts +2 -0
  173. package/dist-esm/test/eventgrid_examples.d.ts.map +1 -0
  174. package/dist-esm/test/eventgrid_examples.js +163 -0
  175. package/dist-esm/test/eventgrid_examples.js.map +1 -0
  176. package/package.json +102 -0
  177. package/review/arm-eventgrid.api.md +2518 -0
  178. package/rollup.config.js +188 -0
  179. package/src/eventGridManagementClient.ts +101 -0
  180. package/src/eventGridManagementClientContext.ts +71 -0
  181. package/src/index.ts +13 -0
  182. package/src/lroImpl.ts +34 -0
  183. package/src/models/index.ts +3297 -0
  184. package/src/models/mappers.ts +3334 -0
  185. package/src/models/parameters.ts +490 -0
  186. package/src/operations/domainTopics.ts +452 -0
  187. package/src/operations/domains.ts +713 -0
  188. package/src/operations/eventChannels.ts +382 -0
  189. package/src/operations/eventSubscriptions.ts +2077 -0
  190. package/src/operations/extensionTopics.ts +67 -0
  191. package/src/operations/index.ts +24 -0
  192. package/src/operations/operations.ts +96 -0
  193. package/src/operations/partnerNamespaces.ts +729 -0
  194. package/src/operations/partnerRegistrations.ts +440 -0
  195. package/src/operations/partnerTopicEventSubscriptions.ts +699 -0
  196. package/src/operations/partnerTopics.ts +532 -0
  197. package/src/operations/privateEndpointConnections.ts +529 -0
  198. package/src/operations/privateLinkResources.ts +259 -0
  199. package/src/operations/systemTopicEventSubscriptions.ts +699 -0
  200. package/src/operations/systemTopics.ts +656 -0
  201. package/src/operations/topicTypes.ts +202 -0
  202. package/src/operations/topics.ts +921 -0
  203. package/src/operationsInterfaces/domainTopics.ts +105 -0
  204. package/src/operationsInterfaces/domains.ts +162 -0
  205. package/src/operationsInterfaces/eventChannels.ts +89 -0
  206. package/src/operationsInterfaces/eventSubscriptions.ts +339 -0
  207. package/src/operationsInterfaces/extensionTopics.ts +30 -0
  208. package/src/operationsInterfaces/index.ts +24 -0
  209. package/src/operationsInterfaces/operations.ts +22 -0
  210. package/src/operationsInterfaces/partnerNamespaces.ts +162 -0
  211. package/src/operationsInterfaces/partnerRegistrations.ts +91 -0
  212. package/src/operationsInterfaces/partnerTopicEventSubscriptions.ts +190 -0
  213. package/src/operationsInterfaces/partnerTopics.ts +114 -0
  214. package/src/operationsInterfaces/privateEndpointConnections.ts +137 -0
  215. package/src/operationsInterfaces/privateLinkResources.ts +52 -0
  216. package/src/operationsInterfaces/systemTopicEventSubscriptions.ts +190 -0
  217. package/src/operationsInterfaces/systemTopics.ts +139 -0
  218. package/src/operationsInterfaces/topicTypes.ts +47 -0
  219. package/src/operationsInterfaces/topics.ts +197 -0
  220. package/tsconfig.json +19 -0
  221. package/types/arm-eventgrid.d.ts +4299 -0
  222. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,713 @@
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 { Domains } 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 { EventGridManagementClientContext } from "../eventGridManagementClientContext";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ Domain,
19
+ DomainsListBySubscriptionNextOptionalParams,
20
+ DomainsListBySubscriptionOptionalParams,
21
+ DomainsListByResourceGroupNextOptionalParams,
22
+ DomainsListByResourceGroupOptionalParams,
23
+ DomainsGetOptionalParams,
24
+ DomainsGetResponse,
25
+ DomainsCreateOrUpdateOptionalParams,
26
+ DomainsCreateOrUpdateResponse,
27
+ DomainsDeleteOptionalParams,
28
+ DomainUpdateParameters,
29
+ DomainsUpdateOptionalParams,
30
+ DomainsListBySubscriptionResponse,
31
+ DomainsListByResourceGroupResponse,
32
+ DomainsListSharedAccessKeysOptionalParams,
33
+ DomainsListSharedAccessKeysResponse,
34
+ DomainRegenerateKeyRequest,
35
+ DomainsRegenerateKeyOptionalParams,
36
+ DomainsRegenerateKeyResponse,
37
+ DomainsListBySubscriptionNextResponse,
38
+ DomainsListByResourceGroupNextResponse
39
+ } from "../models";
40
+
41
+ /// <reference lib="esnext.asynciterable" />
42
+ /** Class containing Domains operations. */
43
+ export class DomainsImpl implements Domains {
44
+ private readonly client: EventGridManagementClientContext;
45
+
46
+ /**
47
+ * Initialize a new instance of the class Domains class.
48
+ * @param client Reference to the service client
49
+ */
50
+ constructor(client: EventGridManagementClientContext) {
51
+ this.client = client;
52
+ }
53
+
54
+ /**
55
+ * List all the domains under an Azure subscription.
56
+ * @param options The options parameters.
57
+ */
58
+ public listBySubscription(
59
+ options?: DomainsListBySubscriptionOptionalParams
60
+ ): PagedAsyncIterableIterator<Domain> {
61
+ const iter = this.listBySubscriptionPagingAll(options);
62
+ return {
63
+ next() {
64
+ return iter.next();
65
+ },
66
+ [Symbol.asyncIterator]() {
67
+ return this;
68
+ },
69
+ byPage: () => {
70
+ return this.listBySubscriptionPagingPage(options);
71
+ }
72
+ };
73
+ }
74
+
75
+ private async *listBySubscriptionPagingPage(
76
+ options?: DomainsListBySubscriptionOptionalParams
77
+ ): AsyncIterableIterator<Domain[]> {
78
+ let result = await this._listBySubscription(options);
79
+ yield result.value || [];
80
+ let continuationToken = result.nextLink;
81
+ while (continuationToken) {
82
+ result = await this._listBySubscriptionNext(continuationToken, options);
83
+ continuationToken = result.nextLink;
84
+ yield result.value || [];
85
+ }
86
+ }
87
+
88
+ private async *listBySubscriptionPagingAll(
89
+ options?: DomainsListBySubscriptionOptionalParams
90
+ ): AsyncIterableIterator<Domain> {
91
+ for await (const page of this.listBySubscriptionPagingPage(options)) {
92
+ yield* page;
93
+ }
94
+ }
95
+
96
+ /**
97
+ * List all the domains under a resource group.
98
+ * @param resourceGroupName The name of the resource group within the user's subscription.
99
+ * @param options The options parameters.
100
+ */
101
+ public listByResourceGroup(
102
+ resourceGroupName: string,
103
+ options?: DomainsListByResourceGroupOptionalParams
104
+ ): PagedAsyncIterableIterator<Domain> {
105
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
106
+ return {
107
+ next() {
108
+ return iter.next();
109
+ },
110
+ [Symbol.asyncIterator]() {
111
+ return this;
112
+ },
113
+ byPage: () => {
114
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
115
+ }
116
+ };
117
+ }
118
+
119
+ private async *listByResourceGroupPagingPage(
120
+ resourceGroupName: string,
121
+ options?: DomainsListByResourceGroupOptionalParams
122
+ ): AsyncIterableIterator<Domain[]> {
123
+ let result = await this._listByResourceGroup(resourceGroupName, options);
124
+ yield result.value || [];
125
+ let continuationToken = result.nextLink;
126
+ while (continuationToken) {
127
+ result = await this._listByResourceGroupNext(
128
+ resourceGroupName,
129
+ continuationToken,
130
+ options
131
+ );
132
+ continuationToken = result.nextLink;
133
+ yield result.value || [];
134
+ }
135
+ }
136
+
137
+ private async *listByResourceGroupPagingAll(
138
+ resourceGroupName: string,
139
+ options?: DomainsListByResourceGroupOptionalParams
140
+ ): AsyncIterableIterator<Domain> {
141
+ for await (const page of this.listByResourceGroupPagingPage(
142
+ resourceGroupName,
143
+ options
144
+ )) {
145
+ yield* page;
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Get properties of a domain.
151
+ * @param resourceGroupName The name of the resource group within the user's subscription.
152
+ * @param domainName Name of the domain.
153
+ * @param options The options parameters.
154
+ */
155
+ get(
156
+ resourceGroupName: string,
157
+ domainName: string,
158
+ options?: DomainsGetOptionalParams
159
+ ): Promise<DomainsGetResponse> {
160
+ return this.client.sendOperationRequest(
161
+ { resourceGroupName, domainName, options },
162
+ getOperationSpec
163
+ );
164
+ }
165
+
166
+ /**
167
+ * Asynchronously creates or updates a new domain with the specified parameters.
168
+ * @param resourceGroupName The name of the resource group within the user's subscription.
169
+ * @param domainName Name of the domain.
170
+ * @param domainInfo Domain information.
171
+ * @param options The options parameters.
172
+ */
173
+ async beginCreateOrUpdate(
174
+ resourceGroupName: string,
175
+ domainName: string,
176
+ domainInfo: Domain,
177
+ options?: DomainsCreateOrUpdateOptionalParams
178
+ ): Promise<
179
+ PollerLike<
180
+ PollOperationState<DomainsCreateOrUpdateResponse>,
181
+ DomainsCreateOrUpdateResponse
182
+ >
183
+ > {
184
+ const directSendOperation = async (
185
+ args: coreClient.OperationArguments,
186
+ spec: coreClient.OperationSpec
187
+ ): Promise<DomainsCreateOrUpdateResponse> => {
188
+ return this.client.sendOperationRequest(args, spec);
189
+ };
190
+ const sendOperation = async (
191
+ args: coreClient.OperationArguments,
192
+ spec: coreClient.OperationSpec
193
+ ) => {
194
+ let currentRawResponse:
195
+ | coreClient.FullOperationResponse
196
+ | undefined = undefined;
197
+ const providedCallback = args.options?.onResponse;
198
+ const callback: coreClient.RawResponseCallback = (
199
+ rawResponse: coreClient.FullOperationResponse,
200
+ flatResponse: unknown
201
+ ) => {
202
+ currentRawResponse = rawResponse;
203
+ providedCallback?.(rawResponse, flatResponse);
204
+ };
205
+ const updatedArgs = {
206
+ ...args,
207
+ options: {
208
+ ...args.options,
209
+ onResponse: callback
210
+ }
211
+ };
212
+ const flatResponse = await directSendOperation(updatedArgs, spec);
213
+ return {
214
+ flatResponse,
215
+ rawResponse: {
216
+ statusCode: currentRawResponse!.status,
217
+ body: currentRawResponse!.parsedBody,
218
+ headers: currentRawResponse!.headers.toJSON()
219
+ }
220
+ };
221
+ };
222
+
223
+ const lro = new LroImpl(
224
+ sendOperation,
225
+ { resourceGroupName, domainName, domainInfo, options },
226
+ createOrUpdateOperationSpec
227
+ );
228
+ return new LroEngine(lro, {
229
+ resumeFrom: options?.resumeFrom,
230
+ intervalInMs: options?.updateIntervalInMs
231
+ });
232
+ }
233
+
234
+ /**
235
+ * Asynchronously creates or updates a new domain with the specified parameters.
236
+ * @param resourceGroupName The name of the resource group within the user's subscription.
237
+ * @param domainName Name of the domain.
238
+ * @param domainInfo Domain information.
239
+ * @param options The options parameters.
240
+ */
241
+ async beginCreateOrUpdateAndWait(
242
+ resourceGroupName: string,
243
+ domainName: string,
244
+ domainInfo: Domain,
245
+ options?: DomainsCreateOrUpdateOptionalParams
246
+ ): Promise<DomainsCreateOrUpdateResponse> {
247
+ const poller = await this.beginCreateOrUpdate(
248
+ resourceGroupName,
249
+ domainName,
250
+ domainInfo,
251
+ options
252
+ );
253
+ return poller.pollUntilDone();
254
+ }
255
+
256
+ /**
257
+ * Delete existing domain.
258
+ * @param resourceGroupName The name of the resource group within the user's subscription.
259
+ * @param domainName Name of the domain.
260
+ * @param options The options parameters.
261
+ */
262
+ async beginDelete(
263
+ resourceGroupName: string,
264
+ domainName: string,
265
+ options?: DomainsDeleteOptionalParams
266
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
267
+ const directSendOperation = async (
268
+ args: coreClient.OperationArguments,
269
+ spec: coreClient.OperationSpec
270
+ ): Promise<void> => {
271
+ return this.client.sendOperationRequest(args, spec);
272
+ };
273
+ const sendOperation = async (
274
+ args: coreClient.OperationArguments,
275
+ spec: coreClient.OperationSpec
276
+ ) => {
277
+ let currentRawResponse:
278
+ | coreClient.FullOperationResponse
279
+ | undefined = undefined;
280
+ const providedCallback = args.options?.onResponse;
281
+ const callback: coreClient.RawResponseCallback = (
282
+ rawResponse: coreClient.FullOperationResponse,
283
+ flatResponse: unknown
284
+ ) => {
285
+ currentRawResponse = rawResponse;
286
+ providedCallback?.(rawResponse, flatResponse);
287
+ };
288
+ const updatedArgs = {
289
+ ...args,
290
+ options: {
291
+ ...args.options,
292
+ onResponse: callback
293
+ }
294
+ };
295
+ const flatResponse = await directSendOperation(updatedArgs, spec);
296
+ return {
297
+ flatResponse,
298
+ rawResponse: {
299
+ statusCode: currentRawResponse!.status,
300
+ body: currentRawResponse!.parsedBody,
301
+ headers: currentRawResponse!.headers.toJSON()
302
+ }
303
+ };
304
+ };
305
+
306
+ const lro = new LroImpl(
307
+ sendOperation,
308
+ { resourceGroupName, domainName, options },
309
+ deleteOperationSpec
310
+ );
311
+ return new LroEngine(lro, {
312
+ resumeFrom: options?.resumeFrom,
313
+ intervalInMs: options?.updateIntervalInMs
314
+ });
315
+ }
316
+
317
+ /**
318
+ * Delete existing domain.
319
+ * @param resourceGroupName The name of the resource group within the user's subscription.
320
+ * @param domainName Name of the domain.
321
+ * @param options The options parameters.
322
+ */
323
+ async beginDeleteAndWait(
324
+ resourceGroupName: string,
325
+ domainName: string,
326
+ options?: DomainsDeleteOptionalParams
327
+ ): Promise<void> {
328
+ const poller = await this.beginDelete(
329
+ resourceGroupName,
330
+ domainName,
331
+ options
332
+ );
333
+ return poller.pollUntilDone();
334
+ }
335
+
336
+ /**
337
+ * Asynchronously updates a domain with the specified parameters.
338
+ * @param resourceGroupName The name of the resource group within the user's subscription.
339
+ * @param domainName Name of the domain.
340
+ * @param domainUpdateParameters Domain update information.
341
+ * @param options The options parameters.
342
+ */
343
+ async beginUpdate(
344
+ resourceGroupName: string,
345
+ domainName: string,
346
+ domainUpdateParameters: DomainUpdateParameters,
347
+ options?: DomainsUpdateOptionalParams
348
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
349
+ const directSendOperation = async (
350
+ args: coreClient.OperationArguments,
351
+ spec: coreClient.OperationSpec
352
+ ): Promise<void> => {
353
+ return this.client.sendOperationRequest(args, spec);
354
+ };
355
+ const sendOperation = async (
356
+ args: coreClient.OperationArguments,
357
+ spec: coreClient.OperationSpec
358
+ ) => {
359
+ let currentRawResponse:
360
+ | coreClient.FullOperationResponse
361
+ | undefined = undefined;
362
+ const providedCallback = args.options?.onResponse;
363
+ const callback: coreClient.RawResponseCallback = (
364
+ rawResponse: coreClient.FullOperationResponse,
365
+ flatResponse: unknown
366
+ ) => {
367
+ currentRawResponse = rawResponse;
368
+ providedCallback?.(rawResponse, flatResponse);
369
+ };
370
+ const updatedArgs = {
371
+ ...args,
372
+ options: {
373
+ ...args.options,
374
+ onResponse: callback
375
+ }
376
+ };
377
+ const flatResponse = await directSendOperation(updatedArgs, spec);
378
+ return {
379
+ flatResponse,
380
+ rawResponse: {
381
+ statusCode: currentRawResponse!.status,
382
+ body: currentRawResponse!.parsedBody,
383
+ headers: currentRawResponse!.headers.toJSON()
384
+ }
385
+ };
386
+ };
387
+
388
+ const lro = new LroImpl(
389
+ sendOperation,
390
+ { resourceGroupName, domainName, domainUpdateParameters, options },
391
+ updateOperationSpec
392
+ );
393
+ return new LroEngine(lro, {
394
+ resumeFrom: options?.resumeFrom,
395
+ intervalInMs: options?.updateIntervalInMs
396
+ });
397
+ }
398
+
399
+ /**
400
+ * Asynchronously updates a domain with the specified parameters.
401
+ * @param resourceGroupName The name of the resource group within the user's subscription.
402
+ * @param domainName Name of the domain.
403
+ * @param domainUpdateParameters Domain update information.
404
+ * @param options The options parameters.
405
+ */
406
+ async beginUpdateAndWait(
407
+ resourceGroupName: string,
408
+ domainName: string,
409
+ domainUpdateParameters: DomainUpdateParameters,
410
+ options?: DomainsUpdateOptionalParams
411
+ ): Promise<void> {
412
+ const poller = await this.beginUpdate(
413
+ resourceGroupName,
414
+ domainName,
415
+ domainUpdateParameters,
416
+ options
417
+ );
418
+ return poller.pollUntilDone();
419
+ }
420
+
421
+ /**
422
+ * List all the domains under an Azure subscription.
423
+ * @param options The options parameters.
424
+ */
425
+ private _listBySubscription(
426
+ options?: DomainsListBySubscriptionOptionalParams
427
+ ): Promise<DomainsListBySubscriptionResponse> {
428
+ return this.client.sendOperationRequest(
429
+ { options },
430
+ listBySubscriptionOperationSpec
431
+ );
432
+ }
433
+
434
+ /**
435
+ * List all the domains under a resource group.
436
+ * @param resourceGroupName The name of the resource group within the user's subscription.
437
+ * @param options The options parameters.
438
+ */
439
+ private _listByResourceGroup(
440
+ resourceGroupName: string,
441
+ options?: DomainsListByResourceGroupOptionalParams
442
+ ): Promise<DomainsListByResourceGroupResponse> {
443
+ return this.client.sendOperationRequest(
444
+ { resourceGroupName, options },
445
+ listByResourceGroupOperationSpec
446
+ );
447
+ }
448
+
449
+ /**
450
+ * List the two keys used to publish to a domain.
451
+ * @param resourceGroupName The name of the resource group within the user's subscription.
452
+ * @param domainName Name of the domain.
453
+ * @param options The options parameters.
454
+ */
455
+ listSharedAccessKeys(
456
+ resourceGroupName: string,
457
+ domainName: string,
458
+ options?: DomainsListSharedAccessKeysOptionalParams
459
+ ): Promise<DomainsListSharedAccessKeysResponse> {
460
+ return this.client.sendOperationRequest(
461
+ { resourceGroupName, domainName, options },
462
+ listSharedAccessKeysOperationSpec
463
+ );
464
+ }
465
+
466
+ /**
467
+ * Regenerate a shared access key for a domain.
468
+ * @param resourceGroupName The name of the resource group within the user's subscription.
469
+ * @param domainName Name of the domain.
470
+ * @param regenerateKeyRequest Request body to regenerate key.
471
+ * @param options The options parameters.
472
+ */
473
+ regenerateKey(
474
+ resourceGroupName: string,
475
+ domainName: string,
476
+ regenerateKeyRequest: DomainRegenerateKeyRequest,
477
+ options?: DomainsRegenerateKeyOptionalParams
478
+ ): Promise<DomainsRegenerateKeyResponse> {
479
+ return this.client.sendOperationRequest(
480
+ { resourceGroupName, domainName, regenerateKeyRequest, options },
481
+ regenerateKeyOperationSpec
482
+ );
483
+ }
484
+
485
+ /**
486
+ * ListBySubscriptionNext
487
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
488
+ * @param options The options parameters.
489
+ */
490
+ private _listBySubscriptionNext(
491
+ nextLink: string,
492
+ options?: DomainsListBySubscriptionNextOptionalParams
493
+ ): Promise<DomainsListBySubscriptionNextResponse> {
494
+ return this.client.sendOperationRequest(
495
+ { nextLink, options },
496
+ listBySubscriptionNextOperationSpec
497
+ );
498
+ }
499
+
500
+ /**
501
+ * ListByResourceGroupNext
502
+ * @param resourceGroupName The name of the resource group within the user's subscription.
503
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
504
+ * @param options The options parameters.
505
+ */
506
+ private _listByResourceGroupNext(
507
+ resourceGroupName: string,
508
+ nextLink: string,
509
+ options?: DomainsListByResourceGroupNextOptionalParams
510
+ ): Promise<DomainsListByResourceGroupNextResponse> {
511
+ return this.client.sendOperationRequest(
512
+ { resourceGroupName, nextLink, options },
513
+ listByResourceGroupNextOperationSpec
514
+ );
515
+ }
516
+ }
517
+ // Operation Specifications
518
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
519
+
520
+ const getOperationSpec: coreClient.OperationSpec = {
521
+ path:
522
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}",
523
+ httpMethod: "GET",
524
+ responses: {
525
+ 200: {
526
+ bodyMapper: Mappers.Domain
527
+ },
528
+ default: {}
529
+ },
530
+ queryParameters: [Parameters.apiVersion],
531
+ urlParameters: [
532
+ Parameters.$host,
533
+ Parameters.subscriptionId,
534
+ Parameters.resourceGroupName,
535
+ Parameters.domainName
536
+ ],
537
+ headerParameters: [Parameters.accept],
538
+ serializer
539
+ };
540
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
541
+ path:
542
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}",
543
+ httpMethod: "PUT",
544
+ responses: {
545
+ 200: {
546
+ bodyMapper: Mappers.Domain
547
+ },
548
+ 201: {
549
+ bodyMapper: Mappers.Domain
550
+ },
551
+ 202: {
552
+ bodyMapper: Mappers.Domain
553
+ },
554
+ 204: {
555
+ bodyMapper: Mappers.Domain
556
+ },
557
+ default: {}
558
+ },
559
+ requestBody: Parameters.domainInfo,
560
+ queryParameters: [Parameters.apiVersion],
561
+ urlParameters: [
562
+ Parameters.$host,
563
+ Parameters.subscriptionId,
564
+ Parameters.resourceGroupName,
565
+ Parameters.domainName
566
+ ],
567
+ headerParameters: [Parameters.accept, Parameters.contentType],
568
+ mediaType: "json",
569
+ serializer
570
+ };
571
+ const deleteOperationSpec: coreClient.OperationSpec = {
572
+ path:
573
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}",
574
+ httpMethod: "DELETE",
575
+ responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
576
+ queryParameters: [Parameters.apiVersion],
577
+ urlParameters: [
578
+ Parameters.$host,
579
+ Parameters.subscriptionId,
580
+ Parameters.resourceGroupName,
581
+ Parameters.domainName
582
+ ],
583
+ serializer
584
+ };
585
+ const updateOperationSpec: coreClient.OperationSpec = {
586
+ path:
587
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}",
588
+ httpMethod: "PATCH",
589
+ responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
590
+ requestBody: Parameters.domainUpdateParameters,
591
+ queryParameters: [Parameters.apiVersion],
592
+ urlParameters: [
593
+ Parameters.$host,
594
+ Parameters.subscriptionId,
595
+ Parameters.resourceGroupName,
596
+ Parameters.domainName
597
+ ],
598
+ headerParameters: [Parameters.accept, Parameters.contentType],
599
+ mediaType: "json",
600
+ serializer
601
+ };
602
+ const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
603
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains",
604
+ httpMethod: "GET",
605
+ responses: {
606
+ 200: {
607
+ bodyMapper: Mappers.DomainsListResult
608
+ },
609
+ default: {}
610
+ },
611
+ queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top],
612
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
613
+ headerParameters: [Parameters.accept],
614
+ serializer
615
+ };
616
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
617
+ path:
618
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains",
619
+ httpMethod: "GET",
620
+ responses: {
621
+ 200: {
622
+ bodyMapper: Mappers.DomainsListResult
623
+ },
624
+ default: {}
625
+ },
626
+ queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top],
627
+ urlParameters: [
628
+ Parameters.$host,
629
+ Parameters.subscriptionId,
630
+ Parameters.resourceGroupName
631
+ ],
632
+ headerParameters: [Parameters.accept],
633
+ serializer
634
+ };
635
+ const listSharedAccessKeysOperationSpec: coreClient.OperationSpec = {
636
+ path:
637
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys",
638
+ httpMethod: "POST",
639
+ responses: {
640
+ 200: {
641
+ bodyMapper: Mappers.DomainSharedAccessKeys
642
+ },
643
+ default: {}
644
+ },
645
+ queryParameters: [Parameters.apiVersion],
646
+ urlParameters: [
647
+ Parameters.$host,
648
+ Parameters.subscriptionId,
649
+ Parameters.resourceGroupName,
650
+ Parameters.domainName
651
+ ],
652
+ headerParameters: [Parameters.accept],
653
+ serializer
654
+ };
655
+ const regenerateKeyOperationSpec: coreClient.OperationSpec = {
656
+ path:
657
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey",
658
+ httpMethod: "POST",
659
+ responses: {
660
+ 200: {
661
+ bodyMapper: Mappers.DomainSharedAccessKeys
662
+ },
663
+ default: {}
664
+ },
665
+ requestBody: Parameters.regenerateKeyRequest,
666
+ queryParameters: [Parameters.apiVersion],
667
+ urlParameters: [
668
+ Parameters.$host,
669
+ Parameters.subscriptionId,
670
+ Parameters.resourceGroupName,
671
+ Parameters.domainName
672
+ ],
673
+ headerParameters: [Parameters.accept, Parameters.contentType],
674
+ mediaType: "json",
675
+ serializer
676
+ };
677
+ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
678
+ path: "{nextLink}",
679
+ httpMethod: "GET",
680
+ responses: {
681
+ 200: {
682
+ bodyMapper: Mappers.DomainsListResult
683
+ },
684
+ default: {}
685
+ },
686
+ queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top],
687
+ urlParameters: [
688
+ Parameters.$host,
689
+ Parameters.subscriptionId,
690
+ Parameters.nextLink
691
+ ],
692
+ headerParameters: [Parameters.accept],
693
+ serializer
694
+ };
695
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
696
+ path: "{nextLink}",
697
+ httpMethod: "GET",
698
+ responses: {
699
+ 200: {
700
+ bodyMapper: Mappers.DomainsListResult
701
+ },
702
+ default: {}
703
+ },
704
+ queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.top],
705
+ urlParameters: [
706
+ Parameters.$host,
707
+ Parameters.subscriptionId,
708
+ Parameters.resourceGroupName,
709
+ Parameters.nextLink
710
+ ],
711
+ headerParameters: [Parameters.accept],
712
+ serializer
713
+ };