@azure/arm-healthbot 1.1.1 → 2.0.1-alpha.20220131.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 (118) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -83
  4. package/dist/index.js +1301 -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/healthbotClient.d.ts +19 -0
  9. package/dist-esm/src/healthbotClient.d.ts.map +1 -0
  10. package/dist-esm/src/healthbotClient.js +52 -0
  11. package/dist-esm/src/healthbotClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/lroImpl.d.ts +16 -0
  17. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  18. package/dist-esm/src/lroImpl.js +29 -0
  19. package/dist-esm/src/lroImpl.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +309 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +16 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +19 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/{esm → dist-esm/src}/models/mappers.js +252 -199
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +12 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/dist-esm/src/models/parameters.js +112 -0
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/dist-esm/src/operations/bots.d.ts +99 -0
  33. package/dist-esm/src/operations/bots.d.ts.map +1 -0
  34. package/dist-esm/src/operations/bots.js +454 -0
  35. package/dist-esm/src/operations/bots.js.map +1 -0
  36. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +1 -2
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/operations.d.ts +32 -0
  41. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/operations.js +120 -0
  43. package/dist-esm/src/operations/operations.js.map +1 -0
  44. package/dist-esm/src/operationsInterfaces/bots.d.ts +63 -0
  45. package/dist-esm/src/operationsInterfaces/bots.d.ts.map +1 -0
  46. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/bots.js} +2 -1
  47. package/dist-esm/src/operationsInterfaces/bots.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
  49. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  50. package/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/index.js} +3 -2
  51. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  53. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  56. package/dist-esm/test/sampleTest.d.ts +2 -0
  57. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  58. package/dist-esm/test/sampleTest.js +40 -0
  59. package/dist-esm/test/sampleTest.js.map +1 -0
  60. package/package.json +65 -22
  61. package/review/arm-healthbot.api.md +271 -0
  62. package/rollup.config.js +181 -30
  63. package/src/healthbotClient.ts +62 -34
  64. package/src/index.ts +12 -0
  65. package/src/lroImpl.ts +34 -0
  66. package/src/models/index.ts +239 -394
  67. package/src/models/mappers.ts +260 -204
  68. package/src/models/parameters.ts +81 -33
  69. package/src/operations/bots.ts +424 -322
  70. package/src/operations/index.ts +1 -2
  71. package/src/operations/operations.ts +87 -75
  72. package/src/operationsInterfaces/bots.ts +116 -0
  73. package/src/{models/operationsMappers.ts → operationsInterfaces/index.ts} +2 -8
  74. package/src/operationsInterfaces/operations.ts +22 -0
  75. package/tsconfig.json +3 -3
  76. package/types/arm-healthbot.d.ts +439 -0
  77. package/types/tsdoc-metadata.json +11 -0
  78. package/dist/arm-healthbot.js +0 -1143
  79. package/dist/arm-healthbot.js.map +0 -1
  80. package/dist/arm-healthbot.min.js +0 -1
  81. package/dist/arm-healthbot.min.js.map +0 -1
  82. package/esm/healthbotClient.d.ts +0 -25
  83. package/esm/healthbotClient.d.ts.map +0 -1
  84. package/esm/healthbotClient.js +0 -38
  85. package/esm/healthbotClient.js.map +0 -1
  86. package/esm/healthbotClientContext.d.ts +0 -22
  87. package/esm/healthbotClientContext.d.ts.map +0 -1
  88. package/esm/healthbotClientContext.js +0 -60
  89. package/esm/healthbotClientContext.js.map +0 -1
  90. package/esm/models/botsMappers.d.ts +0 -2
  91. package/esm/models/botsMappers.d.ts.map +0 -1
  92. package/esm/models/botsMappers.js +0 -9
  93. package/esm/models/botsMappers.js.map +0 -1
  94. package/esm/models/index.d.ts +0 -464
  95. package/esm/models/index.d.ts.map +0 -1
  96. package/esm/models/index.js.map +0 -1
  97. package/esm/models/mappers.d.ts +0 -19
  98. package/esm/models/mappers.d.ts.map +0 -1
  99. package/esm/models/mappers.js.map +0 -1
  100. package/esm/models/operationsMappers.d.ts +0 -2
  101. package/esm/models/operationsMappers.d.ts.map +0 -1
  102. package/esm/models/operationsMappers.js.map +0 -1
  103. package/esm/models/parameters.d.ts +0 -8
  104. package/esm/models/parameters.d.ts.map +0 -1
  105. package/esm/models/parameters.js +0 -80
  106. package/esm/models/parameters.js.map +0 -1
  107. package/esm/operations/bots.d.ts +0 -162
  108. package/esm/operations/bots.d.ts.map +0 -1
  109. package/esm/operations/bots.js +0 -319
  110. package/esm/operations/bots.js.map +0 -1
  111. package/esm/operations/index.d.ts.map +0 -1
  112. package/esm/operations/index.js.map +0 -1
  113. package/esm/operations/operations.d.ts +0 -46
  114. package/esm/operations/operations.d.ts.map +0 -1
  115. package/esm/operations/operations.js +0 -79
  116. package/esm/operations/operations.js.map +0 -1
  117. package/src/healthbotClientContext.ts +0 -67
  118. package/src/models/botsMappers.ts +0 -22
