@azure/arm-cosmosdb 16.3.0-alpha.20250718.1 → 16.3.0-alpha.20250730.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/dist/browser/cosmosDBManagementClient.js +50 -5
  2. package/dist/browser/cosmosDBManagementClient.js.map +1 -1
  3. package/dist/browser/lroImpl.js +7 -3
  4. package/dist/browser/lroImpl.js.map +1 -1
  5. package/dist/browser/models/mappers.js +661 -279
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/cassandraClusters.js +85 -89
  8. package/dist/browser/operations/cassandraClusters.js.map +1 -1
  9. package/dist/browser/operations/cassandraDataCenters.js +43 -45
  10. package/dist/browser/operations/cassandraDataCenters.js.map +1 -1
  11. package/dist/browser/operations/cassandraResources.js +129 -113
  12. package/dist/browser/operations/cassandraResources.js.map +1 -1
  13. package/dist/browser/operations/collection.js +28 -79
  14. package/dist/browser/operations/collection.js.map +1 -1
  15. package/dist/browser/operations/collectionPartition.js +19 -53
  16. package/dist/browser/operations/collectionPartition.js.map +1 -1
  17. package/dist/browser/operations/collectionPartitionRegion.js +10 -27
  18. package/dist/browser/operations/collectionPartitionRegion.js.map +1 -1
  19. package/dist/browser/operations/collectionRegion.js +10 -27
  20. package/dist/browser/operations/collectionRegion.js.map +1 -1
  21. package/dist/browser/operations/database.js +28 -79
  22. package/dist/browser/operations/database.js.map +1 -1
  23. package/dist/browser/operations/databaseAccountRegion.js +10 -27
  24. package/dist/browser/operations/databaseAccountRegion.js.map +1 -1
  25. package/dist/browser/operations/databaseAccounts.js +123 -173
  26. package/dist/browser/operations/databaseAccounts.js.map +1 -1
  27. package/dist/browser/operations/gremlinResources.js +140 -119
  28. package/dist/browser/operations/gremlinResources.js.map +1 -1
  29. package/dist/browser/operations/locations.js +10 -27
  30. package/dist/browser/operations/locations.js.map +1 -1
  31. package/dist/browser/operations/mongoDBResources.js +202 -195
  32. package/dist/browser/operations/mongoDBResources.js.map +1 -1
  33. package/dist/browser/operations/notebookWorkspaces.js +54 -51
  34. package/dist/browser/operations/notebookWorkspaces.js.map +1 -1
  35. package/dist/browser/operations/operations.js +23 -40
  36. package/dist/browser/operations/operations.js.map +1 -1
  37. package/dist/browser/operations/partitionKeyRangeId.js +10 -27
  38. package/dist/browser/operations/partitionKeyRangeId.js.map +1 -1
  39. package/dist/browser/operations/partitionKeyRangeIdRegion.js +10 -27
  40. package/dist/browser/operations/partitionKeyRangeIdRegion.js.map +1 -1
  41. package/dist/browser/operations/percentile.js +10 -27
  42. package/dist/browser/operations/percentile.js.map +1 -1
  43. package/dist/browser/operations/percentileSourceTarget.js +10 -27
  44. package/dist/browser/operations/percentileSourceTarget.js.map +1 -1
  45. package/dist/browser/operations/percentileTarget.js +10 -27
  46. package/dist/browser/operations/percentileTarget.js.map +1 -1
  47. package/dist/browser/operations/privateEndpointConnections.js +32 -39
  48. package/dist/browser/operations/privateEndpointConnections.js.map +1 -1
  49. package/dist/browser/operations/privateLinkResources.js +10 -27
  50. package/dist/browser/operations/privateLinkResources.js.map +1 -1
  51. package/dist/browser/operations/restorableDatabaseAccounts.js +19 -53
  52. package/dist/browser/operations/restorableDatabaseAccounts.js.map +1 -1
  53. package/dist/browser/operations/restorableGremlinDatabases.js +10 -27
  54. package/dist/browser/operations/restorableGremlinDatabases.js.map +1 -1
  55. package/dist/browser/operations/restorableGremlinGraphs.js +10 -27
  56. package/dist/browser/operations/restorableGremlinGraphs.js.map +1 -1
  57. package/dist/browser/operations/restorableGremlinResources.js +10 -27
  58. package/dist/browser/operations/restorableGremlinResources.js.map +1 -1
  59. package/dist/browser/operations/restorableMongodbCollections.js +10 -27
  60. package/dist/browser/operations/restorableMongodbCollections.js.map +1 -1
  61. package/dist/browser/operations/restorableMongodbDatabases.js +10 -27
  62. package/dist/browser/operations/restorableMongodbDatabases.js.map +1 -1
  63. package/dist/browser/operations/restorableMongodbResources.js +10 -27
  64. package/dist/browser/operations/restorableMongodbResources.js.map +1 -1
  65. package/dist/browser/operations/restorableSqlContainers.js +10 -27
  66. package/dist/browser/operations/restorableSqlContainers.js.map +1 -1
  67. package/dist/browser/operations/restorableSqlDatabases.js +10 -27
  68. package/dist/browser/operations/restorableSqlDatabases.js.map +1 -1
  69. package/dist/browser/operations/restorableSqlResources.js +10 -27
  70. package/dist/browser/operations/restorableSqlResources.js.map +1 -1
  71. package/dist/browser/operations/restorableTableResources.js +10 -27
  72. package/dist/browser/operations/restorableTableResources.js.map +1 -1
  73. package/dist/browser/operations/restorableTables.js +10 -27
  74. package/dist/browser/operations/restorableTables.js.map +1 -1
  75. package/dist/browser/operations/service.js +32 -39
  76. package/dist/browser/operations/service.js.map +1 -1
  77. package/dist/browser/operations/sqlResources.js +315 -341
  78. package/dist/browser/operations/sqlResources.js.map +1 -1
  79. package/dist/browser/operations/tableResources.js +76 -63
  80. package/dist/browser/operations/tableResources.js.map +1 -1
  81. package/dist/browser/pagingHelper.js +2 -4
  82. package/dist/browser/pagingHelper.js.map +1 -1
  83. package/dist/commonjs/cosmosDBManagementClient.js +50 -5
  84. package/dist/commonjs/cosmosDBManagementClient.js.map +1 -1
  85. package/dist/commonjs/lroImpl.js +7 -3
  86. package/dist/commonjs/lroImpl.js.map +1 -1
  87. package/dist/commonjs/models/mappers.js +661 -279
  88. package/dist/commonjs/models/mappers.js.map +1 -1
  89. package/dist/commonjs/operations/cassandraClusters.js +85 -88
  90. package/dist/commonjs/operations/cassandraClusters.js.map +1 -1
  91. package/dist/commonjs/operations/cassandraDataCenters.js +43 -44
  92. package/dist/commonjs/operations/cassandraDataCenters.js.map +1 -1
  93. package/dist/commonjs/operations/cassandraResources.js +129 -112
  94. package/dist/commonjs/operations/cassandraResources.js.map +1 -1
  95. package/dist/commonjs/operations/collection.js +28 -78
  96. package/dist/commonjs/operations/collection.js.map +1 -1
  97. package/dist/commonjs/operations/collectionPartition.js +19 -52
  98. package/dist/commonjs/operations/collectionPartition.js.map +1 -1
  99. package/dist/commonjs/operations/collectionPartitionRegion.js +10 -26
  100. package/dist/commonjs/operations/collectionPartitionRegion.js.map +1 -1
  101. package/dist/commonjs/operations/collectionRegion.js +10 -26
  102. package/dist/commonjs/operations/collectionRegion.js.map +1 -1
  103. package/dist/commonjs/operations/database.js +28 -78
  104. package/dist/commonjs/operations/database.js.map +1 -1
  105. package/dist/commonjs/operations/databaseAccountRegion.js +10 -26
  106. package/dist/commonjs/operations/databaseAccountRegion.js.map +1 -1
  107. package/dist/commonjs/operations/databaseAccounts.js +123 -172
  108. package/dist/commonjs/operations/databaseAccounts.js.map +1 -1
  109. package/dist/commonjs/operations/gremlinResources.js +140 -118
  110. package/dist/commonjs/operations/gremlinResources.js.map +1 -1
  111. package/dist/commonjs/operations/locations.js +10 -26
  112. package/dist/commonjs/operations/locations.js.map +1 -1
  113. package/dist/commonjs/operations/mongoDBResources.js +202 -194
  114. package/dist/commonjs/operations/mongoDBResources.js.map +1 -1
  115. package/dist/commonjs/operations/notebookWorkspaces.js +54 -50
  116. package/dist/commonjs/operations/notebookWorkspaces.js.map +1 -1
  117. package/dist/commonjs/operations/operations.js +23 -39
  118. package/dist/commonjs/operations/operations.js.map +1 -1
  119. package/dist/commonjs/operations/partitionKeyRangeId.js +10 -26
  120. package/dist/commonjs/operations/partitionKeyRangeId.js.map +1 -1
  121. package/dist/commonjs/operations/partitionKeyRangeIdRegion.js +10 -26
  122. package/dist/commonjs/operations/partitionKeyRangeIdRegion.js.map +1 -1
  123. package/dist/commonjs/operations/percentile.js +10 -26
  124. package/dist/commonjs/operations/percentile.js.map +1 -1
  125. package/dist/commonjs/operations/percentileSourceTarget.js +10 -26
  126. package/dist/commonjs/operations/percentileSourceTarget.js.map +1 -1
  127. package/dist/commonjs/operations/percentileTarget.js +10 -26
  128. package/dist/commonjs/operations/percentileTarget.js.map +1 -1
  129. package/dist/commonjs/operations/privateEndpointConnections.js +32 -38
  130. package/dist/commonjs/operations/privateEndpointConnections.js.map +1 -1
  131. package/dist/commonjs/operations/privateLinkResources.js +10 -26
  132. package/dist/commonjs/operations/privateLinkResources.js.map +1 -1
  133. package/dist/commonjs/operations/restorableDatabaseAccounts.js +19 -52
  134. package/dist/commonjs/operations/restorableDatabaseAccounts.js.map +1 -1
  135. package/dist/commonjs/operations/restorableGremlinDatabases.js +10 -26
  136. package/dist/commonjs/operations/restorableGremlinDatabases.js.map +1 -1
  137. package/dist/commonjs/operations/restorableGremlinGraphs.js +10 -26
  138. package/dist/commonjs/operations/restorableGremlinGraphs.js.map +1 -1
  139. package/dist/commonjs/operations/restorableGremlinResources.js +10 -26
  140. package/dist/commonjs/operations/restorableGremlinResources.js.map +1 -1
  141. package/dist/commonjs/operations/restorableMongodbCollections.js +10 -26
  142. package/dist/commonjs/operations/restorableMongodbCollections.js.map +1 -1
  143. package/dist/commonjs/operations/restorableMongodbDatabases.js +10 -26
  144. package/dist/commonjs/operations/restorableMongodbDatabases.js.map +1 -1
  145. package/dist/commonjs/operations/restorableMongodbResources.js +10 -26
  146. package/dist/commonjs/operations/restorableMongodbResources.js.map +1 -1
  147. package/dist/commonjs/operations/restorableSqlContainers.js +10 -26
  148. package/dist/commonjs/operations/restorableSqlContainers.js.map +1 -1
  149. package/dist/commonjs/operations/restorableSqlDatabases.js +10 -26
  150. package/dist/commonjs/operations/restorableSqlDatabases.js.map +1 -1
  151. package/dist/commonjs/operations/restorableSqlResources.js +10 -26
  152. package/dist/commonjs/operations/restorableSqlResources.js.map +1 -1
  153. package/dist/commonjs/operations/restorableTableResources.js +10 -26
  154. package/dist/commonjs/operations/restorableTableResources.js.map +1 -1
  155. package/dist/commonjs/operations/restorableTables.js +10 -26
  156. package/dist/commonjs/operations/restorableTables.js.map +1 -1
  157. package/dist/commonjs/operations/service.js +32 -38
  158. package/dist/commonjs/operations/service.js.map +1 -1
  159. package/dist/commonjs/operations/sqlResources.js +315 -340
  160. package/dist/commonjs/operations/sqlResources.js.map +1 -1
  161. package/dist/commonjs/operations/tableResources.js +76 -62
  162. package/dist/commonjs/operations/tableResources.js.map +1 -1
  163. package/dist/commonjs/pagingHelper.js +2 -4
  164. package/dist/commonjs/pagingHelper.js.map +1 -1
  165. package/dist/commonjs/tsdoc-metadata.json +1 -1
  166. package/dist/esm/cosmosDBManagementClient.js +50 -5
  167. package/dist/esm/cosmosDBManagementClient.js.map +1 -1
  168. package/dist/esm/lroImpl.js +7 -3
  169. package/dist/esm/lroImpl.js.map +1 -1
  170. package/dist/esm/models/mappers.js +661 -279
  171. package/dist/esm/models/mappers.js.map +1 -1
  172. package/dist/esm/operations/cassandraClusters.js +85 -89
  173. package/dist/esm/operations/cassandraClusters.js.map +1 -1
  174. package/dist/esm/operations/cassandraDataCenters.js +43 -45
  175. package/dist/esm/operations/cassandraDataCenters.js.map +1 -1
  176. package/dist/esm/operations/cassandraResources.js +129 -113
  177. package/dist/esm/operations/cassandraResources.js.map +1 -1
  178. package/dist/esm/operations/collection.js +28 -79
  179. package/dist/esm/operations/collection.js.map +1 -1
  180. package/dist/esm/operations/collectionPartition.js +19 -53
  181. package/dist/esm/operations/collectionPartition.js.map +1 -1
  182. package/dist/esm/operations/collectionPartitionRegion.js +10 -27
  183. package/dist/esm/operations/collectionPartitionRegion.js.map +1 -1
  184. package/dist/esm/operations/collectionRegion.js +10 -27
  185. package/dist/esm/operations/collectionRegion.js.map +1 -1
  186. package/dist/esm/operations/database.js +28 -79
  187. package/dist/esm/operations/database.js.map +1 -1
  188. package/dist/esm/operations/databaseAccountRegion.js +10 -27
  189. package/dist/esm/operations/databaseAccountRegion.js.map +1 -1
  190. package/dist/esm/operations/databaseAccounts.js +123 -173
  191. package/dist/esm/operations/databaseAccounts.js.map +1 -1
  192. package/dist/esm/operations/gremlinResources.js +140 -119
  193. package/dist/esm/operations/gremlinResources.js.map +1 -1
  194. package/dist/esm/operations/locations.js +10 -27
  195. package/dist/esm/operations/locations.js.map +1 -1
  196. package/dist/esm/operations/mongoDBResources.js +202 -195
  197. package/dist/esm/operations/mongoDBResources.js.map +1 -1
  198. package/dist/esm/operations/notebookWorkspaces.js +54 -51
  199. package/dist/esm/operations/notebookWorkspaces.js.map +1 -1
  200. package/dist/esm/operations/operations.js +23 -40
  201. package/dist/esm/operations/operations.js.map +1 -1
  202. package/dist/esm/operations/partitionKeyRangeId.js +10 -27
  203. package/dist/esm/operations/partitionKeyRangeId.js.map +1 -1
  204. package/dist/esm/operations/partitionKeyRangeIdRegion.js +10 -27
  205. package/dist/esm/operations/partitionKeyRangeIdRegion.js.map +1 -1
  206. package/dist/esm/operations/percentile.js +10 -27
  207. package/dist/esm/operations/percentile.js.map +1 -1
  208. package/dist/esm/operations/percentileSourceTarget.js +10 -27
  209. package/dist/esm/operations/percentileSourceTarget.js.map +1 -1
  210. package/dist/esm/operations/percentileTarget.js +10 -27
  211. package/dist/esm/operations/percentileTarget.js.map +1 -1
  212. package/dist/esm/operations/privateEndpointConnections.js +32 -39
  213. package/dist/esm/operations/privateEndpointConnections.js.map +1 -1
  214. package/dist/esm/operations/privateLinkResources.js +10 -27
  215. package/dist/esm/operations/privateLinkResources.js.map +1 -1
  216. package/dist/esm/operations/restorableDatabaseAccounts.js +19 -53
  217. package/dist/esm/operations/restorableDatabaseAccounts.js.map +1 -1
  218. package/dist/esm/operations/restorableGremlinDatabases.js +10 -27
  219. package/dist/esm/operations/restorableGremlinDatabases.js.map +1 -1
  220. package/dist/esm/operations/restorableGremlinGraphs.js +10 -27
  221. package/dist/esm/operations/restorableGremlinGraphs.js.map +1 -1
  222. package/dist/esm/operations/restorableGremlinResources.js +10 -27
  223. package/dist/esm/operations/restorableGremlinResources.js.map +1 -1
  224. package/dist/esm/operations/restorableMongodbCollections.js +10 -27
  225. package/dist/esm/operations/restorableMongodbCollections.js.map +1 -1
  226. package/dist/esm/operations/restorableMongodbDatabases.js +10 -27
  227. package/dist/esm/operations/restorableMongodbDatabases.js.map +1 -1
  228. package/dist/esm/operations/restorableMongodbResources.js +10 -27
  229. package/dist/esm/operations/restorableMongodbResources.js.map +1 -1
  230. package/dist/esm/operations/restorableSqlContainers.js +10 -27
  231. package/dist/esm/operations/restorableSqlContainers.js.map +1 -1
  232. package/dist/esm/operations/restorableSqlDatabases.js +10 -27
  233. package/dist/esm/operations/restorableSqlDatabases.js.map +1 -1
  234. package/dist/esm/operations/restorableSqlResources.js +10 -27
  235. package/dist/esm/operations/restorableSqlResources.js.map +1 -1
  236. package/dist/esm/operations/restorableTableResources.js +10 -27
  237. package/dist/esm/operations/restorableTableResources.js.map +1 -1
  238. package/dist/esm/operations/restorableTables.js +10 -27
  239. package/dist/esm/operations/restorableTables.js.map +1 -1
  240. package/dist/esm/operations/service.js +32 -39
  241. package/dist/esm/operations/service.js.map +1 -1
  242. package/dist/esm/operations/sqlResources.js +315 -341
  243. package/dist/esm/operations/sqlResources.js.map +1 -1
  244. package/dist/esm/operations/tableResources.js +76 -63
  245. package/dist/esm/operations/tableResources.js.map +1 -1
  246. package/dist/esm/pagingHelper.js +2 -4
  247. package/dist/esm/pagingHelper.js.map +1 -1
  248. package/dist/react-native/cosmosDBManagementClient.js +50 -5
  249. package/dist/react-native/cosmosDBManagementClient.js.map +1 -1
  250. package/dist/react-native/lroImpl.js +7 -3
  251. package/dist/react-native/lroImpl.js.map +1 -1
  252. package/dist/react-native/models/mappers.js +661 -279
  253. package/dist/react-native/models/mappers.js.map +1 -1
  254. package/dist/react-native/operations/cassandraClusters.js +85 -89
  255. package/dist/react-native/operations/cassandraClusters.js.map +1 -1
  256. package/dist/react-native/operations/cassandraDataCenters.js +43 -45
  257. package/dist/react-native/operations/cassandraDataCenters.js.map +1 -1
  258. package/dist/react-native/operations/cassandraResources.js +129 -113
  259. package/dist/react-native/operations/cassandraResources.js.map +1 -1
  260. package/dist/react-native/operations/collection.js +28 -79
  261. package/dist/react-native/operations/collection.js.map +1 -1
  262. package/dist/react-native/operations/collectionPartition.js +19 -53
  263. package/dist/react-native/operations/collectionPartition.js.map +1 -1
  264. package/dist/react-native/operations/collectionPartitionRegion.js +10 -27
  265. package/dist/react-native/operations/collectionPartitionRegion.js.map +1 -1
  266. package/dist/react-native/operations/collectionRegion.js +10 -27
  267. package/dist/react-native/operations/collectionRegion.js.map +1 -1
  268. package/dist/react-native/operations/database.js +28 -79
  269. package/dist/react-native/operations/database.js.map +1 -1
  270. package/dist/react-native/operations/databaseAccountRegion.js +10 -27
  271. package/dist/react-native/operations/databaseAccountRegion.js.map +1 -1
  272. package/dist/react-native/operations/databaseAccounts.js +123 -173
  273. package/dist/react-native/operations/databaseAccounts.js.map +1 -1
  274. package/dist/react-native/operations/gremlinResources.js +140 -119
  275. package/dist/react-native/operations/gremlinResources.js.map +1 -1
  276. package/dist/react-native/operations/locations.js +10 -27
  277. package/dist/react-native/operations/locations.js.map +1 -1
  278. package/dist/react-native/operations/mongoDBResources.js +202 -195
  279. package/dist/react-native/operations/mongoDBResources.js.map +1 -1
  280. package/dist/react-native/operations/notebookWorkspaces.js +54 -51
  281. package/dist/react-native/operations/notebookWorkspaces.js.map +1 -1
  282. package/dist/react-native/operations/operations.js +23 -40
  283. package/dist/react-native/operations/operations.js.map +1 -1
  284. package/dist/react-native/operations/partitionKeyRangeId.js +10 -27
  285. package/dist/react-native/operations/partitionKeyRangeId.js.map +1 -1
  286. package/dist/react-native/operations/partitionKeyRangeIdRegion.js +10 -27
  287. package/dist/react-native/operations/partitionKeyRangeIdRegion.js.map +1 -1
  288. package/dist/react-native/operations/percentile.js +10 -27
  289. package/dist/react-native/operations/percentile.js.map +1 -1
  290. package/dist/react-native/operations/percentileSourceTarget.js +10 -27
  291. package/dist/react-native/operations/percentileSourceTarget.js.map +1 -1
  292. package/dist/react-native/operations/percentileTarget.js +10 -27
  293. package/dist/react-native/operations/percentileTarget.js.map +1 -1
  294. package/dist/react-native/operations/privateEndpointConnections.js +32 -39
  295. package/dist/react-native/operations/privateEndpointConnections.js.map +1 -1
  296. package/dist/react-native/operations/privateLinkResources.js +10 -27
  297. package/dist/react-native/operations/privateLinkResources.js.map +1 -1
  298. package/dist/react-native/operations/restorableDatabaseAccounts.js +19 -53
  299. package/dist/react-native/operations/restorableDatabaseAccounts.js.map +1 -1
  300. package/dist/react-native/operations/restorableGremlinDatabases.js +10 -27
  301. package/dist/react-native/operations/restorableGremlinDatabases.js.map +1 -1
  302. package/dist/react-native/operations/restorableGremlinGraphs.js +10 -27
  303. package/dist/react-native/operations/restorableGremlinGraphs.js.map +1 -1
  304. package/dist/react-native/operations/restorableGremlinResources.js +10 -27
  305. package/dist/react-native/operations/restorableGremlinResources.js.map +1 -1
  306. package/dist/react-native/operations/restorableMongodbCollections.js +10 -27
  307. package/dist/react-native/operations/restorableMongodbCollections.js.map +1 -1
  308. package/dist/react-native/operations/restorableMongodbDatabases.js +10 -27
  309. package/dist/react-native/operations/restorableMongodbDatabases.js.map +1 -1
  310. package/dist/react-native/operations/restorableMongodbResources.js +10 -27
  311. package/dist/react-native/operations/restorableMongodbResources.js.map +1 -1
  312. package/dist/react-native/operations/restorableSqlContainers.js +10 -27
  313. package/dist/react-native/operations/restorableSqlContainers.js.map +1 -1
  314. package/dist/react-native/operations/restorableSqlDatabases.js +10 -27
  315. package/dist/react-native/operations/restorableSqlDatabases.js.map +1 -1
  316. package/dist/react-native/operations/restorableSqlResources.js +10 -27
  317. package/dist/react-native/operations/restorableSqlResources.js.map +1 -1
  318. package/dist/react-native/operations/restorableTableResources.js +10 -27
  319. package/dist/react-native/operations/restorableTableResources.js.map +1 -1
  320. package/dist/react-native/operations/restorableTables.js +10 -27
  321. package/dist/react-native/operations/restorableTables.js.map +1 -1
  322. package/dist/react-native/operations/service.js +32 -39
  323. package/dist/react-native/operations/service.js.map +1 -1
  324. package/dist/react-native/operations/sqlResources.js +315 -341
  325. package/dist/react-native/operations/sqlResources.js.map +1 -1
  326. package/dist/react-native/operations/tableResources.js +76 -63
  327. package/dist/react-native/operations/tableResources.js.map +1 -1
  328. package/dist/react-native/pagingHelper.js +2 -4
  329. package/dist/react-native/pagingHelper.js.map +1 -1
  330. package/package.json +2 -2
