@azure/arm-search 1.3.0 → 3.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 (199) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{LICENSE.txt → LICENSE} +21 -21
  3. package/README.md +98 -96
  4. package/dist/index.js +2926 -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/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +692 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +21 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +35 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/dist-esm/src/models/mappers.js +1013 -0
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +22 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +182 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/adminKeys.d.ts +33 -0
  29. package/dist-esm/src/operations/adminKeys.d.ts.map +1 -0
  30. package/dist-esm/src/operations/adminKeys.js +90 -0
  31. package/dist-esm/src/operations/adminKeys.js.map +1 -0
  32. package/dist-esm/src/operations/index.d.ts +8 -0
  33. package/dist-esm/src/operations/index.d.ts.map +1 -0
  34. package/dist-esm/src/operations/index.js +15 -0
  35. package/dist-esm/src/operations/index.js.map +1 -0
  36. package/dist-esm/src/operations/operations.d.ts +26 -0
  37. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  38. package/dist-esm/src/operations/operations.js +90 -0
  39. package/dist-esm/src/operations/operations.js.map +1 -0
  40. package/dist-esm/src/operations/privateEndpointConnections.d.ts +79 -0
  41. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  42. package/dist-esm/src/operations/privateEndpointConnections.js +273 -0
  43. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  44. package/dist-esm/src/operations/privateLinkResources.d.ts +34 -0
  45. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  46. package/dist-esm/src/operations/privateLinkResources.js +103 -0
  47. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  48. package/dist-esm/src/operations/queryKeys.d.ts +66 -0
  49. package/dist-esm/src/operations/queryKeys.d.ts.map +1 -0
  50. package/dist-esm/src/operations/queryKeys.js +213 -0
  51. package/dist-esm/src/operations/queryKeys.js.map +1 -0
  52. package/dist-esm/src/operations/services.d.ts +123 -0
  53. package/dist-esm/src/operations/services.d.ts.map +1 -0
  54. package/dist-esm/src/operations/services.js +475 -0
  55. package/dist-esm/src/operations/services.js.map +1 -0
  56. package/dist-esm/src/operations/sharedPrivateLinkResources.d.ts +107 -0
  57. package/dist-esm/src/operations/sharedPrivateLinkResources.d.ts.map +1 -0
  58. package/dist-esm/src/operations/sharedPrivateLinkResources.js +379 -0
  59. package/dist-esm/src/operations/sharedPrivateLinkResources.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/adminKeys.d.ts +25 -0
  61. package/dist-esm/src/operationsInterfaces/adminKeys.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/adminKeys.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/adminKeys.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/index.d.ts +8 -0
  65. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/index.js +15 -0
  67. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  69. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +50 -0
  73. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +15 -0
  77. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/queryKeys.d.ts +37 -0
  81. package/dist-esm/src/operationsInterfaces/queryKeys.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/queryKeys.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/queryKeys.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/services.d.ts +85 -0
  85. package/dist-esm/src/operationsInterfaces/services.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/services.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/services.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/sharedPrivateLinkResources.d.ts +78 -0
  89. package/dist-esm/src/operationsInterfaces/sharedPrivateLinkResources.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/sharedPrivateLinkResources.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/sharedPrivateLinkResources.js.map +1 -0
  92. package/dist-esm/src/searchManagementClient.d.ts +25 -0
  93. package/dist-esm/src/searchManagementClient.d.ts.map +1 -0
  94. package/dist-esm/src/searchManagementClient.js +58 -0
  95. package/dist-esm/src/searchManagementClient.js.map +1 -0
  96. package/dist-esm/test/search_examples.d.ts +4 -0
  97. package/dist-esm/test/search_examples.d.ts.map +1 -0
  98. package/dist-esm/test/search_examples.js +163 -0
  99. package/dist-esm/test/search_examples.js.map +1 -0
  100. package/package.json +70 -34
  101. package/review/arm-search.api.md +600 -0
  102. package/rollup.config.js +184 -27
  103. package/src/index.ts +12 -0
  104. package/src/lroImpl.ts +34 -0
  105. package/src/models/index.ts +837 -0
  106. package/src/models/mappers.ts +1092 -0
  107. package/src/models/parameters.ts +213 -0
  108. package/src/operations/adminKeys.ts +122 -0
  109. package/{lib → src}/operations/index.ts +6 -5
  110. package/src/operations/operations.ts +98 -0
  111. package/src/operations/privateEndpointConnections.ts +363 -0
  112. package/src/operations/privateLinkResources.ts +139 -0
  113. package/src/operations/queryKeys.ts +288 -0
  114. package/src/operations/services.ts +606 -0
  115. package/src/operations/sharedPrivateLinkResources.ts +525 -0
  116. package/src/operationsInterfaces/adminKeys.ts +48 -0
  117. package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +7 -6
  118. package/src/operationsInterfaces/operations.ts +22 -0
  119. package/src/operationsInterfaces/privateEndpointConnections.ts +88 -0
  120. package/src/operationsInterfaces/privateLinkResources.ts +31 -0
  121. package/src/operationsInterfaces/queryKeys.ts +66 -0
  122. package/src/operationsInterfaces/services.ts +144 -0
  123. package/src/operationsInterfaces/sharedPrivateLinkResources.ts +131 -0
  124. package/src/searchManagementClient.ts +104 -0
  125. package/tsconfig.json +4 -4
  126. package/types/arm-search.d.ts +1104 -0
  127. package/types/tsdoc-metadata.json +11 -0
  128. package/dist/arm-search.js +0 -1329
  129. package/dist/arm-search.js.map +0 -1
  130. package/dist/arm-search.min.js +0 -1
  131. package/dist/arm-search.min.js.map +0 -1
  132. package/esm/models/adminKeysMappers.d.ts +0 -2
  133. package/esm/models/adminKeysMappers.d.ts.map +0 -1
  134. package/esm/models/adminKeysMappers.js +0 -11
  135. package/esm/models/adminKeysMappers.js.map +0 -1
  136. package/esm/models/index.d.ts +0 -788
  137. package/esm/models/index.d.ts.map +0 -1
  138. package/esm/models/index.js +0 -10
  139. package/esm/models/index.js.map +0 -1
  140. package/esm/models/mappers.d.ts +0 -18
  141. package/esm/models/mappers.d.ts.map +0 -1
  142. package/esm/models/mappers.js +0 -438
  143. package/esm/models/mappers.js.map +0 -1
  144. package/esm/models/operationsMappers.d.ts +0 -2
  145. package/esm/models/operationsMappers.d.ts.map +0 -1
  146. package/esm/models/operationsMappers.js +0 -11
  147. package/esm/models/operationsMappers.js.map +0 -1
  148. package/esm/models/parameters.d.ts +0 -11
  149. package/esm/models/parameters.d.ts.map +0 -1
  150. package/esm/models/parameters.js +0 -107
  151. package/esm/models/parameters.js.map +0 -1
  152. package/esm/models/queryKeysMappers.d.ts +0 -2
  153. package/esm/models/queryKeysMappers.d.ts.map +0 -1
  154. package/esm/models/queryKeysMappers.js +0 -11
  155. package/esm/models/queryKeysMappers.js.map +0 -1
  156. package/esm/models/servicesMappers.d.ts +0 -2
  157. package/esm/models/servicesMappers.d.ts.map +0 -1
  158. package/esm/models/servicesMappers.js +0 -11
  159. package/esm/models/servicesMappers.js.map +0 -1
  160. package/esm/operations/adminKeys.d.ts +0 -74
  161. package/esm/operations/adminKeys.d.ts.map +0 -1
  162. package/esm/operations/adminKeys.js +0 -93
  163. package/esm/operations/adminKeys.js.map +0 -1
  164. package/esm/operations/index.d.ts +0 -5
  165. package/esm/operations/index.d.ts.map +0 -1
  166. package/esm/operations/index.js.map +0 -1
  167. package/esm/operations/operations.d.ts +0 -28
  168. package/esm/operations/operations.d.ts.map +0 -1
  169. package/esm/operations/operations.js +0 -51
  170. package/esm/operations/operations.js.map +0 -1
  171. package/esm/operations/queryKeys.d.ts +0 -102
  172. package/esm/operations/queryKeys.d.ts.map +0 -1
  173. package/esm/operations/queryKeys.js +0 -127
  174. package/esm/operations/queryKeys.js.map +0 -1
  175. package/esm/operations/services.d.ts +0 -174
  176. package/esm/operations/services.d.ts.map +0 -1
  177. package/esm/operations/services.js +0 -268
  178. package/esm/operations/services.js.map +0 -1
  179. package/esm/searchManagementClient.d.ts +0 -22
  180. package/esm/searchManagementClient.d.ts.map +0 -1
  181. package/esm/searchManagementClient.js +0 -37
  182. package/esm/searchManagementClient.js.map +0 -1
  183. package/esm/searchManagementClientContext.d.ts +0 -17
  184. package/esm/searchManagementClientContext.d.ts.map +0 -1
  185. package/esm/searchManagementClientContext.js +0 -57
  186. package/esm/searchManagementClientContext.js.map +0 -1
  187. package/lib/models/adminKeysMappers.ts +0 -15
  188. package/lib/models/index.ts +0 -842
  189. package/lib/models/mappers.ts +0 -462
  190. package/lib/models/operationsMappers.ts +0 -17
  191. package/lib/models/parameters.ts +0 -109
  192. package/lib/models/queryKeysMappers.ts +0 -16
  193. package/lib/models/servicesMappers.ts +0 -22
  194. package/lib/operations/adminKeys.ts +0 -167
  195. package/lib/operations/operations.ts +0 -74
  196. package/lib/operations/queryKeys.ts +0 -234
  197. package/lib/operations/services.ts +0 -439
  198. package/lib/searchManagementClient.ts +0 -49
  199. package/lib/searchManagementClientContext.ts +0 -63
