@azure/arm-billing 2.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +75 -73
  4. package/dist/index.js +10450 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/billingManagementClient.d.ts +37 -0
  9. package/dist-esm/src/billingManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/billingManagementClient.js +70 -0
  11. package/dist-esm/src/billingManagementClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/lroImpl.d.ts +16 -0
  17. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  18. package/dist-esm/src/lroImpl.js +29 -0
  19. package/dist-esm/src/lroImpl.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +3244 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +272 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +86 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/dist-esm/src/models/mappers.js +3514 -0
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +45 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/dist-esm/src/models/parameters.js +374 -0
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/dist-esm/src/operations/address.d.ts +20 -0
  33. package/dist-esm/src/operations/address.d.ts.map +1 -0
  34. package/dist-esm/src/operations/address.js +50 -0
  35. package/dist-esm/src/operations/address.js.map +1 -0
  36. package/dist-esm/src/operations/agreements.d.ts +42 -0
  37. package/dist-esm/src/operations/agreements.d.ts.map +1 -0
  38. package/dist-esm/src/operations/agreements.js +156 -0
  39. package/dist-esm/src/operations/agreements.js.map +1 -0
  40. package/dist-esm/src/operations/availableBalances.d.ts +22 -0
  41. package/dist-esm/src/operations/availableBalances.d.ts.map +1 -0
  42. package/dist-esm/src/operations/availableBalances.js +54 -0
  43. package/dist-esm/src/operations/availableBalances.js.map +1 -0
  44. package/dist-esm/src/operations/billingAccounts.d.ts +79 -0
  45. package/dist-esm/src/operations/billingAccounts.d.ts.map +1 -0
  46. package/dist-esm/src/operations/billingAccounts.js +330 -0
  47. package/dist-esm/src/operations/billingAccounts.js.map +1 -0
  48. package/dist-esm/src/operations/billingPeriods.d.ts +44 -0
  49. package/dist-esm/src/operations/billingPeriods.d.ts.map +1 -0
  50. package/dist-esm/src/operations/billingPeriods.js +168 -0
  51. package/dist-esm/src/operations/billingPeriods.js.map +1 -0
  52. package/dist-esm/src/operations/billingPermissions.d.ts +110 -0
  53. package/dist-esm/src/operations/billingPermissions.d.ts.map +1 -0
  54. package/dist-esm/src/operations/billingPermissions.js +468 -0
  55. package/dist-esm/src/operations/billingPermissions.js.map +1 -0
  56. package/dist-esm/src/operations/billingProfiles.d.ts +64 -0
  57. package/dist-esm/src/operations/billingProfiles.d.ts.map +1 -0
  58. package/dist-esm/src/operations/billingProfiles.js +245 -0
  59. package/dist-esm/src/operations/billingProfiles.js.map +1 -0
  60. package/dist-esm/src/operations/billingPropertyOperations.d.ts +26 -0
  61. package/dist-esm/src/operations/billingPropertyOperations.d.ts.map +1 -0
  62. package/dist-esm/src/operations/billingPropertyOperations.js +74 -0
  63. package/dist-esm/src/operations/billingPropertyOperations.js.map +1 -0
  64. package/dist-esm/src/operations/billingRoleAssignments.d.ts +146 -0
  65. package/dist-esm/src/operations/billingRoleAssignments.d.ts.map +1 -0
  66. package/dist-esm/src/operations/billingRoleAssignments.js +578 -0
  67. package/dist-esm/src/operations/billingRoleAssignments.js.map +1 -0
  68. package/dist-esm/src/operations/billingRoleDefinitions.d.ts +119 -0
  69. package/dist-esm/src/operations/billingRoleDefinitions.d.ts.map +1 -0
  70. package/dist-esm/src/operations/billingRoleDefinitions.js +471 -0
  71. package/dist-esm/src/operations/billingRoleDefinitions.js.map +1 -0
  72. package/dist-esm/src/operations/billingSubscriptions.d.ts +160 -0
  73. package/dist-esm/src/operations/billingSubscriptions.d.ts.map +1 -0
  74. package/dist-esm/src/operations/billingSubscriptions.js +655 -0
  75. package/dist-esm/src/operations/billingSubscriptions.js.map +1 -0
  76. package/dist-esm/src/operations/customers.d.ts +71 -0
  77. package/dist-esm/src/operations/customers.d.ts.map +1 -0
  78. package/dist-esm/src/operations/customers.js +287 -0
  79. package/dist-esm/src/operations/customers.js.map +1 -0
  80. package/dist-esm/src/operations/enrollmentAccounts.d.ts +38 -0
  81. package/dist-esm/src/operations/enrollmentAccounts.d.ts.map +1 -0
  82. package/dist-esm/src/operations/enrollmentAccounts.js +144 -0
  83. package/dist-esm/src/operations/enrollmentAccounts.js.map +1 -0
  84. package/dist-esm/src/operations/index.d.ts +22 -0
  85. package/dist-esm/src/operations/index.d.ts.map +1 -0
  86. package/dist-esm/src/operations/index.js +29 -0
  87. package/dist-esm/src/operations/index.js.map +1 -0
  88. package/dist-esm/src/operations/instructions.d.ts +57 -0
  89. package/dist-esm/src/operations/instructions.d.ts.map +1 -0
  90. package/dist-esm/src/operations/instructions.js +208 -0
  91. package/dist-esm/src/operations/instructions.js.map +1 -0
  92. package/dist-esm/src/operations/invoiceSections.d.ts +70 -0
  93. package/dist-esm/src/operations/invoiceSections.d.ts.map +1 -0
  94. package/dist-esm/src/operations/invoiceSections.js +264 -0
  95. package/dist-esm/src/operations/invoiceSections.js.map +1 -0
  96. package/dist-esm/src/operations/invoices.d.ts +202 -0
  97. package/dist-esm/src/operations/invoices.d.ts.map +1 -0
  98. package/dist-esm/src/operations/invoices.js +817 -0
  99. package/dist-esm/src/operations/invoices.js.map +1 -0
  100. package/dist-esm/src/operations/operations.d.ts +32 -0
  101. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  102. package/dist-esm/src/operations/operations.js +120 -0
  103. package/dist-esm/src/operations/operations.js.map +1 -0
  104. package/dist-esm/src/operations/policies.d.ts +47 -0
  105. package/dist-esm/src/operations/policies.d.ts.map +1 -0
  106. package/dist-esm/src/operations/policies.js +149 -0
  107. package/dist-esm/src/operations/policies.js.map +1 -0
  108. package/dist-esm/src/operations/products.d.ts +160 -0
  109. package/dist-esm/src/operations/products.d.ts.map +1 -0
  110. package/dist-esm/src/operations/products.js +615 -0
  111. package/dist-esm/src/operations/products.js.map +1 -0
  112. package/dist-esm/src/operations/reservations.d.ts +63 -0
  113. package/dist-esm/src/operations/reservations.d.ts.map +1 -0
  114. package/dist-esm/src/operations/reservations.js +265 -0
  115. package/dist-esm/src/operations/reservations.js.map +1 -0
  116. package/dist-esm/src/operations/transactions.d.ts +40 -0
  117. package/dist-esm/src/operations/transactions.d.ts.map +1 -0
  118. package/dist-esm/src/operations/transactions.js +137 -0
  119. package/dist-esm/src/operations/transactions.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/address.d.ts +12 -0
  121. package/dist-esm/src/operationsInterfaces/address.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/address.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/address.js.map +1 -0
  124. package/dist-esm/src/operationsInterfaces/agreements.d.ts +19 -0
  125. package/dist-esm/src/operationsInterfaces/agreements.d.ts.map +1 -0
  126. package/dist-esm/src/operationsInterfaces/agreements.js +9 -0
  127. package/dist-esm/src/operationsInterfaces/agreements.js.map +1 -0
  128. package/dist-esm/src/operationsInterfaces/availableBalances.d.ts +14 -0
  129. package/dist-esm/src/operationsInterfaces/availableBalances.d.ts.map +1 -0
  130. package/dist-esm/src/operationsInterfaces/availableBalances.js +9 -0
  131. package/dist-esm/src/operationsInterfaces/availableBalances.js.map +1 -0
  132. package/dist-esm/src/operationsInterfaces/billingAccounts.d.ts +41 -0
  133. package/dist-esm/src/operationsInterfaces/billingAccounts.d.ts.map +1 -0
  134. package/dist-esm/src/operationsInterfaces/billingAccounts.js +9 -0
  135. package/dist-esm/src/operationsInterfaces/billingAccounts.js.map +1 -0
  136. package/dist-esm/src/operationsInterfaces/billingPeriods.d.ts +21 -0
  137. package/dist-esm/src/operationsInterfaces/billingPeriods.d.ts.map +1 -0
  138. package/dist-esm/src/operationsInterfaces/billingPeriods.js +9 -0
  139. package/dist-esm/src/operationsInterfaces/billingPeriods.js.map +1 -0
  140. package/dist-esm/src/operationsInterfaces/billingPermissions.d.ts +34 -0
  141. package/dist-esm/src/operationsInterfaces/billingPermissions.d.ts.map +1 -0
  142. package/dist-esm/src/operationsInterfaces/billingPermissions.js +9 -0
  143. package/dist-esm/src/operationsInterfaces/billingPermissions.js.map +1 -0
  144. package/dist-esm/src/operationsInterfaces/billingProfiles.d.ts +40 -0
  145. package/dist-esm/src/operationsInterfaces/billingProfiles.d.ts.map +1 -0
  146. package/dist-esm/src/operationsInterfaces/billingProfiles.js +9 -0
  147. package/dist-esm/src/operationsInterfaces/billingProfiles.js.map +1 -0
  148. package/dist-esm/src/operationsInterfaces/billingPropertyOperations.d.ts +18 -0
  149. package/dist-esm/src/operationsInterfaces/billingPropertyOperations.d.ts.map +1 -0
  150. package/dist-esm/src/operationsInterfaces/billingPropertyOperations.js +9 -0
  151. package/dist-esm/src/operationsInterfaces/billingPropertyOperations.js.map +1 -0
  152. package/dist-esm/src/operationsInterfaces/billingRoleAssignments.d.ts +84 -0
  153. package/dist-esm/src/operationsInterfaces/billingRoleAssignments.d.ts.map +1 -0
  154. package/dist-esm/src/operationsInterfaces/billingRoleAssignments.js +9 -0
  155. package/dist-esm/src/operationsInterfaces/billingRoleAssignments.js.map +1 -0
  156. package/dist-esm/src/operationsInterfaces/billingRoleDefinitions.d.ts +57 -0
  157. package/dist-esm/src/operationsInterfaces/billingRoleDefinitions.d.ts.map +1 -0
  158. package/dist-esm/src/operationsInterfaces/billingRoleDefinitions.js +9 -0
  159. package/dist-esm/src/operationsInterfaces/billingRoleDefinitions.js.map +1 -0
  160. package/dist-esm/src/operationsInterfaces/billingSubscriptions.d.ts +80 -0
  161. package/dist-esm/src/operationsInterfaces/billingSubscriptions.d.ts.map +1 -0
  162. package/dist-esm/src/operationsInterfaces/billingSubscriptions.js +9 -0
  163. package/dist-esm/src/operationsInterfaces/billingSubscriptions.js.map +1 -0
  164. package/dist-esm/src/operationsInterfaces/customers.d.ts +29 -0
  165. package/dist-esm/src/operationsInterfaces/customers.d.ts.map +1 -0
  166. package/dist-esm/src/operationsInterfaces/customers.js +9 -0
  167. package/dist-esm/src/operationsInterfaces/customers.js.map +1 -0
  168. package/dist-esm/src/operationsInterfaces/enrollmentAccounts.d.ts +17 -0
  169. package/dist-esm/src/operationsInterfaces/enrollmentAccounts.d.ts.map +1 -0
  170. package/dist-esm/src/operationsInterfaces/enrollmentAccounts.js +9 -0
  171. package/dist-esm/src/operationsInterfaces/enrollmentAccounts.js.map +1 -0
  172. package/dist-esm/src/operationsInterfaces/index.d.ts +22 -0
  173. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  174. package/dist-esm/src/operationsInterfaces/index.js +29 -0
  175. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  176. package/dist-esm/src/operationsInterfaces/instructions.d.ts +32 -0
  177. package/dist-esm/src/operationsInterfaces/instructions.d.ts.map +1 -0
  178. package/dist-esm/src/operationsInterfaces/instructions.js +9 -0
  179. package/dist-esm/src/operationsInterfaces/instructions.js.map +1 -0
  180. package/dist-esm/src/operationsInterfaces/invoiceSections.d.ts +44 -0
  181. package/dist-esm/src/operationsInterfaces/invoiceSections.d.ts.map +1 -0
  182. package/dist-esm/src/operationsInterfaces/invoiceSections.js +9 -0
  183. package/dist-esm/src/operationsInterfaces/invoiceSections.js.map +1 -0
  184. package/dist-esm/src/operationsInterfaces/invoices.d.ts +124 -0
  185. package/dist-esm/src/operationsInterfaces/invoices.d.ts.map +1 -0
  186. package/dist-esm/src/operationsInterfaces/invoices.js +9 -0
  187. package/dist-esm/src/operationsInterfaces/invoices.js.map +1 -0
  188. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  189. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  190. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  191. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  192. package/dist-esm/src/operationsInterfaces/policies.d.ts +39 -0
  193. package/dist-esm/src/operationsInterfaces/policies.d.ts.map +1 -0
  194. package/dist-esm/src/operationsInterfaces/policies.js +9 -0
  195. package/dist-esm/src/operationsInterfaces/policies.js.map +1 -0
  196. package/dist-esm/src/operationsInterfaces/products.d.ts +78 -0
  197. package/dist-esm/src/operationsInterfaces/products.d.ts.map +1 -0
  198. package/dist-esm/src/operationsInterfaces/products.js +9 -0
  199. package/dist-esm/src/operationsInterfaces/products.js.map +1 -0
  200. package/dist-esm/src/operationsInterfaces/reservations.d.ts +21 -0
  201. package/dist-esm/src/operationsInterfaces/reservations.d.ts.map +1 -0
  202. package/dist-esm/src/operationsInterfaces/reservations.js +9 -0
  203. package/dist-esm/src/operationsInterfaces/reservations.js.map +1 -0
  204. package/dist-esm/src/operationsInterfaces/transactions.d.ts +14 -0
  205. package/dist-esm/src/operationsInterfaces/transactions.d.ts.map +1 -0
  206. package/dist-esm/src/operationsInterfaces/transactions.js +9 -0
  207. package/dist-esm/src/operationsInterfaces/transactions.js.map +1 -0
  208. package/dist-esm/test/sampleTest.d.ts +2 -0
  209. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  210. package/dist-esm/test/sampleTest.js +40 -0
  211. package/dist-esm/test/sampleTest.js.map +1 -0
  212. package/package.json +70 -34
  213. package/review/arm-billing.api.md +2361 -0
  214. package/rollup.config.js +184 -27
  215. package/src/billingManagementClient.ts +157 -0
  216. package/src/index.ts +12 -0
  217. package/src/lroImpl.ts +34 -0
  218. package/src/models/index.ts +3657 -0
  219. package/src/models/mappers.ts +3839 -0
  220. package/src/models/parameters.ts +435 -0
  221. package/src/operations/address.ts +68 -0
  222. package/src/operations/agreements.ts +203 -0
  223. package/src/operations/availableBalances.ts +73 -0
  224. package/src/operations/billingAccounts.ts +433 -0
  225. package/src/operations/billingPeriods.ts +196 -0
  226. package/src/operations/billingPermissions.ts +643 -0
  227. package/src/operations/billingProfiles.ts +334 -0
  228. package/src/operations/billingPropertyOperations.ts +100 -0
  229. package/src/operations/billingRoleAssignments.ts +782 -0
  230. package/src/operations/billingRoleDefinitions.ts +639 -0
  231. package/src/operations/billingSubscriptions.ts +902 -0
  232. package/src/operations/customers.ts +377 -0
  233. package/src/operations/enrollmentAccounts.ts +170 -0
  234. package/src/operations/index.ts +29 -0
  235. package/src/operations/instructions.ts +285 -0
  236. package/src/operations/invoiceSections.ts +373 -0
  237. package/src/operations/invoices.ts +1176 -0
  238. package/src/operations/operations.ts +137 -0
  239. package/src/operations/policies.ts +205 -0
  240. package/src/operations/products.ts +838 -0
  241. package/src/operations/reservations.ts +344 -0
  242. package/src/operations/transactions.ts +189 -0
  243. package/src/operationsInterfaces/address.ts +27 -0
  244. package/src/operationsInterfaces/agreements.ts +40 -0
  245. package/src/operationsInterfaces/availableBalances.ts +29 -0
  246. package/src/operationsInterfaces/billingAccounts.ts +81 -0
  247. package/src/operationsInterfaces/billingPeriods.ts +40 -0
  248. package/src/operationsInterfaces/billingPermissions.ts +65 -0
  249. package/src/operationsInterfaces/billingProfiles.ts +78 -0
  250. package/src/operationsInterfaces/billingPropertyOperations.ts +37 -0
  251. package/src/operationsInterfaces/billingRoleAssignments.ts +152 -0
  252. package/src/operationsInterfaces/billingRoleDefinitions.ts +104 -0
  253. package/src/operationsInterfaces/billingSubscriptions.ts +144 -0
  254. package/src/operationsInterfaces/customers.ts +55 -0
  255. package/src/operationsInterfaces/enrollmentAccounts.ts +36 -0
  256. package/src/operationsInterfaces/index.ts +29 -0
  257. package/src/operationsInterfaces/instructions.ts +63 -0
  258. package/src/operationsInterfaces/invoiceSections.ts +86 -0
  259. package/src/operationsInterfaces/invoices.ts +233 -0
  260. package/src/operationsInterfaces/operations.ts +22 -0
  261. package/src/operationsInterfaces/policies.ts +76 -0
  262. package/src/operationsInterfaces/products.ts +137 -0
  263. package/src/operationsInterfaces/reservations.ts +41 -0
  264. package/src/operationsInterfaces/transactions.ts +30 -0
  265. package/tsconfig.json +4 -4
  266. package/types/arm-billing.d.ts +4451 -0
  267. package/types/tsdoc-metadata.json +11 -0
  268. package/dist/arm-billing.js +0 -1188
  269. package/dist/arm-billing.js.map +0 -1
  270. package/dist/arm-billing.min.js +0 -1
  271. package/dist/arm-billing.min.js.map +0 -1
  272. package/esm/billingManagementClient.d.ts +0 -21
  273. package/esm/billingManagementClient.d.ts.map +0 -1
  274. package/esm/billingManagementClient.js +0 -36
  275. package/esm/billingManagementClient.js.map +0 -1
  276. package/esm/billingManagementClientContext.d.ts +0 -16
  277. package/esm/billingManagementClientContext.d.ts.map +0 -1
  278. package/esm/billingManagementClientContext.js +0 -56
  279. package/esm/billingManagementClientContext.js.map +0 -1
  280. package/esm/models/billingPeriodsMappers.d.ts +0 -2
  281. package/esm/models/billingPeriodsMappers.d.ts.map +0 -1
  282. package/esm/models/billingPeriodsMappers.js +0 -11
  283. package/esm/models/billingPeriodsMappers.js.map +0 -1
  284. package/esm/models/enrollmentAccountsMappers.d.ts +0 -2
  285. package/esm/models/enrollmentAccountsMappers.d.ts.map +0 -1
  286. package/esm/models/enrollmentAccountsMappers.js +0 -11
  287. package/esm/models/enrollmentAccountsMappers.js.map +0 -1
  288. package/esm/models/index.d.ts +0 -573
  289. package/esm/models/index.d.ts.map +0 -1
  290. package/esm/models/index.js +0 -10
  291. package/esm/models/index.js.map +0 -1
  292. package/esm/models/invoicesMappers.d.ts +0 -2
  293. package/esm/models/invoicesMappers.d.ts.map +0 -1
  294. package/esm/models/invoicesMappers.js +0 -11
  295. package/esm/models/invoicesMappers.js.map +0 -1
  296. package/esm/models/mappers.d.ts +0 -17
  297. package/esm/models/mappers.d.ts.map +0 -1
  298. package/esm/models/mappers.js +0 -364
  299. package/esm/models/mappers.js.map +0 -1
  300. package/esm/models/operationsMappers.d.ts +0 -2
  301. package/esm/models/operationsMappers.d.ts.map +0 -1
  302. package/esm/models/operationsMappers.js +0 -11
  303. package/esm/models/operationsMappers.js.map +0 -1
  304. package/esm/models/parameters.d.ts +0 -13
  305. package/esm/models/parameters.d.ts.map +0 -1
  306. package/esm/models/parameters.js +0 -133
  307. package/esm/models/parameters.js.map +0 -1
  308. package/esm/operations/billingPeriods.d.ts +0 -70
  309. package/esm/operations/billingPeriods.d.ts.map +0 -1
  310. package/esm/operations/billingPeriods.js +0 -112
  311. package/esm/operations/billingPeriods.js.map +0 -1
  312. package/esm/operations/enrollmentAccounts.d.ts +0 -64
  313. package/esm/operations/enrollmentAccounts.d.ts.map +0 -1
  314. package/esm/operations/enrollmentAccounts.js +0 -105
  315. package/esm/operations/enrollmentAccounts.js.map +0 -1
  316. package/esm/operations/index.d.ts +0 -5
  317. package/esm/operations/index.d.ts.map +0 -1
  318. package/esm/operations/index.js +0 -14
  319. package/esm/operations/index.js.map +0 -1
  320. package/esm/operations/invoices.d.ts +0 -93
  321. package/esm/operations/invoices.d.ts.map +0 -1
  322. package/esm/operations/invoices.js +0 -140
  323. package/esm/operations/invoices.js.map +0 -1
  324. package/esm/operations/operations.d.ts +0 -46
  325. package/esm/operations/operations.d.ts.map +0 -1
  326. package/esm/operations/operations.js +0 -77
  327. package/esm/operations/operations.js.map +0 -1
  328. package/lib/billingManagementClient.ts +0 -48
  329. package/lib/billingManagementClientContext.ts +0 -62
  330. package/lib/models/billingPeriodsMappers.ts +0 -22
  331. package/lib/models/enrollmentAccountsMappers.ts +0 -22
  332. package/lib/models/index.ts +0 -613
  333. package/lib/models/invoicesMappers.ts +0 -22
  334. package/lib/models/mappers.ts +0 -392
  335. package/lib/models/operationsMappers.ts +0 -18
  336. package/lib/models/parameters.ts +0 -135
  337. package/lib/operations/billingPeriods.ts +0 -187
  338. package/lib/operations/enrollmentAccounts.ts +0 -174
  339. package/lib/operations/index.ts +0 -14
  340. package/lib/operations/invoices.ts +0 -243
  341. package/lib/operations/operations.ts +0 -123