@@ -5,13 +5,13 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
12
11
  /// <reference lib="esnext.asynciterable" />
13
12
  /** Class containing PartitionKeyRangeIdRegion operations. */
14
13
  export class PartitionKeyRangeIdRegionImpl {
14
+ client;
15
15
  /**
16
16
  * Initialize a new instance of the class PartitionKeyRangeIdRegion class.
17
17
  * @param client Reference to the service client
@@ -43,39 +43,22 @@ export class PartitionKeyRangeIdRegionImpl {
43
43
  return this;
44
44
  },
45
45
  byPage: (settings) => {
46
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
46
+ if (settings?.maxPageSize) {
47
47
  throw new Error("maxPageSize is not supported by this operation.");
48
48
  }
49
49
  return this.listMetricsPagingPage(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options, settings);
50
50
  },
51
51
  };
52
52
  }
53
- listMetricsPagingPage(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options, _settings) {
54
- return __asyncGenerator(this, arguments, function* listMetricsPagingPage_1() {
55
- let result;
56
- result = yield __await(this._listMetrics(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options));
57
- yield yield __await(result.value || []);
58
- });
53
+ async *listMetricsPagingPage(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options, _settings) {
54
+ let result;
55
+ result = await this._listMetrics(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options);
56
+ yield result.value || [];
59
57
  }
60
- listMetricsPagingAll(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options) {
61
- return __asyncGenerator(this, arguments, function* listMetricsPagingAll_1() {
62
- var _a, e_1, _b, _c;
63
- try {
64
- for (var _d = true, _e = __asyncValues(this.listMetricsPagingPage(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
65
- _c = _f.value;
66
- _d = false;
67
- const page = _c;
68
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
69
- }
70
- }
71
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
72
- finally {
73
- try {
74
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
75
- }
76
- finally { if (e_1) throw e_1.error; }
77
- }
78
- });
58
+ async *listMetricsPagingAll(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options) {
59
+ for await (const page of this.listMetricsPagingPage(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, options)) {
60
+ yield* page;
61
+ }
79
62
  }
80
63
  /**
81
64
  * Retrieves the metrics determined by the given filter for the given partition key range id and
@@ -1 +1 @@
1
- {"version":3,"file":"partitionKeyRangeIdRegion.js","sourceRoot":"","sources":["../../../src/operations/partitionKeyRangeIdRegion.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,4CAA4C;AAC5C,6DAA6D;AAC7D,MAAM,OAAO,6BAA6B;IAKxC;;;OAGG;IACH,YAAY,MAAgC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,WAAW,CAChB,iBAAyB,EACzB,WAAmB,EACnB,MAAc,EACd,WAAmB,EACnB,aAAqB,EACrB,mBAA2B,EAC3B,MAAc,EACd,OAA4D;QAE5D,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CACpC,iBAA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c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { PartitionKeyRangeIdRegion } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PartitionMetric,\n PartitionKeyRangeIdRegionListMetricsOptionalParams,\n PartitionKeyRangeIdRegionListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing PartitionKeyRangeIdRegion operations. */\nexport class PartitionKeyRangeIdRegionImpl\n implements PartitionKeyRangeIdRegion\n{\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class PartitionKeyRangeIdRegion class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given partition key range id and\n * region.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param region Cosmos DB region, with spaces between words and each word capitalized.\n * @param databaseRid Cosmos DB database rid.\n * @param collectionRid Cosmos DB collection rid.\n * @param partitionKeyRangeId Partition Key Range Id for which to get data.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PartitionMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PartitionMetric[]> {\n let result: PartitionKeyRangeIdRegionListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n ): AsyncIterableIterator<PartitionMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given partition key range id and\n * region.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param region Cosmos DB region, with spaces between words and each word capitalized.\n * @param databaseRid Cosmos DB database rid.\n * @param collectionRid Cosmos DB collection rid.\n * @param partitionKeyRangeId Partition Key Range Id for which to get data.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n ): Promise<PartitionKeyRangeIdRegionListMetricsResponse> {\n return this.client.sendOperationRequest(\n {\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PartitionMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n Parameters.databaseRid,\n Parameters.collectionRid,\n Parameters.region,\n Parameters.partitionKeyRangeId,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"partitionKeyRangeIdRegion.js","sourceRoot":"","sources":["../../../src/operations/partitionKeyRangeIdRegion.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,4CAA4C;AAC5C,6DAA6D;AAC7D,MAAM,OAAO,6BAA6B;IAGvB,MAAM,CAA2B;IAElD;;;OAGG;IACH,YAAY,MAAgC;QAC1C,IAAI,CAAC,MAAM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;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { PartitionKeyRangeIdRegion } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PartitionMetric,\n PartitionKeyRangeIdRegionListMetricsOptionalParams,\n PartitionKeyRangeIdRegionListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing PartitionKeyRangeIdRegion operations. */\nexport class PartitionKeyRangeIdRegionImpl\n implements PartitionKeyRangeIdRegion\n{\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class PartitionKeyRangeIdRegion class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given partition key range id and\n * region.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param region Cosmos DB region, with spaces between words and each word capitalized.\n * @param databaseRid Cosmos DB database rid.\n * @param collectionRid Cosmos DB collection rid.\n * @param partitionKeyRangeId Partition Key Range Id for which to get data.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PartitionMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PartitionMetric[]> {\n let result: PartitionKeyRangeIdRegionListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n ): AsyncIterableIterator<PartitionMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given partition key range id and\n * region.\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param region Cosmos DB region, with spaces between words and each word capitalized.\n * @param databaseRid Cosmos DB database rid.\n * @param collectionRid Cosmos DB collection rid.\n * @param partitionKeyRangeId Partition Key Range Id for which to get data.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n region: string,\n databaseRid: string,\n collectionRid: string,\n partitionKeyRangeId: string,\n filter: string,\n options?: PartitionKeyRangeIdRegionListMetricsOptionalParams,\n ): Promise<PartitionKeyRangeIdRegionListMetricsResponse> {\n return this.client.sendOperationRequest(\n {\n resourceGroupName,\n accountName,\n region,\n databaseRid,\n collectionRid,\n partitionKeyRangeId,\n filter,\n options,\n },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PartitionMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n Parameters.databaseRid,\n Parameters.collectionRid,\n Parameters.region,\n Parameters.partitionKeyRangeId,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -5,13 +5,13 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
12
11
  /// <reference lib="esnext.asynciterable" />
13
12
  /** Class containing Percentile operations. */
14
13
  export class PercentileImpl {
14
+ client;
15
15
  /**
16
16
  * Initialize a new instance of the class Percentile class.
17
17
  * @param client Reference to the service client
@@ -39,39 +39,22 @@ export class PercentileImpl {
39
39
  return this;
40
40
  },
41
41
  byPage: (settings) => {
42
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
42
+ if (settings?.maxPageSize) {
43
43
  throw new Error("maxPageSize is not supported by this operation.");
44
44
  }
45
45
  return this.listMetricsPagingPage(resourceGroupName, accountName, filter, options, settings);
46
46
  },
47
47
  };
48
48
  }
49
- listMetricsPagingPage(resourceGroupName, accountName, filter, options, _settings) {
50
- return __asyncGenerator(this, arguments, function* listMetricsPagingPage_1() {
51
- let result;
52
- result = yield __await(this._listMetrics(resourceGroupName, accountName, filter, options));
53
- yield yield __await(result.value || []);
54
- });
49
+ async *listMetricsPagingPage(resourceGroupName, accountName, filter, options, _settings) {
50
+ let result;
51
+ result = await this._listMetrics(resourceGroupName, accountName, filter, options);
52
+ yield result.value || [];
55
53
  }
56
- listMetricsPagingAll(resourceGroupName, accountName, filter, options) {
57
- return __asyncGenerator(this, arguments, function* listMetricsPagingAll_1() {
58
- var _a, e_1, _b, _c;
59
- try {
60
- for (var _d = true, _e = __asyncValues(this.listMetricsPagingPage(resourceGroupName, accountName, filter, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
61
- _c = _f.value;
62
- _d = false;
63
- const page = _c;
64
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
65
- }
66
- }
67
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
68
- finally {
69
- try {
70
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
71
- }
72
- finally { if (e_1) throw e_1.error; }
73
- }
74
- });
54
+ async *listMetricsPagingAll(resourceGroupName, accountName, filter, options) {
55
+ for await (const page of this.listMetricsPagingPage(resourceGroupName, accountName, filter, options)) {
56
+ yield* page;
57
+ }
75
58
  }
76
59
  /**
77
60
  * Retrieves the metrics determined by the given filter for the given database account. This url is
@@ -1 +1 @@
1
- {"version":3,"file":"percentile.js","sourceRoot":"","sources":["../../../src/operations/percentile.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,4CAA4C;AAC5C,8CAA8C;AAC9C,MAAM,OAAO,cAAc;IAGzB;;;OAGG;IACH,YAAY,MAAgC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACI,WAAW,CAChB,iBAAyB,EACzB,WAAmB,EACnB,MAAc,EACd,OAA6C;QAE7C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CACpC,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,OAAO,CACR,CAAC;QACF,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,qBAAqB,CAC/B,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,OAAO,EACP,QAAQ,CACT,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,qBAAqB,CAClC,iBAAyB,EACzB,WAAmB,EACnB,MAAc,EACd,OAA6C,EAC7C,SAAwB;;YAExB,IAAI,MAAqC,CAAC;YAC1C,MAAM,GAAG,cAAM,IAAI,CAAC,YAAY,CAC9B,iBAAiB,EACjB,WAAW,EAC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AC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { Percentile } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PercentileMetric,\n PercentileListMetricsOptionalParams,\n PercentileListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Percentile operations. */\nexport class PercentileImpl implements Percentile {\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class Percentile class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given database account. This url is\n * only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PercentileMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PercentileMetric[]> {\n let result: PercentileListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n ): AsyncIterableIterator<PercentileMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given database account. This url is\n * only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n ): Promise<PercentileListMetricsResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, accountName, filter, options },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PercentileMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"percentile.js","sourceRoot":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AK,IAAI,EAAE,CAAC;IAC3B,CAAC;IAEO,KAAK,CAAC,CAAC,oBAAoB,CACjC,iBAAyB,EACzB,WAAmB,EACnB,MAAc,EACd,OAA6C;QAE7C,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,qBAAqB,CACjD,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,OAAO,CACR,EAAE,CAAC;YACF,KAAK,CAAC,CAAC,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACK,YAAY,CAClB,iBAAyB,EACzB,WAAmB,EACnB,MAAc,EACd,OAA6C;QAE7C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,EACnD,wBAAwB,CACzB,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,wBAAwB,GAA6B;IACzD,IAAI,EAAE,qJAAqJ;IAC3J,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC3D,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,WAAW;KACvB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { Percentile } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PercentileMetric,\n PercentileListMetricsOptionalParams,\n PercentileListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Percentile operations. */\nexport class PercentileImpl implements Percentile {\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class Percentile class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given database account. This url is\n * only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PercentileMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PercentileMetric[]> {\n let result: PercentileListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n ): AsyncIterableIterator<PercentileMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given database account. This url is\n * only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n filter: string,\n options?: PercentileListMetricsOptionalParams,\n ): Promise<PercentileListMetricsResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, accountName, filter, options },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PercentileMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -5,13 +5,13 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
12
11
  /// <reference lib="esnext.asynciterable" />
13
12
  /** Class containing PercentileSourceTarget operations. */
14
13
  export class PercentileSourceTargetImpl {
14
+ client;
15
15
  /**
16
16
  * Initialize a new instance of the class PercentileSourceTarget class.
17
17
  * @param client Reference to the service client
@@ -43,39 +43,22 @@ export class PercentileSourceTargetImpl {
43
43
  return this;
44
44
  },
45
45
  byPage: (settings) => {
46
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
46
+ if (settings?.maxPageSize) {
47
47
  throw new Error("maxPageSize is not supported by this operation.");
48
48
  }
49
49
  return this.listMetricsPagingPage(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options, settings);
50
50
  },
51
51
  };
52
52
  }
53
- listMetricsPagingPage(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options, _settings) {
54
- return __asyncGenerator(this, arguments, function* listMetricsPagingPage_1() {
55
- let result;
56
- result = yield __await(this._listMetrics(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options));
57
- yield yield __await(result.value || []);
58
- });
53
+ async *listMetricsPagingPage(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options, _settings) {
54
+ let result;
55
+ result = await this._listMetrics(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options);
56
+ yield result.value || [];
59
57
  }
60
- listMetricsPagingAll(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options) {
61
- return __asyncGenerator(this, arguments, function* listMetricsPagingAll_1() {
62
- var _a, e_1, _b, _c;
63
- try {
64
- for (var _d = true, _e = __asyncValues(this.listMetricsPagingPage(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
65
- _c = _f.value;
66
- _d = false;
67
- const page = _c;
68
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
69
- }
70
- }
71
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
72
- finally {
73
- try {
74
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
75
- }
76
- finally { if (e_1) throw e_1.error; }
77
- }
78
- });
58
+ async *listMetricsPagingAll(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options) {
59
+ for await (const page of this.listMetricsPagingPage(resourceGroupName, accountName, sourceRegion, targetRegion, filter, options)) {
60
+ yield* page;
61
+ }
79
62
  }
80
63
  /**
81
64
  * Retrieves the metrics determined by the given filter for the given account, source and target
@@ -1 +1 @@
1
- {"version":3,"file":"percentileSourceTarget.js","sourceRoot":"","sources":["../../../src/operations/percentileSourceTarget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,4CAA4C;AAC5C,0DAA0D;AAC1D,MAAM,OAAO,0BAA0B;IAGrC;;;OAGG;IACH,YAAY,MAAgC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,WAAW,CAChB,iBAAyB,EACzB,WAAmB,EACnB,YAAoB,EACpB,YAAoB,EACpB,MAAc,EACd,OAAyD;QAEzD,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CACpC,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,OAAO,CACR,CAAC;QACF,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;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3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,wBAAwB,GAA6B;IACzD,IAAI,EAAE,6MAA6M;IACnN,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC3D,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,YAAY;QACvB,UAAU,CAAC,YAAY;KACxB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { PercentileSourceTarget } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PercentileMetric,\n PercentileSourceTargetListMetricsOptionalParams,\n PercentileSourceTargetListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing PercentileSourceTarget operations. */\nexport class PercentileSourceTargetImpl implements PercentileSourceTarget {\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class PercentileSourceTarget class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account, source and target\n * region. This url is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PercentileMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PercentileMetric[]> {\n let result: PercentileSourceTargetListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n ): AsyncIterableIterator<PercentileMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account, source and target\n * region. This url is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n ): Promise<PercentileSourceTargetListMetricsResponse> {\n return this.client.sendOperationRequest(\n {\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PercentileMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n Parameters.sourceRegion,\n Parameters.targetRegion,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"percentileSourceTarget.js","sourceRoot":"","sources":["../../../src/operations/percentileSourceTarget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAA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AAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { PercentileSourceTarget } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PercentileMetric,\n PercentileSourceTargetListMetricsOptionalParams,\n PercentileSourceTargetListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing PercentileSourceTarget operations. */\nexport class PercentileSourceTargetImpl implements PercentileSourceTarget {\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class PercentileSourceTarget class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account, source and target\n * region. This url is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PercentileMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PercentileMetric[]> {\n let result: PercentileSourceTargetListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n ): AsyncIterableIterator<PercentileMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account, source and target\n * region. This url is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n sourceRegion: string,\n targetRegion: string,\n filter: string,\n options?: PercentileSourceTargetListMetricsOptionalParams,\n ): Promise<PercentileSourceTargetListMetricsResponse> {\n return this.client.sendOperationRequest(\n {\n resourceGroupName,\n accountName,\n sourceRegion,\n targetRegion,\n filter,\n options,\n },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PercentileMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n Parameters.sourceRegion,\n Parameters.targetRegion,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -5,13 +5,13 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
12
11
  /// <reference lib="esnext.asynciterable" />
13
12
  /** Class containing PercentileTarget operations. */
14
13
  export class PercentileTargetImpl {
14
+ client;
15
15
  /**
16
16
  * Initialize a new instance of the class PercentileTarget class.
17
17
  * @param client Reference to the service client
@@ -41,39 +41,22 @@ export class PercentileTargetImpl {
41
41
  return this;
42
42
  },
43
43
  byPage: (settings) => {
44
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
44
+ if (settings?.maxPageSize) {
45
45
  throw new Error("maxPageSize is not supported by this operation.");
46
46
  }
47
47
  return this.listMetricsPagingPage(resourceGroupName, accountName, targetRegion, filter, options, settings);
48
48
  },
49
49
  };
50
50
  }
51
- listMetricsPagingPage(resourceGroupName, accountName, targetRegion, filter, options, _settings) {
52
- return __asyncGenerator(this, arguments, function* listMetricsPagingPage_1() {
53
- let result;
54
- result = yield __await(this._listMetrics(resourceGroupName, accountName, targetRegion, filter, options));
55
- yield yield __await(result.value || []);
56
- });
51
+ async *listMetricsPagingPage(resourceGroupName, accountName, targetRegion, filter, options, _settings) {
52
+ let result;
53
+ result = await this._listMetrics(resourceGroupName, accountName, targetRegion, filter, options);
54
+ yield result.value || [];
57
55
  }
58
- listMetricsPagingAll(resourceGroupName, accountName, targetRegion, filter, options) {
59
- return __asyncGenerator(this, arguments, function* listMetricsPagingAll_1() {
60
- var _a, e_1, _b, _c;
61
- try {
62
- for (var _d = true, _e = __asyncValues(this.listMetricsPagingPage(resourceGroupName, accountName, targetRegion, filter, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
63
- _c = _f.value;
64
- _d = false;
65
- const page = _c;
66
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
67
- }
68
- }
69
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
70
- finally {
71
- try {
72
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
73
- }
74
- finally { if (e_1) throw e_1.error; }
75
- }
76
- });
56
+ async *listMetricsPagingAll(resourceGroupName, accountName, targetRegion, filter, options) {
57
+ for await (const page of this.listMetricsPagingPage(resourceGroupName, accountName, targetRegion, filter, options)) {
58
+ yield* page;
59
+ }
77
60
  }
78
61
  /**
79
62
  * Retrieves the metrics determined by the given filter for the given account target region. This url
@@ -1 +1 @@
1
- {"version":3,"file":"percentileTarget.js","sourceRoot":"","sources":["../../../src/operations/percentileTarget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,C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AAmD;;;;gBAEnD,KAAyB,eAAA,KAAA,cAAA,IAAI,CAAC,qBAAqB,CACjD,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,OAAO,CACR,CAAA,IAAA,+DAAE,CAAC;oBANqB,cAMxB;oBANwB,WAMxB;oBANU,MAAM,IAAI,KAAA,CAAA;oBAOnB,cAAA,KAAK,CAAC,CAAC,iBAAA,cAAA,IAAI,CAAA,CAAA,CAAA,CAAC;gBACd,CAAC;;;;;;;;;QACH,CAAC;KAAA;IAED;;;;;;;;;;;OAWG;IACK,YAAY,CAClB,iBAAyB,EACzB,WAAmB,EACnB,YAAoB,EACpB,MAAc,EACd,OAAmD;QAEnD,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,EACjE,wBAAwB,CACzB,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,wBAAwB,GAA6B;IACzD,IAAI,EAAE,iLAAiL;IACvL,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC3D,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,YAAY;KACxB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { PercentileTarget } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PercentileMetric,\n PercentileTargetListMetricsOptionalParams,\n PercentileTargetListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing PercentileTarget operations. */\nexport class PercentileTargetImpl implements PercentileTarget {\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class PercentileTarget class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account target region. This url\n * is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PercentileMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PercentileMetric[]> {\n let result: PercentileTargetListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n ): AsyncIterableIterator<PercentileMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account target region. This url\n * is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n ): Promise<PercentileTargetListMetricsResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, accountName, targetRegion, filter, options },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PercentileMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n Parameters.targetRegion,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"percentileTarget.js","sourceRoot":"","sources":["../../../src/operations/percentileTarget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,4CAA4C;AAC5C,oDAAoD;AACpD,MAAM,OAAO,oBAAoB;IACd,MAAM,CAA2B;IAElD;;;OAGG;IACH,YAAY,MAAgC;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;OAWG;IACI,WAAW,CAChB,iBAAyB,EACzB,WAAmB,EACnB,YAAoB,EACpB,MAAc,EACd,OAAmD;QAEnD,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CACpC,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,OAAO,CACR,CAAC;QACF,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,qBAAqB,CAC/B,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,CACT,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,qB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AAU,CAAC,cAAc;QACzB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,WAAW;QACtB,UAAU,CAAC,YAAY;KACxB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { PercentileTarget } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CosmosDBManagementClient } from \"../cosmosDBManagementClient.js\";\nimport {\n PercentileMetric,\n PercentileTargetListMetricsOptionalParams,\n PercentileTargetListMetricsResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing PercentileTarget operations. */\nexport class PercentileTargetImpl implements PercentileTarget {\n private readonly client: CosmosDBManagementClient;\n\n /**\n * Initialize a new instance of the class PercentileTarget class.\n * @param client Reference to the service client\n */\n constructor(client: CosmosDBManagementClient) {\n this.client = client;\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account target region. This url\n * is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n public listMetrics(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n ): PagedAsyncIterableIterator<PercentileMetric> {\n const iter = this.listMetricsPagingAll(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n );\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n settings,\n );\n },\n };\n }\n\n private async *listMetricsPagingPage(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n _settings?: PageSettings,\n ): AsyncIterableIterator<PercentileMetric[]> {\n let result: PercentileTargetListMetricsResponse;\n result = await this._listMetrics(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n );\n yield result.value || [];\n }\n\n private async *listMetricsPagingAll(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n ): AsyncIterableIterator<PercentileMetric> {\n for await (const page of this.listMetricsPagingPage(\n resourceGroupName,\n accountName,\n targetRegion,\n filter,\n options,\n )) {\n yield* page;\n }\n }\n\n /**\n * Retrieves the metrics determined by the given filter for the given account target region. This url\n * is only for PBS and Replication Latency data\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @param accountName Cosmos DB database account name.\n * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between\n * words and each word capitalized.\n * @param filter An OData filter expression that describes a subset of metrics to return. The\n * parameters that can be filtered are name.value (name of the metric, can have an or of multiple\n * names), startTime, endTime, and timeGrain. The supported operator is eq.\n * @param options The options parameters.\n */\n private _listMetrics(\n resourceGroupName: string,\n accountName: string,\n targetRegion: string,\n filter: string,\n options?: PercentileTargetListMetricsOptionalParams,\n ): Promise<PercentileTargetListMetricsResponse> {\n return this.client.sendOperationRequest(\n { resourceGroupName, accountName, targetRegion, filter, options },\n listMetricsOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listMetricsOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PercentileMetricListResult,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.resourceGroupName,\n Parameters.accountName,\n Parameters.targetRegion,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
@@ -14,6 +13,7 @@ import { createLroSpec } from "../lroImpl.js";
14
13
  /// <reference lib="esnext.asynciterable" />
15
14
  /** Class containing PrivateEndpointConnections operations. */
16
15
  export class PrivateEndpointConnectionsImpl {
16
+ client;
17
17
  /**
18
18
  * Initialize a new instance of the class PrivateEndpointConnections class.
19
19
  * @param client Reference to the service client
@@ -37,39 +37,22 @@ export class PrivateEndpointConnectionsImpl {
37
37
  return this;
38
38
  },
39
39
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
40
+ if (settings?.maxPageSize) {
41
41
  throw new Error("maxPageSize is not supported by this operation.");
42
42
  }
43
43
  return this.listByDatabaseAccountPagingPage(resourceGroupName, accountName, options, settings);
44
44
  },
45
45
  };
46
46
  }
47
- listByDatabaseAccountPagingPage(resourceGroupName, accountName, options, _settings) {
48
- return __asyncGenerator(this, arguments, function* listByDatabaseAccountPagingPage_1() {
49
- let result;
50
- result = yield __await(this._listByDatabaseAccount(resourceGroupName, accountName, options));
51
- yield yield __await(result.value || []);
52
- });
47
+ async *listByDatabaseAccountPagingPage(resourceGroupName, accountName, options, _settings) {
48
+ let result;
49
+ result = await this._listByDatabaseAccount(resourceGroupName, accountName, options);
50
+ yield result.value || [];
53
51
  }
54
- listByDatabaseAccountPagingAll(resourceGroupName, accountName, options) {
55
- return __asyncGenerator(this, arguments, function* listByDatabaseAccountPagingAll_1() {
56
- var _a, e_1, _b, _c;
57
- try {
58
- for (var _d = true, _e = __asyncValues(this.listByDatabaseAccountPagingPage(resourceGroupName, accountName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
59
- _c = _f.value;
60
- _d = false;
61
- const page = _c;
62
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
63
- }
64
- }
65
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
66
- finally {
67
- try {
68
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
69
- }
70
- finally { if (e_1) throw e_1.error; }
71
- }
72
- });
52
+ async *listByDatabaseAccountPagingAll(resourceGroupName, accountName, options) {
53
+ for await (const page of this.listByDatabaseAccountPagingPage(resourceGroupName, accountName, options)) {
54
+ yield* page;
55
+ }
73
56
  }
74
57
  /**
75
58
  * List all private endpoint connections on a Cosmos DB account.
@@ -108,14 +91,19 @@ export class PrivateEndpointConnectionsImpl {
108
91
  return this.client.sendOperationRequest(args, spec);
109
92
  };
110
93
  const sendOperationFn = async (args, spec) => {
111
- var _a;
112
94
  let currentRawResponse = undefined;
113
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
95
+ const providedCallback = args.options?.onResponse;
114
96
  const callback = (rawResponse, flatResponse) => {
115
97
  currentRawResponse = rawResponse;
116
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
98
+ providedCallback?.(rawResponse, flatResponse);
99
+ };
100
+ const updatedArgs = {
101
+ ...args,
102
+ options: {
103
+ ...args.options,
104
+ onResponse: callback,
105
+ },
117
106
  };
118
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
119
107
  const flatResponse = await directSendOperation(updatedArgs, spec);
120
108
  return {
121
109
  flatResponse,
@@ -138,8 +126,8 @@ export class PrivateEndpointConnectionsImpl {
138
126
  spec: createOrUpdateOperationSpec,
139
127
  });
140
128
  const poller = await createHttpPoller(lro, {
141
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
142
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
129
+ restoreFrom: options?.resumeFrom,
130
+ intervalInMs: options?.updateIntervalInMs,
143
131
  });
144
132
  await poller.poll();
145
133
  return poller;
@@ -168,14 +156,19 @@ export class PrivateEndpointConnectionsImpl {
168
156
  return this.client.sendOperationRequest(args, spec);
169
157
  };
170
158
  const sendOperationFn = async (args, spec) => {
171
- var _a;
172
159
  let currentRawResponse = undefined;
173
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
160
+ const providedCallback = args.options?.onResponse;
174
161
  const callback = (rawResponse, flatResponse) => {
175
162
  currentRawResponse = rawResponse;
176
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
163
+ providedCallback?.(rawResponse, flatResponse);
164
+ };
165
+ const updatedArgs = {
166
+ ...args,
167
+ options: {
168
+ ...args.options,
169
+ onResponse: callback,
170
+ },
177
171
  };
178
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
179
172
  const flatResponse = await directSendOperation(updatedArgs, spec);
180
173
  return {
181
174
  flatResponse,
@@ -197,8 +190,8 @@ export class PrivateEndpointConnectionsImpl {
197
190
  spec: deleteOperationSpec,
198
191
  });
199
192
  const poller = await createHttpPoller(lro, {
200
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
201
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
193
+ restoreFrom: options?.resumeFrom,
194
+ intervalInMs: options?.updateIntervalInMs,
202
195
  });
203
196
  await poller.poll();
204
197
  return poller;