@azure/ai-projects 2.0.0 → 2.0.2

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 (319) hide show
  1. package/README.md +5 -5
  2. package/dist/browser/api/aiProjectContext.d.ts.map +1 -1
  3. package/dist/browser/api/aiProjectContext.js +2 -1
  4. package/dist/browser/api/aiProjectContext.js.map +1 -1
  5. package/dist/browser/api/beta/memoryStores/operations.d.ts.map +1 -1
  6. package/dist/browser/api/beta/memoryStores/operations.js +11 -0
  7. package/dist/browser/api/beta/memoryStores/operations.js.map +1 -1
  8. package/dist/browser/api/datasets/operations.d.ts.map +1 -1
  9. package/dist/browser/api/datasets/operations.js +9 -8
  10. package/dist/browser/api/datasets/operations.js.map +1 -1
  11. package/dist/browser/constants.d.ts +1 -1
  12. package/dist/browser/constants.js +1 -1
  13. package/dist/browser/constants.js.map +1 -1
  14. package/dist/browser/static-helpers/pollingHelpers.d.ts +11 -1
  15. package/dist/browser/static-helpers/pollingHelpers.d.ts.map +1 -1
  16. package/dist/browser/static-helpers/pollingHelpers.js +21 -9
  17. package/dist/browser/static-helpers/pollingHelpers.js.map +1 -1
  18. package/dist/commonjs/aiProjectClient.js +1 -0
  19. package/dist/commonjs/aiProjectClient.js.map +1 -1
  20. package/dist/commonjs/api/agents/index.js +1 -0
  21. package/dist/commonjs/api/agents/index.js.map +1 -1
  22. package/dist/commonjs/api/agents/operations.js +1 -0
  23. package/dist/commonjs/api/agents/operations.js.map +1 -1
  24. package/dist/commonjs/api/agents/options.js +1 -0
  25. package/dist/commonjs/api/agents/options.js.map +1 -1
  26. package/dist/commonjs/api/aiProjectContext.d.ts.map +1 -1
  27. package/dist/commonjs/api/aiProjectContext.js +3 -1
  28. package/dist/commonjs/api/aiProjectContext.js.map +3 -3
  29. package/dist/commonjs/api/beta/evaluationTaxonomies/index.js +1 -0
  30. package/dist/commonjs/api/beta/evaluationTaxonomies/index.js.map +1 -1
  31. package/dist/commonjs/api/beta/evaluationTaxonomies/operations.js +1 -0
  32. package/dist/commonjs/api/beta/evaluationTaxonomies/operations.js.map +1 -1
  33. package/dist/commonjs/api/beta/evaluationTaxonomies/options.js +1 -0
  34. package/dist/commonjs/api/beta/evaluationTaxonomies/options.js.map +1 -1
  35. package/dist/commonjs/api/beta/evaluators/index.js +1 -0
  36. package/dist/commonjs/api/beta/evaluators/index.js.map +1 -1
  37. package/dist/commonjs/api/beta/evaluators/operations.js +1 -0
  38. package/dist/commonjs/api/beta/evaluators/operations.js.map +1 -1
  39. package/dist/commonjs/api/beta/evaluators/options.js +1 -0
  40. package/dist/commonjs/api/beta/evaluators/options.js.map +1 -1
  41. package/dist/commonjs/api/beta/insights/index.js +1 -0
  42. package/dist/commonjs/api/beta/insights/index.js.map +1 -1
  43. package/dist/commonjs/api/beta/insights/operations.js +1 -0
  44. package/dist/commonjs/api/beta/insights/operations.js.map +1 -1
  45. package/dist/commonjs/api/beta/insights/options.js +1 -0
  46. package/dist/commonjs/api/beta/insights/options.js.map +1 -1
  47. package/dist/commonjs/api/beta/memoryStores/index.js +1 -0
  48. package/dist/commonjs/api/beta/memoryStores/index.js.map +1 -1
  49. package/dist/commonjs/api/beta/memoryStores/operations.d.ts.map +1 -1
  50. package/dist/commonjs/api/beta/memoryStores/operations.js +13 -1
  51. package/dist/commonjs/api/beta/memoryStores/operations.js.map +3 -3
  52. package/dist/commonjs/api/beta/memoryStores/options.js +1 -0
  53. package/dist/commonjs/api/beta/memoryStores/options.js.map +1 -1
  54. package/dist/commonjs/api/beta/redTeams/index.js +1 -0
  55. package/dist/commonjs/api/beta/redTeams/index.js.map +1 -1
  56. package/dist/commonjs/api/beta/redTeams/operations.js +1 -0
  57. package/dist/commonjs/api/beta/redTeams/operations.js.map +1 -1
  58. package/dist/commonjs/api/beta/redTeams/options.js +1 -0
  59. package/dist/commonjs/api/beta/redTeams/options.js.map +1 -1
  60. package/dist/commonjs/api/beta/schedules/index.js +1 -0
  61. package/dist/commonjs/api/beta/schedules/index.js.map +1 -1
  62. package/dist/commonjs/api/beta/schedules/operations.js +1 -0
  63. package/dist/commonjs/api/beta/schedules/operations.js.map +1 -1
  64. package/dist/commonjs/api/beta/schedules/options.js +1 -0
  65. package/dist/commonjs/api/beta/schedules/options.js.map +1 -1
  66. package/dist/commonjs/api/connections/index.js +1 -0
  67. package/dist/commonjs/api/connections/index.js.map +1 -1
  68. package/dist/commonjs/api/connections/operations.js +1 -0
  69. package/dist/commonjs/api/connections/operations.js.map +1 -1
  70. package/dist/commonjs/api/connections/options.js +1 -0
  71. package/dist/commonjs/api/connections/options.js.map +1 -1
  72. package/dist/commonjs/api/datasets/index.js +1 -0
  73. package/dist/commonjs/api/datasets/index.js.map +1 -1
  74. package/dist/commonjs/api/datasets/operations.d.ts.map +1 -1
  75. package/dist/commonjs/api/datasets/operations.js +10 -8
  76. package/dist/commonjs/api/datasets/operations.js.map +3 -3
  77. package/dist/commonjs/api/datasets/options.js +1 -0
  78. package/dist/commonjs/api/datasets/options.js.map +1 -1
  79. package/dist/commonjs/api/deployments/index.js +1 -0
  80. package/dist/commonjs/api/deployments/index.js.map +1 -1
  81. package/dist/commonjs/api/deployments/operations.js +1 -0
  82. package/dist/commonjs/api/deployments/operations.js.map +1 -1
  83. package/dist/commonjs/api/deployments/options.js +1 -0
  84. package/dist/commonjs/api/deployments/options.js.map +1 -1
  85. package/dist/commonjs/api/evaluationRules/index.js +1 -0
  86. package/dist/commonjs/api/evaluationRules/index.js.map +1 -1
  87. package/dist/commonjs/api/evaluationRules/operations.js +1 -0
  88. package/dist/commonjs/api/evaluationRules/operations.js.map +1 -1
  89. package/dist/commonjs/api/evaluationRules/options.js +1 -0
  90. package/dist/commonjs/api/evaluationRules/options.js.map +1 -1
  91. package/dist/commonjs/api/index.js +1 -0
  92. package/dist/commonjs/api/index.js.map +1 -1
  93. package/dist/commonjs/api/indexes/index.js +1 -0
  94. package/dist/commonjs/api/indexes/index.js.map +1 -1
  95. package/dist/commonjs/api/indexes/operations.js +1 -0
  96. package/dist/commonjs/api/indexes/operations.js.map +1 -1
  97. package/dist/commonjs/api/indexes/options.js +1 -0
  98. package/dist/commonjs/api/indexes/options.js.map +1 -1
  99. package/dist/commonjs/api/telemetry/index.js +1 -0
  100. package/dist/commonjs/api/telemetry/index.js.map +1 -1
  101. package/dist/commonjs/api/telemetry/operations.js +1 -0
  102. package/dist/commonjs/api/telemetry/operations.js.map +1 -1
  103. package/dist/commonjs/classic/agents/index.js +1 -0
  104. package/dist/commonjs/classic/agents/index.js.map +1 -1
  105. package/dist/commonjs/classic/beta/evaluationTaxonomies/index.js +1 -0
  106. package/dist/commonjs/classic/beta/evaluationTaxonomies/index.js.map +1 -1
  107. package/dist/commonjs/classic/beta/evaluators/index.js +1 -0
  108. package/dist/commonjs/classic/beta/evaluators/index.js.map +1 -1
  109. package/dist/commonjs/classic/beta/index.js +1 -0
  110. package/dist/commonjs/classic/beta/index.js.map +1 -1
  111. package/dist/commonjs/classic/beta/insights/index.js +1 -0
  112. package/dist/commonjs/classic/beta/insights/index.js.map +1 -1
  113. package/dist/commonjs/classic/beta/memoryStores/index.js +1 -0
  114. package/dist/commonjs/classic/beta/memoryStores/index.js.map +1 -1
  115. package/dist/commonjs/classic/beta/redTeams/index.js +1 -0
  116. package/dist/commonjs/classic/beta/redTeams/index.js.map +1 -1
  117. package/dist/commonjs/classic/beta/schedules/index.js +1 -0
  118. package/dist/commonjs/classic/beta/schedules/index.js.map +1 -1
  119. package/dist/commonjs/classic/connections/index.js +1 -0
  120. package/dist/commonjs/classic/connections/index.js.map +1 -1
  121. package/dist/commonjs/classic/datasets/index.js +1 -0
  122. package/dist/commonjs/classic/datasets/index.js.map +1 -1
  123. package/dist/commonjs/classic/deployments/index.js +1 -0
  124. package/dist/commonjs/classic/deployments/index.js.map +1 -1
  125. package/dist/commonjs/classic/evaluationRules/index.js +1 -0
  126. package/dist/commonjs/classic/evaluationRules/index.js.map +1 -1
  127. package/dist/commonjs/classic/index.js +1 -0
  128. package/dist/commonjs/classic/index.js.map +1 -1
  129. package/dist/commonjs/classic/indexes/index.js +1 -0
  130. package/dist/commonjs/classic/indexes/index.js.map +1 -1
  131. package/dist/commonjs/classic/telemetry/index.js +1 -0
  132. package/dist/commonjs/classic/telemetry/index.js.map +1 -1
  133. package/dist/commonjs/constants.d.ts +1 -1
  134. package/dist/commonjs/constants.js +2 -1
  135. package/dist/commonjs/constants.js.map +2 -2
  136. package/dist/commonjs/getCustomFetch.js +1 -0
  137. package/dist/commonjs/getCustomFetch.js.map +1 -1
  138. package/dist/commonjs/index.js +1 -0
  139. package/dist/commonjs/index.js.map +1 -1
  140. package/dist/commonjs/logger.js +1 -0
  141. package/dist/commonjs/logger.js.map +1 -1
  142. package/dist/commonjs/models/index.js +1 -0
  143. package/dist/commonjs/models/index.js.map +1 -1
  144. package/dist/commonjs/models/models.js +1 -0
  145. package/dist/commonjs/models/models.js.map +1 -1
  146. package/dist/commonjs/overwriteOpenAIClient.js +1 -0
  147. package/dist/commonjs/overwriteOpenAIClient.js.map +1 -1
  148. package/dist/commonjs/static-helpers/pagingHelpers.js +1 -0
  149. package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
  150. package/dist/commonjs/static-helpers/pollingHelpers.d.ts +11 -1
  151. package/dist/commonjs/static-helpers/pollingHelpers.d.ts.map +1 -1
  152. package/dist/commonjs/static-helpers/pollingHelpers.js +16 -8
  153. package/dist/commonjs/static-helpers/pollingHelpers.js.map +3 -3
  154. package/dist/commonjs/static-helpers/serialization/serialize-record.js +1 -0
  155. package/dist/commonjs/static-helpers/serialization/serialize-record.js.map +1 -1
  156. package/dist/commonjs/static-helpers/urlTemplate.js +1 -0
  157. package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
  158. package/dist/commonjs/tsdoc-metadata.json +1 -1
  159. package/dist/commonjs/util.js +1 -0
  160. package/dist/commonjs/util.js.map +1 -1
  161. package/dist/esm/aiProjectClient.js +119 -94
  162. package/dist/esm/aiProjectClient.js.map +1 -7
  163. package/dist/esm/api/agents/index.js +4 -28
  164. package/dist/esm/api/agents/index.js.map +1 -7
  165. package/dist/esm/api/agents/operations.js +375 -473
  166. package/dist/esm/api/agents/operations.js.map +1 -7
  167. package/dist/esm/api/agents/options.js +4 -0
  168. package/dist/esm/api/agents/options.js.map +1 -7
  169. package/dist/esm/api/aiProjectContext.d.ts.map +1 -1
  170. package/dist/esm/api/aiProjectContext.js +22 -19
  171. package/dist/esm/api/aiProjectContext.js.map +1 -7
  172. package/dist/esm/api/beta/evaluationTaxonomies/index.js +4 -8
  173. package/dist/esm/api/beta/evaluationTaxonomies/index.js.map +1 -7
  174. package/dist/esm/api/beta/evaluationTaxonomies/operations.js +150 -183
  175. package/dist/esm/api/beta/evaluationTaxonomies/operations.js.map +1 -7
  176. package/dist/esm/api/beta/evaluationTaxonomies/options.js +4 -0
  177. package/dist/esm/api/beta/evaluationTaxonomies/options.js.map +1 -7
  178. package/dist/esm/api/beta/evaluators/index.js +4 -16
  179. package/dist/esm/api/beta/evaluators/index.js.map +1 -7
  180. package/dist/esm/api/beta/evaluators/operations.js +192 -243
  181. package/dist/esm/api/beta/evaluators/operations.js.map +1 -7
  182. package/dist/esm/api/beta/evaluators/options.js +4 -0
  183. package/dist/esm/api/beta/evaluators/options.js.map +1 -7
  184. package/dist/esm/api/beta/insights/index.js +4 -6
  185. package/dist/esm/api/beta/insights/index.js.map +1 -7
  186. package/dist/esm/api/beta/insights/operations.js +109 -126
  187. package/dist/esm/api/beta/insights/operations.js.map +1 -7
  188. package/dist/esm/api/beta/insights/options.js +4 -0
  189. package/dist/esm/api/beta/insights/options.js.map +1 -7
  190. package/dist/esm/api/beta/memoryStores/index.js +4 -22
  191. package/dist/esm/api/beta/memoryStores/index.js.map +1 -7
  192. package/dist/esm/api/beta/memoryStores/operations.d.ts.map +1 -1
  193. package/dist/esm/api/beta/memoryStores/operations.js +305 -363
  194. package/dist/esm/api/beta/memoryStores/operations.js.map +1 -7
  195. package/dist/esm/api/beta/memoryStores/options.js +4 -0
  196. package/dist/esm/api/beta/memoryStores/options.js.map +1 -7
  197. package/dist/esm/api/beta/redTeams/index.js +4 -6
  198. package/dist/esm/api/beta/redTeams/index.js.map +1 -7
  199. package/dist/esm/api/beta/redTeams/operations.js +95 -119
  200. package/dist/esm/api/beta/redTeams/operations.js.map +1 -7
  201. package/dist/esm/api/beta/redTeams/options.js +4 -0
  202. package/dist/esm/api/beta/redTeams/options.js.map +1 -7
  203. package/dist/esm/api/beta/schedules/index.js +4 -9
  204. package/dist/esm/api/beta/schedules/index.js.map +1 -7
  205. package/dist/esm/api/beta/schedules/operations.js +204 -248
  206. package/dist/esm/api/beta/schedules/operations.js.map +1 -7
  207. package/dist/esm/api/beta/schedules/options.js +4 -0
  208. package/dist/esm/api/beta/schedules/options.js.map +1 -7
  209. package/dist/esm/api/connections/index.js +4 -6
  210. package/dist/esm/api/connections/index.js.map +1 -7
  211. package/dist/esm/api/connections/operations.js +109 -116
  212. package/dist/esm/api/connections/operations.js.map +1 -7
  213. package/dist/esm/api/connections/options.js +4 -0
  214. package/dist/esm/api/connections/options.js.map +1 -7
  215. package/dist/esm/api/datasets/index.js +4 -18
  216. package/dist/esm/api/datasets/index.js.map +1 -7
  217. package/dist/esm/api/datasets/operations.d.ts.map +1 -1
  218. package/dist/esm/api/datasets/operations.js +288 -355
  219. package/dist/esm/api/datasets/operations.js.map +1 -7
  220. package/dist/esm/api/datasets/options.js +4 -0
  221. package/dist/esm/api/datasets/options.js.map +1 -7
  222. package/dist/esm/api/deployments/index.js +4 -5
  223. package/dist/esm/api/deployments/index.js.map +1 -7
  224. package/dist/esm/api/deployments/operations.js +57 -70
  225. package/dist/esm/api/deployments/operations.js.map +1 -7
  226. package/dist/esm/api/deployments/options.js +4 -0
  227. package/dist/esm/api/deployments/options.js.map +1 -7
  228. package/dist/esm/api/evaluationRules/index.js +4 -7
  229. package/dist/esm/api/evaluationRules/index.js.map +1 -7
  230. package/dist/esm/api/evaluationRules/operations.js +121 -144
  231. package/dist/esm/api/evaluationRules/operations.js.map +1 -7
  232. package/dist/esm/api/evaluationRules/options.js +4 -0
  233. package/dist/esm/api/evaluationRules/options.js.map +1 -7
  234. package/dist/esm/api/index.js +4 -4
  235. package/dist/esm/api/index.js.map +1 -7
  236. package/dist/esm/api/indexes/index.js +4 -8
  237. package/dist/esm/api/indexes/index.js.map +1 -7
  238. package/dist/esm/api/indexes/operations.js +116 -161
  239. package/dist/esm/api/indexes/operations.js.map +1 -7
  240. package/dist/esm/api/indexes/options.js +4 -0
  241. package/dist/esm/api/indexes/options.js.map +1 -7
  242. package/dist/esm/api/telemetry/index.js +4 -4
  243. package/dist/esm/api/telemetry/index.js.map +1 -7
  244. package/dist/esm/api/telemetry/operations.js +53 -46
  245. package/dist/esm/api/telemetry/operations.js.map +1 -7
  246. package/dist/esm/classic/agents/index.js +40 -80
  247. package/dist/esm/classic/agents/index.js.map +1 -7
  248. package/dist/esm/classic/beta/evaluationTaxonomies/index.js +15 -21
  249. package/dist/esm/classic/beta/evaluationTaxonomies/index.js.map +1 -7
  250. package/dist/esm/classic/beta/evaluators/index.js +16 -23
  251. package/dist/esm/classic/beta/evaluators/index.js.map +1 -7
  252. package/dist/esm/classic/beta/index.js +18 -18
  253. package/dist/esm/classic/beta/index.js.map +1 -7
  254. package/dist/esm/classic/beta/insights/index.js +12 -12
  255. package/dist/esm/classic/beta/insights/index.js.map +1 -7
  256. package/dist/esm/classic/beta/memoryStores/index.js +19 -29
  257. package/dist/esm/classic/beta/memoryStores/index.js.map +1 -7
  258. package/dist/esm/classic/beta/redTeams/index.js +12 -12
  259. package/dist/esm/classic/beta/redTeams/index.js.map +1 -7
  260. package/dist/esm/classic/beta/schedules/index.js +16 -23
  261. package/dist/esm/classic/beta/schedules/index.js.map +1 -7
  262. package/dist/esm/classic/connections/index.js +13 -13
  263. package/dist/esm/classic/connections/index.js.map +1 -7
  264. package/dist/esm/classic/datasets/index.js +19 -29
  265. package/dist/esm/classic/datasets/index.js.map +1 -7
  266. package/dist/esm/classic/deployments/index.js +11 -11
  267. package/dist/esm/classic/deployments/index.js.map +1 -7
  268. package/dist/esm/classic/evaluationRules/index.js +13 -13
  269. package/dist/esm/classic/evaluationRules/index.js.map +1 -7
  270. package/dist/esm/classic/index.js +4 -0
  271. package/dist/esm/classic/index.js.map +1 -7
  272. package/dist/esm/classic/indexes/index.js +14 -14
  273. package/dist/esm/classic/indexes/index.js.map +1 -7
  274. package/dist/esm/classic/telemetry/index.js +7 -9
  275. package/dist/esm/classic/telemetry/index.js.map +1 -7
  276. package/dist/esm/constants.d.ts +1 -1
  277. package/dist/esm/constants.js +11 -6
  278. package/dist/esm/constants.js.map +1 -7
  279. package/dist/esm/getCustomFetch.js +40 -33
  280. package/dist/esm/getCustomFetch.js.map +1 -7
  281. package/dist/esm/index.js +4 -4
  282. package/dist/esm/index.js.map +1 -7
  283. package/dist/esm/logger.js +4 -4
  284. package/dist/esm/logger.js.map +1 -7
  285. package/dist/esm/models/index.js +4 -0
  286. package/dist/esm/models/index.js.map +1 -7
  287. package/dist/esm/models/models.js +3709 -4160
  288. package/dist/esm/models/models.js.map +1 -7
  289. package/dist/esm/overwriteOpenAIClient.js +13 -13
  290. package/dist/esm/overwriteOpenAIClient.js.map +1 -7
  291. package/dist/esm/static-helpers/pagingHelpers.js +123 -99
  292. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -7
  293. package/dist/esm/static-helpers/pollingHelpers.d.ts +11 -1
  294. package/dist/esm/static-helpers/pollingHelpers.d.ts.map +1 -1
  295. package/dist/esm/static-helpers/pollingHelpers.js +99 -69
  296. package/dist/esm/static-helpers/pollingHelpers.js.map +1 -7
  297. package/dist/esm/static-helpers/serialization/serialize-record.js +18 -16
  298. package/dist/esm/static-helpers/serialization/serialize-record.js.map +1 -7
  299. package/dist/esm/static-helpers/urlTemplate.js +169 -142
  300. package/dist/esm/static-helpers/urlTemplate.js.map +1 -7
  301. package/dist/esm/util.js +84 -63
  302. package/dist/esm/util.js.map +1 -7
  303. package/dist/react-native/api/aiProjectContext.d.ts.map +1 -1
  304. package/dist/react-native/api/aiProjectContext.js +2 -1
  305. package/dist/react-native/api/aiProjectContext.js.map +1 -1
  306. package/dist/react-native/api/beta/memoryStores/operations.d.ts.map +1 -1
  307. package/dist/react-native/api/beta/memoryStores/operations.js +11 -0
  308. package/dist/react-native/api/beta/memoryStores/operations.js.map +1 -1
  309. package/dist/react-native/api/datasets/operations.d.ts.map +1 -1
  310. package/dist/react-native/api/datasets/operations.js +9 -8
  311. package/dist/react-native/api/datasets/operations.js.map +1 -1
  312. package/dist/react-native/constants.d.ts +1 -1
  313. package/dist/react-native/constants.js +1 -1
  314. package/dist/react-native/constants.js.map +1 -1
  315. package/dist/react-native/static-helpers/pollingHelpers.d.ts +11 -1
  316. package/dist/react-native/static-helpers/pollingHelpers.d.ts.map +1 -1
  317. package/dist/react-native/static-helpers/pollingHelpers.js +21 -9
  318. package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -1
  319. package/package.json +9 -9