@@ -0,0 +1,606 @@
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 { Services } 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 { SearchManagementClient } from "../searchManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ SearchService,
19
+ ServicesListByResourceGroupNextOptionalParams,
20
+ ServicesListByResourceGroupOptionalParams,
21
+ ServicesListBySubscriptionNextOptionalParams,
22
+ ServicesListBySubscriptionOptionalParams,
23
+ ServicesCreateOrUpdateOptionalParams,
24
+ ServicesCreateOrUpdateResponse,
25
+ SearchServiceUpdate,
26
+ ServicesUpdateOptionalParams,
27
+ ServicesUpdateResponse,
28
+ ServicesGetOptionalParams,
29
+ ServicesGetResponse,
30
+ ServicesDeleteOptionalParams,
31
+ ServicesListByResourceGroupResponse,
32
+ ServicesListBySubscriptionResponse,
33
+ ServicesCheckNameAvailabilityOptionalParams,
34
+ ServicesCheckNameAvailabilityResponse,
35
+ ServicesListByResourceGroupNextResponse,
36
+ ServicesListBySubscriptionNextResponse
37
+ } from "../models";
38
+
39
+ /// <reference lib="esnext.asynciterable" />
40
+ /** Class containing Services operations. */
41
+ export class ServicesImpl implements Services {
42
+ private readonly client: SearchManagementClient;
43
+
44
+ /**
45
+ * Initialize a new instance of the class Services class.
46
+ * @param client Reference to the service client
47
+ */
48
+ constructor(client: SearchManagementClient) {
49
+ this.client = client;
50
+ }
51
+
52
+ /**
53
+ * Gets a list of all search services in the given resource group.
54
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
55
+ * obtain this value from the Azure Resource Manager API or the portal.
56
+ * @param options The options parameters.
57
+ */
58
+ public listByResourceGroup(
59
+ resourceGroupName: string,
60
+ options?: ServicesListByResourceGroupOptionalParams
61
+ ): PagedAsyncIterableIterator<SearchService> {
62
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
63
+ return {
64
+ next() {
65
+ return iter.next();
66
+ },
67
+ [Symbol.asyncIterator]() {
68
+ return this;
69
+ },
70
+ byPage: () => {
71
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
72
+ }
73
+ };
74
+ }
75
+
76
+ private async *listByResourceGroupPagingPage(
77
+ resourceGroupName: string,
78
+ options?: ServicesListByResourceGroupOptionalParams
79
+ ): AsyncIterableIterator<SearchService[]> {
80
+ let result = await this._listByResourceGroup(resourceGroupName, options);
81
+ yield result.value || [];
82
+ let continuationToken = result.nextLink;
83
+ while (continuationToken) {
84
+ result = await this._listByResourceGroupNext(
85
+ resourceGroupName,
86
+ continuationToken,
87
+ options
88
+ );
89
+ continuationToken = result.nextLink;
90
+ yield result.value || [];
91
+ }
92
+ }
93
+
94
+ private async *listByResourceGroupPagingAll(
95
+ resourceGroupName: string,
96
+ options?: ServicesListByResourceGroupOptionalParams
97
+ ): AsyncIterableIterator<SearchService> {
98
+ for await (const page of this.listByResourceGroupPagingPage(
99
+ resourceGroupName,
100
+ options
101
+ )) {
102
+ yield* page;
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Gets a list of all search services in the given subscription.
108
+ * @param options The options parameters.
109
+ */
110
+ public listBySubscription(
111
+ options?: ServicesListBySubscriptionOptionalParams
112
+ ): PagedAsyncIterableIterator<SearchService> {
113
+ const iter = this.listBySubscriptionPagingAll(options);
114
+ return {
115
+ next() {
116
+ return iter.next();
117
+ },
118
+ [Symbol.asyncIterator]() {
119
+ return this;
120
+ },
121
+ byPage: () => {
122
+ return this.listBySubscriptionPagingPage(options);
123
+ }
124
+ };
125
+ }
126
+
127
+ private async *listBySubscriptionPagingPage(
128
+ options?: ServicesListBySubscriptionOptionalParams
129
+ ): AsyncIterableIterator<SearchService[]> {
130
+ let result = await this._listBySubscription(options);
131
+ yield result.value || [];
132
+ let continuationToken = result.nextLink;
133
+ while (continuationToken) {
134
+ result = await this._listBySubscriptionNext(continuationToken, options);
135
+ continuationToken = result.nextLink;
136
+ yield result.value || [];
137
+ }
138
+ }
139
+
140
+ private async *listBySubscriptionPagingAll(
141
+ options?: ServicesListBySubscriptionOptionalParams
142
+ ): AsyncIterableIterator<SearchService> {
143
+ for await (const page of this.listBySubscriptionPagingPage(options)) {
144
+ yield* page;
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Creates or updates a search service in the given resource group. If the search service already
150
+ * exists, all properties will be updated with the given values.
151
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
152
+ * obtain this value from the Azure Resource Manager API or the portal.
153
+ * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search
154
+ * service names must only contain lowercase letters, digits or dashes, cannot use dash as the first
155
+ * two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60
156
+ * characters in length. Search service names must be globally unique since they are part of the
157
+ * service URI (https://<name>.search.windows.net). You cannot change the service name after the
158
+ * service is created.
159
+ * @param service The definition of the search service to create or update.
160
+ * @param options The options parameters.
161
+ */
162
+ async beginCreateOrUpdate(
163
+ resourceGroupName: string,
164
+ searchServiceName: string,
165
+ service: SearchService,
166
+ options?: ServicesCreateOrUpdateOptionalParams
167
+ ): Promise<
168
+ PollerLike<
169
+ PollOperationState<ServicesCreateOrUpdateResponse>,
170
+ ServicesCreateOrUpdateResponse
171
+ >
172
+ > {
173
+ const directSendOperation = async (
174
+ args: coreClient.OperationArguments,
175
+ spec: coreClient.OperationSpec
176
+ ): Promise<ServicesCreateOrUpdateResponse> => {
177
+ return this.client.sendOperationRequest(args, spec);
178
+ };
179
+ const sendOperation = async (
180
+ args: coreClient.OperationArguments,
181
+ spec: coreClient.OperationSpec
182
+ ) => {
183
+ let currentRawResponse:
184
+ | coreClient.FullOperationResponse
185
+ | undefined = undefined;
186
+ const providedCallback = args.options?.onResponse;
187
+ const callback: coreClient.RawResponseCallback = (
188
+ rawResponse: coreClient.FullOperationResponse,
189
+ flatResponse: unknown
190
+ ) => {
191
+ currentRawResponse = rawResponse;
192
+ providedCallback?.(rawResponse, flatResponse);
193
+ };
194
+ const updatedArgs = {
195
+ ...args,
196
+ options: {
197
+ ...args.options,
198
+ onResponse: callback
199
+ }
200
+ };
201
+ const flatResponse = await directSendOperation(updatedArgs, spec);
202
+ return {
203
+ flatResponse,
204
+ rawResponse: {
205
+ statusCode: currentRawResponse!.status,
206
+ body: currentRawResponse!.parsedBody,
207
+ headers: currentRawResponse!.headers.toJSON()
208
+ }
209
+ };
210
+ };
211
+
212
+ const lro = new LroImpl(
213
+ sendOperation,
214
+ { resourceGroupName, searchServiceName, service, options },
215
+ createOrUpdateOperationSpec
216
+ );
217
+ return new LroEngine(lro, {
218
+ resumeFrom: options?.resumeFrom,
219
+ intervalInMs: options?.updateIntervalInMs
220
+ });
221
+ }
222
+
223
+ /**
224
+ * Creates or updates a search service in the given resource group. If the search service already
225
+ * exists, all properties will be updated with the given values.
226
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
227
+ * obtain this value from the Azure Resource Manager API or the portal.
228
+ * @param searchServiceName The name of the Azure Cognitive Search service to create or update. Search
229
+ * service names must only contain lowercase letters, digits or dashes, cannot use dash as the first
230
+ * two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60
231
+ * characters in length. Search service names must be globally unique since they are part of the
232
+ * service URI (https://<name>.search.windows.net). You cannot change the service name after the
233
+ * service is created.
234
+ * @param service The definition of the search service to create or update.
235
+ * @param options The options parameters.
236
+ */
237
+ async beginCreateOrUpdateAndWait(
238
+ resourceGroupName: string,
239
+ searchServiceName: string,
240
+ service: SearchService,
241
+ options?: ServicesCreateOrUpdateOptionalParams
242
+ ): Promise<ServicesCreateOrUpdateResponse> {
243
+ const poller = await this.beginCreateOrUpdate(
244
+ resourceGroupName,
245
+ searchServiceName,
246
+ service,
247
+ options
248
+ );
249
+ return poller.pollUntilDone();
250
+ }
251
+
252
+ /**
253
+ * Updates an existing search service in the given resource group.
254
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
255
+ * obtain this value from the Azure Resource Manager API or the portal.
256
+ * @param searchServiceName The name of the Azure Cognitive Search service to update.
257
+ * @param service The definition of the search service to update.
258
+ * @param options The options parameters.
259
+ */
260
+ update(
261
+ resourceGroupName: string,
262
+ searchServiceName: string,
263
+ service: SearchServiceUpdate,
264
+ options?: ServicesUpdateOptionalParams
265
+ ): Promise<ServicesUpdateResponse> {
266
+ return this.client.sendOperationRequest(
267
+ { resourceGroupName, searchServiceName, service, options },
268
+ updateOperationSpec
269
+ );
270
+ }
271
+
272
+ /**
273
+ * Gets the search service with the given name in the given resource group.
274
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
275
+ * obtain this value from the Azure Resource Manager API or the portal.
276
+ * @param searchServiceName The name of the Azure Cognitive Search service associated with the
277
+ * specified resource group.
278
+ * @param options The options parameters.
279
+ */
280
+ get(
281
+ resourceGroupName: string,
282
+ searchServiceName: string,
283
+ options?: ServicesGetOptionalParams
284
+ ): Promise<ServicesGetResponse> {
285
+ return this.client.sendOperationRequest(
286
+ { resourceGroupName, searchServiceName, options },
287
+ getOperationSpec
288
+ );
289
+ }
290
+
291
+ /**
292
+ * Deletes a search service in the given resource group, along with its associated resources.
293
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
294
+ * obtain this value from the Azure Resource Manager API or the portal.
295
+ * @param searchServiceName The name of the Azure Cognitive Search service associated with the
296
+ * specified resource group.
297
+ * @param options The options parameters.
298
+ */
299
+ delete(
300
+ resourceGroupName: string,
301
+ searchServiceName: string,
302
+ options?: ServicesDeleteOptionalParams
303
+ ): Promise<void> {
304
+ return this.client.sendOperationRequest(
305
+ { resourceGroupName, searchServiceName, options },
306
+ deleteOperationSpec
307
+ );
308
+ }
309
+
310
+ /**
311
+ * Gets a list of all search services in the given resource group.
312
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
313
+ * obtain this value from the Azure Resource Manager API or the portal.
314
+ * @param options The options parameters.
315
+ */
316
+ private _listByResourceGroup(
317
+ resourceGroupName: string,
318
+ options?: ServicesListByResourceGroupOptionalParams
319
+ ): Promise<ServicesListByResourceGroupResponse> {
320
+ return this.client.sendOperationRequest(
321
+ { resourceGroupName, options },
322
+ listByResourceGroupOperationSpec
323
+ );
324
+ }
325
+
326
+ /**
327
+ * Gets a list of all search services in the given subscription.
328
+ * @param options The options parameters.
329
+ */
330
+ private _listBySubscription(
331
+ options?: ServicesListBySubscriptionOptionalParams
332
+ ): Promise<ServicesListBySubscriptionResponse> {
333
+ return this.client.sendOperationRequest(
334
+ { options },
335
+ listBySubscriptionOperationSpec
336
+ );
337
+ }
338
+
339
+ /**
340
+ * Checks whether or not the given search service name is available for use. Search service names must
341
+ * be globally unique since they are part of the service URI (https://<name>.search.windows.net).
342
+ * @param name The search service name to validate. Search service names must only contain lowercase
343
+ * letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain
344
+ * consecutive dashes, and must be between 2 and 60 characters in length.
345
+ * @param options The options parameters.
346
+ */
347
+ checkNameAvailability(
348
+ name: string,
349
+ options?: ServicesCheckNameAvailabilityOptionalParams
350
+ ): Promise<ServicesCheckNameAvailabilityResponse> {
351
+ return this.client.sendOperationRequest(
352
+ { name, options },
353
+ checkNameAvailabilityOperationSpec
354
+ );
355
+ }
356
+
357
+ /**
358
+ * ListByResourceGroupNext
359
+ * @param resourceGroupName The name of the resource group within the current subscription. You can
360
+ * obtain this value from the Azure Resource Manager API or the portal.
361
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
362
+ * @param options The options parameters.
363
+ */
364
+ private _listByResourceGroupNext(
365
+ resourceGroupName: string,
366
+ nextLink: string,
367
+ options?: ServicesListByResourceGroupNextOptionalParams
368
+ ): Promise<ServicesListByResourceGroupNextResponse> {
369
+ return this.client.sendOperationRequest(
370
+ { resourceGroupName, nextLink, options },
371
+ listByResourceGroupNextOperationSpec
372
+ );
373
+ }
374
+
375
+ /**
376
+ * ListBySubscriptionNext
377
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
378
+ * @param options The options parameters.
379
+ */
380
+ private _listBySubscriptionNext(
381
+ nextLink: string,
382
+ options?: ServicesListBySubscriptionNextOptionalParams
383
+ ): Promise<ServicesListBySubscriptionNextResponse> {
384
+ return this.client.sendOperationRequest(
385
+ { nextLink, options },
386
+ listBySubscriptionNextOperationSpec
387
+ );
388
+ }
389
+ }
390
+ // Operation Specifications
391
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
392
+
393
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
394
+ path:
395
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
396
+ httpMethod: "PUT",
397
+ responses: {
398
+ 200: {
399
+ bodyMapper: Mappers.SearchService
400
+ },
401
+ 201: {
402
+ bodyMapper: Mappers.SearchService
403
+ },
404
+ 202: {
405
+ bodyMapper: Mappers.SearchService
406
+ },
407
+ 204: {
408
+ bodyMapper: Mappers.SearchService
409
+ },
410
+ default: {
411
+ bodyMapper: Mappers.CloudError
412
+ }
413
+ },
414
+ requestBody: Parameters.service,
415
+ queryParameters: [Parameters.apiVersion],
416
+ urlParameters: [
417
+ Parameters.$host,
418
+ Parameters.resourceGroupName,
419
+ Parameters.searchServiceName,
420
+ Parameters.subscriptionId
421
+ ],
422
+ headerParameters: [
423
+ Parameters.accept,
424
+ Parameters.clientRequestId,
425
+ Parameters.contentType
426
+ ],
427
+ mediaType: "json",
428
+ serializer
429
+ };
430
+ const updateOperationSpec: coreClient.OperationSpec = {
431
+ path:
432
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
433
+ httpMethod: "PATCH",
434
+ responses: {
435
+ 200: {
436
+ bodyMapper: Mappers.SearchService
437
+ },
438
+ default: {
439
+ bodyMapper: Mappers.CloudError
440
+ }
441
+ },
442
+ requestBody: Parameters.service1,
443
+ queryParameters: [Parameters.apiVersion],
444
+ urlParameters: [
445
+ Parameters.$host,
446
+ Parameters.resourceGroupName,
447
+ Parameters.searchServiceName,
448
+ Parameters.subscriptionId
449
+ ],
450
+ headerParameters: [
451
+ Parameters.accept,
452
+ Parameters.clientRequestId,
453
+ Parameters.contentType
454
+ ],
455
+ mediaType: "json",
456
+ serializer
457
+ };
458
+ const getOperationSpec: coreClient.OperationSpec = {
459
+ path:
460
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
461
+ httpMethod: "GET",
462
+ responses: {
463
+ 200: {
464
+ bodyMapper: Mappers.SearchService
465
+ },
466
+ default: {
467
+ bodyMapper: Mappers.CloudError
468
+ }
469
+ },
470
+ queryParameters: [Parameters.apiVersion],
471
+ urlParameters: [
472
+ Parameters.$host,
473
+ Parameters.resourceGroupName,
474
+ Parameters.searchServiceName,
475
+ Parameters.subscriptionId
476
+ ],
477
+ headerParameters: [Parameters.accept, Parameters.clientRequestId],
478
+ serializer
479
+ };
480
+ const deleteOperationSpec: coreClient.OperationSpec = {
481
+ path:
482
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}",
483
+ httpMethod: "DELETE",
484
+ responses: {
485
+ 200: {},
486
+ 204: {},
487
+ 404: {},
488
+ default: {
489
+ bodyMapper: Mappers.CloudError
490
+ }
491
+ },
492
+ queryParameters: [Parameters.apiVersion],
493
+ urlParameters: [
494
+ Parameters.$host,
495
+ Parameters.resourceGroupName,
496
+ Parameters.searchServiceName,
497
+ Parameters.subscriptionId
498
+ ],
499
+ headerParameters: [Parameters.accept, Parameters.clientRequestId],
500
+ serializer
501
+ };
502
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
503
+ path:
504
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices",
505
+ httpMethod: "GET",
506
+ responses: {
507
+ 200: {
508
+ bodyMapper: Mappers.SearchServiceListResult
509
+ },
510
+ default: {
511
+ bodyMapper: Mappers.CloudError
512
+ }
513
+ },
514
+ queryParameters: [Parameters.apiVersion],
515
+ urlParameters: [
516
+ Parameters.$host,
517
+ Parameters.resourceGroupName,
518
+ Parameters.subscriptionId
519
+ ],
520
+ headerParameters: [Parameters.accept, Parameters.clientRequestId],
521
+ serializer
522
+ };
523
+ const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
524
+ path:
525
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices",
526
+ httpMethod: "GET",
527
+ responses: {
528
+ 200: {
529
+ bodyMapper: Mappers.SearchServiceListResult
530
+ },
531
+ default: {
532
+ bodyMapper: Mappers.CloudError
533
+ }
534
+ },
535
+ queryParameters: [Parameters.apiVersion],
536
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
537
+ headerParameters: [Parameters.accept, Parameters.clientRequestId],
538
+ serializer
539
+ };
540
+ const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = {
541
+ path:
542
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability",
543
+ httpMethod: "POST",
544
+ responses: {
545
+ 200: {
546
+ bodyMapper: Mappers.CheckNameAvailabilityOutput
547
+ },
548
+ default: {
549
+ bodyMapper: Mappers.CloudError
550
+ }
551
+ },
552
+ requestBody: {
553
+ parameterPath: { name: ["name"], typeParam: ["typeParam"] },
554
+ mapper: { ...Mappers.CheckNameAvailabilityInput, required: true }
555
+ },
556
+ queryParameters: [Parameters.apiVersion],
557
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
558
+ headerParameters: [
559
+ Parameters.accept,
560
+ Parameters.clientRequestId,
561
+ Parameters.contentType
562
+ ],
563
+ mediaType: "json",
564
+ serializer
565
+ };
566
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
567
+ path: "{nextLink}",
568
+ httpMethod: "GET",
569
+ responses: {
570
+ 200: {
571
+ bodyMapper: Mappers.SearchServiceListResult
572
+ },
573
+ default: {
574
+ bodyMapper: Mappers.CloudError
575
+ }
576
+ },
577
+ queryParameters: [Parameters.apiVersion],
578
+ urlParameters: [
579
+ Parameters.$host,
580
+ Parameters.resourceGroupName,
581
+ Parameters.subscriptionId,
582
+ Parameters.nextLink
583
+ ],
584
+ headerParameters: [Parameters.accept, Parameters.clientRequestId],
585
+ serializer
586
+ };
587
+ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
588
+ path: "{nextLink}",
589
+ httpMethod: "GET",
590
+ responses: {
591
+ 200: {
592
+ bodyMapper: Mappers.SearchServiceListResult
593
+ },
594
+ default: {
595
+ bodyMapper: Mappers.CloudError
596
+ }
597
+ },
598
+ queryParameters: [Parameters.apiVersion],
599
+ urlParameters: [
600
+ Parameters.$host,
601
+ Parameters.subscriptionId,
602
+ Parameters.nextLink
603
+ ],
604
+ headerParameters: [Parameters.accept, Parameters.clientRequestId],
605
+ serializer
606
+ };