@@ -3,285 +3,440 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as msRestAzure from "@azure/ms-rest-azure-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/botsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Bots } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { HealthbotClientContext } from "../healthbotClientContext";
14
+ import { HealthbotClient } from "../healthbotClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ HealthBot,
19
+ BotsListByResourceGroupNextOptionalParams,
20
+ BotsListByResourceGroupOptionalParams,
21
+ BotsListNextOptionalParams,
22
+ BotsListOptionalParams,
23
+ BotsCreateOptionalParams,
24
+ BotsCreateResponse,
25
+ BotsGetOptionalParams,
26
+ BotsGetResponse,
27
+ HealthBotUpdateParameters,
28
+ BotsUpdateOptionalParams,
29
+ BotsUpdateResponse,
30
+ BotsDeleteOptionalParams,
31
+ BotsListByResourceGroupResponse,
32
+ BotsListResponse,
33
+ BotsListByResourceGroupNextResponse,
34
+ BotsListNextResponse
35
+ } from "../models";
16
36
 
17
- /** Class representing a Bots. */
18
- export class Bots {
19
- private readonly client: HealthbotClientContext;
37
+ /// <reference lib="esnext.asynciterable" />
38
+ /** Class containing Bots operations. */
39
+ export class BotsImpl implements Bots {
40
+ private readonly client: HealthbotClient;
20
41
 
21
42
  /**
22
- * Create a Bots.
23
- * @param {HealthbotClientContext} client Reference to the service client.
43
+ * Initialize a new instance of the class Bots class.
44
+ * @param client Reference to the service client
24
45
  */
25
- constructor(client: HealthbotClientContext) {
46
+ constructor(client: HealthbotClient) {
26
47
  this.client = client;
27
48
  }
28
49
 
29
50
  /**
30
- * Create a new HealthBot.
51
+ * Returns all the resources of a particular type belonging to a resource group
31
52
  * @param resourceGroupName The name of the Bot resource group in the user subscription.
32
- * @param botName The name of the Bot resource.
33
- * @param parameters The parameters to provide for the created bot.
34
- * @param [options] The optional parameters
35
- * @returns Promise<Models.BotsCreateResponse>
53
+ * @param options The options parameters.
36
54
  */
37
- create(resourceGroupName: string, botName: string, parameters: Models.HealthBot, options?: msRest.RequestOptionsBase): Promise<Models.BotsCreateResponse> {
38
- return this.beginCreate(resourceGroupName,botName,parameters,options)
39
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.BotsCreateResponse>;
55
+ public listByResourceGroup(
56
+ resourceGroupName: string,
57
+ options?: BotsListByResourceGroupOptionalParams
58
+ ): PagedAsyncIterableIterator<HealthBot> {
59
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
60
+ return {
61
+ next() {
62
+ return iter.next();
63
+ },
64
+ [Symbol.asyncIterator]() {
65
+ return this;
66
+ },
67
+ byPage: () => {
68
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
69
+ }
70
+ };
40
71
  }
41
72
 
42
- /**
43
- * Get a HealthBot.
44
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
45
- * @param botName The name of the Bot resource.
46
- * @param [options] The optional parameters
47
- * @returns Promise<Models.BotsGetResponse>
48
- */
49
- get(resourceGroupName: string, botName: string, options?: msRest.RequestOptionsBase): Promise<Models.BotsGetResponse>;
50
- /**
51
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
52
- * @param botName The name of the Bot resource.
53
- * @param callback The callback
54
- */
55
- get(resourceGroupName: string, botName: string, callback: msRest.ServiceCallback<Models.HealthBot>): void;
56
- /**
57
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
58
- * @param botName The name of the Bot resource.
59
- * @param options The optional parameters
60
- * @param callback The callback
61
- */
62
- get(resourceGroupName: string, botName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.HealthBot>): void;
63
- get(resourceGroupName: string, botName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.HealthBot>, callback?: msRest.ServiceCallback<Models.HealthBot>): Promise<Models.BotsGetResponse> {
64
- return this.client.sendOperationRequest(
65
- {
73
+ private async *listByResourceGroupPagingPage(
74
+ resourceGroupName: string,
75
+ options?: BotsListByResourceGroupOptionalParams
76
+ ): AsyncIterableIterator<HealthBot[]> {
77
+ let result = await this._listByResourceGroup(resourceGroupName, options);
78
+ yield result.value || [];
79
+ let continuationToken = result.nextLink;
80
+ while (continuationToken) {
81
+ result = await this._listByResourceGroupNext(
66
82
  resourceGroupName,
67
- botName,
83
+ continuationToken,
68
84
  options
69
- },
70
- getOperationSpec,
71
- callback) as Promise<Models.BotsGetResponse>;
85
+ );
86
+ continuationToken = result.nextLink;
87
+ yield result.value || [];
88
+ }
89
+ }
90
+
91
+ private async *listByResourceGroupPagingAll(
92
+ resourceGroupName: string,
93
+ options?: BotsListByResourceGroupOptionalParams
94
+ ): AsyncIterableIterator<HealthBot> {
95
+ for await (const page of this.listByResourceGroupPagingPage(
96
+ resourceGroupName,
97
+ options
98
+ )) {
99
+ yield* page;
100
+ }
72
101
  }
73
102
 
74
103
  /**
75
- * Patch a HealthBot.
76
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
77
- * @param botName The name of the Bot resource.
78
- * @param parameters The parameters to provide for the required bot.
79
- * @param [options] The optional parameters
80
- * @returns Promise<Models.BotsUpdateResponse>
81
- */
82
- update(resourceGroupName: string, botName: string, parameters: Models.HealthBotUpdateParameters, options?: msRest.RequestOptionsBase): Promise<Models.BotsUpdateResponse>;
83
- /**
84
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
85
- * @param botName The name of the Bot resource.
86
- * @param parameters The parameters to provide for the required bot.
87
- * @param callback The callback
88
- */
89
- update(resourceGroupName: string, botName: string, parameters: Models.HealthBotUpdateParameters, callback: msRest.ServiceCallback<Models.HealthBot>): void;
90
- /**
91
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
92
- * @param botName The name of the Bot resource.
93
- * @param parameters The parameters to provide for the required bot.
94
- * @param options The optional parameters
95
- * @param callback The callback
104
+ * Returns all the resources of a particular type belonging to a subscription.
105
+ * @param options The options parameters.
96
106
  */
97
- update(resourceGroupName: string, botName: string, parameters: Models.HealthBotUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.HealthBot>): void;
98
- update(resourceGroupName: string, botName: string, parameters: Models.HealthBotUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.HealthBot>, callback?: msRest.ServiceCallback<Models.HealthBot>): Promise<Models.BotsUpdateResponse> {
99
- return this.client.sendOperationRequest(
100
- {
101
- resourceGroupName,
102
- botName,
103
- parameters,
104
- options
107
+ public list(
108
+ options?: BotsListOptionalParams
109
+ ): PagedAsyncIterableIterator<HealthBot> {
110
+ const iter = this.listPagingAll(options);
111
+ return {
112
+ next() {
113
+ return iter.next();
114
+ },
115
+ [Symbol.asyncIterator]() {
116
+ return this;
105
117
  },
106
- updateOperationSpec,
107
- callback) as Promise<Models.BotsUpdateResponse>;
118
+ byPage: () => {
119
+ return this.listPagingPage(options);
120
+ }
121
+ };
122
+ }
123
+
124
+ private async *listPagingPage(
125
+ options?: BotsListOptionalParams
126
+ ): AsyncIterableIterator<HealthBot[]> {
127
+ let result = await this._list(options);
128
+ yield result.value || [];
129
+ let continuationToken = result.nextLink;
130
+ while (continuationToken) {
131
+ result = await this._listNext(continuationToken, options);
132
+ continuationToken = result.nextLink;
133
+ yield result.value || [];
134
+ }
135
+ }
136
+
137
+ private async *listPagingAll(
138
+ options?: BotsListOptionalParams
139
+ ): AsyncIterableIterator<HealthBot> {
140
+ for await (const page of this.listPagingPage(options)) {
141
+ yield* page;
142
+ }
108
143
  }
109
144
 
110
145
  /**
111
- * Delete a HealthBot.
146
+ * Create a new Azure Health Bot.
112
147
  * @param resourceGroupName The name of the Bot resource group in the user subscription.
113
148
  * @param botName The name of the Bot resource.
114
- * @param [options] The optional parameters
115
- * @returns Promise<msRest.RestResponse>
149
+ * @param parameters The parameters to provide for the created Azure Health Bot.
150
+ * @param options The options parameters.
116
151
  */
117
- deleteMethod(resourceGroupName: string, botName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
118
- return this.beginDeleteMethod(resourceGroupName,botName,options)
119
- .then(lroPoller => lroPoller.pollUntilFinished());
152
+ async beginCreate(
153
+ resourceGroupName: string,
154
+ botName: string,
155
+ parameters: HealthBot,
156
+ options?: BotsCreateOptionalParams
157
+ ): Promise<
158
+ PollerLike<PollOperationState<BotsCreateResponse>, BotsCreateResponse>
159
+ > {
160
+ const directSendOperation = async (
161
+ args: coreClient.OperationArguments,
162
+ spec: coreClient.OperationSpec
163
+ ): Promise<BotsCreateResponse> => {
164
+ return this.client.sendOperationRequest(args, spec);
165
+ };
166
+ const sendOperation = async (
167
+ args: coreClient.OperationArguments,
168
+ spec: coreClient.OperationSpec
169
+ ) => {
170
+ let currentRawResponse:
171
+ | coreClient.FullOperationResponse
172
+ | undefined = undefined;
173
+ const providedCallback = args.options?.onResponse;
174
+ const callback: coreClient.RawResponseCallback = (
175
+ rawResponse: coreClient.FullOperationResponse,
176
+ flatResponse: unknown
177
+ ) => {
178
+ currentRawResponse = rawResponse;
179
+ providedCallback?.(rawResponse, flatResponse);
180
+ };
181
+ const updatedArgs = {
182
+ ...args,
183
+ options: {
184
+ ...args.options,
185
+ onResponse: callback
186
+ }
187
+ };
188
+ const flatResponse = await directSendOperation(updatedArgs, spec);
189
+ return {
190
+ flatResponse,
191
+ rawResponse: {
192
+ statusCode: currentRawResponse!.status,
193
+ body: currentRawResponse!.parsedBody,
194
+ headers: currentRawResponse!.headers.toJSON()
195
+ }
196
+ };
197
+ };
198
+
199
+ const lro = new LroImpl(
200
+ sendOperation,
201
+ { resourceGroupName, botName, parameters, options },
202
+ createOperationSpec
203
+ );
204
+ return new LroEngine(lro, {
205
+ resumeFrom: options?.resumeFrom,
206
+ intervalInMs: options?.updateIntervalInMs,
207
+ lroResourceLocationConfig: "azure-async-operation"
208
+ });
120
209
  }
121
210
 
122
211
  /**
123
- * Returns all the resources of a particular type belonging to a resource group
124
- * @param resourceGroupName The name of the Bot resource group in the user subscription.
125
- * @param [options] The optional parameters
126
- * @returns Promise<Models.BotsListByResourceGroupResponse>
127
- */
128
- listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<Models.BotsListByResourceGroupResponse>;
129
- /**
212
+ * Create a new Azure Health Bot.
130
213
  * @param resourceGroupName The name of the Bot resource group in the user subscription.
131
- * @param callback The callback
214
+ * @param botName The name of the Bot resource.
215
+ * @param parameters The parameters to provide for the created Azure Health Bot.
216
+ * @param options The options parameters.
132
217
  */
133
- listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
218
+ async beginCreateAndWait(
219
+ resourceGroupName: string,
220
+ botName: string,
221
+ parameters: HealthBot,
222
+ options?: BotsCreateOptionalParams
223
+ ): Promise<BotsCreateResponse> {
224
+ const poller = await this.beginCreate(
225
+ resourceGroupName,
226
+ botName,
227
+ parameters,
228
+ options
229
+ );
230
+ return poller.pollUntilDone();
231
+ }
232
+
134
233
  /**
234
+ * Get a HealthBot.
135
235
  * @param resourceGroupName The name of the Bot resource group in the user subscription.
136
- * @param options The optional parameters
137
- * @param callback The callback
236
+ * @param botName The name of the Bot resource.
237
+ * @param options The options parameters.
138
238
  */
139
- listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
140
- listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.BotResponseList>, callback?: msRest.ServiceCallback<Models.BotResponseList>): Promise<Models.BotsListByResourceGroupResponse> {
239
+ get(
240
+ resourceGroupName: string,
241
+ botName: string,
242
+ options?: BotsGetOptionalParams
243
+ ): Promise<BotsGetResponse> {
141
244
  return this.client.sendOperationRequest(
142
- {
143
- resourceGroupName,
144
- options
145
- },
146
- listByResourceGroupOperationSpec,
147
- callback) as Promise<Models.BotsListByResourceGroupResponse>;
245
+ { resourceGroupName, botName, options },
246
+ getOperationSpec
247
+ );
148
248
  }
149
249
 
150
250
  /**
151
- * Returns all the resources of a particular type belonging to a subscription.
152
- * @param [options] The optional parameters
153
- * @returns Promise<Models.BotsListResponse>
154
- */
155
- list(options?: msRest.RequestOptionsBase): Promise<Models.BotsListResponse>;
156
- /**
157
- * @param callback The callback
158
- */
159
- list(callback: msRest.ServiceCallback<Models.BotResponseList>): void;
160
- /**
161
- * @param options The optional parameters
162
- * @param callback The callback
251
+ * Patch a HealthBot.
252
+ * @param resourceGroupName The name of the Bot resource group in the user subscription.
253
+ * @param botName The name of the Bot resource.
254
+ * @param parameters The parameters to provide for the required Azure Health Bot.
255
+ * @param options The options parameters.
163
256
  */
164
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
165
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.BotResponseList>, callback?: msRest.ServiceCallback<Models.BotResponseList>): Promise<Models.BotsListResponse> {
257
+ update(
258
+ resourceGroupName: string,
259
+ botName: string,
260
+ parameters: HealthBotUpdateParameters,
261
+ options?: BotsUpdateOptionalParams
262
+ ): Promise<BotsUpdateResponse> {
166
263
  return this.client.sendOperationRequest(
167
- {
168
- options
169
- },
170
- listOperationSpec,
171
- callback) as Promise<Models.BotsListResponse>;
264
+ { resourceGroupName, botName, parameters, options },
265
+ updateOperationSpec
266
+ );
172
267
  }
173
268
 
174
269
  /**
175
- * Create a new HealthBot.
270
+ * Delete a HealthBot.
176
271
  * @param resourceGroupName The name of the Bot resource group in the user subscription.
177
272
  * @param botName The name of the Bot resource.
178
- * @param parameters The parameters to provide for the created bot.
179
- * @param [options] The optional parameters
180
- * @returns Promise<msRestAzure.LROPoller>
273
+ * @param options The options parameters.
181
274
  */
182
- beginCreate(resourceGroupName: string, botName: string, parameters: Models.HealthBot, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
183
- return this.client.sendLRORequest(
184
- {
185
- resourceGroupName,
186
- botName,
187
- parameters,
188
- options
189
- },
190
- beginCreateOperationSpec,
191
- options);
275
+ async beginDelete(
276
+ resourceGroupName: string,
277
+ botName: string,
278
+ options?: BotsDeleteOptionalParams
279
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
280
+ const directSendOperation = async (
281
+ args: coreClient.OperationArguments,
282
+ spec: coreClient.OperationSpec
283
+ ): Promise<void> => {
284
+ return this.client.sendOperationRequest(args, spec);
285
+ };
286
+ const sendOperation = async (
287
+ args: coreClient.OperationArguments,
288
+ spec: coreClient.OperationSpec
289
+ ) => {
290
+ let currentRawResponse:
291
+ | coreClient.FullOperationResponse
292
+ | undefined = undefined;
293
+ const providedCallback = args.options?.onResponse;
294
+ const callback: coreClient.RawResponseCallback = (
295
+ rawResponse: coreClient.FullOperationResponse,
296
+ flatResponse: unknown
297
+ ) => {
298
+ currentRawResponse = rawResponse;
299
+ providedCallback?.(rawResponse, flatResponse);
300
+ };
301
+ const updatedArgs = {
302
+ ...args,
303
+ options: {
304
+ ...args.options,
305
+ onResponse: callback
306
+ }
307
+ };
308
+ const flatResponse = await directSendOperation(updatedArgs, spec);
309
+ return {
310
+ flatResponse,
311
+ rawResponse: {
312
+ statusCode: currentRawResponse!.status,
313
+ body: currentRawResponse!.parsedBody,
314
+ headers: currentRawResponse!.headers.toJSON()
315
+ }
316
+ };
317
+ };
318
+
319
+ const lro = new LroImpl(
320
+ sendOperation,
321
+ { resourceGroupName, botName, options },
322
+ deleteOperationSpec
323
+ );
324
+ return new LroEngine(lro, {
325
+ resumeFrom: options?.resumeFrom,
326
+ intervalInMs: options?.updateIntervalInMs
327
+ });
192
328
  }
193
329
 
194
330
  /**
195
331
  * Delete a HealthBot.
196
332
  * @param resourceGroupName The name of the Bot resource group in the user subscription.
197
333
  * @param botName The name of the Bot resource.
198
- * @param [options] The optional parameters
199
- * @returns Promise<msRestAzure.LROPoller>
334
+ * @param options The options parameters.
200
335
  */
201
- beginDeleteMethod(resourceGroupName: string, botName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
202
- return this.client.sendLRORequest(
203
- {
204
- resourceGroupName,
205
- botName,
206
- options
207
- },
208
- beginDeleteMethodOperationSpec,
209
- options);
336
+ async beginDeleteAndWait(
337
+ resourceGroupName: string,
338
+ botName: string,
339
+ options?: BotsDeleteOptionalParams
340
+ ): Promise<void> {
341
+ const poller = await this.beginDelete(resourceGroupName, botName, options);
342
+ return poller.pollUntilDone();
210
343
  }
211
344
 
212
345
  /**
213
346
  * Returns all the resources of a particular type belonging to a resource group
214
- * @param nextPageLink The NextLink from the previous successful call to List operation.
215
- * @param [options] The optional parameters
216
- * @returns Promise<Models.BotsListByResourceGroupNextResponse>
217
- */
218
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.BotsListByResourceGroupNextResponse>;
219
- /**
220
- * @param nextPageLink The NextLink from the previous successful call to List operation.
221
- * @param callback The callback
222
- */
223
- listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
224
- /**
225
- * @param nextPageLink The NextLink from the previous successful call to List operation.
226
- * @param options The optional parameters
227
- * @param callback The callback
347
+ * @param resourceGroupName The name of the Bot resource group in the user subscription.
348
+ * @param options The options parameters.
228
349
  */
229
- listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
230
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.BotResponseList>, callback?: msRest.ServiceCallback<Models.BotResponseList>): Promise<Models.BotsListByResourceGroupNextResponse> {
350
+ private _listByResourceGroup(
351
+ resourceGroupName: string,
352
+ options?: BotsListByResourceGroupOptionalParams
353
+ ): Promise<BotsListByResourceGroupResponse> {
231
354
  return this.client.sendOperationRequest(
232
- {
233
- nextPageLink,
234
- options
235
- },
236
- listByResourceGroupNextOperationSpec,
237
- callback) as Promise<Models.BotsListByResourceGroupNextResponse>;
355
+ { resourceGroupName, options },
356
+ listByResourceGroupOperationSpec
357
+ );
238
358
  }
239
359
 
240
360
  /**
241
361
  * Returns all the resources of a particular type belonging to a subscription.
242
- * @param nextPageLink The NextLink from the previous successful call to List operation.
243
- * @param [options] The optional parameters
244
- * @returns Promise<Models.BotsListNextResponse>
362
+ * @param options The options parameters.
245
363
  */
246
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.BotsListNextResponse>;
364
+ private _list(options?: BotsListOptionalParams): Promise<BotsListResponse> {
365
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
366
+ }
367
+
247
368
  /**
248
- * @param nextPageLink The NextLink from the previous successful call to List operation.
249
- * @param callback The callback
369
+ * ListByResourceGroupNext
370
+ * @param resourceGroupName The name of the Bot resource group in the user subscription.
371
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
372
+ * @param options The options parameters.
250
373
  */
251
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
374
+ private _listByResourceGroupNext(
375
+ resourceGroupName: string,
376
+ nextLink: string,
377
+ options?: BotsListByResourceGroupNextOptionalParams
378
+ ): Promise<BotsListByResourceGroupNextResponse> {
379
+ return this.client.sendOperationRequest(
380
+ { resourceGroupName, nextLink, options },
381
+ listByResourceGroupNextOperationSpec
382
+ );
383
+ }
384
+
252
385
  /**
253
- * @param nextPageLink The NextLink from the previous successful call to List operation.
254
- * @param options The optional parameters
255
- * @param callback The callback
386
+ * ListNext
387
+ * @param nextLink The nextLink from the previous successful call to the List method.
388
+ * @param options The options parameters.
256
389
  */
257
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.BotResponseList>): void;
258
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.BotResponseList>, callback?: msRest.ServiceCallback<Models.BotResponseList>): Promise<Models.BotsListNextResponse> {
390
+ private _listNext(
391
+ nextLink: string,
392
+ options?: BotsListNextOptionalParams
393
+ ): Promise<BotsListNextResponse> {
259
394
  return this.client.sendOperationRequest(
260
- {
261
- nextPageLink,
262
- options
263
- },
264
- listNextOperationSpec,
265
- callback) as Promise<Models.BotsListNextResponse>;
395
+ { nextLink, options },
396
+ listNextOperationSpec
397
+ );
266
398
  }
267
399
  }
268
-
269
400
  // Operation Specifications
270
- const serializer = new msRest.Serializer(Mappers);
271
- const getOperationSpec: msRest.OperationSpec = {
272
- httpMethod: "GET",
273
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
401
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
402
+
403
+ const createOperationSpec: coreClient.OperationSpec = {
404
+ path:
405
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
406
+ httpMethod: "PUT",
407
+ responses: {
408
+ 200: {
409
+ bodyMapper: Mappers.HealthBot
410
+ },
411
+ 201: {
412
+ bodyMapper: Mappers.HealthBot
413
+ },
414
+ 202: {
415
+ bodyMapper: Mappers.HealthBot
416
+ },
417
+ 204: {
418
+ bodyMapper: Mappers.HealthBot
419
+ },
420
+ default: {
421
+ bodyMapper: Mappers.ErrorModel
422
+ }
423
+ },
424
+ requestBody: Parameters.parameters,
425
+ queryParameters: [Parameters.apiVersion],
274
426
  urlParameters: [
427
+ Parameters.$host,
275
428
  Parameters.subscriptionId,
276
429
  Parameters.resourceGroupName,
277
430
  Parameters.botName
278
431
  ],
279
- queryParameters: [
280
- Parameters.apiVersion
281
- ],
282
- headerParameters: [
283
- Parameters.acceptLanguage
284
- ],
432
+ headerParameters: [Parameters.contentType, Parameters.accept],
433
+ mediaType: "json",
434
+ serializer
435
+ };
436
+ const getOperationSpec: coreClient.OperationSpec = {
437
+ path:
438
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
439
+ httpMethod: "GET",
285
440
  responses: {
286
441
  200: {
287
442
  bodyMapper: Mappers.HealthBot
@@ -290,30 +445,20 @@ const getOperationSpec: msRest.OperationSpec = {
290
445
  bodyMapper: Mappers.ErrorModel
291
446
  }
292
447
  },
293
- serializer
294
- };
295
-
296
- const updateOperationSpec: msRest.OperationSpec = {
297
- httpMethod: "PATCH",
298
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
448
+ queryParameters: [Parameters.apiVersion],
299
449
  urlParameters: [
450
+ Parameters.$host,
300
451
  Parameters.subscriptionId,
301
452
  Parameters.resourceGroupName,
302
453
  Parameters.botName
303
454
  ],
304
- queryParameters: [
305
- Parameters.apiVersion
306
- ],
307
- headerParameters: [
308
- Parameters.acceptLanguage
309
- ],
310
- requestBody: {
311
- parameterPath: "parameters",
312
- mapper: {
313
- ...Mappers.HealthBotUpdateParameters,
314
- required: true
315
- }
316
- },
455
+ headerParameters: [Parameters.accept],
456
+ serializer
457
+ };
458
+ const updateOperationSpec: coreClient.OperationSpec = {
459
+ path:
460
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
461
+ httpMethod: "PATCH",
317
462
  responses: {
318
463
  200: {
319
464
  bodyMapper: Mappers.HealthBot
@@ -325,129 +470,82 @@ const updateOperationSpec: msRest.OperationSpec = {
325
470
  bodyMapper: Mappers.ErrorModel
326
471
  }
327
472
  },
328
- serializer
329
- };
330
-
331
- const listByResourceGroupOperationSpec: msRest.OperationSpec = {
332
- httpMethod: "GET",
333
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots",
473
+ requestBody: Parameters.parameters1,
474
+ queryParameters: [Parameters.apiVersion],
334
475
  urlParameters: [
476
+ Parameters.$host,
477
+ Parameters.subscriptionId,
335
478
  Parameters.resourceGroupName,
336
- Parameters.subscriptionId
337
- ],
338
- queryParameters: [
339
- Parameters.apiVersion
340
- ],
341
- headerParameters: [
342
- Parameters.acceptLanguage
479
+ Parameters.botName
343
480
  ],
344
- responses: {
345
- 200: {
346
- bodyMapper: Mappers.BotResponseList
347
- },
348
- default: {
349
- bodyMapper: Mappers.ErrorModel
350
- }
351
- },
481
+ headerParameters: [Parameters.contentType, Parameters.accept],
482
+ mediaType: "json",
352
483
  serializer
353
484
  };
354
-
355
- const listOperationSpec: msRest.OperationSpec = {
356
- httpMethod: "GET",
357
- path: "subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots",
358
- urlParameters: [
359
- Parameters.subscriptionId
360
- ],
361
- queryParameters: [
362
- Parameters.apiVersion
363
- ],
364
- headerParameters: [
365
- Parameters.acceptLanguage
366
- ],
485
+ const deleteOperationSpec: coreClient.OperationSpec = {
486
+ path:
487
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
488
+ httpMethod: "DELETE",
367
489
  responses: {
368
- 200: {
369
- bodyMapper: Mappers.BotResponseList
370
- },
490
+ 200: {},
491
+ 201: {},
492
+ 202: {},
493
+ 204: {},
371
494
  default: {
372
495
  bodyMapper: Mappers.ErrorModel
373
496
  }
374
497
  },
375
- serializer
376
- };
377
-
378
- const beginCreateOperationSpec: msRest.OperationSpec = {
379
- httpMethod: "PUT",
380
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
498
+ queryParameters: [Parameters.apiVersion],
381
499
  urlParameters: [
500
+ Parameters.$host,
382
501
  Parameters.subscriptionId,
383
502
  Parameters.resourceGroupName,
384
503
  Parameters.botName
385
504
  ],
386
- queryParameters: [
387
- Parameters.apiVersion
388
- ],
389
- headerParameters: [
390
- Parameters.acceptLanguage
391
- ],
392
- requestBody: {
393
- parameterPath: "parameters",
394
- mapper: {
395
- ...Mappers.HealthBot,
396
- required: true
397
- }
398
- },
505
+ headerParameters: [Parameters.accept],
506
+ serializer
507
+ };
508
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
509
+ path:
510
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots",
511
+ httpMethod: "GET",
399
512
  responses: {
400
513
  200: {
401
- bodyMapper: Mappers.HealthBot
402
- },
403
- 201: {
404
- bodyMapper: Mappers.HealthBot
514
+ bodyMapper: Mappers.BotResponseList
405
515
  },
406
516
  default: {
407
517
  bodyMapper: Mappers.ErrorModel
408
518
  }
409
519
  },
410
- serializer
411
- };
412
-
413
- const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
414
- httpMethod: "DELETE",
415
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}",
520
+ queryParameters: [Parameters.apiVersion],
416
521
  urlParameters: [
522
+ Parameters.$host,
417
523
  Parameters.subscriptionId,
418
- Parameters.resourceGroupName,
419
- Parameters.botName
420
- ],
421
- queryParameters: [
422
- Parameters.apiVersion
423
- ],
424
- headerParameters: [
425
- Parameters.acceptLanguage
524
+ Parameters.resourceGroupName
426
525
  ],
526
+ headerParameters: [Parameters.accept],
527
+ serializer
528
+ };
529
+ const listOperationSpec: coreClient.OperationSpec = {
530
+ path:
531
+ "/subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots",
532
+ httpMethod: "GET",
427
533
  responses: {
428
- 200: {},
429
- 202: {},
430
- 204: {},
534
+ 200: {
535
+ bodyMapper: Mappers.BotResponseList
536
+ },
431
537
  default: {
432
538
  bodyMapper: Mappers.ErrorModel
433
539
  }
434
540
  },
541
+ queryParameters: [Parameters.apiVersion],
542
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
543
+ headerParameters: [Parameters.accept],
435
544
  serializer
436
545
  };
437
-
438
- const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
439
- httpMethod: "GET",
440
- baseUrl: "https://management.azure.com",
546
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
441
547
  path: "{nextLink}",
442
- urlParameters: [
443
- Parameters.nextPageLink
444
- ],
445
- queryParameters: [
446
- Parameters.apiVersion
447
- ],
448
- headerParameters: [
449
- Parameters.acceptLanguage
450
- ],
548
+ httpMethod: "GET",
451
549
  responses: {
452
550
  200: {
453
551
  bodyMapper: Mappers.BotResponseList
@@ -456,22 +554,19 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
456
554
  bodyMapper: Mappers.ErrorModel
457
555
  }
458
556
  },
557
+ queryParameters: [Parameters.apiVersion],
558
+ urlParameters: [
559
+ Parameters.$host,
560
+ Parameters.subscriptionId,
561
+ Parameters.resourceGroupName,
562
+ Parameters.nextLink
563
+ ],
564
+ headerParameters: [Parameters.accept],
459
565
  serializer
460
566
  };
461
-
462
- const listNextOperationSpec: msRest.OperationSpec = {
463
- httpMethod: "GET",
464
- baseUrl: "https://management.azure.com",
567
+ const listNextOperationSpec: coreClient.OperationSpec = {
465
568
  path: "{nextLink}",
466
- urlParameters: [
467
- Parameters.nextPageLink
468
- ],
469
- queryParameters: [
470
- Parameters.apiVersion
471
- ],
472
- headerParameters: [
473
- Parameters.acceptLanguage
474
- ],
569
+ httpMethod: "GET",
475
570
  responses: {
476
571
  200: {
477
572
  bodyMapper: Mappers.BotResponseList
@@ -480,5 +575,12 @@ const listNextOperationSpec: msRest.OperationSpec = {
480
575
  bodyMapper: Mappers.ErrorModel
481
576
  }
482
577
  },
578
+ queryParameters: [Parameters.apiVersion],
579
+ urlParameters: [
580
+ Parameters.$host,
581
+ Parameters.subscriptionId,
582
+ Parameters.nextLink
583
+ ],
584
+ headerParameters: [Parameters.accept],
483
585
  serializer
484
586
  };