@@ -1,183 +1,138 @@
1
- import {
2
- _pagedIndexDeserializer,
3
- indexUnionSerializer,
4
- indexUnionDeserializer
5
- } from "../../models/models.js";
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { _pagedIndexDeserializer, indexUnionSerializer, indexUnionDeserializer, } from "../../models/models.js";
6
4
  import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js";
7
5
  import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js";
8
6
  import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client";
9
- function _createOrUpdateSend(context, name, version, index, options = { requestOptions: {} }) {
10
- const path = expandUrlTemplate(
11
- "/indexes/{name}/versions/{version}{?api-version}",
12
- {
13
- name,
14
- version,
15
- "api-version": context.apiVersion
16
- },
17
- {
18
- allowReserved: options?.requestOptions?.skipUrlEncoding
7
+ export function _createOrUpdateSend(context, name, version, index, options = { requestOptions: {} }) {
8
+ const path = expandUrlTemplate("/indexes/{name}/versions/{version}{?api-version}", {
9
+ name: name,
10
+ version: version,
11
+ "api-version": context.apiVersion,
12
+ }, {
13
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
14
+ });
15
+ return context.path(path).patch({
16
+ ...operationOptionsToRequestParameters(options),
17
+ contentType: "application/merge-patch+json",
18
+ headers: {
19
+ accept: "application/json",
20
+ ...options.requestOptions?.headers,
21
+ },
22
+ body: indexUnionSerializer(index),
23
+ });
24
+ }
25
+ export async function _createOrUpdateDeserialize(result) {
26
+ const expectedStatuses = ["201", "200"];
27
+ if (!expectedStatuses.includes(result.status)) {
28
+ throw createRestError(result);
19
29
  }
20
- );
21
- return context.path(path).patch({
22
- ...operationOptionsToRequestParameters(options),
23
- contentType: "application/merge-patch+json",
24
- headers: {
25
- accept: "application/json",
26
- ...options.requestOptions?.headers
27
- },
28
- body: indexUnionSerializer(index)
29
- });
30
+ return indexUnionDeserializer(result.body);
30
31
  }
31
- async function _createOrUpdateDeserialize(result) {
32
- const expectedStatuses = ["201", "200"];
33
- if (!expectedStatuses.includes(result.status)) {
34
- throw createRestError(result);
35
- }
36
- return indexUnionDeserializer(result.body);
32
+ /** Create a new or update an existing Index with the given version id */
33
+ export async function createOrUpdate(context, name, index, version, options = { requestOptions: {} }) {
34
+ const result = await _createOrUpdateSend(context, name, version, index, options);
35
+ return _createOrUpdateDeserialize(result);
37
36
  }
38
- async function createOrUpdate(context, name, index, version, options = { requestOptions: {} }) {
39
- const result = await _createOrUpdateSend(context, name, version, index, options);
40
- return _createOrUpdateDeserialize(result);
37
+ export function _$deleteSend(context, name, version, options = { requestOptions: {} }) {
38
+ const path = expandUrlTemplate("/indexes/{name}/versions/{version}{?api-version}", {
39
+ name: name,
40
+ version: version,
41
+ "api-version": context.apiVersion,
42
+ }, {
43
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
44
+ });
45
+ return context.path(path).delete({ ...operationOptionsToRequestParameters(options) });
41
46
  }
42
- function _$deleteSend(context, name, version, options = { requestOptions: {} }) {
43
- const path = expandUrlTemplate(
44
- "/indexes/{name}/versions/{version}{?api-version}",
45
- {
46
- name,
47
- version,
48
- "api-version": context.apiVersion
49
- },
50
- {
51
- allowReserved: options?.requestOptions?.skipUrlEncoding
47
+ export async function _$deleteDeserialize(result) {
48
+ const expectedStatuses = ["204"];
49
+ if (!expectedStatuses.includes(result.status)) {
50
+ throw createRestError(result);
52
51
  }
53
- );
54
- return context.path(path).delete({ ...operationOptionsToRequestParameters(options) });
52
+ return;
55
53
  }
56
- async function _$deleteDeserialize(result) {
57
- const expectedStatuses = ["204"];
58
- if (!expectedStatuses.includes(result.status)) {
59
- throw createRestError(result);
60
- }
61
- return;
54
+ /** Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. */
55
+ export async function $delete(context, name, version, options = { requestOptions: {} }) {
56
+ const result = await _$deleteSend(context, name, version, options);
57
+ return _$deleteDeserialize(result);
62
58
  }
63
- async function $delete(context, name, version, options = { requestOptions: {} }) {
64
- const result = await _$deleteSend(context, name, version, options);
65
- return _$deleteDeserialize(result);
59
+ export function _getSend(context, name, version, options = { requestOptions: {} }) {
60
+ const path = expandUrlTemplate("/indexes/{name}/versions/{version}{?api-version}", {
61
+ name: name,
62
+ version: version,
63
+ "api-version": context.apiVersion,
64
+ }, {
65
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
66
+ });
67
+ return context.path(path).get({
68
+ ...operationOptionsToRequestParameters(options),
69
+ headers: {
70
+ accept: "application/json",
71
+ ...options.requestOptions?.headers,
72
+ },
73
+ });
66
74
  }
67
- function _getSend(context, name, version, options = { requestOptions: {} }) {
68
- const path = expandUrlTemplate(
69
- "/indexes/{name}/versions/{version}{?api-version}",
70
- {
71
- name,
72
- version,
73
- "api-version": context.apiVersion
74
- },
75
- {
76
- allowReserved: options?.requestOptions?.skipUrlEncoding
77
- }
78
- );
79
- return context.path(path).get({
80
- ...operationOptionsToRequestParameters(options),
81
- headers: {
82
- accept: "application/json",
83
- ...options.requestOptions?.headers
75
+ export async function _getDeserialize(result) {
76
+ const expectedStatuses = ["200"];
77
+ if (!expectedStatuses.includes(result.status)) {
78
+ throw createRestError(result);
84
79
  }
85
- });
80
+ return indexUnionDeserializer(result.body);
86
81
  }
87
- async function _getDeserialize(result) {
88
- const expectedStatuses = ["200"];
89
- if (!expectedStatuses.includes(result.status)) {
90
- throw createRestError(result);
91
- }
92
- return indexUnionDeserializer(result.body);
82
+ /** Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. */
83
+ export async function get(context, name, version, options = { requestOptions: {} }) {
84
+ const result = await _getSend(context, name, version, options);
85
+ return _getDeserialize(result);
93
86
  }
94
- async function get(context, name, version, options = { requestOptions: {} }) {
95
- const result = await _getSend(context, name, version, options);
96
- return _getDeserialize(result);
87
+ export function _listSend(context, options = { requestOptions: {} }) {
88
+ const path = expandUrlTemplate("/indexes{?api-version}", {
89
+ "api-version": context.apiVersion,
90
+ }, {
91
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
92
+ });
93
+ return context.path(path).get({
94
+ ...operationOptionsToRequestParameters(options),
95
+ headers: {
96
+ accept: "application/json",
97
+ ...options.requestOptions?.headers,
98
+ },
99
+ });
97
100
  }
98
- function _listSend(context, options = { requestOptions: {} }) {
99
- const path = expandUrlTemplate(
100
- "/indexes{?api-version}",
101
- {
102
- "api-version": context.apiVersion
103
- },
104
- {
105
- allowReserved: options?.requestOptions?.skipUrlEncoding
106
- }
107
- );
108
- return context.path(path).get({
109
- ...operationOptionsToRequestParameters(options),
110
- headers: {
111
- accept: "application/json",
112
- ...options.requestOptions?.headers
101
+ export async function _listDeserialize(result) {
102
+ const expectedStatuses = ["200"];
103
+ if (!expectedStatuses.includes(result.status)) {
104
+ throw createRestError(result);
113
105
  }
114
- });
106
+ return _pagedIndexDeserializer(result.body);
115
107
  }
116
- async function _listDeserialize(result) {
117
- const expectedStatuses = ["200"];
118
- if (!expectedStatuses.includes(result.status)) {
119
- throw createRestError(result);
120
- }
121
- return _pagedIndexDeserializer(result.body);
108
+ /** List the latest version of each Index */
109
+ export function list(context, options = { requestOptions: {} }) {
110
+ return buildPagedAsyncIterator(context, () => _listSend(context, options), _listDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion });
122
111
  }
123
- function list(context, options = { requestOptions: {} }) {
124
- return buildPagedAsyncIterator(
125
- context,
126
- () => _listSend(context, options),
127
- _listDeserialize,
128
- ["200"],
129
- { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion }
130
- );
112
+ export function _listVersionsSend(context, name, options = { requestOptions: {} }) {
113
+ const path = expandUrlTemplate("/indexes/{name}/versions{?api-version}", {
114
+ name: name,
115
+ "api-version": context.apiVersion,
116
+ }, {
117
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
118
+ });
119
+ return context.path(path).get({
120
+ ...operationOptionsToRequestParameters(options),
121
+ headers: {
122
+ accept: "application/json",
123
+ ...options.requestOptions?.headers,
124
+ },
125
+ });
131
126
  }
132
- function _listVersionsSend(context, name, options = { requestOptions: {} }) {
133
- const path = expandUrlTemplate(
134
- "/indexes/{name}/versions{?api-version}",
135
- {
136
- name,
137
- "api-version": context.apiVersion
138
- },
139
- {
140
- allowReserved: options?.requestOptions?.skipUrlEncoding
127
+ export async function _listVersionsDeserialize(result) {
128
+ const expectedStatuses = ["200"];
129
+ if (!expectedStatuses.includes(result.status)) {
130
+ throw createRestError(result);
141
131
  }
142
- );
143
- return context.path(path).get({
144
- ...operationOptionsToRequestParameters(options),
145
- headers: {
146
- accept: "application/json",
147
- ...options.requestOptions?.headers
148
- }
149
- });
150
- }
151
- async function _listVersionsDeserialize(result) {
152
- const expectedStatuses = ["200"];
153
- if (!expectedStatuses.includes(result.status)) {
154
- throw createRestError(result);
155
- }
156
- return _pagedIndexDeserializer(result.body);
132
+ return _pagedIndexDeserializer(result.body);
157
133
  }
158
- function listVersions(context, name, options = { requestOptions: {} }) {
159
- return buildPagedAsyncIterator(
160
- context,
161
- () => _listVersionsSend(context, name, options),
162
- _listVersionsDeserialize,
163
- ["200"],
164
- { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion }
165
- );
134
+ /** List all versions of the given Index */
135
+ export function listVersions(context, name, options = { requestOptions: {} }) {
136
+ return buildPagedAsyncIterator(context, () => _listVersionsSend(context, name, options), _listVersionsDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion });
166
137
  }
167
- export {
168
- $delete,
169
- _$deleteDeserialize,
170
- _$deleteSend,
171
- _createOrUpdateDeserialize,
172
- _createOrUpdateSend,
173
- _getDeserialize,
174
- _getSend,
175
- _listDeserialize,
176
- _listSend,
177
- _listVersionsDeserialize,
178
- _listVersionsSend,
179
- createOrUpdate,
180
- get,
181
- list,
182
- listVersions
183
- };
138
+ //# sourceMappingURL=operations.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/ai/ai-projects/src/api/indexes/operations.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext as Client } from \"../index.js\";\nimport type { _PagedIndex, IndexUnion } from \"../../models/models.js\";\nimport {\n _pagedIndexDeserializer,\n indexUnionSerializer,\n indexUnionDeserializer,\n} from \"../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { buildPagedAsyncIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type {\n IndexesCreateOrUpdateOptionalParams,\n IndexesDeleteOptionalParams,\n IndexesGetOptionalParams,\n IndexesListOptionalParams,\n IndexesListVersionsOptionalParams,\n} from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\n\nexport function _createOrUpdateSend(\n context: Client,\n name: string,\n version: string,\n index: IndexUnion,\n options: IndexesCreateOrUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).patch({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/merge-patch+json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: indexUnionSerializer(index),\n });\n}\n\nexport async function _createOrUpdateDeserialize(\n result: PathUncheckedResponse,\n): Promise<IndexUnion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return indexUnionDeserializer(result.body);\n}\n\n/** Create a new or update an existing Index with the given version id */\nexport async function createOrUpdate(\n context: Client,\n name: string,\n index: IndexUnion,\n version: string,\n options: IndexesCreateOrUpdateOptionalParams = { requestOptions: {} },\n): Promise<IndexUnion> {\n const result = await _createOrUpdateSend(context, name, version, index, options);\n return _createOrUpdateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: IndexesDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"204\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\n/** Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: IndexesDeleteOptionalParams = { requestOptions: {} },\n): Promise<void> {\n const result = await _$deleteSend(context, name, version, options);\n return _$deleteDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n version: string,\n options: IndexesGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<IndexUnion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return indexUnionDeserializer(result.body);\n}\n\n/** Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: IndexesGetOptionalParams = { requestOptions: {} },\n): Promise<IndexUnion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: IndexesListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedIndex> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedIndexDeserializer(result.body);\n}\n\n/** List the latest version of each Index */\nexport function list(\n context: Client,\n options: IndexesListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<IndexUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: IndexesListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedIndex> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedIndexDeserializer(result.body);\n}\n\n/** List all versions of the given Index */\nexport function listVersions(\n context: Client,\n name: string,\n options: IndexesListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<IndexUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n"],
5
- "mappings": "AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,+BAA+B;AACxC,SAAS,yBAAyB;AASlC,SAAS,iBAAiB,2CAA2C;AAE9D,SAAS,oBACd,SACA,MACA,SACA,OACA,UAA+C,EAAE,gBAAgB,CAAC,EAAE,GAClD;AAClB,QAAM,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA,eAAe,QAAQ;AAAA,IACzB;AAAA,IACA;AAAA,MACE,eAAe,SAAS,gBAAgB;AAAA,IAC1C;AAAA,EACF;AACA,SAAO,QAAQ,KAAK,IAAI,EAAE,MAAM;AAAA,IAC9B,GAAG,oCAAoC,OAAO;AAAA,IAC9C,aAAa;AAAA,IACb,SAAS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AAwB,OAAO,IAAI;AAC5C;AAGO,SAAS,KACd,SACA,UAAqC,EAAE,gBAAgB,CAAC,EAAE,GAClB;AACxC,SAAO;AAAA,IACL;AAAA,IACA,MAAM,UAAU,SAAS,OAAO;AAAA,IAChC;AAAA,IACA,CAAC,KAAK;AAAA,IACN,EAAE,UAAU,SAAS,cAAc,YAAY,YAAY,QAAQ,WAAW;AAAA,EAChF;AACF;AAEO,SAAS,kBACd,SACA,MACA,UAA6C,EAAE,gBAAgB,CAAC,EAAE,GAChD;AAClB,QAAM,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACE;AAAA,MACA,eAAe,QAAQ;AAAA,IACzB;AAAA,IACA;AAAA,MACE,eAAe,SAAS,gBAAgB;AAAA,IAC1C;AAAA,EACF;AACA,SAAO,QAAQ,KAAK,IAAI,EAAE,IAAI;AAAA,IAC5B,GAAG,oCAAoC,OAAO;AAAA,IAC9C,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,QAAQ,gBAAgB;AAAA,IAC7B;AAAA,EACF,CAAC;AACH;AAEA,eAAsB,yBACpB,QACsB;AACtB,QAAM,mBAAmB,CAAC,KAAK;AAC/B,MAAI,CAAC,iBAAiB,SAAS,OAAO,MAAM,GAAG;AAC7C,UAAM,gBAAgB,MAAM;AAAA,EAC9B;AAEA,SAAO,wBAAwB,OAAO,IAAI;AAC5C;AAGO,SAAS,aACd,SACA,MACA,UAA6C,EAAE,gBAAgB,CAAC,EAAE,GAC1B;AACxC,SAAO;AAAA,IACL;AAAA,IACA,MAAM,kBAAkB,SAAS,MAAM,OAAO;AAAA,IAC9C;AAAA,IACA,CAAC,KAAK;AAAA,IACN,EAAE,UAAU,SAAS,cAAc,YAAY,YAAY,QAAQ,WAAW;AAAA,EAChF;AACF;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/indexes/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAC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UAAU;KAClC,EACD;QACE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe;KACxD,CACF,CAAC;IACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;QAC5B,GAAG,mCAAmC,CAAC,OAAO,CAAC;QAC/C,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,GAAG,OAAO,CAAC,cAAc,EAAE,OAAO;SACnC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,IAAY,EACZ,UAA6C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEnE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAC/C,wBAAwB,EACxB,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAChF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext as Client } from \"../index.js\";\nimport type { _PagedIndex, IndexUnion } from \"../../models/models.js\";\nimport {\n _pagedIndexDeserializer,\n indexUnionSerializer,\n indexUnionDeserializer,\n} from \"../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { buildPagedAsyncIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type {\n IndexesCreateOrUpdateOptionalParams,\n IndexesDeleteOptionalParams,\n IndexesGetOptionalParams,\n IndexesListOptionalParams,\n IndexesListVersionsOptionalParams,\n} from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\n\nexport function _createOrUpdateSend(\n context: Client,\n name: string,\n version: string,\n index: IndexUnion,\n options: IndexesCreateOrUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).patch({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/merge-patch+json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: indexUnionSerializer(index),\n });\n}\n\nexport async function _createOrUpdateDeserialize(\n result: PathUncheckedResponse,\n): Promise<IndexUnion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return indexUnionDeserializer(result.body);\n}\n\n/** Create a new or update an existing Index with the given version id */\nexport async function createOrUpdate(\n context: Client,\n name: string,\n index: IndexUnion,\n version: string,\n options: IndexesCreateOrUpdateOptionalParams = { requestOptions: {} },\n): Promise<IndexUnion> {\n const result = await _createOrUpdateSend(context, name, version, index, options);\n return _createOrUpdateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: IndexesDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"204\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\n/** Delete the specific version of the Index. The service returns 204 No Content if the Index was deleted successfully or if the Index does not exist. */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: IndexesDeleteOptionalParams = { requestOptions: {} },\n): Promise<void> {\n const result = await _$deleteSend(context, name, version, options);\n return _$deleteDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n version: string,\n options: IndexesGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<IndexUnion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return indexUnionDeserializer(result.body);\n}\n\n/** Get the specific version of the Index. The service returns 404 Not Found error if the Index does not exist. */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: IndexesGetOptionalParams = { requestOptions: {} },\n): Promise<IndexUnion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: IndexesListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedIndex> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedIndexDeserializer(result.body);\n}\n\n/** List the latest version of each Index */\nexport function list(\n context: Client,\n options: IndexesListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<IndexUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: IndexesListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/indexes/{name}/versions{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedIndex> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedIndexDeserializer(result.body);\n}\n\n/** List all versions of the given Index */\nexport function listVersions(\n context: Client,\n name: string,\n options: IndexesListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<IndexUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=options.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/api/indexes/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions } from \"@azure-rest/core-client\";\n\n/** Optional parameters. */\nexport interface IndexesCreateOrUpdateOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface IndexesDeleteOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface IndexesGetOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface IndexesListOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface IndexesListVersionsOptionalParams extends OperationOptions {}\n"]}
@@ -1,4 +1,4 @@
1
- import { createTelemetryOperations } from "./operations.js";
2
- export {
3
- createTelemetryOperations
4
- };
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export { createTelemetryOperations } from "./operations.js";
4
+ //# sourceMappingURL=index.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/ai/ai-projects/src/api/telemetry/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { type CreateTelemetryOperations, createTelemetryOperations } from \"./operations.js\";\n"],
5
- "mappings": "AAGA,SAAyC,iCAAiC;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/telemetry/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAkC,yBAAyB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { type CreateTelemetryOperations, createTelemetryOperations } from \"./operations.js\";\n"]}
@@ -1,48 +1,55 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
1
3
  import { RestError } from "@azure/core-rest-pipeline";
2
- function createTelemetryOperations(connectionClient) {
3
- const state = {
4
- _connectionString: void 0
5
- };
6
- return {
7
- /**
8
- * Get the Application Insights connection string associated with the Project's Application Insights resource.
9
- * @param options - The options parameters.
10
- * @returns The Application Insights connection string.
11
- * @throws RestError if an Application Insights connection does not exist for this project.
12
- */
13
- async getApplicationInsightsConnectionString(options) {
14
- if (!state._connectionString) {
15
- const connections = [];
16
- for await (const connection2 of connectionClient.list(
17
- options || {
18
- connectionType: "AppInsights",
19
- defaultConnection: true
20
- }
21
- )) {
22
- connections.push(connection2);
23
- }
24
- const connectionName = connections?.[0]?.name;
25
- if (!connectionName) {
26
- throw new RestError("No Application Insights connection found.", {
27
- code: "ResourceNotFound",
28
- statusCode: 404
29
- });
30
- }
31
- const connection = await connectionClient.getWithCredentials(connectionName, options);
32
- if (connection.credentials?.type === "ApiKey") {
33
- const apiKeyCredentials = connection.credentials;
34
- if (!apiKeyCredentials.apiKey) {
35
- throw new Error("Application Insights connection does not have a connection string.");
36
- }
37
- state._connectionString = apiKeyCredentials.apiKey;
38
- } else {
39
- throw new Error("Application Insights connection does not use API Key credentials.");
40
- }
41
- }
42
- return state._connectionString;
43
- }
44
- };
4
+ /**
5
+ * Creates a new instance of the CreateTelemetryOperations class.
6
+ * @param connectionClient - The connections client to use for operations.
7
+ * @returns A new instance of CreateTelemetryOperations.
8
+ */
9
+ export function createTelemetryOperations(connectionClient) {
10
+ const state = {
11
+ _connectionString: undefined,
12
+ };
13
+ return {
14
+ /**
15
+ * Get the Application Insights connection string associated with the Project's Application Insights resource.
16
+ * @param options - The options parameters.
17
+ * @returns The Application Insights connection string.
18
+ * @throws RestError if an Application Insights connection does not exist for this project.
19
+ */
20
+ async getApplicationInsightsConnectionString(options) {
21
+ if (!state._connectionString) {
22
+ // Get all Application Insights connections that are marked as default
23
+ const connections = [];
24
+ for await (const connection of connectionClient.list(options || {
25
+ connectionType: "AppInsights",
26
+ defaultConnection: true,
27
+ })) {
28
+ connections.push(connection);
29
+ }
30
+ // Find the first connection that is of type "AppInsights"
31
+ const connectionName = connections?.[0]?.name;
32
+ if (!connectionName) {
33
+ throw new RestError("No Application Insights connection found.", {
34
+ code: "ResourceNotFound",
35
+ statusCode: 404,
36
+ });
37
+ }
38
+ // Get the connection with credentials
39
+ const connection = await connectionClient.getWithCredentials(connectionName, options);
40
+ if (connection.credentials?.type === "ApiKey") {
41
+ const apiKeyCredentials = connection.credentials;
42
+ if (!apiKeyCredentials.apiKey) {
43
+ throw new Error("Application Insights connection does not have a connection string.");
44
+ }
45
+ state._connectionString = apiKeyCredentials.apiKey;
46
+ }
47
+ else {
48
+ throw new Error("Application Insights connection does not use API Key credentials.");
49
+ }
50
+ }
51
+ return state._connectionString;
52
+ },
53
+ };
45
54
  }
46
- export {
47
- createTelemetryOperations
48
- };
55
+ //# sourceMappingURL=operations.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/ai/ai-projects/src/api/telemetry/operations.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport type { Connection, ApiKeyCredentials } from \"../../models/models.js\";\nimport type { ConnectionsOperations } from \"../../classic/index.js\";\n\n/**\n * Interface for CreateTelemetryOperations internal state\n * @internal\n */\ninterface TelemetryOperationsState {\n _connectionString?: string;\n}\n\n/**\n * Creates a new instance of the CreateTelemetryOperations class.\n * @param connectionClient - The connections client to use for operations.\n * @returns A new instance of CreateTelemetryOperations.\n */\nexport function createTelemetryOperations(\n connectionClient: ConnectionsOperations,\n): CreateTelemetryOperations {\n const state: TelemetryOperationsState = {\n _connectionString: undefined,\n };\n\n return {\n /**\n * Get the Application Insights connection string associated with the Project's Application Insights resource.\n * @param options - The options parameters.\n * @returns The Application Insights connection string.\n * @throws RestError if an Application Insights connection does not exist for this project.\n */\n async getApplicationInsightsConnectionString(options?: OperationOptions): Promise<string> {\n if (!state._connectionString) {\n // Get all Application Insights connections that are marked as default\n const connections: Connection[] = [];\n for await (const connection of connectionClient.list(\n options || {\n connectionType: \"AppInsights\",\n defaultConnection: true,\n },\n )) {\n connections.push(connection);\n }\n\n // Find the first connection that is of type \"AppInsights\"\n const connectionName = connections?.[0]?.name;\n\n if (!connectionName) {\n throw new RestError(\"No Application Insights connection found.\", {\n code: \"ResourceNotFound\",\n statusCode: 404,\n });\n }\n\n // Get the connection with credentials\n const connection = await connectionClient.getWithCredentials(connectionName, options);\n\n if (connection.credentials?.type === \"ApiKey\") {\n const apiKeyCredentials = connection.credentials as ApiKeyCredentials;\n if (!apiKeyCredentials.apiKey) {\n throw new Error(\"Application Insights connection does not have a connection string.\");\n }\n state._connectionString = apiKeyCredentials.apiKey;\n } else {\n throw new Error(\"Application Insights connection does not use API Key credentials.\");\n }\n }\n\n return state._connectionString;\n },\n };\n}\n\n/**\n * CreateTelemetryOperations provides operations for working with Application Insights telemetry.\n * DO NOT instantiate this class directly.\n * Instead, you should access these operations through the AIProjectClient's telemetry attribute.\n */\nexport interface CreateTelemetryOperations {\n /**\n * Get the Application Insights connection string associated with the Project's Application Insights resource.\n * @param options - The options parameters.\n * @returns The Application Insights connection string.\n * @throws RestError if an Application Insights connection does not exist for this project.\n */\n getApplicationInsightsConnectionString(options?: OperationOptions): Promise<string>;\n}\n"],
5
- "mappings": "AAIA,SAAS,iBAAiB;AAiBnB,SAAS,0BACd,kBAC2B;AAC3B,QAAM,QAAkC;AAAA,IACtC,mBAAmB;AAAA,EACrB;AAEA,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,MAAM,uCAAuC,SAA6C;AACxF,UAAI,CAAC,MAAM,mBAAmB;AAE5B,cAAM,cAA4B,CAAC;AACnC,yBAAiBA,eAAc,iBAAiB;AAAA,UAC9C,WAAW;AAAA,YACT,gBAAgB;AAAA,YAChB,mBAAmB;AAAA,UACrB;AAAA,QACF,GAAG;AACD,sBAAY,KAAKA,WAAU;AAAA,QAC7B;AAGA,cAAM,iBAAiB,cAAc,CAAC,GAAG;AAEzC,YAAI,CAAC,gBAAgB;AACnB,gBAAM,IAAI,UAAU,6CAA6C;AAAA,YAC/D,MAAM;AAAA,YACN,YAAY;AAAA,UACd,CAAC;AAAA,QACH;AAGA,cAAM,aAAa,MAAM,iBAAiB,mBAAmB,gBAAgB,OAAO;AAEpF,YAAI,WAAW,aAAa,SAAS,UAAU;AAC7C,gBAAM,oBAAoB,WAAW;AACrC,cAAI,CAAC,kBAAkB,QAAQ;AAC7B,kBAAM,IAAI,MAAM,oEAAoE;AAAA,UACtF;AACA,gBAAM,oBAAoB,kBAAkB;AAAA,QAC9C,OAAO;AACL,gBAAM,IAAI,MAAM,mEAAmE;AAAA,QACrF;AAAA,MACF;AAEA,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AACF;",
6
- "names": ["connection"]
7
- }
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/telemetry/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAYtD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,gBAAuC;IAEvC,MAAM,KAAK,GAA6B;QACtC,iBAAiB,EAAE,SAAS;KAC7B,CAAC;IAEF,OAAO;QACL;;;;;WAKG;QACH,KAAK,CAAC,sCAAsC,CAAC,OAA0B;YACrE,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC7B,sEAAsE;gBACtE,MAAM,WAAW,GAAiB,EAAE,CAAC;gBACrC,IAAI,KAAK,EAAE,MAAM,UAAU,IAAI,gBAAgB,CAAC,IAAI,CAClD,OAAO,IAAI;oBACT,cAAc,EAAE,aAAa;oBAC7B,iBAAiB,EAAE,IAAI;iBACxB,CACF,EAAE,CAAC;oBACF,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC/B,CAAC;gBAED,0DAA0D;gBAC1D,MAAM,cAAc,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;gBAE9C,IAAI,CAAC,cAAc,EAAE,CAAC;oBACpB,MAAM,IAAI,SAAS,CAAC,2CAA2C,EAAE;wBAC/D,IAAI,EAAE,kBAAkB;wBACxB,UAAU,EAAE,GAAG;qBAChB,CAAC,CAAC;gBACL,CAAC;gBAED,sCAAsC;gBACtC,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,kBAAkB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;gBAEtF,IAAI,UAAU,CAAC,WAAW,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;oBAC9C,MAAM,iBAAiB,GAAG,UAAU,CAAC,WAAgC,CAAC;oBACtE,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;wBAC9B,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;oBACxF,CAAC;oBACD,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAAC;gBACrD,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;gBACvF,CAAC;YACH,CAAC;YAED,OAAO,KAAK,CAAC,iBAAiB,CAAC;QACjC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport type { Connection, ApiKeyCredentials } from \"../../models/models.js\";\nimport type { ConnectionsOperations } from \"../../classic/index.js\";\n\n/**\n * Interface for CreateTelemetryOperations internal state\n * @internal\n */\ninterface TelemetryOperationsState {\n _connectionString?: string;\n}\n\n/**\n * Creates a new instance of the CreateTelemetryOperations class.\n * @param connectionClient - The connections client to use for operations.\n * @returns A new instance of CreateTelemetryOperations.\n */\nexport function createTelemetryOperations(\n connectionClient: ConnectionsOperations,\n): CreateTelemetryOperations {\n const state: TelemetryOperationsState = {\n _connectionString: undefined,\n };\n\n return {\n /**\n * Get the Application Insights connection string associated with the Project's Application Insights resource.\n * @param options - The options parameters.\n * @returns The Application Insights connection string.\n * @throws RestError if an Application Insights connection does not exist for this project.\n */\n async getApplicationInsightsConnectionString(options?: OperationOptions): Promise<string> {\n if (!state._connectionString) {\n // Get all Application Insights connections that are marked as default\n const connections: Connection[] = [];\n for await (const connection of connectionClient.list(\n options || {\n connectionType: \"AppInsights\",\n defaultConnection: true,\n },\n )) {\n connections.push(connection);\n }\n\n // Find the first connection that is of type \"AppInsights\"\n const connectionName = connections?.[0]?.name;\n\n if (!connectionName) {\n throw new RestError(\"No Application Insights connection found.\", {\n code: \"ResourceNotFound\",\n statusCode: 404,\n });\n }\n\n // Get the connection with credentials\n const connection = await connectionClient.getWithCredentials(connectionName, options);\n\n if (connection.credentials?.type === \"ApiKey\") {\n const apiKeyCredentials = connection.credentials as ApiKeyCredentials;\n if (!apiKeyCredentials.apiKey) {\n throw new Error(\"Application Insights connection does not have a connection string.\");\n }\n state._connectionString = apiKeyCredentials.apiKey;\n } else {\n throw new Error(\"Application Insights connection does not use API Key credentials.\");\n }\n }\n\n return state._connectionString;\n },\n };\n}\n\n/**\n * CreateTelemetryOperations provides operations for working with Application Insights telemetry.\n * DO NOT instantiate this class directly.\n * Instead, you should access these operations through the AIProjectClient's telemetry attribute.\n */\nexport interface CreateTelemetryOperations {\n /**\n * Get the Application Insights connection string associated with the Project's Application Insights resource.\n * @param options - The options parameters.\n * @returns The Application Insights connection string.\n * @throws RestError if an Application Insights connection does not exist for this project.\n */\n getApplicationInsightsConnectionString(options?: OperationOptions): Promise<string>;\n}\n"]}