@azure/arm-hanaonazure 2.2.0 → 4.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 (145) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +1 -1
  4. package/README.md +72 -72
  5. package/dist/index.js +1333 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.min.js +1 -0
  8. package/dist/index.min.js.map +1 -0
  9. package/dist-esm/src/hanaManagementClient.d.ts +21 -0
  10. package/dist-esm/src/hanaManagementClient.d.ts.map +1 -0
  11. package/dist-esm/src/hanaManagementClient.js +54 -0
  12. package/dist-esm/src/hanaManagementClient.js.map +1 -0
  13. package/dist-esm/src/index.d.ts +5 -0
  14. package/dist-esm/src/index.d.ts.map +1 -0
  15. package/dist-esm/src/index.js +12 -0
  16. package/dist-esm/src/index.js.map +1 -0
  17. package/dist-esm/src/lroImpl.d.ts +16 -0
  18. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  19. package/dist-esm/src/lroImpl.js +29 -0
  20. package/dist-esm/src/lroImpl.js.map +1 -0
  21. package/dist-esm/src/models/index.d.ts +260 -0
  22. package/dist-esm/src/models/index.d.ts.map +1 -0
  23. package/dist-esm/src/models/index.js +19 -0
  24. package/dist-esm/src/models/index.js.map +1 -0
  25. package/dist-esm/src/models/mappers.d.ts +15 -0
  26. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  27. package/dist-esm/src/models/mappers.js +330 -0
  28. package/dist-esm/src/models/mappers.js.map +1 -0
  29. package/dist-esm/src/models/parameters.d.ts +14 -0
  30. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  31. package/dist-esm/src/models/parameters.js +116 -0
  32. package/dist-esm/src/models/parameters.js.map +1 -0
  33. package/dist-esm/src/operations/index.d.ts +4 -0
  34. package/dist-esm/src/operations/index.d.ts.map +1 -0
  35. package/dist-esm/src/operations/index.js +11 -0
  36. package/dist-esm/src/operations/index.js.map +1 -0
  37. package/dist-esm/src/operations/operations.d.ts +26 -0
  38. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  39. package/dist-esm/src/operations/operations.js +90 -0
  40. package/dist-esm/src/operations/operations.js.map +1 -0
  41. package/dist-esm/src/operations/providerInstances.d.ts +88 -0
  42. package/dist-esm/src/operations/providerInstances.d.ts.map +1 -0
  43. package/dist-esm/src/operations/providerInstances.js +344 -0
  44. package/dist-esm/src/operations/providerInstances.js.map +1 -0
  45. package/dist-esm/src/operations/sapMonitors.d.ts +81 -0
  46. package/dist-esm/src/operations/sapMonitors.d.ts.map +1 -0
  47. package/dist-esm/src/operations/sapMonitors.js +346 -0
  48. package/dist-esm/src/operations/sapMonitors.js.map +1 -0
  49. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  50. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  51. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  52. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  53. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  54. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  55. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  56. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  57. package/dist-esm/src/operationsInterfaces/providerInstances.d.ts +62 -0
  58. package/dist-esm/src/operationsInterfaces/providerInstances.d.ts.map +1 -0
  59. package/dist-esm/src/operationsInterfaces/providerInstances.js +9 -0
  60. package/dist-esm/src/operationsInterfaces/providerInstances.js.map +1 -0
  61. package/dist-esm/src/operationsInterfaces/sapMonitors.d.ts +59 -0
  62. package/dist-esm/src/operationsInterfaces/sapMonitors.d.ts.map +1 -0
  63. package/dist-esm/src/operationsInterfaces/sapMonitors.js +9 -0
  64. package/dist-esm/src/operationsInterfaces/sapMonitors.js.map +1 -0
  65. package/dist-esm/test/sampleTest.d.ts +2 -0
  66. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  67. package/dist-esm/test/sampleTest.js +40 -0
  68. package/dist-esm/test/sampleTest.js.map +1 -0
  69. package/package.json +65 -31
  70. package/review/arm-hanaonazure.api.md +260 -0
  71. package/rollup.config.js +181 -30
  72. package/src/hanaManagementClient.ts +75 -34
  73. package/src/index.ts +12 -0
  74. package/src/lroImpl.ts +34 -0
  75. package/src/models/index.ts +227 -638
  76. package/src/models/mappers.ts +138 -367
  77. package/src/models/parameters.ts +84 -30
  78. package/src/operations/index.ts +4 -6
  79. package/src/operations/operations.ts +66 -42
  80. package/src/operations/providerInstances.ts +477 -0
  81. package/src/operations/sapMonitors.ts +332 -256
  82. package/src/operationsInterfaces/index.ts +11 -0
  83. package/src/operationsInterfaces/operations.ts +22 -0
  84. package/src/operationsInterfaces/providerInstances.ts +115 -0
  85. package/src/operationsInterfaces/sapMonitors.ts +113 -0
  86. package/tsconfig.json +4 -4
  87. package/types/arm-hanaonazure.d.ts +444 -0
  88. package/types/tsdoc-metadata.json +11 -0
  89. package/dist/arm-hanaonazure.js +0 -1702
  90. package/dist/arm-hanaonazure.js.map +0 -1
  91. package/dist/arm-hanaonazure.min.js +0 -1
  92. package/dist/arm-hanaonazure.min.js.map +0 -1
  93. package/esm/hanaManagementClient.d.ts +0 -21
  94. package/esm/hanaManagementClient.d.ts.map +0 -1
  95. package/esm/hanaManagementClient.js +0 -36
  96. package/esm/hanaManagementClient.js.map +0 -1
  97. package/esm/hanaManagementClientContext.d.ts +0 -17
  98. package/esm/hanaManagementClientContext.d.ts.map +0 -1
  99. package/esm/hanaManagementClientContext.js +0 -57
  100. package/esm/hanaManagementClientContext.js.map +0 -1
  101. package/esm/models/hanaInstancesMappers.d.ts +0 -2
  102. package/esm/models/hanaInstancesMappers.d.ts.map +0 -1
  103. package/esm/models/hanaInstancesMappers.js +0 -9
  104. package/esm/models/hanaInstancesMappers.js.map +0 -1
  105. package/esm/models/index.d.ts +0 -661
  106. package/esm/models/index.d.ts.map +0 -1
  107. package/esm/models/index.js +0 -8
  108. package/esm/models/index.js.map +0 -1
  109. package/esm/models/mappers.d.ts +0 -21
  110. package/esm/models/mappers.d.ts.map +0 -1
  111. package/esm/models/mappers.js +0 -556
  112. package/esm/models/mappers.js.map +0 -1
  113. package/esm/models/operationsMappers.d.ts +0 -2
  114. package/esm/models/operationsMappers.d.ts.map +0 -1
  115. package/esm/models/operationsMappers.js +0 -9
  116. package/esm/models/operationsMappers.js.map +0 -1
  117. package/esm/models/parameters.d.ts +0 -9
  118. package/esm/models/parameters.d.ts.map +0 -1
  119. package/esm/models/parameters.js +0 -81
  120. package/esm/models/parameters.js.map +0 -1
  121. package/esm/models/sapMonitorsMappers.d.ts +0 -2
  122. package/esm/models/sapMonitorsMappers.d.ts.map +0 -1
  123. package/esm/models/sapMonitorsMappers.js +0 -9
  124. package/esm/models/sapMonitorsMappers.js.map +0 -1
  125. package/esm/operations/hanaInstances.d.ts +0 -244
  126. package/esm/operations/hanaInstances.d.ts.map +0 -1
  127. package/esm/operations/hanaInstances.js +0 -514
  128. package/esm/operations/hanaInstances.js.map +0 -1
  129. package/esm/operations/index.d.ts +0 -4
  130. package/esm/operations/index.d.ts.map +0 -1
  131. package/esm/operations/index.js +0 -13
  132. package/esm/operations/index.js.map +0 -1
  133. package/esm/operations/operations.d.ts +0 -28
  134. package/esm/operations/operations.d.ts.map +0 -1
  135. package/esm/operations/operations.js +0 -51
  136. package/esm/operations/operations.js.map +0 -1
  137. package/esm/operations/sapMonitors.d.ts +0 -138
  138. package/esm/operations/sapMonitors.d.ts.map +0 -1
  139. package/esm/operations/sapMonitors.js +0 -260
  140. package/esm/operations/sapMonitors.js.map +0 -1
  141. package/src/hanaManagementClientContext.ts +0 -63
  142. package/src/models/hanaInstancesMappers.ts +0 -25
  143. package/src/models/operationsMappers.ts +0 -14
  144. package/src/models/sapMonitorsMappers.ts +0 -23
  145. package/src/operations/hanaInstances.ts +0 -718
