@azure/arm-storagecache 4.3.0 → 5.0.0

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 (312) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +70 -78
  4. package/dist/index.js +3916 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/ascOperationsGet.d.ts +2 -0
  9. package/dist-esm/samples-dev/ascOperationsGet.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/ascOperationsGet.js +31 -0
  11. package/dist-esm/samples-dev/ascOperationsGet.js.map +1 -0
  12. package/dist-esm/samples-dev/cachesCreateOrUpdate.d.ts +2 -0
  13. package/dist-esm/samples-dev/cachesCreateOrUpdate.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/cachesCreateOrUpdate.js +89 -0
  15. package/dist-esm/samples-dev/cachesCreateOrUpdate.js.map +1 -0
  16. package/dist-esm/samples-dev/cachesCreateOrUpdateLdapOnly.d.ts +2 -0
  17. package/dist-esm/samples-dev/cachesCreateOrUpdateLdapOnly.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/cachesCreateOrUpdateLdapOnly.js +75 -0
  19. package/dist-esm/samples-dev/cachesCreateOrUpdateLdapOnly.js.map +1 -0
  20. package/dist-esm/samples-dev/cachesDebugInfo.d.ts +2 -0
  21. package/dist-esm/samples-dev/cachesDebugInfo.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/cachesDebugInfo.js +31 -0
  23. package/dist-esm/samples-dev/cachesDebugInfo.js.map +1 -0
  24. package/dist-esm/samples-dev/cachesDelete.d.ts +2 -0
  25. package/dist-esm/samples-dev/cachesDelete.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/cachesDelete.js +31 -0
  27. package/dist-esm/samples-dev/cachesDelete.js.map +1 -0
  28. package/dist-esm/samples-dev/cachesDnsRefresh.d.ts +2 -0
  29. package/dist-esm/samples-dev/cachesDnsRefresh.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/cachesDnsRefresh.js +32 -0
  31. package/dist-esm/samples-dev/cachesDnsRefresh.js.map +1 -0
  32. package/dist-esm/samples-dev/cachesFlush.d.ts +2 -0
  33. package/dist-esm/samples-dev/cachesFlush.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/cachesFlush.js +31 -0
  35. package/dist-esm/samples-dev/cachesFlush.js.map +1 -0
  36. package/dist-esm/samples-dev/cachesGet.d.ts +2 -0
  37. package/dist-esm/samples-dev/cachesGet.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/cachesGet.js +31 -0
  39. package/dist-esm/samples-dev/cachesGet.js.map +1 -0
  40. package/dist-esm/samples-dev/cachesList.d.ts +2 -0
  41. package/dist-esm/samples-dev/cachesList.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/cachesList.js +43 -0
  43. package/dist-esm/samples-dev/cachesList.js.map +1 -0
  44. package/dist-esm/samples-dev/cachesListByResourceGroup.d.ts +2 -0
  45. package/dist-esm/samples-dev/cachesListByResourceGroup.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/cachesListByResourceGroup.js +44 -0
  47. package/dist-esm/samples-dev/cachesListByResourceGroup.js.map +1 -0
  48. package/dist-esm/samples-dev/cachesStart.d.ts +2 -0
  49. package/dist-esm/samples-dev/cachesStart.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/cachesStart.js +31 -0
  51. package/dist-esm/samples-dev/cachesStart.js.map +1 -0
  52. package/dist-esm/samples-dev/cachesStop.d.ts +2 -0
  53. package/dist-esm/samples-dev/cachesStop.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/cachesStop.js +31 -0
  55. package/dist-esm/samples-dev/cachesStop.js.map +1 -0
  56. package/dist-esm/samples-dev/cachesUpdate.d.ts +2 -0
  57. package/dist-esm/samples-dev/cachesUpdate.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/cachesUpdate.js +101 -0
  59. package/dist-esm/samples-dev/cachesUpdate.js.map +1 -0
  60. package/dist-esm/samples-dev/cachesUpdateLdapOnly.d.ts +2 -0
  61. package/dist-esm/samples-dev/cachesUpdateLdapOnly.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/cachesUpdateLdapOnly.js +103 -0
  63. package/dist-esm/samples-dev/cachesUpdateLdapOnly.js.map +1 -0
  64. package/dist-esm/samples-dev/cachesUpgradeFirmware.d.ts +2 -0
  65. package/dist-esm/samples-dev/cachesUpgradeFirmware.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/cachesUpgradeFirmware.js +31 -0
  67. package/dist-esm/samples-dev/cachesUpgradeFirmware.js.map +1 -0
  68. package/dist-esm/samples-dev/skusList.d.ts +2 -0
  69. package/dist-esm/samples-dev/skusList.d.ts.map +1 -0
  70. package/dist-esm/samples-dev/skusList.js +43 -0
  71. package/dist-esm/samples-dev/skusList.js.map +1 -0
  72. package/dist-esm/samples-dev/storageTargetsCreateOrUpdate.d.ts +2 -0
  73. package/dist-esm/samples-dev/storageTargetsCreateOrUpdate.d.ts.map +1 -0
  74. package/dist-esm/samples-dev/storageTargetsCreateOrUpdate.js +51 -0
  75. package/dist-esm/samples-dev/storageTargetsCreateOrUpdate.js.map +1 -0
  76. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateBlobNfs.d.ts +2 -0
  77. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateBlobNfs.d.ts.map +1 -0
  78. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateBlobNfs.js +41 -0
  79. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateBlobNfs.js.map +1 -0
  80. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateNoJunctions.d.ts +2 -0
  81. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateNoJunctions.d.ts.map +1 -0
  82. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateNoJunctions.js +37 -0
  83. package/dist-esm/samples-dev/storageTargetsCreateOrUpdateNoJunctions.js.map +1 -0
  84. package/dist-esm/samples-dev/storageTargetsDelete.d.ts +2 -0
  85. package/dist-esm/samples-dev/storageTargetsDelete.d.ts.map +1 -0
  86. package/dist-esm/samples-dev/storageTargetsDelete.js +32 -0
  87. package/dist-esm/samples-dev/storageTargetsDelete.js.map +1 -0
  88. package/dist-esm/samples-dev/storageTargetsFlush.d.ts +2 -0
  89. package/dist-esm/samples-dev/storageTargetsFlush.d.ts.map +1 -0
  90. package/dist-esm/samples-dev/storageTargetsFlush.js +32 -0
  91. package/dist-esm/samples-dev/storageTargetsFlush.js.map +1 -0
  92. package/dist-esm/samples-dev/storageTargetsGet.d.ts +2 -0
  93. package/dist-esm/samples-dev/storageTargetsGet.d.ts.map +1 -0
  94. package/dist-esm/samples-dev/storageTargetsGet.js +32 -0
  95. package/dist-esm/samples-dev/storageTargetsGet.js.map +1 -0
  96. package/dist-esm/samples-dev/storageTargetsList.d.ts +2 -0
  97. package/dist-esm/samples-dev/storageTargetsList.d.ts.map +1 -0
  98. package/dist-esm/samples-dev/storageTargetsList.js +45 -0
  99. package/dist-esm/samples-dev/storageTargetsList.js.map +1 -0
  100. package/dist-esm/samples-dev/storageTargetsResume.d.ts +2 -0
  101. package/dist-esm/samples-dev/storageTargetsResume.d.ts.map +1 -0
  102. package/dist-esm/samples-dev/storageTargetsResume.js +32 -0
  103. package/dist-esm/samples-dev/storageTargetsResume.js.map +1 -0
  104. package/dist-esm/samples-dev/storageTargetsSuspend.d.ts +2 -0
  105. package/dist-esm/samples-dev/storageTargetsSuspend.d.ts.map +1 -0
  106. package/dist-esm/samples-dev/storageTargetsSuspend.js +32 -0
  107. package/dist-esm/samples-dev/storageTargetsSuspend.js.map +1 -0
  108. package/dist-esm/samples-dev/usageModelsList.d.ts +2 -0
  109. package/dist-esm/samples-dev/usageModelsList.d.ts.map +1 -0
  110. package/dist-esm/samples-dev/usageModelsList.js +43 -0
  111. package/dist-esm/samples-dev/usageModelsList.js.map +1 -0
  112. package/dist-esm/src/index.d.ts +5 -0
  113. package/dist-esm/src/index.d.ts.map +1 -0
  114. package/{esm/models/ascOperationsMappers.js → dist-esm/src/index.js} +5 -2
  115. package/dist-esm/src/index.js.map +1 -0
  116. package/dist-esm/src/lroImpl.d.ts +16 -0
  117. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  118. package/dist-esm/src/lroImpl.js +29 -0
  119. package/dist-esm/src/lroImpl.js.map +1 -0
  120. package/dist-esm/src/models/index.d.ts +1030 -0
  121. package/dist-esm/src/models/index.d.ts.map +1 -0
  122. package/dist-esm/src/models/index.js +114 -0
  123. package/dist-esm/src/models/index.js.map +1 -0
  124. package/dist-esm/src/models/mappers.d.ts +49 -0
  125. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  126. package/{esm → dist-esm/src}/models/mappers.js +848 -893
  127. package/dist-esm/src/models/mappers.js.map +1 -0
  128. package/dist-esm/src/models/parameters.d.ts +16 -0
  129. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  130. package/{esm → dist-esm/src}/models/parameters.js +71 -42
  131. package/dist-esm/src/models/parameters.js.map +1 -0
  132. package/dist-esm/src/operations/ascOperations.d.ts +20 -0
  133. package/dist-esm/src/operations/ascOperations.d.ts.map +1 -0
  134. package/dist-esm/src/operations/ascOperations.js +53 -0
  135. package/dist-esm/src/operations/ascOperations.js.map +1 -0
  136. package/dist-esm/src/operations/caches.d.ts +184 -0
  137. package/dist-esm/src/operations/caches.d.ts.map +1 -0
  138. package/dist-esm/src/operations/caches.js +825 -0
  139. package/dist-esm/src/operations/caches.js.map +1 -0
  140. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  141. package/dist-esm/src/operations/index.d.ts.map +1 -0
  142. package/{esm → dist-esm/src}/operations/index.js +1 -2
  143. package/dist-esm/src/operations/index.js.map +1 -0
  144. package/dist-esm/src/operations/operations.d.ts +32 -0
  145. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  146. package/dist-esm/src/operations/operations.js +120 -0
  147. package/dist-esm/src/operations/operations.js.map +1 -0
  148. package/dist-esm/src/operations/skus.d.ts +32 -0
  149. package/dist-esm/src/operations/skus.d.ts.map +1 -0
  150. package/dist-esm/src/operations/skus.js +124 -0
  151. package/dist-esm/src/operations/skus.js.map +1 -0
  152. package/dist-esm/src/operations/storageTargetOperations.d.ts +70 -0
  153. package/dist-esm/src/operations/storageTargetOperations.d.ts.map +1 -0
  154. package/dist-esm/src/operations/storageTargetOperations.js +259 -0
  155. package/dist-esm/src/operations/storageTargetOperations.js.map +1 -0
  156. package/dist-esm/src/operations/storageTargets.d.ts +115 -0
  157. package/dist-esm/src/operations/storageTargets.d.ts.map +1 -0
  158. package/dist-esm/src/operations/storageTargets.js +424 -0
  159. package/dist-esm/src/operations/storageTargets.js.map +1 -0
  160. package/dist-esm/src/operations/usageModels.d.ts +32 -0
  161. package/dist-esm/src/operations/usageModels.d.ts.map +1 -0
  162. package/dist-esm/src/operations/usageModels.js +124 -0
  163. package/dist-esm/src/operations/usageModels.js.map +1 -0
  164. package/dist-esm/src/operationsInterfaces/ascOperations.d.ts +12 -0
  165. package/dist-esm/src/operationsInterfaces/ascOperations.d.ts.map +1 -0
  166. package/{src/models/ascOperationsMappers.ts → dist-esm/src/operationsInterfaces/ascOperations.js} +2 -6
  167. package/dist-esm/src/operationsInterfaces/ascOperations.js.map +1 -0
  168. package/dist-esm/src/operationsInterfaces/caches.d.ts +148 -0
  169. package/dist-esm/src/operationsInterfaces/caches.d.ts.map +1 -0
  170. package/{src/models/storageTargetOperationsMappers.ts → dist-esm/src/operationsInterfaces/caches.js} +2 -4
  171. package/dist-esm/src/operationsInterfaces/caches.js.map +1 -0
  172. package/dist-esm/src/operationsInterfaces/index.d.ts +8 -0
  173. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  174. package/dist-esm/src/operationsInterfaces/index.js +15 -0
  175. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  176. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  177. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  178. package/{esm/models/storageTargetOperationsMappers.js → dist-esm/src/operationsInterfaces/operations.js} +2 -2
  179. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  180. package/dist-esm/src/operationsInterfaces/skus.d.ts +11 -0
  181. package/dist-esm/src/operationsInterfaces/skus.d.ts.map +1 -0
  182. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/skus.js} +2 -1
  183. package/dist-esm/src/operationsInterfaces/skus.js.map +1 -0
  184. package/dist-esm/src/operationsInterfaces/storageTargetOperations.d.ts +62 -0
  185. package/dist-esm/src/operationsInterfaces/storageTargetOperations.d.ts.map +1 -0
  186. package/dist-esm/src/operationsInterfaces/storageTargetOperations.js +9 -0
  187. package/dist-esm/src/operationsInterfaces/storageTargetOperations.js.map +1 -0
  188. package/dist-esm/src/operationsInterfaces/storageTargets.d.ts +88 -0
  189. package/dist-esm/src/operationsInterfaces/storageTargets.d.ts.map +1 -0
  190. package/dist-esm/src/operationsInterfaces/storageTargets.js +9 -0
  191. package/dist-esm/src/operationsInterfaces/storageTargets.js.map +1 -0
  192. package/dist-esm/src/operationsInterfaces/usageModels.d.ts +11 -0
  193. package/dist-esm/src/operationsInterfaces/usageModels.d.ts.map +1 -0
  194. package/dist-esm/src/operationsInterfaces/usageModels.js +9 -0
  195. package/dist-esm/src/operationsInterfaces/usageModels.js.map +1 -0
  196. package/dist-esm/src/storageCacheManagementClient.d.ts +25 -0
  197. package/dist-esm/src/storageCacheManagementClient.d.ts.map +1 -0
  198. package/dist-esm/src/storageCacheManagementClient.js +58 -0
  199. package/dist-esm/src/storageCacheManagementClient.js.map +1 -0
  200. package/dist-esm/test/sampleTest.d.ts +2 -0
  201. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  202. package/dist-esm/test/sampleTest.js +40 -0
  203. package/dist-esm/test/sampleTest.js.map +1 -0
  204. package/package.json +80 -33
  205. package/review/arm-storagecache.api.md +883 -0
  206. package/rollup.config.js +181 -30
  207. package/src/{models/skusMappers.ts → index.ts} +4 -8
  208. package/src/lroImpl.ts +34 -0
  209. package/src/models/index.ts +819 -1303
  210. package/src/models/mappers.ts +856 -900
  211. package/src/models/parameters.ts +92 -43
  212. package/src/operations/ascOperations.ts +37 -51
  213. package/src/operations/caches.ts +844 -504
  214. package/src/operations/index.ts +1 -2
  215. package/src/operations/operations.ts +85 -73
  216. package/src/operations/skus.ts +87 -76
  217. package/src/operations/storageTargetOperations.ts +284 -124
  218. package/src/operations/storageTargets.ts +458 -271
  219. package/src/operations/usageModels.ts +90 -76
  220. package/src/operationsInterfaces/ascOperations.ts +27 -0
  221. package/src/operationsInterfaces/caches.ts +245 -0
  222. package/src/{models/operationsMappers.ts → operationsInterfaces/index.ts} +7 -9
  223. package/src/operationsInterfaces/operations.ts +22 -0
  224. package/src/operationsInterfaces/skus.ts +22 -0
  225. package/src/operationsInterfaces/storageTargetOperations.ts +104 -0
  226. package/src/operationsInterfaces/storageTargets.ts +150 -0
  227. package/src/operationsInterfaces/usageModels.ts +22 -0
  228. package/src/storageCacheManagementClient.ts +90 -46
  229. package/tsconfig.json +5 -4
  230. package/types/arm-storagecache.d.ts +1507 -0
  231. package/types/tsdoc-metadata.json +11 -0
  232. package/dist/arm-storagecache.js +0 -3545
  233. package/dist/arm-storagecache.js.map +0 -1
  234. package/dist/arm-storagecache.min.js +0 -1
  235. package/dist/arm-storagecache.min.js.map +0 -1
  236. package/esm/models/ascOperationsMappers.d.ts +0 -2
  237. package/esm/models/ascOperationsMappers.d.ts.map +0 -1
  238. package/esm/models/ascOperationsMappers.js.map +0 -1
  239. package/esm/models/cachesMappers.d.ts +0 -2
  240. package/esm/models/cachesMappers.d.ts.map +0 -1
  241. package/esm/models/cachesMappers.js +0 -9
  242. package/esm/models/cachesMappers.js.map +0 -1
  243. package/esm/models/index.d.ts +0 -1541
  244. package/esm/models/index.d.ts.map +0 -1
  245. package/esm/models/index.js.map +0 -1
  246. package/esm/models/mappers.d.ts +0 -50
  247. package/esm/models/mappers.d.ts.map +0 -1
  248. package/esm/models/mappers.js.map +0 -1
  249. package/esm/models/operationsMappers.d.ts +0 -2
  250. package/esm/models/operationsMappers.d.ts.map +0 -1
  251. package/esm/models/operationsMappers.js +0 -9
  252. package/esm/models/operationsMappers.js.map +0 -1
  253. package/esm/models/parameters.d.ts +0 -12
  254. package/esm/models/parameters.d.ts.map +0 -1
  255. package/esm/models/parameters.js.map +0 -1
  256. package/esm/models/skusMappers.d.ts +0 -2
  257. package/esm/models/skusMappers.d.ts.map +0 -1
  258. package/esm/models/skusMappers.js +0 -9
  259. package/esm/models/skusMappers.js.map +0 -1
  260. package/esm/models/storageTargetOperationsMappers.d.ts +0 -2
  261. package/esm/models/storageTargetOperationsMappers.d.ts.map +0 -1
  262. package/esm/models/storageTargetOperationsMappers.js.map +0 -1
  263. package/esm/models/storageTargetsMappers.d.ts +0 -2
  264. package/esm/models/storageTargetsMappers.d.ts.map +0 -1
  265. package/esm/models/storageTargetsMappers.js +0 -9
  266. package/esm/models/storageTargetsMappers.js.map +0 -1
  267. package/esm/models/usageModelsMappers.d.ts +0 -2
  268. package/esm/models/usageModelsMappers.d.ts.map +0 -1
  269. package/esm/models/usageModelsMappers.js +0 -9
  270. package/esm/models/usageModelsMappers.js.map +0 -1
  271. package/esm/operations/ascOperations.d.ts +0 -34
  272. package/esm/operations/ascOperations.d.ts.map +0 -1
  273. package/esm/operations/ascOperations.js +0 -57
  274. package/esm/operations/ascOperations.js.map +0 -1
  275. package/esm/operations/caches.d.ts +0 -261
  276. package/esm/operations/caches.d.ts.map +0 -1
  277. package/esm/operations/caches.js +0 -581
  278. package/esm/operations/caches.js.map +0 -1
  279. package/esm/operations/index.d.ts.map +0 -1
  280. package/esm/operations/index.js.map +0 -1
  281. package/esm/operations/operations.d.ts +0 -46
  282. package/esm/operations/operations.d.ts.map +0 -1
  283. package/esm/operations/operations.js +0 -79
  284. package/esm/operations/operations.js.map +0 -1
  285. package/esm/operations/skus.d.ts +0 -46
  286. package/esm/operations/skus.d.ts.map +0 -1
  287. package/esm/operations/skus.js +0 -82
  288. package/esm/operations/skus.js.map +0 -1
  289. package/esm/operations/storageTargetOperations.d.ts +0 -75
  290. package/esm/operations/storageTargetOperations.d.ts.map +0 -1
  291. package/esm/operations/storageTargetOperations.js +0 -193
  292. package/esm/operations/storageTargetOperations.js.map +0 -1
  293. package/esm/operations/storageTargets.d.ts +0 -153
  294. package/esm/operations/storageTargets.d.ts.map +0 -1
  295. package/esm/operations/storageTargets.js +0 -305
  296. package/esm/operations/storageTargets.js.map +0 -1
  297. package/esm/operations/usageModels.d.ts +0 -46
  298. package/esm/operations/usageModels.d.ts.map +0 -1
  299. package/esm/operations/usageModels.js +0 -82
  300. package/esm/operations/usageModels.js.map +0 -1
  301. package/esm/storageCacheManagementClient.d.ts +0 -31
  302. package/esm/storageCacheManagementClient.d.ts.map +0 -1
  303. package/esm/storageCacheManagementClient.js +0 -44
  304. package/esm/storageCacheManagementClient.js.map +0 -1
  305. package/esm/storageCacheManagementClientContext.d.ts +0 -23
  306. package/esm/storageCacheManagementClientContext.d.ts.map +0 -1
  307. package/esm/storageCacheManagementClientContext.js +0 -61
  308. package/esm/storageCacheManagementClientContext.js.map +0 -1
  309. package/src/models/cachesMappers.ts +0 -40
  310. package/src/models/storageTargetsMappers.ts +0 -40
  311. package/src/models/usageModelsMappers.ts +0 -14
  312. package/src/storageCacheManagementClientContext.ts +0 -68
