@azure/arm-extendedlocation 1.0.0-beta.3 → 1.0.0-beta.5

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 (348) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +30 -24
  3. package/dist/browser/api/customLocations/index.d.ts +3 -0
  4. package/dist/browser/api/customLocations/index.js +4 -0
  5. package/dist/browser/api/customLocations/index.js.map +1 -0
  6. package/dist/browser/api/customLocations/operations.d.ts +43 -0
  7. package/dist/browser/api/customLocations/operations.js +305 -0
  8. package/dist/browser/api/customLocations/operations.js.map +1 -0
  9. package/dist/browser/api/customLocations/options.d.ts +39 -0
  10. package/dist/browser/api/customLocations/options.js +4 -0
  11. package/dist/browser/api/customLocations/options.js.map +1 -0
  12. package/dist/browser/api/customLocationsManagementContext.d.ts +22 -0
  13. package/dist/browser/api/customLocationsManagementContext.js +26 -0
  14. package/dist/browser/api/customLocationsManagementContext.js.map +1 -0
  15. package/dist/browser/api/index.d.ts +3 -0
  16. package/dist/browser/api/index.js +4 -0
  17. package/dist/browser/api/index.js.map +1 -0
  18. package/dist/browser/api/resourceSyncRules/index.d.ts +3 -0
  19. package/dist/browser/api/resourceSyncRules/index.js +4 -0
  20. package/dist/browser/api/resourceSyncRules/index.js.map +1 -0
  21. package/dist/browser/api/resourceSyncRules/operations.d.ts +27 -0
  22. package/dist/browser/api/resourceSyncRules/operations.js +181 -0
  23. package/dist/browser/api/resourceSyncRules/operations.js.map +1 -0
  24. package/dist/browser/api/resourceSyncRules/options.d.ts +25 -0
  25. package/dist/browser/api/resourceSyncRules/options.js +4 -0
  26. package/dist/browser/api/resourceSyncRules/options.js.map +1 -0
  27. package/dist/browser/classic/customLocations/index.d.ts +37 -0
  28. package/dist/browser/classic/customLocations/index.js +39 -0
  29. package/dist/browser/classic/customLocations/index.js.map +1 -0
  30. package/dist/browser/classic/index.d.ts +3 -0
  31. package/dist/browser/classic/index.js +4 -0
  32. package/dist/browser/classic/index.js.map +1 -0
  33. package/dist/browser/classic/resourceSyncRules/index.d.ts +29 -0
  34. package/dist/browser/classic/resourceSyncRules/index.js +35 -0
  35. package/dist/browser/classic/resourceSyncRules/index.js.map +1 -0
  36. package/dist/browser/customLocationsManagementClient.d.ts +18 -0
  37. package/dist/browser/customLocationsManagementClient.js +37 -0
  38. package/dist/browser/customLocationsManagementClient.js.map +1 -0
  39. package/dist/browser/index.d.ts +18 -0
  40. package/dist/browser/index.js +9 -0
  41. package/dist/browser/index.js.map +1 -0
  42. package/dist/browser/logger.d.ts +2 -0
  43. package/dist/browser/logger.js +5 -0
  44. package/dist/browser/logger.js.map +1 -0
  45. package/dist/browser/models/index.d.ts +3 -0
  46. package/dist/browser/models/index.js +4 -0
  47. package/dist/browser/models/index.js.map +1 -0
  48. package/dist/browser/models/models.d.ts +402 -0
  49. package/dist/browser/models/models.js +506 -0
  50. package/dist/browser/models/models.js.map +1 -0
  51. package/dist/browser/package.json +3 -0
  52. package/dist/browser/restorePollerHelpers.d.ts +21 -0
  53. package/dist/browser/restorePollerHelpers.js +101 -0
  54. package/dist/browser/restorePollerHelpers.js.map +1 -0
  55. package/dist/browser/static-helpers/cloudSettingHelpers.d.ts +22 -0
  56. package/dist/browser/static-helpers/cloudSettingHelpers.js +38 -0
  57. package/dist/browser/static-helpers/cloudSettingHelpers.js.map +1 -0
  58. package/dist/browser/static-helpers/pagingHelpers.d.ts +74 -0
  59. package/dist/browser/static-helpers/pagingHelpers.js +143 -0
  60. package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
  61. package/dist/browser/static-helpers/pollingHelpers.d.ts +34 -0
  62. package/dist/browser/static-helpers/pollingHelpers.js +95 -0
  63. package/dist/browser/static-helpers/pollingHelpers.js.map +1 -0
  64. package/dist/browser/static-helpers/serialization/check-prop-undefined.d.ts +8 -0
  65. package/dist/browser/static-helpers/serialization/check-prop-undefined.js +17 -0
  66. package/dist/browser/static-helpers/serialization/check-prop-undefined.js.map +1 -0
  67. package/dist/browser/static-helpers/simplePollerHelpers.d.ts +73 -0
  68. package/dist/browser/static-helpers/simplePollerHelpers.js +44 -0
  69. package/dist/browser/static-helpers/simplePollerHelpers.js.map +1 -0
  70. package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
  71. package/dist/browser/static-helpers/urlTemplate.js +200 -0
  72. package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
  73. package/dist/commonjs/api/customLocations/index.d.ts +3 -0
  74. package/dist/commonjs/api/customLocations/index.js +44 -0
  75. package/dist/commonjs/api/customLocations/index.js.map +7 -0
  76. package/dist/commonjs/api/customLocations/operations.d.ts +43 -0
  77. package/dist/commonjs/api/customLocations/operations.js +434 -0
  78. package/dist/commonjs/api/customLocations/operations.js.map +7 -0
  79. package/dist/commonjs/api/customLocations/options.d.ts +39 -0
  80. package/dist/commonjs/api/customLocations/options.js +16 -0
  81. package/dist/commonjs/api/customLocations/options.js.map +7 -0
  82. package/dist/commonjs/api/customLocationsManagementContext.d.ts +22 -0
  83. package/dist/commonjs/api/customLocationsManagementContext.js +47 -0
  84. package/dist/commonjs/api/customLocationsManagementContext.js.map +7 -0
  85. package/dist/commonjs/api/index.d.ts +3 -0
  86. package/dist/commonjs/api/index.js +28 -0
  87. package/dist/commonjs/api/index.js.map +7 -0
  88. package/dist/commonjs/api/resourceSyncRules/index.d.ts +3 -0
  89. package/dist/commonjs/api/resourceSyncRules/index.js +36 -0
  90. package/dist/commonjs/api/resourceSyncRules/index.js.map +7 -0
  91. package/dist/commonjs/api/resourceSyncRules/operations.d.ts +27 -0
  92. package/dist/commonjs/api/resourceSyncRules/operations.js +271 -0
  93. package/dist/commonjs/api/resourceSyncRules/operations.js.map +7 -0
  94. package/dist/commonjs/api/resourceSyncRules/options.d.ts +25 -0
  95. package/dist/commonjs/api/resourceSyncRules/options.js +16 -0
  96. package/dist/commonjs/api/resourceSyncRules/options.js.map +7 -0
  97. package/dist/commonjs/classic/customLocations/index.d.ts +37 -0
  98. package/dist/commonjs/classic/customLocations/index.js +63 -0
  99. package/dist/commonjs/classic/customLocations/index.js.map +7 -0
  100. package/dist/commonjs/classic/index.d.ts +3 -0
  101. package/dist/commonjs/classic/index.js +16 -0
  102. package/dist/commonjs/classic/index.js.map +7 -0
  103. package/dist/commonjs/classic/resourceSyncRules/index.d.ts +29 -0
  104. package/dist/commonjs/classic/resourceSyncRules/index.js +80 -0
  105. package/dist/commonjs/classic/resourceSyncRules/index.js.map +7 -0
  106. package/dist/commonjs/customLocationsManagementClient.d.ts +18 -0
  107. package/dist/commonjs/customLocationsManagementClient.js +58 -0
  108. package/dist/commonjs/customLocationsManagementClient.js.map +7 -0
  109. package/dist/commonjs/index.d.ts +18 -0
  110. package/dist/commonjs/index.js +48 -0
  111. package/dist/commonjs/index.js.map +7 -0
  112. package/dist/commonjs/logger.d.ts +2 -0
  113. package/dist/commonjs/logger.js +29 -0
  114. package/dist/commonjs/logger.js.map +7 -0
  115. package/dist/commonjs/models/index.d.ts +3 -0
  116. package/dist/commonjs/models/index.js +34 -0
  117. package/dist/commonjs/models/index.js.map +7 -0
  118. package/dist/commonjs/models/models.d.ts +402 -0
  119. package/dist/commonjs/models/models.js +560 -0
  120. package/dist/commonjs/models/models.js.map +7 -0
  121. package/dist/commonjs/package.json +3 -0
  122. package/dist/commonjs/restorePollerHelpers.d.ts +21 -0
  123. package/dist/commonjs/restorePollerHelpers.js +114 -0
  124. package/dist/commonjs/restorePollerHelpers.js.map +7 -0
  125. package/dist/commonjs/static-helpers/cloudSettingHelpers.d.ts +22 -0
  126. package/dist/commonjs/static-helpers/cloudSettingHelpers.js +52 -0
  127. package/dist/commonjs/static-helpers/cloudSettingHelpers.js.map +7 -0
  128. package/dist/commonjs/static-helpers/pagingHelpers.d.ts +74 -0
  129. package/dist/commonjs/static-helpers/pagingHelpers.js +143 -0
  130. package/dist/commonjs/static-helpers/pagingHelpers.js.map +7 -0
  131. package/dist/commonjs/static-helpers/pollingHelpers.d.ts +34 -0
  132. package/dist/commonjs/static-helpers/pollingHelpers.js +101 -0
  133. package/dist/commonjs/static-helpers/pollingHelpers.js.map +7 -0
  134. package/dist/commonjs/static-helpers/serialization/check-prop-undefined.d.ts +8 -0
  135. package/dist/commonjs/static-helpers/serialization/check-prop-undefined.js +35 -0
  136. package/dist/commonjs/static-helpers/serialization/check-prop-undefined.js.map +7 -0
  137. package/dist/commonjs/static-helpers/simplePollerHelpers.d.ts +73 -0
  138. package/dist/commonjs/static-helpers/simplePollerHelpers.js +67 -0
  139. package/dist/commonjs/static-helpers/simplePollerHelpers.js.map +7 -0
  140. package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
  141. package/dist/commonjs/static-helpers/urlTemplate.js +197 -0
  142. package/dist/commonjs/static-helpers/urlTemplate.js.map +7 -0
  143. package/{types → dist/commonjs}/tsdoc-metadata.json +11 -11
  144. package/dist/esm/api/customLocations/index.d.ts +3 -0
  145. package/dist/esm/api/customLocations/index.js +4 -0
  146. package/dist/esm/api/customLocations/index.js.map +1 -0
  147. package/dist/esm/api/customLocations/operations.d.ts +43 -0
  148. package/dist/esm/api/customLocations/operations.js +305 -0
  149. package/dist/esm/api/customLocations/operations.js.map +1 -0
  150. package/dist/esm/api/customLocations/options.d.ts +39 -0
  151. package/dist/esm/api/customLocations/options.js +4 -0
  152. package/dist/esm/api/customLocations/options.js.map +1 -0
  153. package/dist/esm/api/customLocationsManagementContext.d.ts +22 -0
  154. package/dist/esm/api/customLocationsManagementContext.js +26 -0
  155. package/dist/esm/api/customLocationsManagementContext.js.map +1 -0
  156. package/dist/esm/api/index.d.ts +3 -0
  157. package/dist/esm/api/index.js +4 -0
  158. package/dist/esm/api/index.js.map +1 -0
  159. package/dist/esm/api/resourceSyncRules/index.d.ts +3 -0
  160. package/dist/esm/api/resourceSyncRules/index.js +4 -0
  161. package/dist/esm/api/resourceSyncRules/index.js.map +1 -0
  162. package/dist/esm/api/resourceSyncRules/operations.d.ts +27 -0
  163. package/dist/esm/api/resourceSyncRules/operations.js +181 -0
  164. package/dist/esm/api/resourceSyncRules/operations.js.map +1 -0
  165. package/dist/esm/api/resourceSyncRules/options.d.ts +25 -0
  166. package/dist/esm/api/resourceSyncRules/options.js +4 -0
  167. package/dist/esm/api/resourceSyncRules/options.js.map +1 -0
  168. package/dist/esm/classic/customLocations/index.d.ts +37 -0
  169. package/dist/esm/classic/customLocations/index.js +39 -0
  170. package/dist/esm/classic/customLocations/index.js.map +1 -0
  171. package/dist/esm/classic/index.d.ts +3 -0
  172. package/dist/esm/classic/index.js +4 -0
  173. package/dist/esm/classic/index.js.map +1 -0
  174. package/dist/esm/classic/resourceSyncRules/index.d.ts +29 -0
  175. package/dist/esm/classic/resourceSyncRules/index.js +35 -0
  176. package/dist/esm/classic/resourceSyncRules/index.js.map +1 -0
  177. package/dist/esm/customLocationsManagementClient.d.ts +18 -0
  178. package/dist/esm/customLocationsManagementClient.js +37 -0
  179. package/dist/esm/customLocationsManagementClient.js.map +1 -0
  180. package/dist/esm/index.d.ts +18 -0
  181. package/dist/esm/index.js +9 -0
  182. package/dist/esm/index.js.map +1 -0
  183. package/dist/esm/logger.d.ts +2 -0
  184. package/dist/esm/logger.js +5 -0
  185. package/dist/esm/logger.js.map +1 -0
  186. package/dist/esm/models/index.d.ts +3 -0
  187. package/dist/esm/models/index.js +4 -0
  188. package/dist/esm/models/index.js.map +1 -0
  189. package/dist/esm/models/models.d.ts +402 -0
  190. package/dist/esm/models/models.js +506 -0
  191. package/dist/esm/models/models.js.map +1 -0
  192. package/dist/esm/package.json +3 -0
  193. package/dist/esm/restorePollerHelpers.d.ts +21 -0
  194. package/dist/esm/restorePollerHelpers.js +101 -0
  195. package/dist/esm/restorePollerHelpers.js.map +1 -0
  196. package/dist/esm/static-helpers/cloudSettingHelpers.d.ts +22 -0
  197. package/dist/esm/static-helpers/cloudSettingHelpers.js +38 -0
  198. package/dist/esm/static-helpers/cloudSettingHelpers.js.map +1 -0
  199. package/dist/esm/static-helpers/pagingHelpers.d.ts +74 -0
  200. package/dist/esm/static-helpers/pagingHelpers.js +143 -0
  201. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
  202. package/dist/esm/static-helpers/pollingHelpers.d.ts +34 -0
  203. package/dist/esm/static-helpers/pollingHelpers.js +95 -0
  204. package/dist/esm/static-helpers/pollingHelpers.js.map +1 -0
  205. package/dist/esm/static-helpers/serialization/check-prop-undefined.d.ts +8 -0
  206. package/dist/esm/static-helpers/serialization/check-prop-undefined.js +17 -0
  207. package/dist/esm/static-helpers/serialization/check-prop-undefined.js.map +1 -0
  208. package/dist/esm/static-helpers/simplePollerHelpers.d.ts +73 -0
  209. package/dist/esm/static-helpers/simplePollerHelpers.js +44 -0
  210. package/dist/esm/static-helpers/simplePollerHelpers.js.map +1 -0
  211. package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
  212. package/dist/esm/static-helpers/urlTemplate.js +200 -0
  213. package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
  214. package/package.json +151 -90
  215. package/CHANGELOG.md +0 -54
  216. package/dist/index.js +0 -2315
  217. package/dist/index.js.map +0 -1
  218. package/dist/index.min.js +0 -1
  219. package/dist/index.min.js.map +0 -1
  220. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.d.ts +0 -2
  221. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.d.ts.map +0 -1
  222. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.js +0 -50
  223. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.js.map +0 -1
  224. package/dist-esm/samples-dev/customLocationsDeleteSample.d.ts +0 -2
  225. package/dist-esm/samples-dev/customLocationsDeleteSample.d.ts.map +0 -1
  226. package/dist-esm/samples-dev/customLocationsDeleteSample.js +0 -39
  227. package/dist-esm/samples-dev/customLocationsDeleteSample.js.map +0 -1
  228. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.d.ts +0 -2
  229. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.d.ts.map +0 -1
  230. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.js +0 -42
  231. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.js.map +0 -1
  232. package/dist-esm/samples-dev/customLocationsGetSample.d.ts +0 -2
  233. package/dist-esm/samples-dev/customLocationsGetSample.d.ts.map +0 -1
  234. package/dist-esm/samples-dev/customLocationsGetSample.js +0 -39
  235. package/dist-esm/samples-dev/customLocationsGetSample.js.map +0 -1
  236. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.d.ts +0 -2
  237. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.d.ts.map +0 -1
  238. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.js +0 -52
  239. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.js.map +0 -1
  240. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.d.ts +0 -2
  241. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.d.ts.map +0 -1
  242. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.js +0 -51
  243. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.js.map +0 -1
  244. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.d.ts +0 -2
  245. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.d.ts.map +0 -1
  246. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.js +0 -53
  247. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.js.map +0 -1
  248. package/dist-esm/samples-dev/customLocationsListOperationsSample.d.ts +0 -2
  249. package/dist-esm/samples-dev/customLocationsListOperationsSample.d.ts.map +0 -1
  250. package/dist-esm/samples-dev/customLocationsListOperationsSample.js +0 -51
  251. package/dist-esm/samples-dev/customLocationsListOperationsSample.js.map +0 -1
  252. package/dist-esm/samples-dev/customLocationsUpdateSample.d.ts +0 -2
  253. package/dist-esm/samples-dev/customLocationsUpdateSample.d.ts.map +0 -1
  254. package/dist-esm/samples-dev/customLocationsUpdateSample.js +0 -42
  255. package/dist-esm/samples-dev/customLocationsUpdateSample.js.map +0 -1
  256. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.d.ts +0 -2
  257. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.d.ts.map +0 -1
  258. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.js +0 -49
  259. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.js.map +0 -1
  260. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.d.ts +0 -2
  261. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.d.ts.map +0 -1
  262. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.js +0 -40
  263. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.js.map +0 -1
  264. package/dist-esm/samples-dev/resourceSyncRulesGetSample.d.ts +0 -2
  265. package/dist-esm/samples-dev/resourceSyncRulesGetSample.d.ts.map +0 -1
  266. package/dist-esm/samples-dev/resourceSyncRulesGetSample.js +0 -40
  267. package/dist-esm/samples-dev/resourceSyncRulesGetSample.js.map +0 -1
  268. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.d.ts +0 -2
  269. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.d.ts.map +0 -1
  270. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.js +0 -53
  271. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.js.map +0 -1
  272. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.d.ts +0 -2
  273. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.d.ts.map +0 -1
  274. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.js +0 -42
  275. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.js.map +0 -1
  276. package/dist-esm/src/customLocationsManagementClient.d.ts +0 -21
  277. package/dist-esm/src/customLocationsManagementClient.d.ts.map +0 -1
  278. package/dist-esm/src/customLocationsManagementClient.js +0 -101
  279. package/dist-esm/src/customLocationsManagementClient.js.map +0 -1
  280. package/dist-esm/src/index.d.ts +0 -6
  281. package/dist-esm/src/index.d.ts.map +0 -1
  282. package/dist-esm/src/index.js +0 -13
  283. package/dist-esm/src/index.js.map +0 -1
  284. package/dist-esm/src/lroImpl.d.ts +0 -16
  285. package/dist-esm/src/lroImpl.d.ts.map +0 -1
  286. package/dist-esm/src/lroImpl.js +0 -29
  287. package/dist-esm/src/lroImpl.js.map +0 -1
  288. package/dist-esm/src/models/index.d.ts +0 -541
  289. package/dist-esm/src/models/index.d.ts.map +0 -1
  290. package/dist-esm/src/models/index.js +0 -34
  291. package/dist-esm/src/models/index.js.map +0 -1
  292. package/dist-esm/src/models/mappers.d.ts +0 -26
  293. package/dist-esm/src/models/mappers.d.ts.map +0 -1
  294. package/dist-esm/src/models/mappers.js +0 -777
  295. package/dist-esm/src/models/mappers.js.map +0 -1
  296. package/dist-esm/src/models/parameters.d.ts +0 -27
  297. package/dist-esm/src/models/parameters.d.ts.map +0 -1
  298. package/dist-esm/src/models/parameters.js +0 -185
  299. package/dist-esm/src/models/parameters.js.map +0 -1
  300. package/dist-esm/src/operations/customLocations.d.ts +0 -155
  301. package/dist-esm/src/operations/customLocations.d.ts.map +0 -1
  302. package/dist-esm/src/operations/customLocations.js +0 -757
  303. package/dist-esm/src/operations/customLocations.js.map +0 -1
  304. package/dist-esm/src/operations/index.d.ts +0 -3
  305. package/dist-esm/src/operations/index.d.ts.map +0 -1
  306. package/dist-esm/src/operations/index.js +0 -10
  307. package/dist-esm/src/operations/index.js.map +0 -1
  308. package/dist-esm/src/operations/resourceSyncRules.d.ts +0 -97
  309. package/dist-esm/src/operations/resourceSyncRules.d.ts.map +0 -1
  310. package/dist-esm/src/operations/resourceSyncRules.js +0 -411
  311. package/dist-esm/src/operations/resourceSyncRules.js.map +0 -1
  312. package/dist-esm/src/operationsInterfaces/customLocations.d.ts +0 -86
  313. package/dist-esm/src/operationsInterfaces/customLocations.d.ts.map +0 -1
  314. package/dist-esm/src/operationsInterfaces/customLocations.js +0 -9
  315. package/dist-esm/src/operationsInterfaces/customLocations.js.map +0 -1
  316. package/dist-esm/src/operationsInterfaces/index.d.ts +0 -3
  317. package/dist-esm/src/operationsInterfaces/index.d.ts.map +0 -1
  318. package/dist-esm/src/operationsInterfaces/index.js +0 -10
  319. package/dist-esm/src/operationsInterfaces/index.js.map +0 -1
  320. package/dist-esm/src/operationsInterfaces/resourceSyncRules.d.ts +0 -71
  321. package/dist-esm/src/operationsInterfaces/resourceSyncRules.d.ts.map +0 -1
  322. package/dist-esm/src/operationsInterfaces/resourceSyncRules.js +0 -9
  323. package/dist-esm/src/operationsInterfaces/resourceSyncRules.js.map +0 -1
  324. package/dist-esm/src/pagingHelper.d.ts +0 -13
  325. package/dist-esm/src/pagingHelper.d.ts.map +0 -1
  326. package/dist-esm/src/pagingHelper.js +0 -32
  327. package/dist-esm/src/pagingHelper.js.map +0 -1
  328. package/dist-esm/test/sampleTest.d.ts +0 -2
  329. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  330. package/dist-esm/test/sampleTest.js +0 -38
  331. package/dist-esm/test/sampleTest.js.map +0 -1
  332. package/review/arm-extendedlocation.api.md +0 -434
  333. package/rollup.config.js +0 -122
  334. package/src/customLocationsManagementClient.ts +0 -142
  335. package/src/index.ts +0 -13
  336. package/src/lroImpl.ts +0 -34
  337. package/src/models/index.ts +0 -606
  338. package/src/models/mappers.ts +0 -832
  339. package/src/models/parameters.ts +0 -225
  340. package/src/operations/customLocations.ts +0 -977
  341. package/src/operations/index.ts +0 -10
  342. package/src/operations/resourceSyncRules.ts +0 -575
  343. package/src/operationsInterfaces/customLocations.ts +0 -160
  344. package/src/operationsInterfaces/index.ts +0 -10
  345. package/src/operationsInterfaces/resourceSyncRules.ts +0 -136
  346. package/src/pagingHelper.ts +0 -39
  347. package/tsconfig.json +0 -33
  348. package/types/arm-extendedlocation.d.ts +0 -790
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/models/models.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { areAllPropsUndefined } from \"../static-helpers/serialization/check-prop-undefined.js\";\n\n/**\n * This file contains only generated model types and their (de)serializers.\n * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input.\n */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/** Collection of CustomLocationOperation items */\nexport interface _CustomLocationOperationsList {\n /** The link to the next page of items */\n nextLink?: string;\n /** The CustomLocationOperation items */\n value: CustomLocationOperation[];\n}\n\nexport function _customLocationOperationsListDeserializer(\n item: any,\n): _CustomLocationOperationsList {\n return {\n nextLink: item[\"nextLink\"],\n value: customLocationOperationArrayDeserializer(item[\"value\"]),\n };\n}\n\nexport function customLocationOperationArrayDeserializer(\n result: Array<CustomLocationOperation>,\n): any[] {\n return result.map((item) => {\n return customLocationOperationDeserializer(item);\n });\n}\n\n/** Custom Locations operation. */\nexport interface CustomLocationOperation {\n /** Is this Operation a data plane operation */\n readonly isDataAction?: boolean;\n /** The name of the compute operation. */\n readonly name?: string;\n /** The origin of the compute operation. */\n readonly origin?: string;\n /** The description of the operation. */\n readonly description?: string;\n /** The display name of the compute operation. */\n readonly operation?: string;\n /** The resource provider for the operation. */\n readonly provider?: string;\n /** The display name of the resource the operation applies to. */\n readonly resource?: string;\n}\n\nexport function customLocationOperationDeserializer(item: any): CustomLocationOperation {\n return {\n ...(!item[\"display\"]\n ? item[\"display\"]\n : _customLocationOperationDisplayDeserializer(item[\"display\"])),\n isDataAction: item[\"isDataAction\"],\n name: item[\"name\"],\n origin: item[\"origin\"],\n };\n}\n\n/** Describes the properties of a Custom Locations Operation Value Display. */\nexport interface CustomLocationOperationValueDisplay {\n /** The description of the operation. */\n readonly description?: string;\n /** The display name of the compute operation. */\n readonly operation?: string;\n /** The resource provider for the operation. */\n readonly provider?: string;\n /** The display name of the resource the operation applies to. */\n readonly resource?: string;\n}\n\nexport function customLocationOperationValueDisplayDeserializer(\n item: any,\n): CustomLocationOperationValueDisplay {\n return {\n description: item[\"description\"],\n operation: item[\"operation\"],\n provider: item[\"provider\"],\n resource: item[\"resource\"],\n };\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorDetailDeserializer(item[\"error\"]),\n };\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: ErrorDetail[];\n /** The error additional info. */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\nexport function errorDetailDeserializer(item: any): ErrorDetail {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n target: item[\"target\"],\n details: !item[\"details\"] ? item[\"details\"] : errorDetailArrayDeserializer(item[\"details\"]),\n additionalInfo: !item[\"additionalInfo\"]\n ? item[\"additionalInfo\"]\n : errorAdditionalInfoArrayDeserializer(item[\"additionalInfo\"]),\n };\n}\n\nexport function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[] {\n return result.map((item) => {\n return errorDetailDeserializer(item);\n });\n}\n\nexport function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[] {\n return result.map((item) => {\n return errorAdditionalInfoDeserializer(item);\n });\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: any;\n}\n\nexport function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo {\n return {\n type: item[\"type\"],\n info: item[\"info\"],\n };\n}\n\n/** Custom Locations definition. */\nexport interface CustomLocation extends TrackedResource {\n /** Identity for the resource. */\n identity?: Identity;\n /** This is optional input that contains the authentication that should be used to generate the namespace. */\n authentication?: CustomLocationPropertiesAuthentication;\n /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */\n clusterExtensionIds?: string[];\n /** Display name for the Custom Locations location. */\n displayName?: string;\n /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */\n hostResourceId?: string;\n /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */\n hostType?: HostType;\n /** Kubernetes namespace that will be created on the specified cluster. */\n namespace?: string;\n /** Provisioning State for the Custom Location. */\n provisioningState?: string;\n}\n\nexport function customLocationSerializer(item: CustomLocation): any {\n return {\n tags: item[\"tags\"],\n location: item[\"location\"],\n properties: areAllPropsUndefined(item, [\n \"authentication\",\n \"clusterExtensionIds\",\n \"displayName\",\n \"hostResourceId\",\n \"hostType\",\n \"namespace\",\n \"provisioningState\",\n ])\n ? undefined\n : _customLocationPropertiesSerializer(item),\n identity: !item[\"identity\"] ? item[\"identity\"] : identitySerializer(item[\"identity\"]),\n };\n}\n\nexport function customLocationDeserializer(item: any): CustomLocation {\n return {\n tags: !item[\"tags\"]\n ? item[\"tags\"]\n : Object.fromEntries(Object.entries(item[\"tags\"]).map(([k, p]: [string, any]) => [k, p])),\n location: item[\"location\"],\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n ...(!item[\"properties\"]\n ? item[\"properties\"]\n : _customLocationPropertiesDeserializer(item[\"properties\"])),\n identity: !item[\"identity\"] ? item[\"identity\"] : identityDeserializer(item[\"identity\"]),\n };\n}\n\n/** Properties for a custom location. */\nexport interface CustomLocationProperties {\n /** This is optional input that contains the authentication that should be used to generate the namespace. */\n authentication?: CustomLocationPropertiesAuthentication;\n /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */\n clusterExtensionIds?: string[];\n /** Display name for the Custom Locations location. */\n displayName?: string;\n /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */\n hostResourceId?: string;\n /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */\n hostType?: HostType;\n /** Kubernetes namespace that will be created on the specified cluster. */\n namespace?: string;\n /** Provisioning State for the Custom Location. */\n provisioningState?: string;\n}\n\nexport function customLocationPropertiesSerializer(item: CustomLocationProperties): any {\n return {\n authentication: !item[\"authentication\"]\n ? item[\"authentication\"]\n : customLocationPropertiesAuthenticationSerializer(item[\"authentication\"]),\n clusterExtensionIds: !item[\"clusterExtensionIds\"]\n ? item[\"clusterExtensionIds\"]\n : item[\"clusterExtensionIds\"].map((p: any) => {\n return p;\n }),\n displayName: item[\"displayName\"],\n hostResourceId: item[\"hostResourceId\"],\n hostType: item[\"hostType\"],\n namespace: item[\"namespace\"],\n provisioningState: item[\"provisioningState\"],\n };\n}\n\nexport function customLocationPropertiesDeserializer(item: any): CustomLocationProperties {\n return {\n authentication: !item[\"authentication\"]\n ? item[\"authentication\"]\n : customLocationPropertiesAuthenticationDeserializer(item[\"authentication\"]),\n clusterExtensionIds: !item[\"clusterExtensionIds\"]\n ? item[\"clusterExtensionIds\"]\n : item[\"clusterExtensionIds\"].map((p: any) => {\n return p;\n }),\n displayName: item[\"displayName\"],\n hostResourceId: item[\"hostResourceId\"],\n hostType: item[\"hostType\"],\n namespace: item[\"namespace\"],\n provisioningState: item[\"provisioningState\"],\n };\n}\n\n/** This is optional input that contains the authentication that should be used to generate the namespace. */\nexport interface CustomLocationPropertiesAuthentication {\n /** The type of the Custom Locations authentication */\n type?: string;\n /** The kubeconfig value. */\n value?: string;\n}\n\nexport function customLocationPropertiesAuthenticationSerializer(\n item: CustomLocationPropertiesAuthentication,\n): any {\n return { type: item[\"type\"], value: item[\"value\"] };\n}\n\nexport function customLocationPropertiesAuthenticationDeserializer(\n item: any,\n): CustomLocationPropertiesAuthentication {\n return {\n type: item[\"type\"],\n value: item[\"value\"],\n };\n}\n\n/** Type of host the Custom Locations is referencing (Kubernetes, etc...). */\nexport enum KnownHostType {\n /** Kubernetes */\n Kubernetes = \"Kubernetes\",\n}\n\n/**\n * Type of host the Custom Locations is referencing (Kubernetes, etc...). \\\n * {@link KnownHostType} can be used interchangeably with HostType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Kubernetes**: Kubernetes\n */\nexport type HostType = string;\n\n/** Identity for the resource. */\nexport interface Identity {\n /** The principal ID of resource identity. */\n readonly principalId?: string;\n /** The tenant ID of resource. */\n readonly tenantId?: string;\n /** The identity type. */\n type?: ResourceIdentityType;\n}\n\nexport function identitySerializer(item: Identity): any {\n return { type: item[\"type\"] };\n}\n\nexport function identityDeserializer(item: any): Identity {\n return {\n principalId: item[\"principalId\"],\n tenantId: item[\"tenantId\"],\n type: item[\"type\"],\n };\n}\n\n/** The identity type. */\nexport enum KnownResourceIdentityType {\n /** SystemAssigned */\n SystemAssigned = \"SystemAssigned\",\n /** None */\n None = \"None\",\n}\n\n/**\n * The identity type. \\\n * {@link KnownResourceIdentityType} can be used interchangeably with ResourceIdentityType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **SystemAssigned**: SystemAssigned \\\n * **None**: None\n */\nexport type ResourceIdentityType = string;\n\n/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */\nexport interface TrackedResource extends Resource {\n /** Resource tags. */\n tags?: Record<string, string>;\n /** The geo-location where the resource lives */\n location: string;\n}\n\nexport function trackedResourceSerializer(item: TrackedResource): any {\n return { tags: item[\"tags\"], location: item[\"location\"] };\n}\n\nexport function trackedResourceDeserializer(item: any): TrackedResource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n tags: !item[\"tags\"]\n ? item[\"tags\"]\n : Object.fromEntries(Object.entries(item[\"tags\"]).map(([k, p]: [string, any]) => [k, p])),\n location: item[\"location\"],\n };\n}\n\n/** Common fields that are returned in the response for all Azure Resource Manager resources */\nexport interface Resource {\n /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */\n readonly id?: string;\n /** The name of the resource */\n readonly name?: string;\n /** The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\" */\n readonly type?: string;\n /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */\n readonly systemData?: SystemData;\n}\n\nexport function resourceSerializer(_item: Resource): any {\n return {};\n}\n\nexport function resourceDeserializer(item: any): Resource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Metadata pertaining to creation and last modification of the resource. */\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: CreatedByType;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: CreatedByType;\n /** The timestamp of resource last modification (UTC) */\n lastModifiedAt?: Date;\n}\n\nexport function systemDataDeserializer(item: any): SystemData {\n return {\n createdBy: item[\"createdBy\"],\n createdByType: item[\"createdByType\"],\n createdAt: !item[\"createdAt\"] ? item[\"createdAt\"] : new Date(item[\"createdAt\"]),\n lastModifiedBy: item[\"lastModifiedBy\"],\n lastModifiedByType: item[\"lastModifiedByType\"],\n lastModifiedAt: !item[\"lastModifiedAt\"]\n ? item[\"lastModifiedAt\"]\n : new Date(item[\"lastModifiedAt\"]),\n };\n}\n\n/** The kind of entity that created the resource. */\nexport enum KnownCreatedByType {\n /** The entity was created by a user. */\n User = \"User\",\n /** The entity was created by an application. */\n Application = \"Application\",\n /** The entity was created by a managed identity. */\n ManagedIdentity = \"ManagedIdentity\",\n /** The entity was created by a key. */\n Key = \"Key\",\n}\n\n/**\n * The kind of entity that created the resource. \\\n * {@link KnownCreatedByType} can be used interchangeably with CreatedByType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **User**: The entity was created by a user. \\\n * **Application**: The entity was created by an application. \\\n * **ManagedIdentity**: The entity was created by a managed identity. \\\n * **Key**: The entity was created by a key.\n */\nexport type CreatedByType = string;\n\n/** The Custom Locations patchable resource definition. */\nexport interface PatchableCustomLocations {\n /** Identity for the resource. */\n identity?: Identity;\n /** The Custom Locations patchable properties. */\n properties?: CustomLocationProperties;\n /** Resource tags */\n tags?: Record<string, string>;\n}\n\nexport function patchableCustomLocationsSerializer(item: PatchableCustomLocations): any {\n return {\n identity: !item[\"identity\"] ? item[\"identity\"] : identitySerializer(item[\"identity\"]),\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : customLocationPropertiesSerializer(item[\"properties\"]),\n tags: item[\"tags\"],\n };\n}\n\n/** The List Custom Locations operation response. */\nexport interface _CustomLocationListResult {\n /** The URL to use for getting the next set of results. */\n readonly nextLink?: string;\n /** The list of Custom Locations. */\n readonly value?: CustomLocation[];\n}\n\nexport function _customLocationListResultDeserializer(item: any): _CustomLocationListResult {\n return {\n nextLink: item[\"nextLink\"],\n value: !item[\"value\"] ? item[\"value\"] : customLocationArrayDeserializer(item[\"value\"]),\n };\n}\n\nexport function customLocationArraySerializer(result: Array<CustomLocation>): any[] {\n return result.map((item) => {\n return customLocationSerializer(item);\n });\n}\n\nexport function customLocationArrayDeserializer(result: Array<CustomLocation>): any[] {\n return result.map((item) => {\n return customLocationDeserializer(item);\n });\n}\n\n/** List of EnabledResourceTypes definition. */\nexport interface _EnabledResourceTypesListResult {\n /** The URL to use for getting the next set of results. */\n readonly nextLink?: string;\n /** The list of EnabledResourceTypes available for a customLocation. */\n readonly value?: EnabledResourceType[];\n}\n\nexport function _enabledResourceTypesListResultDeserializer(\n item: any,\n): _EnabledResourceTypesListResult {\n return {\n nextLink: item[\"nextLink\"],\n value: !item[\"value\"] ? item[\"value\"] : enabledResourceTypeArrayDeserializer(item[\"value\"]),\n };\n}\n\nexport function enabledResourceTypeArrayDeserializer(result: Array<EnabledResourceType>): any[] {\n return result.map((item) => {\n return enabledResourceTypeDeserializer(item);\n });\n}\n\n/** EnabledResourceType definition. */\nexport interface EnabledResourceType extends ProxyResource {\n /** Metadata pertaining to creation and last modification of the resource */\n readonly systemData?: SystemData;\n /** Cluster Extension ID */\n clusterExtensionId?: string;\n /** Cluster Extension Type */\n extensionType?: string;\n /** Metadata of the Resource Type */\n typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[];\n}\n\nexport function enabledResourceTypeDeserializer(item: any): EnabledResourceType {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n ...(!item[\"properties\"]\n ? item[\"properties\"]\n : _enabledResourceTypePropertiesDeserializer(item[\"properties\"])),\n };\n}\n\n/** Properties for EnabledResourceType of a custom location. */\nexport interface EnabledResourceTypeProperties {\n /** Cluster Extension ID */\n clusterExtensionId?: string;\n /** Cluster Extension Type */\n extensionType?: string;\n /** Metadata of the Resource Type */\n typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[];\n}\n\nexport function enabledResourceTypePropertiesDeserializer(\n item: any,\n): EnabledResourceTypeProperties {\n return {\n clusterExtensionId: item[\"clusterExtensionId\"],\n extensionType: item[\"extensionType\"],\n typesMetadata: !item[\"typesMetadata\"]\n ? item[\"typesMetadata\"]\n : enabledResourceTypePropertiesTypesMetadataItemArrayDeserializer(item[\"typesMetadata\"]),\n };\n}\n\nexport function enabledResourceTypePropertiesTypesMetadataItemArrayDeserializer(\n result: Array<EnabledResourceTypePropertiesTypesMetadataItem>,\n): any[] {\n return result.map((item) => {\n return enabledResourceTypePropertiesTypesMetadataItemDeserializer(item);\n });\n}\n\n/** Metadata of the Resource Type. */\nexport interface EnabledResourceTypePropertiesTypesMetadataItem {\n /** Api Version of Resource Type */\n apiVersion?: string;\n /** Resource Provider Namespace of Resource Type */\n resourceProviderNamespace?: string;\n /** Resource Type */\n resourceType?: string;\n}\n\nexport function enabledResourceTypePropertiesTypesMetadataItemDeserializer(\n item: any,\n): EnabledResourceTypePropertiesTypesMetadataItem {\n return {\n apiVersion: item[\"apiVersion\"],\n resourceProviderNamespace: item[\"resourceProviderNamespace\"],\n resourceType: item[\"resourceType\"],\n };\n}\n\n/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */\nexport interface ProxyResource extends Resource {}\n\nexport function proxyResourceDeserializer(item: any): ProxyResource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** The Find Target Resource Group operation request. */\nexport interface CustomLocationFindTargetResourceGroupProperties {\n /** Labels of the custom resource, this is a map of {key,value} pairs. */\n labels?: Record<string, string>;\n}\n\nexport function customLocationFindTargetResourceGroupPropertiesSerializer(\n item: CustomLocationFindTargetResourceGroupProperties,\n): any {\n return { labels: item[\"labels\"] };\n}\n\n/** The Find Target Resource Group operation response. */\nexport interface CustomLocationFindTargetResourceGroupResult {\n /** The matching resource sync rule is the particular resource sync rule that matched the match expressions and labels and had lowest priority. This is the rule responsible for mapping the target resource to the target resource group. */\n readonly matchedResourceSyncRule?: string;\n /** The target resource group of matching resource sync rule. The labels from the request will be used to find out matching resource sync rule against the selector property of the resource sync rule. The one with highest priority will be returned if there are multiple matching rules. */\n readonly targetResourceGroup?: string;\n}\n\nexport function customLocationFindTargetResourceGroupResultDeserializer(\n item: any,\n): CustomLocationFindTargetResourceGroupResult {\n return {\n matchedResourceSyncRule: item[\"matchedResourceSyncRule\"],\n targetResourceGroup: item[\"targetResourceGroup\"],\n };\n}\n\n/** Resource Sync Rules definition. */\nexport interface ResourceSyncRule extends TrackedResource {\n /** Priority represents a priority of the Resource Sync Rule */\n priority?: number;\n /** Provisioning State for the Resource Sync Rule. */\n readonly provisioningState?: string;\n /** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */\n selector?: ResourceSyncRulePropertiesSelector;\n /** For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. */\n targetResourceGroup?: string;\n}\n\nexport function resourceSyncRuleSerializer(item: ResourceSyncRule): any {\n return {\n tags: item[\"tags\"],\n location: item[\"location\"],\n properties: areAllPropsUndefined(item, [\"priority\", \"selector\", \"targetResourceGroup\"])\n ? undefined\n : _resourceSyncRulePropertiesSerializer(item),\n };\n}\n\nexport function resourceSyncRuleDeserializer(item: any): ResourceSyncRule {\n return {\n tags: !item[\"tags\"]\n ? item[\"tags\"]\n : Object.fromEntries(Object.entries(item[\"tags\"]).map(([k, p]: [string, any]) => [k, p])),\n location: item[\"location\"],\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n ...(!item[\"properties\"]\n ? item[\"properties\"]\n : _resourceSyncRulePropertiesDeserializer(item[\"properties\"])),\n };\n}\n\n/** Properties for a resource sync rule. For an unmapped custom resource, its labels will be used to find out matching resource sync rules using the selector property of the resource sync rule. If this resource sync rule has highest priority among all matching rules, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. */\nexport interface ResourceSyncRuleProperties {\n /** Priority represents a priority of the Resource Sync Rule */\n priority?: number;\n /** Provisioning State for the Resource Sync Rule. */\n readonly provisioningState?: string;\n /** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */\n selector?: ResourceSyncRulePropertiesSelector;\n /** For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. */\n targetResourceGroup?: string;\n}\n\nexport function resourceSyncRulePropertiesSerializer(item: ResourceSyncRuleProperties): any {\n return {\n priority: item[\"priority\"],\n selector: !item[\"selector\"]\n ? item[\"selector\"]\n : resourceSyncRulePropertiesSelectorSerializer(item[\"selector\"]),\n targetResourceGroup: item[\"targetResourceGroup\"],\n };\n}\n\nexport function resourceSyncRulePropertiesDeserializer(item: any): ResourceSyncRuleProperties {\n return {\n priority: item[\"priority\"],\n provisioningState: item[\"provisioningState\"],\n selector: !item[\"selector\"]\n ? item[\"selector\"]\n : resourceSyncRulePropertiesSelectorDeserializer(item[\"selector\"]),\n targetResourceGroup: item[\"targetResourceGroup\"],\n };\n}\n\n/** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */\nexport interface ResourceSyncRulePropertiesSelector {\n /** MatchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. */\n matchExpressions?: MatchExpressionsProperties[];\n /** MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. */\n matchLabels?: Record<string, string>;\n}\n\nexport function resourceSyncRulePropertiesSelectorSerializer(\n item: ResourceSyncRulePropertiesSelector,\n): any {\n return {\n matchExpressions: !item[\"matchExpressions\"]\n ? item[\"matchExpressions\"]\n : matchExpressionsPropertiesArraySerializer(item[\"matchExpressions\"]),\n matchLabels: item[\"matchLabels\"],\n };\n}\n\nexport function resourceSyncRulePropertiesSelectorDeserializer(\n item: any,\n): ResourceSyncRulePropertiesSelector {\n return {\n matchExpressions: !item[\"matchExpressions\"]\n ? item[\"matchExpressions\"]\n : matchExpressionsPropertiesArrayDeserializer(item[\"matchExpressions\"]),\n matchLabels: !item[\"matchLabels\"]\n ? item[\"matchLabels\"]\n : Object.fromEntries(\n Object.entries(item[\"matchLabels\"]).map(([k, p]: [string, any]) => [k, p]),\n ),\n };\n}\n\nexport function matchExpressionsPropertiesArraySerializer(\n result: Array<MatchExpressionsProperties>,\n): any[] {\n return result.map((item) => {\n return matchExpressionsPropertiesSerializer(item);\n });\n}\n\nexport function matchExpressionsPropertiesArrayDeserializer(\n result: Array<MatchExpressionsProperties>,\n): any[] {\n return result.map((item) => {\n return matchExpressionsPropertiesDeserializer(item);\n });\n}\n\n/** Resource Sync Rules matchExpression property definition. */\nexport interface MatchExpressionsProperties {\n /** Key is the label key that the selector applies to. */\n key?: string;\n /** The Operator field represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. */\n operator?: string;\n /** The label value */\n values?: string[];\n}\n\nexport function matchExpressionsPropertiesSerializer(item: MatchExpressionsProperties): any {\n return {\n key: item[\"key\"],\n operator: item[\"operator\"],\n values: !item[\"values\"]\n ? item[\"values\"]\n : item[\"values\"].map((p: any) => {\n return p;\n }),\n };\n}\n\nexport function matchExpressionsPropertiesDeserializer(item: any): MatchExpressionsProperties {\n return {\n key: item[\"key\"],\n operator: item[\"operator\"],\n values: !item[\"values\"]\n ? item[\"values\"]\n : item[\"values\"].map((p: any) => {\n return p;\n }),\n };\n}\n\n/** The Resource Sync Rules patchable resource definition. */\nexport interface PatchableResourceSyncRule {\n /** The Resource Sync Rules patchable properties. */\n properties?: ResourceSyncRuleProperties;\n /** Resource tags */\n tags?: Record<string, string>;\n}\n\nexport function patchableResourceSyncRuleSerializer(item: PatchableResourceSyncRule): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : resourceSyncRulePropertiesSerializer(item[\"properties\"]),\n tags: item[\"tags\"],\n };\n}\n\n/** The List Resource Sync Rules operation response. */\nexport interface _ResourceSyncRuleListResult {\n /** The URL to use for getting the next set of results. */\n readonly nextLink?: string;\n /** The list of Resource Sync Rules. */\n readonly value?: ResourceSyncRule[];\n}\n\nexport function _resourceSyncRuleListResultDeserializer(item: any): _ResourceSyncRuleListResult {\n return {\n nextLink: item[\"nextLink\"],\n value: !item[\"value\"] ? item[\"value\"] : resourceSyncRuleArrayDeserializer(item[\"value\"]),\n };\n}\n\nexport function resourceSyncRuleArraySerializer(result: Array<ResourceSyncRule>): any[] {\n return result.map((item) => {\n return resourceSyncRuleSerializer(item);\n });\n}\n\nexport function resourceSyncRuleArrayDeserializer(result: Array<ResourceSyncRule>): any[] {\n return result.map((item) => {\n return resourceSyncRuleDeserializer(item);\n });\n}\n\n/** The available API versions. */\nexport enum KnownVersions {\n /** The 2021-08-31-preview API version. */\n V20210831Preview = \"2021-08-31-preview\",\n}\n\nexport function _customLocationOperationDisplayDeserializer(item: any) {\n return {\n description: item[\"description\"],\n operation: item[\"operation\"],\n provider: item[\"provider\"],\n resource: item[\"resource\"],\n };\n}\n\nexport function _customLocationPropertiesSerializer(item: CustomLocation): any {\n return {\n authentication: !item[\"authentication\"]\n ? item[\"authentication\"]\n : customLocationPropertiesAuthenticationSerializer(item[\"authentication\"]),\n clusterExtensionIds: !item[\"clusterExtensionIds\"]\n ? item[\"clusterExtensionIds\"]\n : item[\"clusterExtensionIds\"].map((p: any) => {\n return p;\n }),\n displayName: item[\"displayName\"],\n hostResourceId: item[\"hostResourceId\"],\n hostType: item[\"hostType\"],\n namespace: item[\"namespace\"],\n provisioningState: item[\"provisioningState\"],\n };\n}\n\nexport function _customLocationPropertiesDeserializer(item: any) {\n return {\n authentication: !item[\"authentication\"]\n ? item[\"authentication\"]\n : customLocationPropertiesAuthenticationDeserializer(item[\"authentication\"]),\n clusterExtensionIds: !item[\"clusterExtensionIds\"]\n ? item[\"clusterExtensionIds\"]\n : item[\"clusterExtensionIds\"].map((p: any) => {\n return p;\n }),\n displayName: item[\"displayName\"],\n hostResourceId: item[\"hostResourceId\"],\n hostType: item[\"hostType\"],\n namespace: item[\"namespace\"],\n provisioningState: item[\"provisioningState\"],\n };\n}\n\nexport function _enabledResourceTypePropertiesDeserializer(item: any) {\n return {\n clusterExtensionId: item[\"clusterExtensionId\"],\n extensionType: item[\"extensionType\"],\n typesMetadata: !item[\"typesMetadata\"]\n ? item[\"typesMetadata\"]\n : enabledResourceTypePropertiesTypesMetadataItemArrayDeserializer(item[\"typesMetadata\"]),\n };\n}\n\nexport function _resourceSyncRulePropertiesSerializer(item: ResourceSyncRule): any {\n return {\n priority: item[\"priority\"],\n selector: !item[\"selector\"]\n ? item[\"selector\"]\n : resourceSyncRulePropertiesSelectorSerializer(item[\"selector\"]),\n targetResourceGroup: item[\"targetResourceGroup\"],\n };\n}\n\nexport function _resourceSyncRulePropertiesDeserializer(item: any) {\n return {\n priority: item[\"priority\"],\n provisioningState: item[\"provisioningState\"],\n selector: !item[\"selector\"]\n ? item[\"selector\"]\n : resourceSyncRulePropert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IAChC,KAAK,eAAe,IACpB,gEAAgE,KAAK,eAAe,CAAC;AAAA,EAC3F;AACF;AAEO,SAAS,sCAAsC,MAA6B;AACjF,SAAO;AAAA,IACL,UAAU,KAAK,UAAU;AAAA,IACzB,UAAU,CAAC,KAAK,UAAU,IACtB,KAAK,UAAU,IACf,6CAA6C,KAAK,UAAU,CAAC;AAAA,IACjE,qBAAqB,KAAK,qBAAqB;AAAA,EACjD;AACF;AAEO,SAAS,wCAAwC,MAAW;AACjE,SAAO;AAAA,IACL,UAAU,KAAK,UAAU;AAAA,IACzB,mBAAmB,KAAK,mBAAmB;AAAA,IAC3C,UAAU,CAAC,KAAK,UAAU,IACtB,KAAK,UAAU,IACf,+CAA+C,KAAK,UAAU,CAAC;AAAA,IACnE,qBAAqB,KAAK,qBAAqB;AAAA,EACjD;AACF;",
6
+ "names": ["KnownHostType", "KnownResourceIdentityType", "KnownCreatedByType", "KnownVersions"]
7
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,21 @@
1
+ import type { CustomLocationsManagementClient } from "./customLocationsManagementClient.js";
2
+ import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client";
3
+ import type { AbortSignalLike } from "@azure/abort-controller";
4
+ import type { PollerLike, OperationState } from "@azure/core-lro";
5
+ export interface RestorePollerOptions<TResult, TResponse extends PathUncheckedResponse = PathUncheckedResponse> extends OperationOptions {
6
+ /** Delay to wait until next poll, in milliseconds. */
7
+ updateIntervalInMs?: number;
8
+ /**
9
+ * The signal which can be used to abort requests.
10
+ */
11
+ abortSignal?: AbortSignalLike;
12
+ /** Deserialization function for raw response body */
13
+ processResponseBody?: (result: TResponse) => Promise<TResult>;
14
+ }
15
+ /**
16
+ * Creates a poller from the serialized state of another poller. This can be
17
+ * useful when you want to create pollers on a different host or a poller
18
+ * needs to be constructed after the original one is not in scope.
19
+ */
20
+ export declare function restorePoller<TResponse extends PathUncheckedResponse, TResult>(client: CustomLocationsManagementClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>, options?: RestorePollerOptions<TResult>): PollerLike<OperationState<TResult>, TResult>;
21
+ //# sourceMappingURL=restorePollerHelpers.d.ts.map
@@ -0,0 +1,114 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var restorePollerHelpers_exports = {};
19
+ __export(restorePollerHelpers_exports, {
20
+ restorePoller: () => restorePoller
21
+ });
22
+ module.exports = __toCommonJS(restorePollerHelpers_exports);
23
+ var import_operations = require("./api/resourceSyncRules/operations.js");
24
+ var import_operations2 = require("./api/customLocations/operations.js");
25
+ var import_pollingHelpers = require("./static-helpers/pollingHelpers.js");
26
+ var import_core_lro = require("@azure/core-lro");
27
+ function restorePoller(client, serializedState, sourceOperation, options) {
28
+ const pollerConfig = (0, import_core_lro.deserializeState)(serializedState).config;
29
+ const { initialRequestUrl, requestMethod, metadata } = pollerConfig;
30
+ if (!initialRequestUrl || !requestMethod) {
31
+ throw new Error(
32
+ `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`
33
+ );
34
+ }
35
+ const resourceLocationConfig = metadata?.["resourceLocationConfig"];
36
+ const { deserializer, expectedStatuses = [] } = getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};
37
+ const deserializeHelper = options?.processResponseBody ?? deserializer;
38
+ if (!deserializeHelper) {
39
+ throw new Error(
40
+ `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`
41
+ );
42
+ }
43
+ const apiVersion = getApiVersionFromUrl(initialRequestUrl);
44
+ return (0, import_pollingHelpers.getLongRunningPoller)(
45
+ client["_client"] ?? client,
46
+ deserializeHelper,
47
+ expectedStatuses,
48
+ {
49
+ updateIntervalInMs: options?.updateIntervalInMs,
50
+ abortSignal: options?.abortSignal,
51
+ resourceLocationConfig,
52
+ restoreFrom: serializedState,
53
+ initialRequestUrl,
54
+ apiVersion
55
+ }
56
+ );
57
+ }
58
+ const deserializeMap = {
59
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}": { deserializer: import_operations._updateDeserialize, expectedStatuses: ["200", "201", "202"] },
60
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}": { deserializer: import_operations._createOrUpdateDeserialize, expectedStatuses: ["200", "201", "202"] },
61
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}": { deserializer: import_operations2._$deleteDeserialize, expectedStatuses: ["202", "204", "200"] },
62
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}": {
63
+ deserializer: import_operations2._createOrUpdateDeserialize,
64
+ expectedStatuses: ["200", "201", "202"]
65
+ }
66
+ };
67
+ function getDeserializationHelper(urlStr, method) {
68
+ const path = new URL(urlStr).pathname;
69
+ const pathParts = path.split("/");
70
+ let matchedLen = -1, matchedValue;
71
+ for (const [key, value] of Object.entries(deserializeMap)) {
72
+ if (!key.startsWith(method)) {
73
+ continue;
74
+ }
75
+ const candidatePath = getPathFromMapKey(key);
76
+ const candidateParts = candidatePath.split("/");
77
+ let found = true;
78
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
79
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
80
+ const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
81
+ const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(
82
+ pathParts[j] || ""
83
+ );
84
+ if (!isMatched) {
85
+ found = false;
86
+ break;
87
+ }
88
+ continue;
89
+ }
90
+ if (candidateParts[i] !== pathParts[j]) {
91
+ found = false;
92
+ break;
93
+ }
94
+ }
95
+ if (found && candidatePath.length > matchedLen) {
96
+ matchedLen = candidatePath.length;
97
+ matchedValue = value;
98
+ }
99
+ }
100
+ return matchedValue;
101
+ }
102
+ function getPathFromMapKey(mapKey) {
103
+ const pathStart = mapKey.indexOf("/");
104
+ return mapKey.slice(pathStart);
105
+ }
106
+ function getApiVersionFromUrl(urlStr) {
107
+ const url = new URL(urlStr);
108
+ return url.searchParams.get("api-version") ?? void 0;
109
+ }
110
+ // Annotate the CommonJS export names for ESM import in node:
111
+ 0 && (module.exports = {
112
+ restorePoller
113
+ });
114
+ //# sourceMappingURL=restorePollerHelpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/restorePollerHelpers.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CustomLocationsManagementClient } from \"./customLocationsManagementClient.js\";\nimport {\n _updateDeserialize,\n _createOrUpdateDeserialize,\n} from \"./api/resourceSyncRules/operations.js\";\nimport {\n _$deleteDeserialize,\n _createOrUpdateDeserialize as _createOrUpdateDeserializeCustomLocations,\n} from \"./api/customLocations/operations.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport type { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { PollerLike, OperationState, ResourceLocationConfig } from \"@azure/core-lro\";\nimport { deserializeState } from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: CustomLocationsManagementClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n const apiVersion = getApiVersionFromUrl(initialRequestUrl);\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n apiVersion,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: (result: PathUncheckedResponse) => Promise<any>;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}\":\n { deserializer: _updateDeserialize, expectedStatuses: [\"200\", \"201\", \"202\"] },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}\":\n { deserializer: _createOrUpdateDeserialize, expectedStatuses: [\"200\", \"201\", \"202\"] },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}\":\n { deserializer: _$deleteDeserialize, expectedStatuses: [\"202\", \"204\", \"200\"] },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}\":\n {\n deserializer: _createOrUpdateDeserializeCustomLocations,\n expectedStatuses: [\"200\", \"201\", \"202\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n\nfunction getApiVersionFromUrl(urlStr: string): string | undefined {\n const url = new URL(urlStr);\n return url.searchParams.get(\"api-version\") ?? undefined;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAGO;AACP,IAAAA,qBAGO;AACP,4BAAqC;AAIrC,sBAAiC;AAqB1B,SAAS,cACd,QACA,iBACA,iBACA,SAC8C;AAC9C,QAAM,mBAAe,kCAAiB,eAAe,EAAE;AACvD,QAAM,EAAE,mBAAmB,eAAe,SAAS,IAAI;AACvD,MAAI,CAAC,qBAAqB,CAAC,eAAe;AACxC,UAAM,IAAI;AAAA,MACR,6BAA6B,eAAe,wBAAwB,iBAAiB,IAAI;AAAA,IAC3F;AAAA,EACF;AACA,QAAM,yBAAyB,WAAW,wBAAwB;AAGlE,QAAM,EAAE,cAAc,mBAAmB,CAAC,EAAE,IAC1C,yBAAyB,mBAAmB,aAAa,KAAK,CAAC;AACjE,QAAM,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AG,QAAQ,GAAG,MAAM,IAAI;AAChF,cAAM,QAAQ,eAAe,CAAC,EAAG,QAAQ,GAAG,IAAI,GAC9C,MAAM,eAAe,CAAC,GAAG;AAK3B,cAAM,YAAY,IAAI,OAAO,GAAG,eAAe,CAAC,GAAG,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE;AAAA,UACtE,UAAU,CAAC,KAAK;AAAA,QAClB;AAEA,YAAI,CAAC,WAAW;AACd,kBAAQ;AACR;AAAA,QACF;AACA;AAAA,MACF;AAKA,UAAI,eAAe,CAAC,MAAM,UAAU,CAAC,GAAG;AACtC,gBAAQ;AACR;AAAA,MACF;AAAA,IACF;AAIA,QAAI,SAAS,cAAc,SAAS,YAAY;AAC9C,mBAAa,cAAc;AAC3B,qBAAe;AAAA,IACjB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,kBAAkB,QAAwB;AACjD,QAAM,YAAY,OAAO,QAAQ,GAAG;AACpC,SAAO,OAAO,MAAM,SAAS;AAC/B;AAEA,SAAS,qBAAqB,QAAoC;AAChE,QAAM,MAAM,IAAI,IAAI,MAAM;AAC1B,SAAO,IAAI,aAAa,IAAI,aAAa,KAAK;AAChD;",
6
+ "names": ["import_operations", "_createOrUpdateDeserializeCustomLocations"]
7
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * An enum to describe Azure Cloud environments.
3
+ * @enum {string}
4
+ */
5
+ export declare enum AzureClouds {
6
+ /** Azure public cloud, which is the default cloud for Azure SDKs. */
7
+ AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
8
+ /** Azure China cloud */
9
+ AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
10
+ /** Azure US government cloud */
11
+ AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
12
+ }
13
+ /** The supported values for cloud setting as a string literal type */
14
+ export type AzureSupportedClouds = `${AzureClouds}`;
15
+ /**
16
+ * Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
17
+ * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
18
+ * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
19
+ * @throws {Error} Throws an error if an unknown cloud setting is provided.
20
+ */
21
+ export declare function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined;
22
+ //# sourceMappingURL=cloudSettingHelpers.d.ts.map
@@ -0,0 +1,52 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var cloudSettingHelpers_exports = {};
19
+ __export(cloudSettingHelpers_exports, {
20
+ AzureClouds: () => AzureClouds,
21
+ getArmEndpoint: () => getArmEndpoint
22
+ });
23
+ module.exports = __toCommonJS(cloudSettingHelpers_exports);
24
+ var AzureClouds = /* @__PURE__ */ ((AzureClouds2) => {
25
+ AzureClouds2["AZURE_PUBLIC_CLOUD"] = "AZURE_PUBLIC_CLOUD";
26
+ AzureClouds2["AZURE_CHINA_CLOUD"] = "AZURE_CHINA_CLOUD";
27
+ AzureClouds2["AZURE_US_GOVERNMENT"] = "AZURE_US_GOVERNMENT";
28
+ return AzureClouds2;
29
+ })(AzureClouds || {});
30
+ function getArmEndpoint(cloudSetting) {
31
+ if (cloudSetting === void 0) {
32
+ return void 0;
33
+ }
34
+ const cloudEndpoints = {
35
+ AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
36
+ AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
37
+ AZURE_PUBLIC_CLOUD: "https://management.azure.com/"
38
+ };
39
+ if (cloudSetting in cloudEndpoints) {
40
+ return cloudEndpoints[cloudSetting];
41
+ } else {
42
+ throw new Error(
43
+ `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`
44
+ );
45
+ }
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ AzureClouds,
50
+ getArmEndpoint
51
+ });
52
+ //# sourceMappingURL=cloudSettingHelpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/static-helpers/cloudSettingHelpers.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * An enum to describe Azure Cloud environments.\n * @enum {string}\n */\nexport enum AzureClouds {\n /** Azure public cloud, which is the default cloud for Azure SDKs. */\n AZURE_PUBLIC_CLOUD = \"AZURE_PUBLIC_CLOUD\",\n /** Azure China cloud */\n AZURE_CHINA_CLOUD = \"AZURE_CHINA_CLOUD\",\n /** Azure US government cloud */\n AZURE_US_GOVERNMENT = \"AZURE_US_GOVERNMENT\",\n}\n\n/** The supported values for cloud setting as a string literal type */\nexport type AzureSupportedClouds = `${AzureClouds}`;\n\n/**\n * Gets the Azure Resource Manager endpoint URL for the specified cloud setting.\n * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.\n * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.\n * @throws {Error} Throws an error if an unknown cloud setting is provided.\n */\nexport function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined {\n if (cloudSetting === undefined) {\n return undefined;\n }\n const cloudEndpoints: Record<keyof typeof AzureClouds, string> = {\n AZURE_CHINA_CLOUD: \"https://management.chinacloudapi.cn/\",\n AZURE_US_GOVERNMENT: \"https://management.usgovcloudapi.net/\",\n AZURE_PUBLIC_CLOUD: \"https://management.azure.com/\",\n };\n if (cloudSetting in cloudEndpoints) {\n return cloudEndpoints[cloudSetting];\n } else {\n throw new Error(\n `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`,\n );\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,IAAK,cAAL,kBAAKA,iBAAL;AAEL,EAAAA,aAAA,wBAAqB;AAErB,EAAAA,aAAA,uBAAoB;AAEpB,EAAAA,aAAA,yBAAsB;AANZ,SAAAA;AAAA,GAAA;AAkBL,SAAS,eAAe,cAAyD;AACtF,MAAI,iBAAiB,QAAW;AAC9B,WAAO;AAAA,EACT;AACA,QAAM,iBAA2D;AAAA,IAC/D,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,EACtB;AACA,MAAI,gBAAgB,gBAAgB;AAClC,WAAO,eAAe,YAAY;AAAA,EACpC,OAAO;AACL,UAAM,IAAI;AAAA,MACR,0BAA0B,YAAY;AAAA,IACxC;AAAA,EACF;AACF;",
6
+ "names": ["AzureClouds"]
7
+ }
@@ -0,0 +1,74 @@
1
+ import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
2
+ /**
3
+ * Options for the byPage method
4
+ */
5
+ export interface PageSettings {
6
+ /**
7
+ * A reference to a specific page to start iterating from.
8
+ */
9
+ continuationToken?: string;
10
+ }
11
+ /**
12
+ * An interface that describes a page of results.
13
+ */
14
+ export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
15
+ /**
16
+ * The token that keeps track of where to continue the iterator
17
+ */
18
+ continuationToken?: string;
19
+ };
20
+ /**
21
+ * An interface that allows async iterable iteration both to completion and by page.
22
+ */
23
+ export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
24
+ /**
25
+ * The next method, part of the iteration protocol
26
+ */
27
+ next(): Promise<IteratorResult<TElement>>;
28
+ /**
29
+ * The connection to the async iterator, part of the iteration protocol
30
+ */
31
+ [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
32
+ /**
33
+ * Return an AsyncIterableIterator that works a page at a time
34
+ */
35
+ byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
36
+ }
37
+ /**
38
+ * An interface that describes how to communicate with the service.
39
+ */
40
+ export interface PagedResult<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
41
+ /**
42
+ * Link to the first page of results.
43
+ */
44
+ firstPageLink?: string;
45
+ /**
46
+ * A method that returns a page of results.
47
+ */
48
+ getPage: (pageLink?: string) => Promise<{
49
+ page: TPage;
50
+ nextPageLink?: string;
51
+ } | undefined>;
52
+ /**
53
+ * a function to implement the `byPage` method on the paged async iterator.
54
+ */
55
+ byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
56
+ /**
57
+ * A function to extract elements from a page.
58
+ */
59
+ toElements?: (page: TPage) => TElement[];
60
+ }
61
+ /**
62
+ * Options for the paging helper
63
+ */
64
+ export interface BuildPagedAsyncIteratorOptions {
65
+ itemName?: string;
66
+ nextLinkName?: string;
67
+ nextLinkMethod?: "GET" | "POST";
68
+ apiVersion?: string;
69
+ }
70
+ /**
71
+ * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
72
+ */
73
+ export declare function buildPagedAsyncIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings, TResponse extends PathUncheckedResponse = PathUncheckedResponse>(client: Client, getInitialResponse: () => PromiseLike<TResponse>, processResponseBody: (result: TResponse) => PromiseLike<unknown>, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
74
+ //# sourceMappingURL=pagingHelpers.d.ts.map
@@ -0,0 +1,143 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var pagingHelpers_exports = {};
19
+ __export(pagingHelpers_exports, {
20
+ buildPagedAsyncIterator: () => buildPagedAsyncIterator
21
+ });
22
+ module.exports = __toCommonJS(pagingHelpers_exports);
23
+ var import_core_client = require("@azure-rest/core-client");
24
+ var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
25
+ function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
26
+ const itemName = options.itemName ?? "value";
27
+ const nextLinkName = options.nextLinkName ?? "nextLink";
28
+ const nextLinkMethod = options.nextLinkMethod ?? "GET";
29
+ const apiVersion = options.apiVersion;
30
+ const pagedResult = {
31
+ getPage: async (pageLink) => {
32
+ let result;
33
+ if (pageLink === void 0) {
34
+ result = await getInitialResponse();
35
+ } else {
36
+ const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink;
37
+ result = nextLinkMethod === "POST" ? await client.pathUnchecked(resolvedPageLink).post() : await client.pathUnchecked(resolvedPageLink).get();
38
+ }
39
+ checkPagingRequest(result, expectedStatuses);
40
+ const results = await processResponseBody(result);
41
+ const nextLink = getNextLink(results, nextLinkName);
42
+ const values = getElements(results, itemName);
43
+ return {
44
+ page: values,
45
+ nextPageLink: nextLink
46
+ };
47
+ },
48
+ byPage: (settings) => {
49
+ const { continuationToken } = settings ?? {};
50
+ return getPageAsyncIterator(pagedResult, {
51
+ pageLink: continuationToken
52
+ });
53
+ }
54
+ };
55
+ return getPagedAsyncIterator(pagedResult);
56
+ }
57
+ function getPagedAsyncIterator(pagedResult) {
58
+ const iter = getItemAsyncIterator(pagedResult);
59
+ return {
60
+ next() {
61
+ return iter.next();
62
+ },
63
+ [Symbol.asyncIterator]() {
64
+ return this;
65
+ },
66
+ byPage: pagedResult?.byPage ?? ((settings) => {
67
+ const { continuationToken } = settings ?? {};
68
+ return getPageAsyncIterator(pagedResult, {
69
+ pageLink: continuationToken
70
+ });
71
+ })
72
+ };
73
+ }
74
+ async function* getItemAsyncIterator(pagedResult) {
75
+ const pages = getPageAsyncIterator(pagedResult);
76
+ for await (const page of pages) {
77
+ yield* page;
78
+ }
79
+ }
80
+ async function* getPageAsyncIterator(pagedResult, options = {}) {
81
+ const { pageLink } = options;
82
+ let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
83
+ if (!response) {
84
+ return;
85
+ }
86
+ let result = response.page;
87
+ result.continuationToken = response.nextPageLink;
88
+ yield result;
89
+ while (response.nextPageLink) {
90
+ response = await pagedResult.getPage(response.nextPageLink);
91
+ if (!response) {
92
+ return;
93
+ }
94
+ result = response.page;
95
+ result.continuationToken = response.nextPageLink;
96
+ yield result;
97
+ }
98
+ }
99
+ function getNextLink(body, nextLinkName) {
100
+ if (!nextLinkName) {
101
+ return void 0;
102
+ }
103
+ const nextLink = body[nextLinkName];
104
+ if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) {
105
+ throw new import_core_rest_pipeline.RestError(
106
+ `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`
107
+ );
108
+ }
109
+ if (nextLink === null) {
110
+ return void 0;
111
+ }
112
+ return nextLink;
113
+ }
114
+ function getElements(body, itemName) {
115
+ const value = body[itemName];
116
+ if (!Array.isArray(value)) {
117
+ throw new import_core_rest_pipeline.RestError(
118
+ `Couldn't paginate response
119
+ Body doesn't contain an array property with name: ${itemName}`
120
+ );
121
+ }
122
+ return value ?? [];
123
+ }
124
+ function checkPagingRequest(response, expectedStatuses) {
125
+ if (!expectedStatuses.includes(response.status)) {
126
+ throw (0, import_core_client.createRestError)(
127
+ `Pagination failed with unexpected statusCode ${response.status}`,
128
+ response
129
+ );
130
+ }
131
+ }
132
+ function addApiVersionToUrl(url, apiVersion) {
133
+ const urlObj = new URL(url, "https://microsoft.com");
134
+ if (!urlObj.searchParams.get("api-version")) {
135
+ return `${url}${urlObj.search ? "&" : "?"}api-version=${apiVersion}`;
136
+ }
137
+ return url;
138
+ }
139
+ // Annotate the CommonJS export names for ESM import in node:
140
+ 0 && (module.exports = {
141
+ buildPagedAsyncIterator
142
+ });
143
+ //# sourceMappingURL=pagingHelpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/static-helpers/pagingHelpers.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n nextLinkMethod?: \"GET\" | \"POST\";\n apiVersion?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const nextLinkMethod = options.nextLinkMethod ?? \"GET\";\n const apiVersion = options.apiVersion;\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n let result;\n if (pageLink === undefined) {\n result = await getInitialResponse();\n } else {\n const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink;\n result =\n nextLinkMethod === \"POST\"\n ? await client.pathUnchecked(resolvedPageLink).post()\n : await client.pathUnchecked(resolvedPageLink).get();\n }\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n\n/**\n * Adds the api-version query parameter on a URL if it's not present.\n * @param url - the URL to modify\n * @param apiVersion - the API version to set\n * @returns - the URL with the api-version query parameter set\n */\nfunction addApiVersionToUrl(url: string, apiVersion: string): string {\n // The base URL is only used for parsing and won't appear in the returned URL\n const urlObj = new URL(url, \"https://microsoft.com\");\n if (!urlObj.searchParams.get(\"api-version\")) {\n // Append one if there is no apiVersion\n return `${url}${urlObj.search ? \"&\" : \"?\"}api-version=${apiVersion}`;\n }\n return url;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yBAAgC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