@@ -0,0 +1,1176 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Invoices } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { BillingManagementClient } from "../billingManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ Invoice,
19
+ InvoicesListByBillingAccountNextOptionalParams,
20
+ InvoicesListByBillingAccountOptionalParams,
21
+ InvoicesListByBillingProfileNextOptionalParams,
22
+ InvoicesListByBillingProfileOptionalParams,
23
+ InvoicesListByBillingSubscriptionNextOptionalParams,
24
+ InvoicesListByBillingSubscriptionOptionalParams,
25
+ InvoicesListByBillingAccountResponse,
26
+ InvoicesListByBillingProfileResponse,
27
+ InvoicesGetOptionalParams,
28
+ InvoicesGetResponse,
29
+ InvoicesGetByIdOptionalParams,
30
+ InvoicesGetByIdResponse,
31
+ InvoicesDownloadInvoiceOptionalParams,
32
+ InvoicesDownloadInvoiceResponse,
33
+ InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams,
34
+ InvoicesDownloadMultipleBillingProfileInvoicesResponse,
35
+ InvoicesListByBillingSubscriptionResponse,
36
+ InvoicesGetBySubscriptionAndInvoiceIdOptionalParams,
37
+ InvoicesGetBySubscriptionAndInvoiceIdResponse,
38
+ InvoicesDownloadBillingSubscriptionInvoiceOptionalParams,
39
+ InvoicesDownloadBillingSubscriptionInvoiceResponse,
40
+ InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams,
41
+ InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse,
42
+ InvoicesListByBillingAccountNextResponse,
43
+ InvoicesListByBillingProfileNextResponse,
44
+ InvoicesListByBillingSubscriptionNextResponse
45
+ } from "../models";
46
+
47
+ /// <reference lib="esnext.asynciterable" />
48
+ /** Class containing Invoices operations. */
49
+ export class InvoicesImpl implements Invoices {
50
+ private readonly client: BillingManagementClient;
51
+
52
+ /**
53
+ * Initialize a new instance of the class Invoices class.
54
+ * @param client Reference to the service client
55
+ */
56
+ constructor(client: BillingManagementClient) {
57
+ this.client = client;
58
+ }
59
+
60
+ /**
61
+ * Lists the invoices for a billing account for a given start date and end date. The operation is
62
+ * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
63
+ * Agreement.
64
+ * @param billingAccountName The ID that uniquely identifies a billing account.
65
+ * @param periodStartDate The start date to fetch the invoices. The date should be specified in
66
+ * MM-DD-YYYY format.
67
+ * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY
68
+ * format.
69
+ * @param options The options parameters.
70
+ */
71
+ public listByBillingAccount(
72
+ billingAccountName: string,
73
+ periodStartDate: string,
74
+ periodEndDate: string,
75
+ options?: InvoicesListByBillingAccountOptionalParams
76
+ ): PagedAsyncIterableIterator<Invoice> {
77
+ const iter = this.listByBillingAccountPagingAll(
78
+ billingAccountName,
79
+ periodStartDate,
80
+ periodEndDate,
81
+ options
82
+ );
83
+ return {
84
+ next() {
85
+ return iter.next();
86
+ },
87
+ [Symbol.asyncIterator]() {
88
+ return this;
89
+ },
90
+ byPage: () => {
91
+ return this.listByBillingAccountPagingPage(
92
+ billingAccountName,
93
+ periodStartDate,
94
+ periodEndDate,
95
+ options
96
+ );
97
+ }
98
+ };
99
+ }
100
+
101
+ private async *listByBillingAccountPagingPage(
102
+ billingAccountName: string,
103
+ periodStartDate: string,
104
+ periodEndDate: string,
105
+ options?: InvoicesListByBillingAccountOptionalParams
106
+ ): AsyncIterableIterator<Invoice[]> {
107
+ let result = await this._listByBillingAccount(
108
+ billingAccountName,
109
+ periodStartDate,
110
+ periodEndDate,
111
+ options
112
+ );
113
+ yield result.value || [];
114
+ let continuationToken = result.nextLink;
115
+ while (continuationToken) {
116
+ result = await this._listByBillingAccountNext(
117
+ billingAccountName,
118
+ periodStartDate,
119
+ periodEndDate,
120
+ continuationToken,
121
+ options
122
+ );
123
+ continuationToken = result.nextLink;
124
+ yield result.value || [];
125
+ }
126
+ }
127
+
128
+ private async *listByBillingAccountPagingAll(
129
+ billingAccountName: string,
130
+ periodStartDate: string,
131
+ periodEndDate: string,
132
+ options?: InvoicesListByBillingAccountOptionalParams
133
+ ): AsyncIterableIterator<Invoice> {
134
+ for await (const page of this.listByBillingAccountPagingPage(
135
+ billingAccountName,
136
+ periodStartDate,
137
+ periodEndDate,
138
+ options
139
+ )) {
140
+ yield* page;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Lists the invoices for a billing profile for a given start date and end date. The operation is
146
+ * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
147
+ * Agreement.
148
+ * @param billingAccountName The ID that uniquely identifies a billing account.
149
+ * @param billingProfileName The ID that uniquely identifies a billing profile.
150
+ * @param periodStartDate The start date to fetch the invoices. The date should be specified in
151
+ * MM-DD-YYYY format.
152
+ * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY
153
+ * format.
154
+ * @param options The options parameters.
155
+ */
156
+ public listByBillingProfile(
157
+ billingAccountName: string,
158
+ billingProfileName: string,
159
+ periodStartDate: string,
160
+ periodEndDate: string,
161
+ options?: InvoicesListByBillingProfileOptionalParams
162
+ ): PagedAsyncIterableIterator<Invoice> {
163
+ const iter = this.listByBillingProfilePagingAll(
164
+ billingAccountName,
165
+ billingProfileName,
166
+ periodStartDate,
167
+ periodEndDate,
168
+ options
169
+ );
170
+ return {
171
+ next() {
172
+ return iter.next();
173
+ },
174
+ [Symbol.asyncIterator]() {
175
+ return this;
176
+ },
177
+ byPage: () => {
178
+ return this.listByBillingProfilePagingPage(
179
+ billingAccountName,
180
+ billingProfileName,
181
+ periodStartDate,
182
+ periodEndDate,
183
+ options
184
+ );
185
+ }
186
+ };
187
+ }
188
+
189
+ private async *listByBillingProfilePagingPage(
190
+ billingAccountName: string,
191
+ billingProfileName: string,
192
+ periodStartDate: string,
193
+ periodEndDate: string,
194
+ options?: InvoicesListByBillingProfileOptionalParams
195
+ ): AsyncIterableIterator<Invoice[]> {
196
+ let result = await this._listByBillingProfile(
197
+ billingAccountName,
198
+ billingProfileName,
199
+ periodStartDate,
200
+ periodEndDate,
201
+ options
202
+ );
203
+ yield result.value || [];
204
+ let continuationToken = result.nextLink;
205
+ while (continuationToken) {
206
+ result = await this._listByBillingProfileNext(
207
+ billingAccountName,
208
+ billingProfileName,
209
+ periodStartDate,
210
+ periodEndDate,
211
+ continuationToken,
212
+ options
213
+ );
214
+ continuationToken = result.nextLink;
215
+ yield result.value || [];
216
+ }
217
+ }
218
+
219
+ private async *listByBillingProfilePagingAll(
220
+ billingAccountName: string,
221
+ billingProfileName: string,
222
+ periodStartDate: string,
223
+ periodEndDate: string,
224
+ options?: InvoicesListByBillingProfileOptionalParams
225
+ ): AsyncIterableIterator<Invoice> {
226
+ for await (const page of this.listByBillingProfilePagingPage(
227
+ billingAccountName,
228
+ billingProfileName,
229
+ periodStartDate,
230
+ periodEndDate,
231
+ options
232
+ )) {
233
+ yield* page;
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Lists the invoices for a subscription.
239
+ * @param periodStartDate Invoice period start date.
240
+ * @param periodEndDate Invoice period end date.
241
+ * @param options The options parameters.
242
+ */
243
+ public listByBillingSubscription(
244
+ periodStartDate: string,
245
+ periodEndDate: string,
246
+ options?: InvoicesListByBillingSubscriptionOptionalParams
247
+ ): PagedAsyncIterableIterator<Invoice> {
248
+ const iter = this.listByBillingSubscriptionPagingAll(
249
+ periodStartDate,
250
+ periodEndDate,
251
+ options
252
+ );
253
+ return {
254
+ next() {
255
+ return iter.next();
256
+ },
257
+ [Symbol.asyncIterator]() {
258
+ return this;
259
+ },
260
+ byPage: () => {
261
+ return this.listByBillingSubscriptionPagingPage(
262
+ periodStartDate,
263
+ periodEndDate,
264
+ options
265
+ );
266
+ }
267
+ };
268
+ }
269
+
270
+ private async *listByBillingSubscriptionPagingPage(
271
+ periodStartDate: string,
272
+ periodEndDate: string,
273
+ options?: InvoicesListByBillingSubscriptionOptionalParams
274
+ ): AsyncIterableIterator<Invoice[]> {
275
+ let result = await this._listByBillingSubscription(
276
+ periodStartDate,
277
+ periodEndDate,
278
+ options
279
+ );
280
+ yield result.value || [];
281
+ let continuationToken = result.nextLink;
282
+ while (continuationToken) {
283
+ result = await this._listByBillingSubscriptionNext(
284
+ periodStartDate,
285
+ periodEndDate,
286
+ continuationToken,
287
+ options
288
+ );
289
+ continuationToken = result.nextLink;
290
+ yield result.value || [];
291
+ }
292
+ }
293
+
294
+ private async *listByBillingSubscriptionPagingAll(
295
+ periodStartDate: string,
296
+ periodEndDate: string,
297
+ options?: InvoicesListByBillingSubscriptionOptionalParams
298
+ ): AsyncIterableIterator<Invoice> {
299
+ for await (const page of this.listByBillingSubscriptionPagingPage(
300
+ periodStartDate,
301
+ periodEndDate,
302
+ options
303
+ )) {
304
+ yield* page;
305
+ }
306
+ }
307
+
308
+ /**
309
+ * Lists the invoices for a billing account for a given start date and end date. The operation is
310
+ * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
311
+ * Agreement.
312
+ * @param billingAccountName The ID that uniquely identifies a billing account.
313
+ * @param periodStartDate The start date to fetch the invoices. The date should be specified in
314
+ * MM-DD-YYYY format.
315
+ * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY
316
+ * format.
317
+ * @param options The options parameters.
318
+ */
319
+ private _listByBillingAccount(
320
+ billingAccountName: string,
321
+ periodStartDate: string,
322
+ periodEndDate: string,
323
+ options?: InvoicesListByBillingAccountOptionalParams
324
+ ): Promise<InvoicesListByBillingAccountResponse> {
325
+ return this.client.sendOperationRequest(
326
+ { billingAccountName, periodStartDate, periodEndDate, options },
327
+ listByBillingAccountOperationSpec
328
+ );
329
+ }
330
+
331
+ /**
332
+ * Lists the invoices for a billing profile for a given start date and end date. The operation is
333
+ * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer
334
+ * Agreement.
335
+ * @param billingAccountName The ID that uniquely identifies a billing account.
336
+ * @param billingProfileName The ID that uniquely identifies a billing profile.
337
+ * @param periodStartDate The start date to fetch the invoices. The date should be specified in
338
+ * MM-DD-YYYY format.
339
+ * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY
340
+ * format.
341
+ * @param options The options parameters.
342
+ */
343
+ private _listByBillingProfile(
344
+ billingAccountName: string,
345
+ billingProfileName: string,
346
+ periodStartDate: string,
347
+ periodEndDate: string,
348
+ options?: InvoicesListByBillingProfileOptionalParams
349
+ ): Promise<InvoicesListByBillingProfileResponse> {
350
+ return this.client.sendOperationRequest(
351
+ {
352
+ billingAccountName,
353
+ billingProfileName,
354
+ periodStartDate,
355
+ periodEndDate,
356
+ options
357
+ },
358
+ listByBillingProfileOperationSpec
359
+ );
360
+ }
361
+
362
+ /**
363
+ * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with
364
+ * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
365
+ * @param billingAccountName The ID that uniquely identifies a billing account.
366
+ * @param invoiceName The ID that uniquely identifies an invoice.
367
+ * @param options The options parameters.
368
+ */
369
+ get(
370
+ billingAccountName: string,
371
+ invoiceName: string,
372
+ options?: InvoicesGetOptionalParams
373
+ ): Promise<InvoicesGetResponse> {
374
+ return this.client.sendOperationRequest(
375
+ { billingAccountName, invoiceName, options },
376
+ getOperationSpec
377
+ );
378
+ }
379
+
380
+ /**
381
+ * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft
382
+ * Partner Agreement or Microsoft Customer Agreement.
383
+ * @param invoiceName The ID that uniquely identifies an invoice.
384
+ * @param options The options parameters.
385
+ */
386
+ getById(
387
+ invoiceName: string,
388
+ options?: InvoicesGetByIdOptionalParams
389
+ ): Promise<InvoicesGetByIdResponse> {
390
+ return this.client.sendOperationRequest(
391
+ { invoiceName, options },
392
+ getByIdOperationSpec
393
+ );
394
+ }
395
+
396
+ /**
397
+ * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement
398
+ * type Microsoft Partner Agreement or Microsoft Customer Agreement.
399
+ * @param billingAccountName The ID that uniquely identifies a billing account.
400
+ * @param invoiceName The ID that uniquely identifies an invoice.
401
+ * @param downloadToken Download token with document source and document ID.
402
+ * @param options The options parameters.
403
+ */
404
+ async beginDownloadInvoice(
405
+ billingAccountName: string,
406
+ invoiceName: string,
407
+ downloadToken: string,
408
+ options?: InvoicesDownloadInvoiceOptionalParams
409
+ ): Promise<
410
+ PollerLike<
411
+ PollOperationState<InvoicesDownloadInvoiceResponse>,
412
+ InvoicesDownloadInvoiceResponse
413
+ >
414
+ > {
415
+ const directSendOperation = async (
416
+ args: coreClient.OperationArguments,
417
+ spec: coreClient.OperationSpec
418
+ ): Promise<InvoicesDownloadInvoiceResponse> => {
419
+ return this.client.sendOperationRequest(args, spec);
420
+ };
421
+ const sendOperation = async (
422
+ args: coreClient.OperationArguments,
423
+ spec: coreClient.OperationSpec
424
+ ) => {
425
+ let currentRawResponse:
426
+ | coreClient.FullOperationResponse
427
+ | undefined = undefined;
428
+ const providedCallback = args.options?.onResponse;
429
+ const callback: coreClient.RawResponseCallback = (
430
+ rawResponse: coreClient.FullOperationResponse,
431
+ flatResponse: unknown
432
+ ) => {
433
+ currentRawResponse = rawResponse;
434
+ providedCallback?.(rawResponse, flatResponse);
435
+ };
436
+ const updatedArgs = {
437
+ ...args,
438
+ options: {
439
+ ...args.options,
440
+ onResponse: callback
441
+ }
442
+ };
443
+ const flatResponse = await directSendOperation(updatedArgs, spec);
444
+ return {
445
+ flatResponse,
446
+ rawResponse: {
447
+ statusCode: currentRawResponse!.status,
448
+ body: currentRawResponse!.parsedBody,
449
+ headers: currentRawResponse!.headers.toJSON()
450
+ }
451
+ };
452
+ };
453
+
454
+ const lro = new LroImpl(
455
+ sendOperation,
456
+ { billingAccountName, invoiceName, downloadToken, options },
457
+ downloadInvoiceOperationSpec
458
+ );
459
+ return new LroEngine(lro, {
460
+ resumeFrom: options?.resumeFrom,
461
+ intervalInMs: options?.updateIntervalInMs,
462
+ lroResourceLocationConfig: "location"
463
+ });
464
+ }
465
+
466
+ /**
467
+ * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement
468
+ * type Microsoft Partner Agreement or Microsoft Customer Agreement.
469
+ * @param billingAccountName The ID that uniquely identifies a billing account.
470
+ * @param invoiceName The ID that uniquely identifies an invoice.
471
+ * @param downloadToken Download token with document source and document ID.
472
+ * @param options The options parameters.
473
+ */
474
+ async beginDownloadInvoiceAndWait(
475
+ billingAccountName: string,
476
+ invoiceName: string,
477
+ downloadToken: string,
478
+ options?: InvoicesDownloadInvoiceOptionalParams
479
+ ): Promise<InvoicesDownloadInvoiceResponse> {
480
+ const poller = await this.beginDownloadInvoice(
481
+ billingAccountName,
482
+ invoiceName,
483
+ downloadToken,
484
+ options
485
+ );
486
+ return poller.pollUntilDone();
487
+ }
488
+
489
+ /**
490
+ * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip
491
+ * file. The operation is supported for billing accounts with agreement type Microsoft Partner
492
+ * Agreement or Microsoft Customer Agreement.
493
+ * @param billingAccountName The ID that uniquely identifies a billing account.
494
+ * @param downloadUrls An array of download urls for individual documents
495
+ * @param options The options parameters.
496
+ */
497
+ async beginDownloadMultipleBillingProfileInvoices(
498
+ billingAccountName: string,
499
+ downloadUrls: string[],
500
+ options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams
501
+ ): Promise<
502
+ PollerLike<
503
+ PollOperationState<
504
+ InvoicesDownloadMultipleBillingProfileInvoicesResponse
505
+ >,
506
+ InvoicesDownloadMultipleBillingProfileInvoicesResponse
507
+ >
508
+ > {
509
+ const directSendOperation = async (
510
+ args: coreClient.OperationArguments,
511
+ spec: coreClient.OperationSpec
512
+ ): Promise<InvoicesDownloadMultipleBillingProfileInvoicesResponse> => {
513
+ return this.client.sendOperationRequest(args, spec);
514
+ };
515
+ const sendOperation = async (
516
+ args: coreClient.OperationArguments,
517
+ spec: coreClient.OperationSpec
518
+ ) => {
519
+ let currentRawResponse:
520
+ | coreClient.FullOperationResponse
521
+ | undefined = undefined;
522
+ const providedCallback = args.options?.onResponse;
523
+ const callback: coreClient.RawResponseCallback = (
524
+ rawResponse: coreClient.FullOperationResponse,
525
+ flatResponse: unknown
526
+ ) => {
527
+ currentRawResponse = rawResponse;
528
+ providedCallback?.(rawResponse, flatResponse);
529
+ };
530
+ const updatedArgs = {
531
+ ...args,
532
+ options: {
533
+ ...args.options,
534
+ onResponse: callback
535
+ }
536
+ };
537
+ const flatResponse = await directSendOperation(updatedArgs, spec);
538
+ return {
539
+ flatResponse,
540
+ rawResponse: {
541
+ statusCode: currentRawResponse!.status,
542
+ body: currentRawResponse!.parsedBody,
543
+ headers: currentRawResponse!.headers.toJSON()
544
+ }
545
+ };
546
+ };
547
+
548
+ const lro = new LroImpl(
549
+ sendOperation,
550
+ { billingAccountName, downloadUrls, options },
551
+ downloadMultipleBillingProfileInvoicesOperationSpec
552
+ );
553
+ return new LroEngine(lro, {
554
+ resumeFrom: options?.resumeFrom,
555
+ intervalInMs: options?.updateIntervalInMs,
556
+ lroResourceLocationConfig: "location"
557
+ });
558
+ }
559
+
560
+ /**
561
+ * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip
562
+ * file. The operation is supported for billing accounts with agreement type Microsoft Partner
563
+ * Agreement or Microsoft Customer Agreement.
564
+ * @param billingAccountName The ID that uniquely identifies a billing account.
565
+ * @param downloadUrls An array of download urls for individual documents
566
+ * @param options The options parameters.
567
+ */
568
+ async beginDownloadMultipleBillingProfileInvoicesAndWait(
569
+ billingAccountName: string,
570
+ downloadUrls: string[],
571
+ options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams
572
+ ): Promise<InvoicesDownloadMultipleBillingProfileInvoicesResponse> {
573
+ const poller = await this.beginDownloadMultipleBillingProfileInvoices(
574
+ billingAccountName,
575
+ downloadUrls,
576
+ options
577
+ );
578
+ return poller.pollUntilDone();
579
+ }
580
+
581
+ /**
582
+ * Lists the invoices for a subscription.
583
+ * @param periodStartDate Invoice period start date.
584
+ * @param periodEndDate Invoice period end date.
585
+ * @param options The options parameters.
586
+ */
587
+ private _listByBillingSubscription(
588
+ periodStartDate: string,
589
+ periodEndDate: string,
590
+ options?: InvoicesListByBillingSubscriptionOptionalParams
591
+ ): Promise<InvoicesListByBillingSubscriptionResponse> {
592
+ return this.client.sendOperationRequest(
593
+ { periodStartDate, periodEndDate, options },
594
+ listByBillingSubscriptionOperationSpec
595
+ );
596
+ }
597
+
598
+ /**
599
+ * Gets an invoice by subscription ID and invoice ID.
600
+ * @param invoiceName The ID that uniquely identifies an invoice.
601
+ * @param options The options parameters.
602
+ */
603
+ getBySubscriptionAndInvoiceId(
604
+ invoiceName: string,
605
+ options?: InvoicesGetBySubscriptionAndInvoiceIdOptionalParams
606
+ ): Promise<InvoicesGetBySubscriptionAndInvoiceIdResponse> {
607
+ return this.client.sendOperationRequest(
608
+ { invoiceName, options },
609
+ getBySubscriptionAndInvoiceIdOperationSpec
610
+ );
611
+ }
612
+
613
+ /**
614
+ * Gets a URL to download an invoice.
615
+ * @param invoiceName The ID that uniquely identifies an invoice.
616
+ * @param downloadToken Download token with document source and document ID.
617
+ * @param options The options parameters.
618
+ */
619
+ async beginDownloadBillingSubscriptionInvoice(
620
+ invoiceName: string,
621
+ downloadToken: string,
622
+ options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams
623
+ ): Promise<
624
+ PollerLike<
625
+ PollOperationState<InvoicesDownloadBillingSubscriptionInvoiceResponse>,
626
+ InvoicesDownloadBillingSubscriptionInvoiceResponse
627
+ >
628
+ > {
629
+ const directSendOperation = async (
630
+ args: coreClient.OperationArguments,
631
+ spec: coreClient.OperationSpec
632
+ ): Promise<InvoicesDownloadBillingSubscriptionInvoiceResponse> => {
633
+ return this.client.sendOperationRequest(args, spec);
634
+ };
635
+ const sendOperation = async (
636
+ args: coreClient.OperationArguments,
637
+ spec: coreClient.OperationSpec
638
+ ) => {
639
+ let currentRawResponse:
640
+ | coreClient.FullOperationResponse
641
+ | undefined = undefined;
642
+ const providedCallback = args.options?.onResponse;
643
+ const callback: coreClient.RawResponseCallback = (
644
+ rawResponse: coreClient.FullOperationResponse,
645
+ flatResponse: unknown
646
+ ) => {
647
+ currentRawResponse = rawResponse;
648
+ providedCallback?.(rawResponse, flatResponse);
649
+ };
650
+ const updatedArgs = {
651
+ ...args,
652
+ options: {
653
+ ...args.options,
654
+ onResponse: callback
655
+ }
656
+ };
657
+ const flatResponse = await directSendOperation(updatedArgs, spec);
658
+ return {
659
+ flatResponse,
660
+ rawResponse: {
661
+ statusCode: currentRawResponse!.status,
662
+ body: currentRawResponse!.parsedBody,
663
+ headers: currentRawResponse!.headers.toJSON()
664
+ }
665
+ };
666
+ };
667
+
668
+ const lro = new LroImpl(
669
+ sendOperation,
670
+ { invoiceName, downloadToken, options },
671
+ downloadBillingSubscriptionInvoiceOperationSpec
672
+ );
673
+ return new LroEngine(lro, {
674
+ resumeFrom: options?.resumeFrom,
675
+ intervalInMs: options?.updateIntervalInMs,
676
+ lroResourceLocationConfig: "location"
677
+ });
678
+ }
679
+
680
+ /**
681
+ * Gets a URL to download an invoice.
682
+ * @param invoiceName The ID that uniquely identifies an invoice.
683
+ * @param downloadToken Download token with document source and document ID.
684
+ * @param options The options parameters.
685
+ */
686
+ async beginDownloadBillingSubscriptionInvoiceAndWait(
687
+ invoiceName: string,
688
+ downloadToken: string,
689
+ options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams
690
+ ): Promise<InvoicesDownloadBillingSubscriptionInvoiceResponse> {
691
+ const poller = await this.beginDownloadBillingSubscriptionInvoice(
692
+ invoiceName,
693
+ downloadToken,
694
+ options
695
+ );
696
+ return poller.pollUntilDone();
697
+ }
698
+
699
+ /**
700
+ * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip
701
+ * file.
702
+ * @param downloadUrls An array of download urls for individual documents
703
+ * @param options The options parameters.
704
+ */
705
+ async beginDownloadMultipleBillingSubscriptionInvoices(
706
+ downloadUrls: string[],
707
+ options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams
708
+ ): Promise<
709
+ PollerLike<
710
+ PollOperationState<
711
+ InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse
712
+ >,
713
+ InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse
714
+ >
715
+ > {
716
+ const directSendOperation = async (
717
+ args: coreClient.OperationArguments,
718
+ spec: coreClient.OperationSpec
719
+ ): Promise<InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse> => {
720
+ return this.client.sendOperationRequest(args, spec);
721
+ };
722
+ const sendOperation = async (
723
+ args: coreClient.OperationArguments,
724
+ spec: coreClient.OperationSpec
725
+ ) => {
726
+ let currentRawResponse:
727
+ | coreClient.FullOperationResponse
728
+ | undefined = undefined;
729
+ const providedCallback = args.options?.onResponse;
730
+ const callback: coreClient.RawResponseCallback = (
731
+ rawResponse: coreClient.FullOperationResponse,
732
+ flatResponse: unknown
733
+ ) => {
734
+ currentRawResponse = rawResponse;
735
+ providedCallback?.(rawResponse, flatResponse);
736
+ };
737
+ const updatedArgs = {
738
+ ...args,
739
+ options: {
740
+ ...args.options,
741
+ onResponse: callback
742
+ }
743
+ };
744
+ const flatResponse = await directSendOperation(updatedArgs, spec);
745
+ return {
746
+ flatResponse,
747
+ rawResponse: {
748
+ statusCode: currentRawResponse!.status,
749
+ body: currentRawResponse!.parsedBody,
750
+ headers: currentRawResponse!.headers.toJSON()
751
+ }
752
+ };
753
+ };
754
+
755
+ const lro = new LroImpl(
756
+ sendOperation,
757
+ { downloadUrls, options },
758
+ downloadMultipleBillingSubscriptionInvoicesOperationSpec
759
+ );
760
+ return new LroEngine(lro, {
761
+ resumeFrom: options?.resumeFrom,
762
+ intervalInMs: options?.updateIntervalInMs,
763
+ lroResourceLocationConfig: "location"
764
+ });
765
+ }
766
+
767
+ /**
768
+ * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip
769
+ * file.
770
+ * @param downloadUrls An array of download urls for individual documents
771
+ * @param options The options parameters.
772
+ */
773
+ async beginDownloadMultipleBillingSubscriptionInvoicesAndWait(
774
+ downloadUrls: string[],
775
+ options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams
776
+ ): Promise<InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse> {
777
+ const poller = await this.beginDownloadMultipleBillingSubscriptionInvoices(
778
+ downloadUrls,
779
+ options
780
+ );
781
+ return poller.pollUntilDone();
782
+ }
783
+
784
+ /**
785
+ * ListByBillingAccountNext
786
+ * @param billingAccountName The ID that uniquely identifies a billing account.
787
+ * @param periodStartDate The start date to fetch the invoices. The date should be specified in
788
+ * MM-DD-YYYY format.
789
+ * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY
790
+ * format.
791
+ * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method.
792
+ * @param options The options parameters.
793
+ */
794
+ private _listByBillingAccountNext(
795
+ billingAccountName: string,
796
+ periodStartDate: string,
797
+ periodEndDate: string,
798
+ nextLink: string,
799
+ options?: InvoicesListByBillingAccountNextOptionalParams
800
+ ): Promise<InvoicesListByBillingAccountNextResponse> {
801
+ return this.client.sendOperationRequest(
802
+ { billingAccountName, periodStartDate, periodEndDate, nextLink, options },
803
+ listByBillingAccountNextOperationSpec
804
+ );
805
+ }
806
+
807
+ /**
808
+ * ListByBillingProfileNext
809
+ * @param billingAccountName The ID that uniquely identifies a billing account.
810
+ * @param billingProfileName The ID that uniquely identifies a billing profile.
811
+ * @param periodStartDate The start date to fetch the invoices. The date should be specified in
812
+ * MM-DD-YYYY format.
813
+ * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY
814
+ * format.
815
+ * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method.
816
+ * @param options The options parameters.
817
+ */
818
+ private _listByBillingProfileNext(
819
+ billingAccountName: string,
820
+ billingProfileName: string,
821
+ periodStartDate: string,
822
+ periodEndDate: string,
823
+ nextLink: string,
824
+ options?: InvoicesListByBillingProfileNextOptionalParams
825
+ ): Promise<InvoicesListByBillingProfileNextResponse> {
826
+ return this.client.sendOperationRequest(
827
+ {
828
+ billingAccountName,
829
+ billingProfileName,
830
+ periodStartDate,
831
+ periodEndDate,
832
+ nextLink,
833
+ options
834
+ },
835
+ listByBillingProfileNextOperationSpec
836
+ );
837
+ }
838
+
839
+ /**
840
+ * ListByBillingSubscriptionNext
841
+ * @param periodStartDate Invoice period start date.
842
+ * @param periodEndDate Invoice period end date.
843
+ * @param nextLink The nextLink from the previous successful call to the ListByBillingSubscription
844
+ * method.
845
+ * @param options The options parameters.
846
+ */
847
+ private _listByBillingSubscriptionNext(
848
+ periodStartDate: string,
849
+ periodEndDate: string,
850
+ nextLink: string,
851
+ options?: InvoicesListByBillingSubscriptionNextOptionalParams
852
+ ): Promise<InvoicesListByBillingSubscriptionNextResponse> {
853
+ return this.client.sendOperationRequest(
854
+ { periodStartDate, periodEndDate, nextLink, options },
855
+ listByBillingSubscriptionNextOperationSpec
856
+ );
857
+ }
858
+ }
859
+ // Operation Specifications
860
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
861
+
862
+ const listByBillingAccountOperationSpec: coreClient.OperationSpec = {
863
+ path:
864
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices",
865
+ httpMethod: "GET",
866
+ responses: {
867
+ 200: {
868
+ bodyMapper: Mappers.InvoiceListResult
869
+ },
870
+ default: {
871
+ bodyMapper: Mappers.ErrorResponse
872
+ }
873
+ },
874
+ queryParameters: [
875
+ Parameters.apiVersion,
876
+ Parameters.periodStartDate,
877
+ Parameters.periodEndDate
878
+ ],
879
+ urlParameters: [Parameters.$host, Parameters.billingAccountName],
880
+ headerParameters: [Parameters.accept],
881
+ serializer
882
+ };
883
+ const listByBillingProfileOperationSpec: coreClient.OperationSpec = {
884
+ path:
885
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices",
886
+ httpMethod: "GET",
887
+ responses: {
888
+ 200: {
889
+ bodyMapper: Mappers.InvoiceListResult
890
+ },
891
+ default: {
892
+ bodyMapper: Mappers.ErrorResponse
893
+ }
894
+ },
895
+ queryParameters: [
896
+ Parameters.apiVersion,
897
+ Parameters.periodStartDate,
898
+ Parameters.periodEndDate
899
+ ],
900
+ urlParameters: [
901
+ Parameters.$host,
902
+ Parameters.billingAccountName,
903
+ Parameters.billingProfileName
904
+ ],
905
+ headerParameters: [Parameters.accept],
906
+ serializer
907
+ };
908
+ const getOperationSpec: coreClient.OperationSpec = {
909
+ path:
910
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}",
911
+ httpMethod: "GET",
912
+ responses: {
913
+ 200: {
914
+ bodyMapper: Mappers.Invoice
915
+ },
916
+ default: {
917
+ bodyMapper: Mappers.ErrorResponse
918
+ }
919
+ },
920
+ queryParameters: [Parameters.apiVersion],
921
+ urlParameters: [
922
+ Parameters.$host,
923
+ Parameters.billingAccountName,
924
+ Parameters.invoiceName
925
+ ],
926
+ headerParameters: [Parameters.accept],
927
+ serializer
928
+ };
929
+ const getByIdOperationSpec: coreClient.OperationSpec = {
930
+ path:
931
+ "/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}",
932
+ httpMethod: "GET",
933
+ responses: {
934
+ 200: {
935
+ bodyMapper: Mappers.Invoice
936
+ },
937
+ default: {
938
+ bodyMapper: Mappers.ErrorResponse
939
+ }
940
+ },
941
+ queryParameters: [Parameters.apiVersion],
942
+ urlParameters: [Parameters.$host, Parameters.invoiceName],
943
+ headerParameters: [Parameters.accept],
944
+ serializer
945
+ };
946
+ const downloadInvoiceOperationSpec: coreClient.OperationSpec = {
947
+ path:
948
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download",
949
+ httpMethod: "POST",
950
+ responses: {
951
+ 200: {
952
+ bodyMapper: Mappers.DownloadUrl
953
+ },
954
+ 201: {
955
+ bodyMapper: Mappers.DownloadUrl
956
+ },
957
+ 202: {
958
+ bodyMapper: Mappers.DownloadUrl
959
+ },
960
+ 204: {
961
+ bodyMapper: Mappers.DownloadUrl
962
+ },
963
+ default: {
964
+ bodyMapper: Mappers.ErrorResponse
965
+ }
966
+ },
967
+ queryParameters: [Parameters.apiVersion, Parameters.downloadToken],
968
+ urlParameters: [
969
+ Parameters.$host,
970
+ Parameters.billingAccountName,
971
+ Parameters.invoiceName
972
+ ],
973
+ headerParameters: [Parameters.accept],
974
+ serializer
975
+ };
976
+ const downloadMultipleBillingProfileInvoicesOperationSpec: coreClient.OperationSpec = {
977
+ path:
978
+ "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments",
979
+ httpMethod: "POST",
980
+ responses: {
981
+ 200: {
982
+ bodyMapper: Mappers.DownloadUrl
983
+ },
984
+ 201: {
985
+ bodyMapper: Mappers.DownloadUrl
986
+ },
987
+ 202: {
988
+ bodyMapper: Mappers.DownloadUrl
989
+ },
990
+ 204: {
991
+ bodyMapper: Mappers.DownloadUrl
992
+ },
993
+ default: {
994
+ bodyMapper: Mappers.ErrorResponse
995
+ }
996
+ },
997
+ requestBody: Parameters.downloadUrls,
998
+ queryParameters: [Parameters.apiVersion],
999
+ urlParameters: [Parameters.$host, Parameters.billingAccountName],
1000
+ headerParameters: [Parameters.accept, Parameters.contentType],
1001
+ mediaType: "json",
1002
+ serializer
1003
+ };
1004
+ const listByBillingSubscriptionOperationSpec: coreClient.OperationSpec = {
1005
+ path:
1006
+ "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices",
1007
+ httpMethod: "GET",
1008
+ responses: {
1009
+ 200: {
1010
+ bodyMapper: Mappers.InvoiceListResult
1011
+ },
1012
+ default: {
1013
+ bodyMapper: Mappers.ErrorResponse
1014
+ }
1015
+ },
1016
+ queryParameters: [
1017
+ Parameters.apiVersion,
1018
+ Parameters.periodStartDate,
1019
+ Parameters.periodEndDate
1020
+ ],
1021
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
1022
+ headerParameters: [Parameters.accept],
1023
+ serializer
1024
+ };
1025
+ const getBySubscriptionAndInvoiceIdOperationSpec: coreClient.OperationSpec = {
1026
+ path:
1027
+ "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}",
1028
+ httpMethod: "GET",
1029
+ responses: {
1030
+ 200: {
1031
+ bodyMapper: Mappers.Invoice
1032
+ },
1033
+ default: {
1034
+ bodyMapper: Mappers.ErrorResponse
1035
+ }
1036
+ },
1037
+ queryParameters: [Parameters.apiVersion],
1038
+ urlParameters: [
1039
+ Parameters.$host,
1040
+ Parameters.subscriptionId,
1041
+ Parameters.invoiceName
1042
+ ],
1043
+ headerParameters: [Parameters.accept],
1044
+ serializer
1045
+ };
1046
+ const downloadBillingSubscriptionInvoiceOperationSpec: coreClient.OperationSpec = {
1047
+ path:
1048
+ "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download",
1049
+ httpMethod: "POST",
1050
+ responses: {
1051
+ 200: {
1052
+ bodyMapper: Mappers.DownloadUrl
1053
+ },
1054
+ 201: {
1055
+ bodyMapper: Mappers.DownloadUrl
1056
+ },
1057
+ 202: {
1058
+ bodyMapper: Mappers.DownloadUrl
1059
+ },
1060
+ 204: {
1061
+ bodyMapper: Mappers.DownloadUrl
1062
+ },
1063
+ default: {
1064
+ bodyMapper: Mappers.ErrorResponse
1065
+ }
1066
+ },
1067
+ queryParameters: [Parameters.apiVersion, Parameters.downloadToken],
1068
+ urlParameters: [
1069
+ Parameters.$host,
1070
+ Parameters.subscriptionId,
1071
+ Parameters.invoiceName
1072
+ ],
1073
+ headerParameters: [Parameters.accept],
1074
+ serializer
1075
+ };
1076
+ const downloadMultipleBillingSubscriptionInvoicesOperationSpec: coreClient.OperationSpec = {
1077
+ path:
1078
+ "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments",
1079
+ httpMethod: "POST",
1080
+ responses: {
1081
+ 200: {
1082
+ bodyMapper: Mappers.DownloadUrl
1083
+ },
1084
+ 201: {
1085
+ bodyMapper: Mappers.DownloadUrl
1086
+ },
1087
+ 202: {
1088
+ bodyMapper: Mappers.DownloadUrl
1089
+ },
1090
+ 204: {
1091
+ bodyMapper: Mappers.DownloadUrl
1092
+ },
1093
+ default: {
1094
+ bodyMapper: Mappers.ErrorResponse
1095
+ }
1096
+ },
1097
+ requestBody: Parameters.downloadUrls,
1098
+ queryParameters: [Parameters.apiVersion],
1099
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
1100
+ headerParameters: [Parameters.accept, Parameters.contentType],
1101
+ mediaType: "json",
1102
+ serializer
1103
+ };
1104
+ const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = {
1105
+ path: "{nextLink}",
1106
+ httpMethod: "GET",
1107
+ responses: {
1108
+ 200: {
1109
+ bodyMapper: Mappers.InvoiceListResult
1110
+ },
1111
+ default: {
1112
+ bodyMapper: Mappers.ErrorResponse
1113
+ }
1114
+ },
1115
+ queryParameters: [
1116
+ Parameters.apiVersion,
1117
+ Parameters.periodStartDate,
1118
+ Parameters.periodEndDate
1119
+ ],
1120
+ urlParameters: [
1121
+ Parameters.$host,
1122
+ Parameters.billingAccountName,
1123
+ Parameters.nextLink
1124
+ ],
1125
+ headerParameters: [Parameters.accept],
1126
+ serializer
1127
+ };
1128
+ const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = {
1129
+ path: "{nextLink}",
1130
+ httpMethod: "GET",
1131
+ responses: {
1132
+ 200: {
1133
+ bodyMapper: Mappers.InvoiceListResult
1134
+ },
1135
+ default: {
1136
+ bodyMapper: Mappers.ErrorResponse
1137
+ }
1138
+ },
1139
+ queryParameters: [
1140
+ Parameters.apiVersion,
1141
+ Parameters.periodStartDate,
1142
+ Parameters.periodEndDate
1143
+ ],
1144
+ urlParameters: [
1145
+ Parameters.$host,
1146
+ Parameters.billingAccountName,
1147
+ Parameters.nextLink,
1148
+ Parameters.billingProfileName
1149
+ ],
1150
+ headerParameters: [Parameters.accept],
1151
+ serializer
1152
+ };
1153
+ const listByBillingSubscriptionNextOperationSpec: coreClient.OperationSpec = {
1154
+ path: "{nextLink}",
1155
+ httpMethod: "GET",
1156
+ responses: {
1157
+ 200: {
1158
+ bodyMapper: Mappers.InvoiceListResult
1159
+ },
1160
+ default: {
1161
+ bodyMapper: Mappers.ErrorResponse
1162
+ }
1163
+ },
1164
+ queryParameters: [
1165
+ Parameters.apiVersion,
1166
+ Parameters.periodStartDate,
1167
+ Parameters.periodEndDate
1168
+ ],
1169
+ urlParameters: [
1170
+ Parameters.$host,
1171
+ Parameters.nextLink,
1172
+ Parameters.subscriptionId
1173
+ ],
1174
+ headerParameters: [Parameters.accept],
1175
+ serializer
1176
+ };