@@ -3,374 +3,547 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as msRestAzure from "@azure/ms-rest-azure-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/storageTargetsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { StorageTargets } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { StorageCacheManagementClientContext } from "../storageCacheManagementClientContext";
14
+ import { StorageCacheManagementClient } from "../storageCacheManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ StorageTarget,
19
+ StorageTargetsListByCacheNextOptionalParams,
20
+ StorageTargetsListByCacheOptionalParams,
21
+ StorageTargetsDnsRefreshOptionalParams,
22
+ StorageTargetsListByCacheResponse,
23
+ StorageTargetsDeleteOptionalParams,
24
+ StorageTargetsGetOptionalParams,
25
+ StorageTargetsGetResponse,
26
+ StorageTargetsCreateOrUpdateOptionalParams,
27
+ StorageTargetsCreateOrUpdateResponse,
28
+ StorageTargetsListByCacheNextResponse
29
+ } from "../models";
16
30
 
17
- /** Class representing a StorageTargets. */
18
- export class StorageTargets {
19
- private readonly client: StorageCacheManagementClientContext;
31
+ /// <reference lib="esnext.asynciterable" />
32
+ /** Class containing StorageTargets operations. */
33
+ export class StorageTargetsImpl implements StorageTargets {
34
+ private readonly client: StorageCacheManagementClient;
20
35
 
21
36
  /**
22
- * Create a StorageTargets.
23
- * @param {StorageCacheManagementClientContext} client Reference to the service client.
37
+ * Initialize a new instance of the class StorageTargets class.
38
+ * @param client Reference to the service client
24
39
  */
25
- constructor(client: StorageCacheManagementClientContext) {
40
+ constructor(client: StorageCacheManagementClient) {
26
41
  this.client = client;
27
42
  }
28
43
 
29
44
  /**
30
- * Tells a storage target to refresh its DNS information.
45
+ * Returns a list of Storage Targets for the specified Cache.
31
46
  * @param resourceGroupName Target resource group.
32
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
33
- * from the [-0-9a-zA-Z_] char class.
34
- * @param storageTargetName Name of Storage Target.
35
- * @param [options] The optional parameters
36
- * @returns Promise<msRest.RestResponse>
47
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
48
+ * the [-0-9a-zA-Z_] char class.
49
+ * @param options The options parameters.
37
50
  */
38
- dnsRefresh(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
39
- return this.beginDnsRefresh(resourceGroupName,cacheName,storageTargetName,options)
40
- .then(lroPoller => lroPoller.pollUntilFinished());
51
+ public listByCache(
52
+ resourceGroupName: string,
53
+ cacheName: string,
54
+ options?: StorageTargetsListByCacheOptionalParams
55
+ ): PagedAsyncIterableIterator<StorageTarget> {
56
+ const iter = this.listByCachePagingAll(
57
+ resourceGroupName,
58
+ cacheName,
59
+ options
60
+ );
61
+ return {
62
+ next() {
63
+ return iter.next();
64
+ },
65
+ [Symbol.asyncIterator]() {
66
+ return this;
67
+ },
68
+ byPage: () => {
69
+ return this.listByCachePagingPage(
70
+ resourceGroupName,
71
+ cacheName,
72
+ options
73
+ );
74
+ }
75
+ };
41
76
  }
42
77
 
43
- /**
44
- * Returns a list of Storage Targets for the specified Cache.
45
- * @param resourceGroupName Target resource group.
46
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
47
- * from the [-0-9a-zA-Z_] char class.
48
- * @param [options] The optional parameters
49
- * @returns Promise<Models.StorageTargetsListByCacheResponse>
50
- */
51
- listByCache(resourceGroupName: string, cacheName: string, options?: msRest.RequestOptionsBase): Promise<Models.StorageTargetsListByCacheResponse>;
52
- /**
53
- * @param resourceGroupName Target resource group.
54
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
55
- * from the [-0-9a-zA-Z_] char class.
56
- * @param callback The callback
57
- */
58
- listByCache(resourceGroupName: string, cacheName: string, callback: msRest.ServiceCallback<Models.StorageTargetsResult>): void;
59
- /**
60
- * @param resourceGroupName Target resource group.
61
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
62
- * from the [-0-9a-zA-Z_] char class.
63
- * @param options The optional parameters
64
- * @param callback The callback
65
- */
66
- listByCache(resourceGroupName: string, cacheName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.StorageTargetsResult>): void;
67
- listByCache(resourceGroupName: string, cacheName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.StorageTargetsResult>, callback?: msRest.ServiceCallback<Models.StorageTargetsResult>): Promise<Models.StorageTargetsListByCacheResponse> {
68
- return this.client.sendOperationRequest(
69
- {
78
+ private async *listByCachePagingPage(
79
+ resourceGroupName: string,
80
+ cacheName: string,
81
+ options?: StorageTargetsListByCacheOptionalParams
82
+ ): AsyncIterableIterator<StorageTarget[]> {
83
+ let result = await this._listByCache(resourceGroupName, cacheName, options);
84
+ yield result.value || [];
85
+ let continuationToken = result.nextLink;
86
+ while (continuationToken) {
87
+ result = await this._listByCacheNext(
70
88
  resourceGroupName,
71
89
  cacheName,
90
+ continuationToken,
72
91
  options
73
- },
74
- listByCacheOperationSpec,
75
- callback) as Promise<Models.StorageTargetsListByCacheResponse>;
92
+ );
93
+ continuationToken = result.nextLink;
94
+ yield result.value || [];
95
+ }
96
+ }
97
+
98
+ private async *listByCachePagingAll(
99
+ resourceGroupName: string,
100
+ cacheName: string,
101
+ options?: StorageTargetsListByCacheOptionalParams
102
+ ): AsyncIterableIterator<StorageTarget> {
103
+ for await (const page of this.listByCachePagingPage(
104
+ resourceGroupName,
105
+ cacheName,
106
+ options
107
+ )) {
108
+ yield* page;
109
+ }
76
110
  }
77
111
 
78
112
  /**
79
- * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache
80
- * is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is
81
- * healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be
82
- * flushed before the Storage Target will be deleted.
113
+ * Tells a storage target to refresh its DNS information.
83
114
  * @param resourceGroupName Target resource group.
84
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
85
- * from the [-0-9a-zA-Z_] char class.
115
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
116
+ * the [-0-9a-zA-Z_] char class.
86
117
  * @param storageTargetName Name of Storage Target.
87
- * @param [options] The optional parameters
88
- * @returns Promise<msRest.RestResponse>
118
+ * @param options The options parameters.
89
119
  */
90
- deleteMethod(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: Models.StorageTargetsDeleteMethodOptionalParams): Promise<msRest.RestResponse> {
91
- return this.beginDeleteMethod(resourceGroupName,cacheName,storageTargetName,options)
92
- .then(lroPoller => lroPoller.pollUntilFinished());
120
+ async beginDnsRefresh(
121
+ resourceGroupName: string,
122
+ cacheName: string,
123
+ storageTargetName: string,
124
+ options?: StorageTargetsDnsRefreshOptionalParams
125
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
126
+ const directSendOperation = async (
127
+ args: coreClient.OperationArguments,
128
+ spec: coreClient.OperationSpec
129
+ ): Promise<void> => {
130
+ return this.client.sendOperationRequest(args, spec);
131
+ };
132
+ const sendOperation = async (
133
+ args: coreClient.OperationArguments,
134
+ spec: coreClient.OperationSpec
135
+ ) => {
136
+ let currentRawResponse:
137
+ | coreClient.FullOperationResponse
138
+ | undefined = undefined;
139
+ const providedCallback = args.options?.onResponse;
140
+ const callback: coreClient.RawResponseCallback = (
141
+ rawResponse: coreClient.FullOperationResponse,
142
+ flatResponse: unknown
143
+ ) => {
144
+ currentRawResponse = rawResponse;
145
+ providedCallback?.(rawResponse, flatResponse);
146
+ };
147
+ const updatedArgs = {
148
+ ...args,
149
+ options: {
150
+ ...args.options,
151
+ onResponse: callback
152
+ }
153
+ };
154
+ const flatResponse = await directSendOperation(updatedArgs, spec);
155
+ return {
156
+ flatResponse,
157
+ rawResponse: {
158
+ statusCode: currentRawResponse!.status,
159
+ body: currentRawResponse!.parsedBody,
160
+ headers: currentRawResponse!.headers.toJSON()
161
+ }
162
+ };
163
+ };
164
+
165
+ const lro = new LroImpl(
166
+ sendOperation,
167
+ { resourceGroupName, cacheName, storageTargetName, options },
168
+ dnsRefreshOperationSpec
169
+ );
170
+ return new LroEngine(lro, {
171
+ resumeFrom: options?.resumeFrom,
172
+ intervalInMs: options?.updateIntervalInMs,
173
+ lroResourceLocationConfig: "azure-async-operation"
174
+ });
93
175
  }
94
176
 
95
177
  /**
96
- * Returns a Storage Target from a Cache.
178
+ * Tells a storage target to refresh its DNS information.
97
179
  * @param resourceGroupName Target resource group.
98
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
99
- * from the [-0-9a-zA-Z_] char class.
180
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
181
+ * the [-0-9a-zA-Z_] char class.
100
182
  * @param storageTargetName Name of Storage Target.
101
- * @param [options] The optional parameters
102
- * @returns Promise<Models.StorageTargetsGetResponse>
183
+ * @param options The options parameters.
103
184
  */
104
- get(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise<Models.StorageTargetsGetResponse>;
185
+ async beginDnsRefreshAndWait(
186
+ resourceGroupName: string,
187
+ cacheName: string,
188
+ storageTargetName: string,
189
+ options?: StorageTargetsDnsRefreshOptionalParams
190
+ ): Promise<void> {
191
+ const poller = await this.beginDnsRefresh(
192
+ resourceGroupName,
193
+ cacheName,
194
+ storageTargetName,
195
+ options
196
+ );
197
+ return poller.pollUntilDone();
198
+ }
199
+
105
200
  /**
201
+ * Returns a list of Storage Targets for the specified Cache.
106
202
  * @param resourceGroupName Target resource group.
107
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
108
- * from the [-0-9a-zA-Z_] char class.
109
- * @param storageTargetName Name of Storage Target.
110
- * @param callback The callback
203
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
204
+ * the [-0-9a-zA-Z_] char class.
205
+ * @param options The options parameters.
111
206
  */
112
- get(resourceGroupName: string, cacheName: string, storageTargetName: string, callback: msRest.ServiceCallback<Models.StorageTarget>): void;
207
+ private _listByCache(
208
+ resourceGroupName: string,
209
+ cacheName: string,
210
+ options?: StorageTargetsListByCacheOptionalParams
211
+ ): Promise<StorageTargetsListByCacheResponse> {
212
+ return this.client.sendOperationRequest(
213
+ { resourceGroupName, cacheName, options },
214
+ listByCacheOperationSpec
215
+ );
216
+ }
217
+
113
218
  /**
219
+ * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is
220
+ * down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is
221
+ * healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be
222
+ * flushed before the Storage Target will be deleted.
114
223
  * @param resourceGroupName Target resource group.
115
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
116
- * from the [-0-9a-zA-Z_] char class.
224
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
225
+ * the [-0-9a-zA-Z_] char class.
117
226
  * @param storageTargetName Name of Storage Target.
118
- * @param options The optional parameters
119
- * @param callback The callback
227
+ * @param options The options parameters.
120
228
  */
121
- get(resourceGroupName: string, cacheName: string, storageTargetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.StorageTarget>): void;
122
- get(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.StorageTarget>, callback?: msRest.ServiceCallback<Models.StorageTarget>): Promise<Models.StorageTargetsGetResponse> {
123
- return this.client.sendOperationRequest(
124
- {
125
- resourceGroupName,
126
- cacheName,
127
- storageTargetName,
128
- options
129
- },
130
- getOperationSpec,
131
- callback) as Promise<Models.StorageTargetsGetResponse>;
229
+ async beginDelete(
230
+ resourceGroupName: string,
231
+ cacheName: string,
232
+ storageTargetName: string,
233
+ options?: StorageTargetsDeleteOptionalParams
234
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
235
+ const directSendOperation = async (
236
+ args: coreClient.OperationArguments,
237
+ spec: coreClient.OperationSpec
238
+ ): Promise<void> => {
239
+ return this.client.sendOperationRequest(args, spec);
240
+ };
241
+ const sendOperation = async (
242
+ args: coreClient.OperationArguments,
243
+ spec: coreClient.OperationSpec
244
+ ) => {
245
+ let currentRawResponse:
246
+ | coreClient.FullOperationResponse
247
+ | undefined = undefined;
248
+ const providedCallback = args.options?.onResponse;
249
+ const callback: coreClient.RawResponseCallback = (
250
+ rawResponse: coreClient.FullOperationResponse,
251
+ flatResponse: unknown
252
+ ) => {
253
+ currentRawResponse = rawResponse;
254
+ providedCallback?.(rawResponse, flatResponse);
255
+ };
256
+ const updatedArgs = {
257
+ ...args,
258
+ options: {
259
+ ...args.options,
260
+ onResponse: callback
261
+ }
262
+ };
263
+ const flatResponse = await directSendOperation(updatedArgs, spec);
264
+ return {
265
+ flatResponse,
266
+ rawResponse: {
267
+ statusCode: currentRawResponse!.status,
268
+ body: currentRawResponse!.parsedBody,
269
+ headers: currentRawResponse!.headers.toJSON()
270
+ }
271
+ };
272
+ };
273
+
274
+ const lro = new LroImpl(
275
+ sendOperation,
276
+ { resourceGroupName, cacheName, storageTargetName, options },
277
+ deleteOperationSpec
278
+ );
279
+ return new LroEngine(lro, {
280
+ resumeFrom: options?.resumeFrom,
281
+ intervalInMs: options?.updateIntervalInMs
282
+ });
132
283
  }
133
284
 
134
285
  /**
135
- * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is
136
- * down or unhealthy, the actual creation/modification of the Storage Target may be delayed until
137
- * the Cache is healthy again.
286
+ * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is
287
+ * down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is
288
+ * healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be
289
+ * flushed before the Storage Target will be deleted.
138
290
  * @param resourceGroupName Target resource group.
139
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
140
- * from the [-0-9a-zA-Z_] char class.
291
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
292
+ * the [-0-9a-zA-Z_] char class.
141
293
  * @param storageTargetName Name of Storage Target.
142
- * @param [options] The optional parameters
143
- * @returns Promise<Models.StorageTargetsCreateOrUpdateResponse>
294
+ * @param options The options parameters.
144
295
  */
145
- createOrUpdate(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: Models.StorageTargetsCreateOrUpdateOptionalParams): Promise<Models.StorageTargetsCreateOrUpdateResponse> {
146
- return this.beginCreateOrUpdate(resourceGroupName,cacheName,storageTargetName,options)
147
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.StorageTargetsCreateOrUpdateResponse>;
296
+ async beginDeleteAndWait(
297
+ resourceGroupName: string,
298
+ cacheName: string,
299
+ storageTargetName: string,
300
+ options?: StorageTargetsDeleteOptionalParams
301
+ ): Promise<void> {
302
+ const poller = await this.beginDelete(
303
+ resourceGroupName,
304
+ cacheName,
305
+ storageTargetName,
306
+ options
307
+ );
308
+ return poller.pollUntilDone();
148
309
  }
149
310
 
150
311
  /**
151
- * Tells a storage target to refresh its DNS information.
312
+ * Returns a Storage Target from a Cache.
152
313
  * @param resourceGroupName Target resource group.
153
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
154
- * from the [-0-9a-zA-Z_] char class.
314
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
315
+ * the [-0-9a-zA-Z_] char class.
155
316
  * @param storageTargetName Name of Storage Target.
156
- * @param [options] The optional parameters
157
- * @returns Promise<msRestAzure.LROPoller>
317
+ * @param options The options parameters.
158
318
  */
159
- beginDnsRefresh(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
160
- return this.client.sendLRORequest(
161
- {
162
- resourceGroupName,
163
- cacheName,
164
- storageTargetName,
165
- options
166
- },
167
- beginDnsRefreshOperationSpec,
168
- options);
319
+ get(
320
+ resourceGroupName: string,
321
+ cacheName: string,
322
+ storageTargetName: string,
323
+ options?: StorageTargetsGetOptionalParams
324
+ ): Promise<StorageTargetsGetResponse> {
325
+ return this.client.sendOperationRequest(
326
+ { resourceGroupName, cacheName, storageTargetName, options },
327
+ getOperationSpec
328
+ );
169
329
  }
170
330
 
171
331
  /**
172
- * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache
173
- * is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is
174
- * healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be
175
- * flushed before the Storage Target will be deleted.
332
+ * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down
333
+ * or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache
334
+ * is healthy again.
176
335
  * @param resourceGroupName Target resource group.
177
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
178
- * from the [-0-9a-zA-Z_] char class.
336
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
337
+ * the [-0-9a-zA-Z_] char class.
179
338
  * @param storageTargetName Name of Storage Target.
180
- * @param [options] The optional parameters
181
- * @returns Promise<msRestAzure.LROPoller>
339
+ * @param options The options parameters.
182
340
  */
183
- beginDeleteMethod(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: Models.StorageTargetsBeginDeleteMethodOptionalParams): Promise<msRestAzure.LROPoller> {
184
- return this.client.sendLRORequest(
185
- {
186
- resourceGroupName,
187
- cacheName,
188
- storageTargetName,
189
- options
190
- },
191
- beginDeleteMethodOperationSpec,
192
- options);
341
+ async beginCreateOrUpdate(
342
+ resourceGroupName: string,
343
+ cacheName: string,
344
+ storageTargetName: string,
345
+ options?: StorageTargetsCreateOrUpdateOptionalParams
346
+ ): Promise<
347
+ PollerLike<
348
+ PollOperationState<StorageTargetsCreateOrUpdateResponse>,
349
+ StorageTargetsCreateOrUpdateResponse
350
+ >
351
+ > {
352
+ const directSendOperation = async (
353
+ args: coreClient.OperationArguments,
354
+ spec: coreClient.OperationSpec
355
+ ): Promise<StorageTargetsCreateOrUpdateResponse> => {
356
+ return this.client.sendOperationRequest(args, spec);
357
+ };
358
+ const sendOperation = async (
359
+ args: coreClient.OperationArguments,
360
+ spec: coreClient.OperationSpec
361
+ ) => {
362
+ let currentRawResponse:
363
+ | coreClient.FullOperationResponse
364
+ | undefined = undefined;
365
+ const providedCallback = args.options?.onResponse;
366
+ const callback: coreClient.RawResponseCallback = (
367
+ rawResponse: coreClient.FullOperationResponse,
368
+ flatResponse: unknown
369
+ ) => {
370
+ currentRawResponse = rawResponse;
371
+ providedCallback?.(rawResponse, flatResponse);
372
+ };
373
+ const updatedArgs = {
374
+ ...args,
375
+ options: {
376
+ ...args.options,
377
+ onResponse: callback
378
+ }
379
+ };
380
+ const flatResponse = await directSendOperation(updatedArgs, spec);
381
+ return {
382
+ flatResponse,
383
+ rawResponse: {
384
+ statusCode: currentRawResponse!.status,
385
+ body: currentRawResponse!.parsedBody,
386
+ headers: currentRawResponse!.headers.toJSON()
387
+ }
388
+ };
389
+ };
390
+
391
+ const lro = new LroImpl(
392
+ sendOperation,
393
+ { resourceGroupName, cacheName, storageTargetName, options },
394
+ createOrUpdateOperationSpec
395
+ );
396
+ return new LroEngine(lro, {
397
+ resumeFrom: options?.resumeFrom,
398
+ intervalInMs: options?.updateIntervalInMs
399
+ });
193
400
  }
194
401
 
195
402
  /**
196
- * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is
197
- * down or unhealthy, the actual creation/modification of the Storage Target may be delayed until
198
- * the Cache is healthy again.
403
+ * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down
404
+ * or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache
405
+ * is healthy again.
199
406
  * @param resourceGroupName Target resource group.
200
- * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be
201
- * from the [-0-9a-zA-Z_] char class.
407
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
408
+ * the [-0-9a-zA-Z_] char class.
202
409
  * @param storageTargetName Name of Storage Target.
203
- * @param [options] The optional parameters
204
- * @returns Promise<msRestAzure.LROPoller>
410
+ * @param options The options parameters.
205
411
  */
206
- beginCreateOrUpdate(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: Models.StorageTargetsBeginCreateOrUpdateOptionalParams): Promise<msRestAzure.LROPoller> {
207
- return this.client.sendLRORequest(
208
- {
209
- resourceGroupName,
210
- cacheName,
211
- storageTargetName,
212
- options
213
- },
214
- beginCreateOrUpdateOperationSpec,
215
- options);
412
+ async beginCreateOrUpdateAndWait(
413
+ resourceGroupName: string,
414
+ cacheName: string,
415
+ storageTargetName: string,
416
+ options?: StorageTargetsCreateOrUpdateOptionalParams
417
+ ): Promise<StorageTargetsCreateOrUpdateResponse> {
418
+ const poller = await this.beginCreateOrUpdate(
419
+ resourceGroupName,
420
+ cacheName,
421
+ storageTargetName,
422
+ options
423
+ );
424
+ return poller.pollUntilDone();
216
425
  }
217
426
 
218
427
  /**
219
- * Returns a list of Storage Targets for the specified Cache.
220
- * @param nextPageLink The NextLink from the previous successful call to List operation.
221
- * @param [options] The optional parameters
222
- * @returns Promise<Models.StorageTargetsListByCacheNextResponse>
223
- */
224
- listByCacheNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.StorageTargetsListByCacheNextResponse>;
225
- /**
226
- * @param nextPageLink The NextLink from the previous successful call to List operation.
227
- * @param callback The callback
228
- */
229
- listByCacheNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.StorageTargetsResult>): void;
230
- /**
231
- * @param nextPageLink The NextLink from the previous successful call to List operation.
232
- * @param options The optional parameters
233
- * @param callback The callback
428
+ * ListByCacheNext
429
+ * @param resourceGroupName Target resource group.
430
+ * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from
431
+ * the [-0-9a-zA-Z_] char class.
432
+ * @param nextLink The nextLink from the previous successful call to the ListByCache method.
433
+ * @param options The options parameters.
234
434
  */
235
- listByCacheNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.StorageTargetsResult>): void;
236
- listByCacheNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.StorageTargetsResult>, callback?: msRest.ServiceCallback<Models.StorageTargetsResult>): Promise<Models.StorageTargetsListByCacheNextResponse> {
435
+ private _listByCacheNext(
436
+ resourceGroupName: string,
437
+ cacheName: string,
438
+ nextLink: string,
439
+ options?: StorageTargetsListByCacheNextOptionalParams
440
+ ): Promise<StorageTargetsListByCacheNextResponse> {
237
441
  return this.client.sendOperationRequest(
238
- {
239
- nextPageLink,
240
- options
241
- },
242
- listByCacheNextOperationSpec,
243
- callback) as Promise<Models.StorageTargetsListByCacheNextResponse>;
442
+ { resourceGroupName, cacheName, nextLink, options },
443
+ listByCacheNextOperationSpec
444
+ );
244
445
  }
245
446
  }
246
-
247
447
  // Operation Specifications
248
- const serializer = new msRest.Serializer(Mappers);
249
- const listByCacheOperationSpec: msRest.OperationSpec = {
250
- httpMethod: "GET",
251
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets",
252
- urlParameters: [
253
- Parameters.resourceGroupName,
254
- Parameters.subscriptionId,
255
- Parameters.cacheName
256
- ],
257
- queryParameters: [
258
- Parameters.apiVersion
259
- ],
260
- headerParameters: [
261
- Parameters.acceptLanguage
262
- ],
448
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
449
+
450
+ const dnsRefreshOperationSpec: coreClient.OperationSpec = {
451
+ path:
452
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/dnsRefresh",
453
+ httpMethod: "POST",
263
454
  responses: {
264
- 200: {
265
- bodyMapper: Mappers.StorageTargetsResult
266
- },
455
+ 200: {},
456
+ 201: {},
457
+ 202: {},
458
+ 204: {},
267
459
  default: {
268
460
  bodyMapper: Mappers.CloudError
269
461
  }
270
462
  },
271
- serializer
272
- };
273
-
274
- const getOperationSpec: msRest.OperationSpec = {
275
- httpMethod: "GET",
276
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}",
463
+ queryParameters: [Parameters.apiVersion],
277
464
  urlParameters: [
278
- Parameters.resourceGroupName,
465
+ Parameters.$host,
279
466
  Parameters.subscriptionId,
467
+ Parameters.resourceGroupName,
280
468
  Parameters.cacheName,
281
469
  Parameters.storageTargetName
282
470
  ],
283
- queryParameters: [
284
- Parameters.apiVersion
285
- ],
286
- headerParameters: [
287
- Parameters.acceptLanguage
288
- ],
471
+ headerParameters: [Parameters.accept],
472
+ serializer
473
+ };
474
+ const listByCacheOperationSpec: coreClient.OperationSpec = {
475
+ path:
476
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets",
477
+ httpMethod: "GET",
289
478
  responses: {
290
479
  200: {
291
- bodyMapper: Mappers.StorageTarget
480
+ bodyMapper: Mappers.StorageTargetsResult
292
481
  },
293
482
  default: {
294
483
  bodyMapper: Mappers.CloudError
295
484
  }
296
485
  },
297
- serializer
298
- };
299
-
300
- const beginDnsRefreshOperationSpec: msRest.OperationSpec = {
301
- httpMethod: "POST",
302
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/dnsRefresh",
486
+ queryParameters: [Parameters.apiVersion],
303
487
  urlParameters: [
304
- Parameters.resourceGroupName,
488
+ Parameters.$host,
305
489
  Parameters.subscriptionId,
306
- Parameters.cacheName,
307
- Parameters.storageTargetName
308
- ],
309
- queryParameters: [
310
- Parameters.apiVersion
311
- ],
312
- headerParameters: [
313
- Parameters.acceptLanguage
490
+ Parameters.resourceGroupName,
491
+ Parameters.cacheName
314
492
  ],
493
+ headerParameters: [Parameters.accept],
494
+ serializer
495
+ };
496
+ const deleteOperationSpec: coreClient.OperationSpec = {
497
+ path:
498
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}",
499
+ httpMethod: "DELETE",
315
500
  responses: {
316
501
  200: {},
502
+ 201: {},
317
503
  202: {},
504
+ 204: {},
318
505
  default: {
319
506
  bodyMapper: Mappers.CloudError
320
507
  }
321
508
  },
322
- serializer
323
- };
324
-
325
- const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
326
- httpMethod: "DELETE",
327
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}",
509
+ queryParameters: [Parameters.apiVersion, Parameters.force],
328
510
  urlParameters: [
329
- Parameters.resourceGroupName,
511
+ Parameters.$host,
330
512
  Parameters.subscriptionId,
513
+ Parameters.resourceGroupName,
331
514
  Parameters.cacheName,
332
515
  Parameters.storageTargetName
333
516
  ],
334
- queryParameters: [
335
- Parameters.apiVersion,
336
- Parameters.force
337
- ],
338
- headerParameters: [
339
- Parameters.acceptLanguage
340
- ],
517
+ headerParameters: [Parameters.accept],
518
+ serializer
519
+ };
520
+ const getOperationSpec: coreClient.OperationSpec = {
521
+ path:
522
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}",
523
+ httpMethod: "GET",
341
524
  responses: {
342
- 200: {},
343
- 202: {},
344
- 204: {},
525
+ 200: {
526
+ bodyMapper: Mappers.StorageTarget
527
+ },
345
528
  default: {
346
529
  bodyMapper: Mappers.CloudError
347
530
  }
348
531
  },
349
- serializer
350
- };
351
-
352
- const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = {
353
- httpMethod: "PUT",
354
- path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}",
532
+ queryParameters: [Parameters.apiVersion],
355
533
  urlParameters: [
356
- Parameters.resourceGroupName,
534
+ Parameters.$host,
357
535
  Parameters.subscriptionId,
536
+ Parameters.resourceGroupName,
358
537
  Parameters.cacheName,
359
538
  Parameters.storageTargetName
360
539
  ],
361
- queryParameters: [
362
- Parameters.apiVersion
363
- ],
364
- headerParameters: [
365
- Parameters.acceptLanguage
366
- ],
367
- requestBody: {
368
- parameterPath: [
369
- "options",
370
- "storagetarget"
371
- ],
372
- mapper: Mappers.StorageTarget
373
- },
540
+ headerParameters: [Parameters.accept],
541
+ serializer
542
+ };
543
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
544
+ path:
545
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}",
546
+ httpMethod: "PUT",
374
547
  responses: {
375
548
  200: {
376
549
  bodyMapper: Mappers.StorageTarget
@@ -378,27 +551,32 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = {
378
551
  201: {
379
552
  bodyMapper: Mappers.StorageTarget
380
553
  },
381
- 202: {},
554
+ 202: {
555
+ bodyMapper: Mappers.StorageTarget
556
+ },
557
+ 204: {
558
+ bodyMapper: Mappers.StorageTarget
559
+ },
382
560
  default: {
383
561
  bodyMapper: Mappers.CloudError
384
562
  }
385
563
  },
564
+ requestBody: Parameters.storagetarget,
565
+ queryParameters: [Parameters.apiVersion],
566
+ urlParameters: [
567
+ Parameters.$host,
568
+ Parameters.subscriptionId,
569
+ Parameters.resourceGroupName,
570
+ Parameters.cacheName,
571
+ Parameters.storageTargetName
572
+ ],
573
+ headerParameters: [Parameters.accept, Parameters.contentType],
574
+ mediaType: "json",
386
575
  serializer
387
576
  };
388
-
389
- const listByCacheNextOperationSpec: msRest.OperationSpec = {
390
- httpMethod: "GET",
391
- baseUrl: "https://management.azure.com",
577
+ const listByCacheNextOperationSpec: coreClient.OperationSpec = {
392
578
  path: "{nextLink}",
393
- urlParameters: [
394
- Parameters.nextPageLink
395
- ],
396
- queryParameters: [
397
- Parameters.apiVersion
398
- ],
399
- headerParameters: [
400
- Parameters.acceptLanguage
401
- ],
579
+ httpMethod: "GET",
402
580
  responses: {
403
581
  200: {
404
582
  bodyMapper: Mappers.StorageTargetsResult
@@ -407,5 +585,14 @@ const listByCacheNextOperationSpec: msRest.OperationSpec = {
407
585
  bodyMapper: Mappers.CloudError
408
586
  }
409
587
  },
588
+ queryParameters: [Parameters.apiVersion],
589
+ urlParameters: [
590
+ Parameters.$host,
591
+ Parameters.nextLink,
592
+ Parameters.subscriptionId,
593
+ Parameters.resourceGroupName,
594
+ Parameters.cacheName
595
+ ],
596
+ headerParameters: [Parameters.accept],
410
597
  serializer
411
598
  };