@@ -1,242 +1,331 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as msRestAzure from "@azure/ms-rest-azure-js";
13
- import * as Models from "../models";
14
- import * as Mappers from "../models/sapMonitorsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { SapMonitors } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
15
13
  import * as Parameters from "../models/parameters";
16
- import { HanaManagementClientContext } from "../hanaManagementClientContext";
14
+ import { HanaManagementClient } from "../hanaManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ SapMonitor,
19
+ SapMonitorsListNextOptionalParams,
20
+ SapMonitorsListOptionalParams,
21
+ SapMonitorsListResponse,
22
+ SapMonitorsGetOptionalParams,
23
+ SapMonitorsGetResponse,
24
+ SapMonitorsCreateOptionalParams,
25
+ SapMonitorsCreateResponse,
26
+ SapMonitorsDeleteOptionalParams,
27
+ Tags,
28
+ SapMonitorsUpdateOptionalParams,
29
+ SapMonitorsUpdateResponse,
30
+ SapMonitorsListNextResponse
31
+ } from "../models";
17
32
 
18
- /** Class representing a SapMonitors. */
19
- export class SapMonitors {
20
- private readonly client: HanaManagementClientContext;
33
+ /// <reference lib="esnext.asynciterable" />
34
+ /** Class containing SapMonitors operations. */
35
+ export class SapMonitorsImpl implements SapMonitors {
36
+ private readonly client: HanaManagementClient;
21
37
 
22
38
  /**
23
- * Create a SapMonitors.
24
- * @param {HanaManagementClientContext} client Reference to the service client.
39
+ * Initialize a new instance of the class SapMonitors class.
40
+ * @param client Reference to the service client
25
41
  */
26
- constructor(client: HanaManagementClientContext) {
42
+ constructor(client: HanaManagementClient) {
27
43
  this.client = client;
28
44
  }
29
45
 
30
46
  /**
31
- * Gets a list of SAP monitors in the specified subscription. The operations returns various
32
- * properties of each SAP monitor.
33
- * @summary Gets a list of SAP monitors in the specified subscription.
34
- * @param [options] The optional parameters
35
- * @returns Promise<Models.SapMonitorsListResponse>
47
+ * Gets a list of SAP monitors in the specified subscription. The operations returns various properties
48
+ * of each SAP monitor.
49
+ * @param options The options parameters.
36
50
  */
37
- list(options?: msRest.RequestOptionsBase): Promise<Models.SapMonitorsListResponse>;
38
- /**
39
- * @param callback The callback
40
- */
41
- list(callback: msRest.ServiceCallback<Models.SapMonitorListResult>): void;
42
- /**
43
- * @param options The optional parameters
44
- * @param callback The callback
45
- */
46
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SapMonitorListResult>): void;
47
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SapMonitorListResult>, callback?: msRest.ServiceCallback<Models.SapMonitorListResult>): Promise<Models.SapMonitorsListResponse> {
48
- return this.client.sendOperationRequest(
49
- {
50
- options
51
+ public list(
52
+ options?: SapMonitorsListOptionalParams
53
+ ): PagedAsyncIterableIterator<SapMonitor> {
54
+ const iter = this.listPagingAll(options);
55
+ return {
56
+ next() {
57
+ return iter.next();
51
58
  },
52
- listOperationSpec,
53
- callback) as Promise<Models.SapMonitorsListResponse>;
59
+ [Symbol.asyncIterator]() {
60
+ return this;
61
+ },
62
+ byPage: () => {
63
+ return this.listPagingPage(options);
64
+ }
65
+ };
66
+ }
67
+
68
+ private async *listPagingPage(
69
+ options?: SapMonitorsListOptionalParams
70
+ ): AsyncIterableIterator<SapMonitor[]> {
71
+ let result = await this._list(options);
72
+ yield result.value || [];
73
+ let continuationToken = result.nextLink;
74
+ while (continuationToken) {
75
+ result = await this._listNext(continuationToken, options);
76
+ continuationToken = result.nextLink;
77
+ yield result.value || [];
78
+ }
79
+ }
80
+
81
+ private async *listPagingAll(
82
+ options?: SapMonitorsListOptionalParams
83
+ ): AsyncIterableIterator<SapMonitor> {
84
+ for await (const page of this.listPagingPage(options)) {
85
+ yield* page;
86
+ }
54
87
  }
55
88
 
56
89
  /**
57
- * Gets properties of a SAP monitor for the specified subscription, resource group, and resource
58
- * name.
59
- * @summary Gets properties of a SAP monitor.
60
- * @param resourceGroupName Name of the resource group.
61
- * @param sapMonitorName Name of the SAP monitor resource.
62
- * @param [options] The optional parameters
63
- * @returns Promise<Models.SapMonitorsGetResponse>
64
- */
65
- get(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase): Promise<Models.SapMonitorsGetResponse>;
66
- /**
67
- * @param resourceGroupName Name of the resource group.
68
- * @param sapMonitorName Name of the SAP monitor resource.
69
- * @param callback The callback
90
+ * Gets a list of SAP monitors in the specified subscription. The operations returns various properties
91
+ * of each SAP monitor.
92
+ * @param options The options parameters.
70
93
  */
71
- get(resourceGroupName: string, sapMonitorName: string, callback: msRest.ServiceCallback<Models.SapMonitor>): void;
94
+ private _list(
95
+ options?: SapMonitorsListOptionalParams
96
+ ): Promise<SapMonitorsListResponse> {
97
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
98
+ }
99
+
72
100
  /**
101
+ * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name.
73
102
  * @param resourceGroupName Name of the resource group.
74
103
  * @param sapMonitorName Name of the SAP monitor resource.
75
- * @param options The optional parameters
76
- * @param callback The callback
104
+ * @param options The options parameters.
77
105
  */
78
- get(resourceGroupName: string, sapMonitorName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SapMonitor>): void;
79
- get(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SapMonitor>, callback?: msRest.ServiceCallback<Models.SapMonitor>): Promise<Models.SapMonitorsGetResponse> {
106
+ get(
107
+ resourceGroupName: string,
108
+ sapMonitorName: string,
109
+ options?: SapMonitorsGetOptionalParams
110
+ ): Promise<SapMonitorsGetResponse> {
80
111
  return this.client.sendOperationRequest(
81
- {
82
- resourceGroupName,
83
- sapMonitorName,
84
- options
85
- },
86
- getOperationSpec,
87
- callback) as Promise<Models.SapMonitorsGetResponse>;
112
+ { resourceGroupName, sapMonitorName, options },
113
+ getOperationSpec
114
+ );
88
115
  }
89
116
 
90
117
  /**
91
118
  * Creates a SAP monitor for the specified subscription, resource group, and resource name.
92
- * @summary Creates a SAP monitor.
93
119
  * @param resourceGroupName Name of the resource group.
94
120
  * @param sapMonitorName Name of the SAP monitor resource.
95
121
  * @param sapMonitorParameter Request body representing a SAP Monitor
96
- * @param [options] The optional parameters
97
- * @returns Promise<Models.SapMonitorsCreateResponse>
122
+ * @param options The options parameters.
98
123
  */
99
- create(resourceGroupName: string, sapMonitorName: string, sapMonitorParameter: Models.SapMonitor, options?: msRest.RequestOptionsBase): Promise<Models.SapMonitorsCreateResponse> {
100
- return this.beginCreate(resourceGroupName,sapMonitorName,sapMonitorParameter,options)
101
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.SapMonitorsCreateResponse>;
124
+ async beginCreate(
125
+ resourceGroupName: string,
126
+ sapMonitorName: string,
127
+ sapMonitorParameter: SapMonitor,
128
+ options?: SapMonitorsCreateOptionalParams
129
+ ): Promise<
130
+ PollerLike<
131
+ PollOperationState<SapMonitorsCreateResponse>,
132
+ SapMonitorsCreateResponse
133
+ >
134
+ > {
135
+ const directSendOperation = async (
136
+ args: coreClient.OperationArguments,
137
+ spec: coreClient.OperationSpec
138
+ ): Promise<SapMonitorsCreateResponse> => {
139
+ return this.client.sendOperationRequest(args, spec);
140
+ };
141
+ const sendOperation = async (
142
+ args: coreClient.OperationArguments,
143
+ spec: coreClient.OperationSpec
144
+ ) => {
145
+ let currentRawResponse:
146
+ | coreClient.FullOperationResponse
147
+ | undefined = undefined;
148
+ const providedCallback = args.options?.onResponse;
149
+ const callback: coreClient.RawResponseCallback = (
150
+ rawResponse: coreClient.FullOperationResponse,
151
+ flatResponse: unknown
152
+ ) => {
153
+ currentRawResponse = rawResponse;
154
+ providedCallback?.(rawResponse, flatResponse);
155
+ };
156
+ const updatedArgs = {
157
+ ...args,
158
+ options: {
159
+ ...args.options,
160
+ onResponse: callback
161
+ }
162
+ };
163
+ const flatResponse = await directSendOperation(updatedArgs, spec);
164
+ return {
165
+ flatResponse,
166
+ rawResponse: {
167
+ statusCode: currentRawResponse!.status,
168
+ body: currentRawResponse!.parsedBody,
169
+ headers: currentRawResponse!.headers.toJSON()
170
+ }
171
+ };
172
+ };
173
+
174
+ const lro = new LroImpl(
175
+ sendOperation,
176
+ { resourceGroupName, sapMonitorName, sapMonitorParameter, options },
177
+ createOperationSpec
178
+ );
179
+ return new LroEngine(lro, {
180
+ resumeFrom: options?.resumeFrom,
181
+ intervalInMs: options?.updateIntervalInMs
182
+ });
102
183
  }
103
184
 
104
185
  /**
105
- * Deletes a SAP monitor with the specified subscription, resource group, and monitor name.
106
- * @summary Deletes a SAP monitor.
186
+ * Creates a SAP monitor for the specified subscription, resource group, and resource name.
107
187
  * @param resourceGroupName Name of the resource group.
108
188
  * @param sapMonitorName Name of the SAP monitor resource.
109
- * @param [options] The optional parameters
110
- * @returns Promise<msRest.RestResponse>
189
+ * @param sapMonitorParameter Request body representing a SAP Monitor
190
+ * @param options The options parameters.
111
191
  */
112
- deleteMethod(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
113
- return this.beginDeleteMethod(resourceGroupName,sapMonitorName,options)
114
- .then(lroPoller => lroPoller.pollUntilFinished());
192
+ async beginCreateAndWait(
193
+ resourceGroupName: string,
194
+ sapMonitorName: string,
195
+ sapMonitorParameter: SapMonitor,
196
+ options?: SapMonitorsCreateOptionalParams
197
+ ): Promise<SapMonitorsCreateResponse> {
198
+ const poller = await this.beginCreate(
199
+ resourceGroupName,
200
+ sapMonitorName,
201
+ sapMonitorParameter,
202
+ options
203
+ );
204
+ return poller.pollUntilDone();
115
205
  }
116
206
 
117
207
  /**
118
- * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and
119
- * monitor name.
120
- * @summary Patches the Tags field of a SAP monitor.
121
- * @param resourceGroupName Name of the resource group.
122
- * @param sapMonitorName Name of the SAP monitor resource.
123
- * @param tagsParameter Request body that only contains the new Tags field
124
- * @param [options] The optional parameters
125
- * @returns Promise<Models.SapMonitorsUpdateResponse>
126
- */
127
- update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase): Promise<Models.SapMonitorsUpdateResponse>;
128
- /**
129
- * @param resourceGroupName Name of the resource group.
130
- * @param sapMonitorName Name of the SAP monitor resource.
131
- * @param tagsParameter Request body that only contains the new Tags field
132
- * @param callback The callback
133
- */
134
- update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, callback: msRest.ServiceCallback<Models.SapMonitor>): void;
135
- /**
208
+ * Deletes a SAP monitor with the specified subscription, resource group, and monitor name.
136
209
  * @param resourceGroupName Name of the resource group.
137
210
  * @param sapMonitorName Name of the SAP monitor resource.
138
- * @param tagsParameter Request body that only contains the new Tags field
139
- * @param options The optional parameters
140
- * @param callback The callback
211
+ * @param options The options parameters.
141
212
  */
142
- update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SapMonitor>): void;
143
- update(resourceGroupName: string, sapMonitorName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SapMonitor>, callback?: msRest.ServiceCallback<Models.SapMonitor>): Promise<Models.SapMonitorsUpdateResponse> {
144
- return this.client.sendOperationRequest(
145
- {
146
- resourceGroupName,
147
- sapMonitorName,
148
- tagsParameter,
149
- options
150
- },
151
- updateOperationSpec,
152
- callback) as Promise<Models.SapMonitorsUpdateResponse>;
213
+ async beginDelete(
214
+ resourceGroupName: string,
215
+ sapMonitorName: string,
216
+ options?: SapMonitorsDeleteOptionalParams
217
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
218
+ const directSendOperation = async (
219
+ args: coreClient.OperationArguments,
220
+ spec: coreClient.OperationSpec
221
+ ): Promise<void> => {
222
+ return this.client.sendOperationRequest(args, spec);
223
+ };
224
+ const sendOperation = async (
225
+ args: coreClient.OperationArguments,
226
+ spec: coreClient.OperationSpec
227
+ ) => {
228
+ let currentRawResponse:
229
+ | coreClient.FullOperationResponse
230
+ | undefined = undefined;
231
+ const providedCallback = args.options?.onResponse;
232
+ const callback: coreClient.RawResponseCallback = (
233
+ rawResponse: coreClient.FullOperationResponse,
234
+ flatResponse: unknown
235
+ ) => {
236
+ currentRawResponse = rawResponse;
237
+ providedCallback?.(rawResponse, flatResponse);
238
+ };
239
+ const updatedArgs = {
240
+ ...args,
241
+ options: {
242
+ ...args.options,
243
+ onResponse: callback
244
+ }
245
+ };
246
+ const flatResponse = await directSendOperation(updatedArgs, spec);
247
+ return {
248
+ flatResponse,
249
+ rawResponse: {
250
+ statusCode: currentRawResponse!.status,
251
+ body: currentRawResponse!.parsedBody,
252
+ headers: currentRawResponse!.headers.toJSON()
253
+ }
254
+ };
255
+ };
256
+
257
+ const lro = new LroImpl(
258
+ sendOperation,
259
+ { resourceGroupName, sapMonitorName, options },
260
+ deleteOperationSpec
261
+ );
262
+ return new LroEngine(lro, {
263
+ resumeFrom: options?.resumeFrom,
264
+ intervalInMs: options?.updateIntervalInMs
265
+ });
153
266
  }
154
267
 
155
268
  /**
156
- * Creates a SAP monitor for the specified subscription, resource group, and resource name.
157
- * @summary Creates a SAP monitor.
269
+ * Deletes a SAP monitor with the specified subscription, resource group, and monitor name.
158
270
  * @param resourceGroupName Name of the resource group.
159
271
  * @param sapMonitorName Name of the SAP monitor resource.
160
- * @param sapMonitorParameter Request body representing a SAP Monitor
161
- * @param [options] The optional parameters
162
- * @returns Promise<msRestAzure.LROPoller>
272
+ * @param options The options parameters.
163
273
  */
164
- beginCreate(resourceGroupName: string, sapMonitorName: string, sapMonitorParameter: Models.SapMonitor, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
165
- return this.client.sendLRORequest(
166
- {
167
- resourceGroupName,
168
- sapMonitorName,
169
- sapMonitorParameter,
170
- options
171
- },
172
- beginCreateOperationSpec,
173
- options);
274
+ async beginDeleteAndWait(
275
+ resourceGroupName: string,
276
+ sapMonitorName: string,
277
+ options?: SapMonitorsDeleteOptionalParams
278
+ ): Promise<void> {
279
+ const poller = await this.beginDelete(
280
+ resourceGroupName,
281
+ sapMonitorName,
282
+ options
283
+ );
284
+ return poller.pollUntilDone();
174
285
  }
175
286
 
176
287
  /**
177
- * Deletes a SAP monitor with the specified subscription, resource group, and monitor name.
178
- * @summary Deletes a SAP monitor.
288
+ * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor
289
+ * name.
179
290
  * @param resourceGroupName Name of the resource group.
180
291
  * @param sapMonitorName Name of the SAP monitor resource.
181
- * @param [options] The optional parameters
182
- * @returns Promise<msRestAzure.LROPoller>
292
+ * @param tagsParameter Request body that only contains the new Tags field
293
+ * @param options The options parameters.
183
294
  */
184
- beginDeleteMethod(resourceGroupName: string, sapMonitorName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
185
- return this.client.sendLRORequest(
186
- {
187
- resourceGroupName,
188
- sapMonitorName,
189
- options
190
- },
191
- beginDeleteMethodOperationSpec,
192
- options);
295
+ update(
296
+ resourceGroupName: string,
297
+ sapMonitorName: string,
298
+ tagsParameter: Tags,
299
+ options?: SapMonitorsUpdateOptionalParams
300
+ ): Promise<SapMonitorsUpdateResponse> {
301
+ return this.client.sendOperationRequest(
302
+ { resourceGroupName, sapMonitorName, tagsParameter, options },
303
+ updateOperationSpec
304
+ );
193
305
  }
194
306
 
195
307
  /**
196
- * Gets a list of SAP monitors in the specified subscription. The operations returns various
197
- * properties of each SAP monitor.
198
- * @summary Gets a list of SAP monitors in the specified subscription.
199
- * @param nextPageLink The NextLink from the previous successful call to List operation.
200
- * @param [options] The optional parameters
201
- * @returns Promise<Models.SapMonitorsListNextResponse>
202
- */
203
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.SapMonitorsListNextResponse>;
204
- /**
205
- * @param nextPageLink The NextLink from the previous successful call to List operation.
206
- * @param callback The callback
207
- */
208
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.SapMonitorListResult>): void;
209
- /**
210
- * @param nextPageLink The NextLink from the previous successful call to List operation.
211
- * @param options The optional parameters
212
- * @param callback The callback
308
+ * ListNext
309
+ * @param nextLink The nextLink from the previous successful call to the List method.
310
+ * @param options The options parameters.
213
311
  */
214
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SapMonitorListResult>): void;
215
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SapMonitorListResult>, callback?: msRest.ServiceCallback<Models.SapMonitorListResult>): Promise<Models.SapMonitorsListNextResponse> {
312
+ private _listNext(
313
+ nextLink: string,
314
+ options?: SapMonitorsListNextOptionalParams
315
+ ): Promise<SapMonitorsListNextResponse> {
216
316
  return this.client.sendOperationRequest(
217
- {
218
- nextPageLink,
219
- options
220
- },
221
- listNextOperationSpec,
222
- callback) as Promise<Models.SapMonitorsListNextResponse>;
317
+ { nextLink, options },
318
+ listNextOperationSpec
319
+ );
223
320
  }
224
321
  }
225
-
226
322
  // Operation Specifications
227
- const serializer = new msRest.Serializer(Mappers);
228
- const listOperationSpec: msRest.OperationSpec = {
323
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
324
+
325
+ const listOperationSpec: coreClient.OperationSpec = {
326
+ path:
327
+ "/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors",
229
328
  httpMethod: "GET",
230
- path: "subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors",
231
- urlParameters: [
232
- Parameters.subscriptionId
233
- ],
234
- queryParameters: [
235
- Parameters.apiVersion
236
- ],
237
- headerParameters: [
238
- Parameters.acceptLanguage
239
- ],
240
329
  responses: {
241
330
  200: {
242
331
  bodyMapper: Mappers.SapMonitorListResult
@@ -245,23 +334,15 @@ const listOperationSpec: msRest.OperationSpec = {
245
334
  bodyMapper: Mappers.ErrorResponse
246
335
  }
247
336
  },
337
+ queryParameters: [Parameters.apiVersion],
338
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
339
+ headerParameters: [Parameters.accept],
248
340
  serializer
249
341
  };
250
-
251
- const getOperationSpec: msRest.OperationSpec = {
342
+ const getOperationSpec: coreClient.OperationSpec = {
343
+ path:
344
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
252
345
  httpMethod: "GET",
253
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
254
- urlParameters: [
255
- Parameters.subscriptionId,
256
- Parameters.resourceGroupName,
257
- Parameters.sapMonitorName
258
- ],
259
- queryParameters: [
260
- Parameters.apiVersion
261
- ],
262
- headerParameters: [
263
- Parameters.acceptLanguage
264
- ],
265
346
  responses: {
266
347
  200: {
267
348
  bodyMapper: Mappers.SapMonitor
@@ -270,62 +351,20 @@ const getOperationSpec: msRest.OperationSpec = {
270
351
  bodyMapper: Mappers.ErrorResponse
271
352
  }
272
353
  },
273
- serializer
274
- };
275
-
276
- const updateOperationSpec: msRest.OperationSpec = {
277
- httpMethod: "PATCH",
278
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
354
+ queryParameters: [Parameters.apiVersion],
279
355
  urlParameters: [
356
+ Parameters.$host,
280
357
  Parameters.subscriptionId,
281
358
  Parameters.resourceGroupName,
282
359
  Parameters.sapMonitorName
283
360
  ],
284
- queryParameters: [
285
- Parameters.apiVersion
286
- ],
287
- headerParameters: [
288
- Parameters.acceptLanguage
289
- ],
290
- requestBody: {
291
- parameterPath: "tagsParameter",
292
- mapper: {
293
- ...Mappers.Tags,
294
- required: true
295
- }
296
- },
297
- responses: {
298
- 200: {
299
- bodyMapper: Mappers.SapMonitor
300
- },
301
- default: {
302
- bodyMapper: Mappers.ErrorResponse
303
- }
304
- },
361
+ headerParameters: [Parameters.accept],
305
362
  serializer
306
363
  };
307
-
308
- const beginCreateOperationSpec: msRest.OperationSpec = {
364
+ const createOperationSpec: coreClient.OperationSpec = {
365
+ path:
366
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
309
367
  httpMethod: "PUT",
310
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
311
- urlParameters: [
312
- Parameters.subscriptionId,
313
- Parameters.resourceGroupName,
314
- Parameters.sapMonitorName
315
- ],
316
- queryParameters: [
317
- Parameters.apiVersion
318
- ],
319
- headerParameters: [
320
- Parameters.acceptLanguage
321
- ],
322
- requestBody: {
323
- parameterPath: "sapMonitorParameter",
324
- mapper: {
325
- ...Mappers.SapMonitor,
326
- required: true
327
- }
328
- },
329
368
  responses: {
330
369
  200: {
331
370
  bodyMapper: Mappers.SapMonitor
@@ -333,48 +372,78 @@ const beginCreateOperationSpec: msRest.OperationSpec = {
333
372
  201: {
334
373
  bodyMapper: Mappers.SapMonitor
335
374
  },
375
+ 202: {
376
+ bodyMapper: Mappers.SapMonitor
377
+ },
378
+ 204: {
379
+ bodyMapper: Mappers.SapMonitor
380
+ },
336
381
  default: {
337
382
  bodyMapper: Mappers.ErrorResponse
338
383
  }
339
384
  },
340
- serializer
341
- };
342
-
343
- const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
344
- httpMethod: "DELETE",
345
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
385
+ requestBody: Parameters.sapMonitorParameter,
386
+ queryParameters: [Parameters.apiVersion],
346
387
  urlParameters: [
388
+ Parameters.$host,
347
389
  Parameters.subscriptionId,
348
390
  Parameters.resourceGroupName,
349
391
  Parameters.sapMonitorName
350
392
  ],
351
- queryParameters: [
352
- Parameters.apiVersion
353
- ],
354
- headerParameters: [
355
- Parameters.acceptLanguage
356
- ],
393
+ headerParameters: [Parameters.accept, Parameters.contentType],
394
+ mediaType: "json",
395
+ serializer
396
+ };
397
+ const deleteOperationSpec: coreClient.OperationSpec = {
398
+ path:
399
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
400
+ httpMethod: "DELETE",
357
401
  responses: {
358
402
  200: {},
403
+ 201: {},
359
404
  202: {},
360
405
  204: {},
361
406
  default: {
362
407
  bodyMapper: Mappers.ErrorResponse
363
408
  }
364
409
  },
410
+ queryParameters: [Parameters.apiVersion],
411
+ urlParameters: [
412
+ Parameters.$host,
413
+ Parameters.subscriptionId,
414
+ Parameters.resourceGroupName,
415
+ Parameters.sapMonitorName
416
+ ],
417
+ headerParameters: [Parameters.accept],
365
418
  serializer
366
419
  };
367
-
368
- const listNextOperationSpec: msRest.OperationSpec = {
369
- httpMethod: "GET",
370
- baseUrl: "https://management.azure.com",
371
- path: "{nextLink}",
420
+ const updateOperationSpec: coreClient.OperationSpec = {
421
+ path:
422
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/sapMonitors/{sapMonitorName}",
423
+ httpMethod: "PATCH",
424
+ responses: {
425
+ 200: {
426
+ bodyMapper: Mappers.SapMonitor
427
+ },
428
+ default: {
429
+ bodyMapper: Mappers.ErrorResponse
430
+ }
431
+ },
432
+ requestBody: Parameters.tagsParameter,
433
+ queryParameters: [Parameters.apiVersion],
372
434
  urlParameters: [
373
- Parameters.nextPageLink
374
- ],
375
- headerParameters: [
376
- Parameters.acceptLanguage
435
+ Parameters.$host,
436
+ Parameters.subscriptionId,
437
+ Parameters.resourceGroupName,
438
+ Parameters.sapMonitorName
377
439
  ],
440
+ headerParameters: [Parameters.accept, Parameters.contentType],
441
+ mediaType: "json",
442
+ serializer
443
+ };
444
+ const listNextOperationSpec: coreClient.OperationSpec = {
445
+ path: "{nextLink}",
446
+ httpMethod: "GET",
378
447
  responses: {
379
448
  200: {
380
449
  bodyMapper: Mappers.SapMonitorListResult
@@ -383,5 +452,12 @@ const listNextOperationSpec: msRest.OperationSpec = {
383
452
  bodyMapper: Mappers.ErrorResponse
384
453
  }
385
454
  },
455
+ queryParameters: [Parameters.apiVersion],
456
+ urlParameters: [
457
+ Parameters.$host,
458
+ Parameters.subscriptionId,
459
+ Parameters.nextLink
460
+ ],
461
+ headerParameters: [Parameters.accept],
386
462
  serializer
387
463
  };