@emilgroup/billing-v2-sdk-node 0.0.0-stage → 1.0.1-beta.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 (265) hide show
  1. package/.openapi-generator/FILES +93 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +83 -2
  5. package/api/bill-runs-api.ts +472 -0
  6. package/api/bills-api.ts +149 -0
  7. package/api/invoices-api.ts +1534 -0
  8. package/api/jobs-api.ts +760 -0
  9. package/api/policy-billings-api.ts +595 -0
  10. package/api.ts +39 -0
  11. package/base.ts +396 -0
  12. package/common.ts +200 -0
  13. package/configuration.ts +118 -0
  14. package/dist/api/bill-runs-api.d.ts +266 -0
  15. package/dist/api/bill-runs-api.js +470 -0
  16. package/dist/api/bills-api.d.ts +87 -0
  17. package/dist/api/bills-api.js +211 -0
  18. package/dist/api/invoices-api.d.ts +847 -0
  19. package/dist/api/invoices-api.js +1357 -0
  20. package/dist/api/jobs-api.d.ts +426 -0
  21. package/dist/api/jobs-api.js +712 -0
  22. package/dist/api/policy-billings-api.d.ts +332 -0
  23. package/dist/api/policy-billings-api.js +565 -0
  24. package/dist/api.d.ts +16 -0
  25. package/dist/api.js +34 -0
  26. package/dist/base.d.ts +97 -0
  27. package/dist/base.js +493 -0
  28. package/dist/common.d.ts +92 -0
  29. package/dist/common.js +278 -0
  30. package/dist/configuration.d.ts +96 -0
  31. package/dist/configuration.js +52 -0
  32. package/dist/index.d.ts +15 -0
  33. package/dist/index.js +36 -0
  34. package/dist/models/any.d.ts +25 -0
  35. package/dist/models/any.js +15 -0
  36. package/dist/models/bill-item.d.ts +132 -0
  37. package/dist/models/bill-item.js +15 -0
  38. package/dist/models/bill-run.d.ts +145 -0
  39. package/dist/models/bill-run.js +15 -0
  40. package/dist/models/bill.d.ts +194 -0
  41. package/dist/models/bill.js +15 -0
  42. package/dist/models/cancel-job-response.d.ts +25 -0
  43. package/dist/models/cancel-job-response.js +15 -0
  44. package/dist/models/create-correction-invoices-request.d.ts +72 -0
  45. package/dist/models/create-correction-invoices-request.js +15 -0
  46. package/dist/models/create-correction-invoices-response.d.ts +31 -0
  47. package/dist/models/create-correction-invoices-response.js +15 -0
  48. package/dist/models/create-detail-export-job-request.d.ts +56 -0
  49. package/dist/models/create-detail-export-job-request.js +15 -0
  50. package/dist/models/create-detail-export-job-response.d.ts +25 -0
  51. package/dist/models/create-detail-export-job-response.js +15 -0
  52. package/dist/models/create-estimated-invoice-for-interval-request.d.ts +42 -0
  53. package/dist/models/create-estimated-invoice-for-interval-request.js +15 -0
  54. package/dist/models/create-estimated-invoice-for-interval-response.d.ts +25 -0
  55. package/dist/models/create-estimated-invoice-for-interval-response.js +15 -0
  56. package/dist/models/create-estimated-invoice-request.d.ts +36 -0
  57. package/dist/models/create-estimated-invoice-request.js +15 -0
  58. package/dist/models/create-estimated-invoice-response.d.ts +25 -0
  59. package/dist/models/create-estimated-invoice-response.js +15 -0
  60. package/dist/models/create-export-job-request.d.ts +68 -0
  61. package/dist/models/create-export-job-request.js +15 -0
  62. package/dist/models/create-export-job-response.d.ts +25 -0
  63. package/dist/models/create-export-job-response.js +15 -0
  64. package/dist/models/create-initial-invoice-request.d.ts +72 -0
  65. package/dist/models/create-initial-invoice-request.js +15 -0
  66. package/dist/models/create-initial-invoice-response.d.ts +25 -0
  67. package/dist/models/create-initial-invoice-response.js +15 -0
  68. package/dist/models/create-invoice-request.d.ts +67 -0
  69. package/dist/models/create-invoice-request.js +15 -0
  70. package/dist/models/create-invoice-response.d.ts +25 -0
  71. package/dist/models/create-invoice-response.js +15 -0
  72. package/dist/models/create-invoice-status-body.d.ts +24 -0
  73. package/dist/models/create-invoice-status-body.js +15 -0
  74. package/dist/models/create-invoice-status-response.d.ts +25 -0
  75. package/dist/models/create-invoice-status-response.js +15 -0
  76. package/dist/models/create-item-request.d.ts +36 -0
  77. package/dist/models/create-item-request.js +15 -0
  78. package/dist/models/create-policy-billing-request.d.ts +42 -0
  79. package/dist/models/create-policy-billing-request.js +15 -0
  80. package/dist/models/create-policy-billing-response.d.ts +25 -0
  81. package/dist/models/create-policy-billing-response.js +15 -0
  82. package/dist/models/create-recurring-invoice-request.d.ts +72 -0
  83. package/dist/models/create-recurring-invoice-request.js +15 -0
  84. package/dist/models/create-recurring-invoice-response.d.ts +31 -0
  85. package/dist/models/create-recurring-invoice-response.js +15 -0
  86. package/dist/models/create-termination-invoice-request.d.ts +60 -0
  87. package/dist/models/create-termination-invoice-request.js +15 -0
  88. package/dist/models/create-termination-invoice-response.d.ts +25 -0
  89. package/dist/models/create-termination-invoice-response.js +15 -0
  90. package/dist/models/create-withdraw-invoice-request.d.ts +48 -0
  91. package/dist/models/create-withdraw-invoice-request.js +15 -0
  92. package/dist/models/create-withdraw-invoice-response.d.ts +25 -0
  93. package/dist/models/create-withdraw-invoice-response.js +15 -0
  94. package/dist/models/estimate-history-entry.d.ts +36 -0
  95. package/dist/models/estimate-history-entry.js +15 -0
  96. package/dist/models/export-column.d.ts +36 -0
  97. package/dist/models/export-column.js +15 -0
  98. package/dist/models/filter-field.d.ts +110 -0
  99. package/dist/models/filter-field.js +15 -0
  100. package/dist/models/filter-value.d.ts +37 -0
  101. package/dist/models/filter-value.js +15 -0
  102. package/dist/models/get-bill-response.d.ts +25 -0
  103. package/dist/models/get-bill-response.js +15 -0
  104. package/dist/models/get-bill-run-filter-catalog-response.d.ts +31 -0
  105. package/dist/models/get-bill-run-filter-catalog-response.js +15 -0
  106. package/dist/models/get-bill-run-response.d.ts +25 -0
  107. package/dist/models/get-bill-run-response.js +15 -0
  108. package/dist/models/get-invoice-filter-catalog-response.d.ts +31 -0
  109. package/dist/models/get-invoice-filter-catalog-response.js +15 -0
  110. package/dist/models/get-invoice-response.d.ts +25 -0
  111. package/dist/models/get-invoice-response.js +15 -0
  112. package/dist/models/get-job-download-response.d.ts +25 -0
  113. package/dist/models/get-job-download-response.js +15 -0
  114. package/dist/models/get-job-filter-catalog-response.d.ts +31 -0
  115. package/dist/models/get-job-filter-catalog-response.js +15 -0
  116. package/dist/models/get-job-response.d.ts +25 -0
  117. package/dist/models/get-job-response.js +15 -0
  118. package/dist/models/get-policies-billing-date-filter-catalog-response.d.ts +31 -0
  119. package/dist/models/get-policies-billing-date-filter-catalog-response.js +15 -0
  120. package/dist/models/get-policies-billing-filter-catalog-response.d.ts +31 -0
  121. package/dist/models/get-policies-billing-filter-catalog-response.js +15 -0
  122. package/dist/models/get-policy-billing-response.d.ts +25 -0
  123. package/dist/models/get-policy-billing-response.js +15 -0
  124. package/dist/models/highlight.d.ts +30 -0
  125. package/dist/models/highlight.js +15 -0
  126. package/dist/models/index.d.ts +75 -0
  127. package/dist/models/index.js +91 -0
  128. package/dist/models/invoice-item.d.ts +204 -0
  129. package/dist/models/invoice-item.js +15 -0
  130. package/dist/models/invoice-payment.d.ts +108 -0
  131. package/dist/models/invoice-payment.js +15 -0
  132. package/dist/models/invoice-payments.d.ts +25 -0
  133. package/dist/models/invoice-payments.js +15 -0
  134. package/dist/models/invoice-status.d.ts +54 -0
  135. package/dist/models/invoice-status.js +15 -0
  136. package/dist/models/invoice.d.ts +275 -0
  137. package/dist/models/invoice.js +15 -0
  138. package/dist/models/job-download.d.ts +36 -0
  139. package/dist/models/job-download.js +15 -0
  140. package/dist/models/job-error.d.ts +30 -0
  141. package/dist/models/job-error.js +15 -0
  142. package/dist/models/job-progress.d.ts +36 -0
  143. package/dist/models/job-progress.js +15 -0
  144. package/dist/models/job.d.ts +134 -0
  145. package/dist/models/job.js +15 -0
  146. package/dist/models/list-bill-runs-response.d.ts +37 -0
  147. package/dist/models/list-bill-runs-response.js +15 -0
  148. package/dist/models/list-invoices-response.d.ts +37 -0
  149. package/dist/models/list-invoices-response.js +15 -0
  150. package/dist/models/list-jobs-response.d.ts +37 -0
  151. package/dist/models/list-jobs-response.js +15 -0
  152. package/dist/models/list-policies-billing-dates-response.d.ts +37 -0
  153. package/dist/models/list-policies-billing-dates-response.js +15 -0
  154. package/dist/models/list-policies-billings-response.d.ts +37 -0
  155. package/dist/models/list-policies-billings-response.js +15 -0
  156. package/dist/models/list-request.d.ts +60 -0
  157. package/dist/models/list-request.js +15 -0
  158. package/dist/models/localized-text.d.ts +30 -0
  159. package/dist/models/localized-text.js +15 -0
  160. package/dist/models/match.d.ts +69 -0
  161. package/dist/models/match.js +15 -0
  162. package/dist/models/payment-term.d.ts +42 -0
  163. package/dist/models/payment-term.js +15 -0
  164. package/dist/models/policy-billing.d.ts +139 -0
  165. package/dist/models/policy-billing.js +15 -0
  166. package/dist/models/request-bill-run-request.d.ts +30 -0
  167. package/dist/models/request-bill-run-request.js +15 -0
  168. package/dist/models/request-bill-run-response.d.ts +25 -0
  169. package/dist/models/request-bill-run-response.js +15 -0
  170. package/dist/models/resolved-billing-config.d.ts +130 -0
  171. package/dist/models/resolved-billing-config.js +15 -0
  172. package/dist/models/revert-invoice-request.d.ts +24 -0
  173. package/dist/models/revert-invoice-request.js +15 -0
  174. package/dist/models/revert-invoice-response.d.ts +25 -0
  175. package/dist/models/revert-invoice-response.js +15 -0
  176. package/dist/models/slice.d.ts +30 -0
  177. package/dist/models/slice.js +15 -0
  178. package/dist/models/status.d.ts +37 -0
  179. package/dist/models/status.js +15 -0
  180. package/dist/models/tax.d.ts +30 -0
  181. package/dist/models/tax.js +15 -0
  182. package/dist/models/update-policy-billing-body.d.ts +24 -0
  183. package/dist/models/update-policy-billing-body.js +15 -0
  184. package/dist/models/update-policy-billing-response.d.ts +25 -0
  185. package/dist/models/update-policy-billing-response.js +15 -0
  186. package/git_push.sh +57 -0
  187. package/index.ts +19 -0
  188. package/models/any.ts +32 -0
  189. package/models/bill-item.ts +138 -0
  190. package/models/bill-run.ts +151 -0
  191. package/models/bill.ts +200 -0
  192. package/models/cancel-job-response.ts +31 -0
  193. package/models/create-correction-invoices-request.ts +78 -0
  194. package/models/create-correction-invoices-response.ts +37 -0
  195. package/models/create-detail-export-job-request.ts +60 -0
  196. package/models/create-detail-export-job-response.ts +31 -0
  197. package/models/create-estimated-invoice-for-interval-request.ts +48 -0
  198. package/models/create-estimated-invoice-for-interval-response.ts +31 -0
  199. package/models/create-estimated-invoice-request.ts +42 -0
  200. package/models/create-estimated-invoice-response.ts +31 -0
  201. package/models/create-export-job-request.ts +74 -0
  202. package/models/create-export-job-response.ts +31 -0
  203. package/models/create-initial-invoice-request.ts +78 -0
  204. package/models/create-initial-invoice-response.ts +31 -0
  205. package/models/create-invoice-request.ts +73 -0
  206. package/models/create-invoice-response.ts +31 -0
  207. package/models/create-invoice-status-body.ts +30 -0
  208. package/models/create-invoice-status-response.ts +31 -0
  209. package/models/create-item-request.ts +42 -0
  210. package/models/create-policy-billing-request.ts +48 -0
  211. package/models/create-policy-billing-response.ts +31 -0
  212. package/models/create-recurring-invoice-request.ts +78 -0
  213. package/models/create-recurring-invoice-response.ts +37 -0
  214. package/models/create-termination-invoice-request.ts +66 -0
  215. package/models/create-termination-invoice-response.ts +31 -0
  216. package/models/create-withdraw-invoice-request.ts +54 -0
  217. package/models/create-withdraw-invoice-response.ts +31 -0
  218. package/models/estimate-history-entry.ts +42 -0
  219. package/models/export-column.ts +42 -0
  220. package/models/filter-field.ts +116 -0
  221. package/models/filter-value.ts +43 -0
  222. package/models/get-bill-response.ts +31 -0
  223. package/models/get-bill-run-filter-catalog-response.ts +37 -0
  224. package/models/get-bill-run-response.ts +31 -0
  225. package/models/get-invoice-filter-catalog-response.ts +37 -0
  226. package/models/get-invoice-response.ts +31 -0
  227. package/models/get-job-download-response.ts +31 -0
  228. package/models/get-job-filter-catalog-response.ts +37 -0
  229. package/models/get-job-response.ts +31 -0
  230. package/models/get-policies-billing-date-filter-catalog-response.ts +37 -0
  231. package/models/get-policies-billing-filter-catalog-response.ts +37 -0
  232. package/models/get-policy-billing-response.ts +31 -0
  233. package/models/highlight.ts +36 -0
  234. package/models/index.ts +75 -0
  235. package/models/invoice-item.ts +210 -0
  236. package/models/invoice-payment.ts +114 -0
  237. package/models/invoice-payments.ts +31 -0
  238. package/models/invoice-status.ts +60 -0
  239. package/models/invoice.ts +281 -0
  240. package/models/job-download.ts +42 -0
  241. package/models/job-error.ts +36 -0
  242. package/models/job-progress.ts +42 -0
  243. package/models/job.ts +140 -0
  244. package/models/list-bill-runs-response.ts +43 -0
  245. package/models/list-invoices-response.ts +43 -0
  246. package/models/list-jobs-response.ts +43 -0
  247. package/models/list-policies-billing-dates-response.ts +43 -0
  248. package/models/list-policies-billings-response.ts +43 -0
  249. package/models/list-request.ts +66 -0
  250. package/models/localized-text.ts +36 -0
  251. package/models/match.ts +75 -0
  252. package/models/payment-term.ts +48 -0
  253. package/models/policy-billing.ts +145 -0
  254. package/models/request-bill-run-request.ts +36 -0
  255. package/models/request-bill-run-response.ts +31 -0
  256. package/models/resolved-billing-config.ts +134 -0
  257. package/models/revert-invoice-request.ts +30 -0
  258. package/models/revert-invoice-response.ts +31 -0
  259. package/models/slice.ts +36 -0
  260. package/models/status.ts +43 -0
  261. package/models/tax.ts +36 -0
  262. package/models/update-policy-billing-body.ts +30 -0
  263. package/models/update-policy-billing-response.ts +31 -0
  264. package/package.json +27 -4
  265. package/tsconfig.json +23 -0
@@ -0,0 +1,1534 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL Billing Service
5
+ * The billing service: bills, bill runs, invoices and policy billings.
6
+ *
7
+ * The version of the OpenAPI document: 2.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
+ import { Configuration } from '../configuration';
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ // @ts-ignore
22
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
+ // @ts-ignore
24
+ import { CreateCorrectionInvoicesRequest } from '../models';
25
+ // @ts-ignore
26
+ import { CreateCorrectionInvoicesResponse } from '../models';
27
+ // @ts-ignore
28
+ import { CreateEstimatedInvoiceForIntervalRequest } from '../models';
29
+ // @ts-ignore
30
+ import { CreateEstimatedInvoiceForIntervalResponse } from '../models';
31
+ // @ts-ignore
32
+ import { CreateEstimatedInvoiceRequest } from '../models';
33
+ // @ts-ignore
34
+ import { CreateEstimatedInvoiceResponse } from '../models';
35
+ // @ts-ignore
36
+ import { CreateInitialInvoiceRequest } from '../models';
37
+ // @ts-ignore
38
+ import { CreateInitialInvoiceResponse } from '../models';
39
+ // @ts-ignore
40
+ import { CreateInvoiceRequest } from '../models';
41
+ // @ts-ignore
42
+ import { CreateInvoiceResponse } from '../models';
43
+ // @ts-ignore
44
+ import { CreateInvoiceStatusBody } from '../models';
45
+ // @ts-ignore
46
+ import { CreateInvoiceStatusResponse } from '../models';
47
+ // @ts-ignore
48
+ import { CreateRecurringInvoiceRequest } from '../models';
49
+ // @ts-ignore
50
+ import { CreateRecurringInvoiceResponse } from '../models';
51
+ // @ts-ignore
52
+ import { CreateTerminationInvoiceRequest } from '../models';
53
+ // @ts-ignore
54
+ import { CreateTerminationInvoiceResponse } from '../models';
55
+ // @ts-ignore
56
+ import { CreateWithdrawInvoiceRequest } from '../models';
57
+ // @ts-ignore
58
+ import { CreateWithdrawInvoiceResponse } from '../models';
59
+ // @ts-ignore
60
+ import { GetInvoiceFilterCatalogResponse } from '../models';
61
+ // @ts-ignore
62
+ import { GetInvoiceResponse } from '../models';
63
+ // @ts-ignore
64
+ import { GetPoliciesBillingDateFilterCatalogResponse } from '../models';
65
+ // @ts-ignore
66
+ import { ListInvoicesResponse } from '../models';
67
+ // @ts-ignore
68
+ import { ListPoliciesBillingDatesResponse } from '../models';
69
+ // @ts-ignore
70
+ import { RevertInvoiceRequest } from '../models';
71
+ // @ts-ignore
72
+ import { RevertInvoiceResponse } from '../models';
73
+ // @ts-ignore
74
+ import { Status } from '../models';
75
+ // URLSearchParams not necessarily used
76
+ // @ts-ignore
77
+ import { URL, URLSearchParams } from 'url';
78
+ const FormData = require('form-data');
79
+ /**
80
+ * InvoicesApi - axios parameter creator
81
+ * @export
82
+ */
83
+ export const InvoicesApiAxiosParamCreator = function (configuration?: Configuration) {
84
+ return {
85
+ /**
86
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
87
+ * @summary Creates correction invoices for a policy.
88
+ * @param {CreateCorrectionInvoicesRequest} body The request of `CreateCorrectionInvoices`. Only `policyCode`, the billing interval and `metadata` are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
89
+ * @param {*} [options] Override http request option.
90
+ * @throws {RequiredError}
91
+ */
92
+ billingServiceCreateCorrectionInvoices: async (body: CreateCorrectionInvoicesRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
93
+ // verify required parameter 'body' is not null or undefined
94
+ assertParamExists('billingServiceCreateCorrectionInvoices', 'body', body)
95
+ const localVarPath = `/billingservice/v2/correction-invoices`;
96
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
97
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
98
+ let baseOptions;
99
+ let baseAccessToken;
100
+ if (configuration) {
101
+ baseOptions = configuration.baseOptions;
102
+ baseAccessToken = configuration.accessToken;
103
+ }
104
+
105
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
106
+ const localVarHeaderParameter = {} as any;
107
+ const localVarQueryParameter = {} as any;
108
+
109
+
110
+
111
+ localVarHeaderParameter['Content-Type'] = 'application/json';
112
+
113
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
114
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
115
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
116
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
117
+
118
+ return {
119
+ url: toPathString(localVarUrlObj),
120
+ options: localVarRequestOptions,
121
+ };
122
+ },
123
+ /**
124
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
125
+ * @summary Creates an estimate for the running period of a policy.
126
+ * @param {CreateEstimatedInvoiceRequest} body The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
127
+ * @param {*} [options] Override http request option.
128
+ * @throws {RequiredError}
129
+ */
130
+ billingServiceCreateEstimatedInvoice: async (body: CreateEstimatedInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
131
+ // verify required parameter 'body' is not null or undefined
132
+ assertParamExists('billingServiceCreateEstimatedInvoice', 'body', body)
133
+ const localVarPath = `/billingservice/v2/estimated-invoices`;
134
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
135
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
136
+ let baseOptions;
137
+ let baseAccessToken;
138
+ if (configuration) {
139
+ baseOptions = configuration.baseOptions;
140
+ baseAccessToken = configuration.accessToken;
141
+ }
142
+
143
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
144
+ const localVarHeaderParameter = {} as any;
145
+ const localVarQueryParameter = {} as any;
146
+
147
+
148
+
149
+ localVarHeaderParameter['Content-Type'] = 'application/json';
150
+
151
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
152
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
153
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
154
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
155
+
156
+ return {
157
+ url: toPathString(localVarUrlObj),
158
+ options: localVarRequestOptions,
159
+ };
160
+ },
161
+ /**
162
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
163
+ * @summary Creates an estimate for an explicit period of a policy.
164
+ * @param {CreateEstimatedInvoiceForIntervalRequest} body The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ */
168
+ billingServiceCreateEstimatedInvoiceForInterval: async (body: CreateEstimatedInvoiceForIntervalRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
169
+ // verify required parameter 'body' is not null or undefined
170
+ assertParamExists('billingServiceCreateEstimatedInvoiceForInterval', 'body', body)
171
+ const localVarPath = `/billingservice/v2/estimated-invoices/interval`;
172
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
173
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
174
+ let baseOptions;
175
+ let baseAccessToken;
176
+ if (configuration) {
177
+ baseOptions = configuration.baseOptions;
178
+ baseAccessToken = configuration.accessToken;
179
+ }
180
+
181
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
182
+ const localVarHeaderParameter = {} as any;
183
+ const localVarQueryParameter = {} as any;
184
+
185
+
186
+
187
+ localVarHeaderParameter['Content-Type'] = 'application/json';
188
+
189
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
190
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
191
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
192
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
193
+
194
+ return {
195
+ url: toPathString(localVarUrlObj),
196
+ options: localVarRequestOptions,
197
+ };
198
+ },
199
+ /**
200
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
201
+ * @summary Creates the first invoice of a policy.
202
+ * @param {CreateInitialInvoiceRequest} body The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
203
+ * @param {*} [options] Override http request option.
204
+ * @throws {RequiredError}
205
+ */
206
+ billingServiceCreateInitialInvoice: async (body: CreateInitialInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
207
+ // verify required parameter 'body' is not null or undefined
208
+ assertParamExists('billingServiceCreateInitialInvoice', 'body', body)
209
+ const localVarPath = `/billingservice/v2/initial-invoices`;
210
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
211
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
212
+ let baseOptions;
213
+ let baseAccessToken;
214
+ if (configuration) {
215
+ baseOptions = configuration.baseOptions;
216
+ baseAccessToken = configuration.accessToken;
217
+ }
218
+
219
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
220
+ const localVarHeaderParameter = {} as any;
221
+ const localVarQueryParameter = {} as any;
222
+
223
+
224
+
225
+ localVarHeaderParameter['Content-Type'] = 'application/json';
226
+
227
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
228
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
229
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
230
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
231
+
232
+ return {
233
+ url: toPathString(localVarUrlObj),
234
+ options: localVarRequestOptions,
235
+ };
236
+ },
237
+ /**
238
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
239
+ * @summary Creates a manual invoice with free items.
240
+ * @param {CreateInvoiceRequest} body The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
241
+ * @param {*} [options] Override http request option.
242
+ * @throws {RequiredError}
243
+ */
244
+ billingServiceCreateInvoice: async (body: CreateInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
245
+ // verify required parameter 'body' is not null or undefined
246
+ assertParamExists('billingServiceCreateInvoice', 'body', body)
247
+ const localVarPath = `/billingservice/v2/invoices`;
248
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
249
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
250
+ let baseOptions;
251
+ let baseAccessToken;
252
+ if (configuration) {
253
+ baseOptions = configuration.baseOptions;
254
+ baseAccessToken = configuration.accessToken;
255
+ }
256
+
257
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
258
+ const localVarHeaderParameter = {} as any;
259
+ const localVarQueryParameter = {} as any;
260
+
261
+
262
+
263
+ localVarHeaderParameter['Content-Type'] = 'application/json';
264
+
265
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
266
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
267
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
268
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
269
+
270
+ return {
271
+ url: toPathString(localVarUrlObj),
272
+ options: localVarRequestOptions,
273
+ };
274
+ },
275
+ /**
276
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
277
+ * @summary Adds a status row to an invoice.
278
+ * @param {string} invoiceCode The code of the invoice.
279
+ * @param {CreateInvoiceStatusBody} body
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ */
283
+ billingServiceCreateInvoiceStatus: async (invoiceCode: string, body: CreateInvoiceStatusBody, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
284
+ // verify required parameter 'invoiceCode' is not null or undefined
285
+ assertParamExists('billingServiceCreateInvoiceStatus', 'invoiceCode', invoiceCode)
286
+ // verify required parameter 'body' is not null or undefined
287
+ assertParamExists('billingServiceCreateInvoiceStatus', 'body', body)
288
+ const localVarPath = `/billingservice/v2/invoices/{invoiceCode}/statuses`
289
+ .replace(`{${"invoiceCode"}}`, encodeURIComponent(String(invoiceCode)));
290
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
291
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
292
+ let baseOptions;
293
+ let baseAccessToken;
294
+ if (configuration) {
295
+ baseOptions = configuration.baseOptions;
296
+ baseAccessToken = configuration.accessToken;
297
+ }
298
+
299
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
300
+ const localVarHeaderParameter = {} as any;
301
+ const localVarQueryParameter = {} as any;
302
+
303
+
304
+
305
+ localVarHeaderParameter['Content-Type'] = 'application/json';
306
+
307
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
308
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
309
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
310
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
311
+
312
+ return {
313
+ url: toPathString(localVarUrlObj),
314
+ options: localVarRequestOptions,
315
+ };
316
+ },
317
+ /**
318
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
319
+ * @summary Creates the recurring invoice for the next period of a policy.
320
+ * @param {CreateRecurringInvoiceRequest} body The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
321
+ * @param {*} [options] Override http request option.
322
+ * @throws {RequiredError}
323
+ */
324
+ billingServiceCreateRecurringInvoice: async (body: CreateRecurringInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
325
+ // verify required parameter 'body' is not null or undefined
326
+ assertParamExists('billingServiceCreateRecurringInvoice', 'body', body)
327
+ const localVarPath = `/billingservice/v2/recurring-invoices`;
328
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
329
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
330
+ let baseOptions;
331
+ let baseAccessToken;
332
+ if (configuration) {
333
+ baseOptions = configuration.baseOptions;
334
+ baseAccessToken = configuration.accessToken;
335
+ }
336
+
337
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
338
+ const localVarHeaderParameter = {} as any;
339
+ const localVarQueryParameter = {} as any;
340
+
341
+
342
+
343
+ localVarHeaderParameter['Content-Type'] = 'application/json';
344
+
345
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
346
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
347
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
348
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
349
+
350
+ return {
351
+ url: toPathString(localVarUrlObj),
352
+ options: localVarRequestOptions,
353
+ };
354
+ },
355
+ /**
356
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
357
+ * @summary Creates the final invoice of a terminated policy.
358
+ * @param {CreateTerminationInvoiceRequest} body The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
359
+ * @param {*} [options] Override http request option.
360
+ * @throws {RequiredError}
361
+ */
362
+ billingServiceCreateTerminationInvoice: async (body: CreateTerminationInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
363
+ // verify required parameter 'body' is not null or undefined
364
+ assertParamExists('billingServiceCreateTerminationInvoice', 'body', body)
365
+ const localVarPath = `/billingservice/v2/termination-invoices`;
366
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
367
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
368
+ let baseOptions;
369
+ let baseAccessToken;
370
+ if (configuration) {
371
+ baseOptions = configuration.baseOptions;
372
+ baseAccessToken = configuration.accessToken;
373
+ }
374
+
375
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
376
+ const localVarHeaderParameter = {} as any;
377
+ const localVarQueryParameter = {} as any;
378
+
379
+
380
+
381
+ localVarHeaderParameter['Content-Type'] = 'application/json';
382
+
383
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
384
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
385
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
386
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
387
+
388
+ return {
389
+ url: toPathString(localVarUrlObj),
390
+ options: localVarRequestOptions,
391
+ };
392
+ },
393
+ /**
394
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
395
+ * @summary Creates a withdraw invoice for a policy that never came into force.
396
+ * @param {CreateWithdrawInvoiceRequest} body The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
397
+ * @param {*} [options] Override http request option.
398
+ * @throws {RequiredError}
399
+ */
400
+ billingServiceCreateWithdrawInvoice: async (body: CreateWithdrawInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
401
+ // verify required parameter 'body' is not null or undefined
402
+ assertParamExists('billingServiceCreateWithdrawInvoice', 'body', body)
403
+ const localVarPath = `/billingservice/v2/withdraw-invoices`;
404
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
405
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
406
+ let baseOptions;
407
+ let baseAccessToken;
408
+ if (configuration) {
409
+ baseOptions = configuration.baseOptions;
410
+ baseAccessToken = configuration.accessToken;
411
+ }
412
+
413
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
414
+ const localVarHeaderParameter = {} as any;
415
+ const localVarQueryParameter = {} as any;
416
+
417
+
418
+
419
+ localVarHeaderParameter['Content-Type'] = 'application/json';
420
+
421
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
422
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
423
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
424
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
425
+
426
+ return {
427
+ url: toPathString(localVarUrlObj),
428
+ options: localVarRequestOptions,
429
+ };
430
+ },
431
+ /**
432
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
433
+ * @summary Returns one invoice.
434
+ * @param {string} code The invoice\&#39;s code.
435
+ * @param {string} [expand] The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
436
+ * @param {*} [options] Override http request option.
437
+ * @throws {RequiredError}
438
+ */
439
+ billingServiceGetInvoice: async (code: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
440
+ // verify required parameter 'code' is not null or undefined
441
+ assertParamExists('billingServiceGetInvoice', 'code', code)
442
+ const localVarPath = `/billingservice/v2/invoices/{code}`
443
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
444
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
445
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
446
+ let baseOptions;
447
+ let baseAccessToken;
448
+ if (configuration) {
449
+ baseOptions = configuration.baseOptions;
450
+ baseAccessToken = configuration.accessToken;
451
+ }
452
+
453
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
454
+ const localVarHeaderParameter = {} as any;
455
+ const localVarQueryParameter = {} as any;
456
+
457
+ if (expand !== undefined) {
458
+ localVarQueryParameter['expand'] = expand;
459
+ }
460
+
461
+
462
+
463
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
464
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
465
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
466
+
467
+ return {
468
+ url: toPathString(localVarUrlObj),
469
+ options: localVarRequestOptions,
470
+ };
471
+ },
472
+ /**
473
+ *
474
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
475
+ * @param {*} [options] Override http request option.
476
+ * @throws {RequiredError}
477
+ */
478
+ billingServiceGetInvoiceFilterCatalog: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
479
+ const localVarPath = `/billingservice/v2/invoices:filterCatalog`;
480
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
481
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
482
+ let baseOptions;
483
+ let baseAccessToken;
484
+ if (configuration) {
485
+ baseOptions = configuration.baseOptions;
486
+ baseAccessToken = configuration.accessToken;
487
+ }
488
+
489
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
490
+ const localVarHeaderParameter = {} as any;
491
+ const localVarQueryParameter = {} as any;
492
+
493
+
494
+
495
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
496
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
497
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
498
+
499
+ return {
500
+ url: toPathString(localVarUrlObj),
501
+ options: localVarRequestOptions,
502
+ };
503
+ },
504
+ /**
505
+ *
506
+ * @summary Returns the filter catalog of the policies-billing-dates list.
507
+ * @param {*} [options] Override http request option.
508
+ * @throws {RequiredError}
509
+ */
510
+ billingServiceGetPoliciesBillingDateFilterCatalog: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
511
+ const localVarPath = `/billingservice/v2/invoices/policies-billing-dates:filterCatalog`;
512
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
513
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
514
+ let baseOptions;
515
+ let baseAccessToken;
516
+ if (configuration) {
517
+ baseOptions = configuration.baseOptions;
518
+ baseAccessToken = configuration.accessToken;
519
+ }
520
+
521
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
522
+ const localVarHeaderParameter = {} as any;
523
+ const localVarQueryParameter = {} as any;
524
+
525
+
526
+
527
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
528
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
529
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
530
+
531
+ return {
532
+ url: toPathString(localVarUrlObj),
533
+ options: localVarRequestOptions,
534
+ };
535
+ },
536
+ /**
537
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
538
+ * @summary Lists invoices.
539
+ * @param {number} [pageSize]
540
+ * @param {string} [pageToken]
541
+ * @param {string} [filter]
542
+ * @param {string} [search]
543
+ * @param {string} [order]
544
+ * @param {string} [expand]
545
+ * @param {string} [filters]
546
+ * @param {*} [options] Override http request option.
547
+ * @throws {RequiredError}
548
+ */
549
+ billingServiceListInvoices: async (pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
550
+ const localVarPath = `/billingservice/v2/invoices`;
551
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
552
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
553
+ let baseOptions;
554
+ let baseAccessToken;
555
+ if (configuration) {
556
+ baseOptions = configuration.baseOptions;
557
+ baseAccessToken = configuration.accessToken;
558
+ }
559
+
560
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
561
+ const localVarHeaderParameter = {} as any;
562
+ const localVarQueryParameter = {} as any;
563
+
564
+ if (pageSize !== undefined) {
565
+ localVarQueryParameter['pageSize'] = pageSize;
566
+ }
567
+
568
+ if (pageToken !== undefined) {
569
+ localVarQueryParameter['pageToken'] = pageToken;
570
+ }
571
+
572
+ if (filter !== undefined) {
573
+ localVarQueryParameter['filter'] = filter;
574
+ }
575
+
576
+ if (search !== undefined) {
577
+ localVarQueryParameter['search'] = search;
578
+ }
579
+
580
+ if (order !== undefined) {
581
+ localVarQueryParameter['order'] = order;
582
+ }
583
+
584
+ if (expand !== undefined) {
585
+ localVarQueryParameter['expand'] = expand;
586
+ }
587
+
588
+ if (filters !== undefined) {
589
+ localVarQueryParameter['filters'] = filters;
590
+ }
591
+
592
+
593
+
594
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
595
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
596
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
597
+
598
+ return {
599
+ url: toPathString(localVarUrlObj),
600
+ options: localVarRequestOptions,
601
+ };
602
+ },
603
+ /**
604
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
605
+ * @summary Lists the billing schedule rows.
606
+ * @param {number} [pageSize]
607
+ * @param {string} [pageToken]
608
+ * @param {string} [filter]
609
+ * @param {string} [search]
610
+ * @param {string} [order]
611
+ * @param {string} [expand]
612
+ * @param {string} [filters]
613
+ * @param {*} [options] Override http request option.
614
+ * @throws {RequiredError}
615
+ */
616
+ billingServiceListPoliciesBillingDates: async (pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
617
+ const localVarPath = `/billingservice/v2/invoices/policies-billing-dates`;
618
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
619
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
620
+ let baseOptions;
621
+ let baseAccessToken;
622
+ if (configuration) {
623
+ baseOptions = configuration.baseOptions;
624
+ baseAccessToken = configuration.accessToken;
625
+ }
626
+
627
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
628
+ const localVarHeaderParameter = {} as any;
629
+ const localVarQueryParameter = {} as any;
630
+
631
+ if (pageSize !== undefined) {
632
+ localVarQueryParameter['pageSize'] = pageSize;
633
+ }
634
+
635
+ if (pageToken !== undefined) {
636
+ localVarQueryParameter['pageToken'] = pageToken;
637
+ }
638
+
639
+ if (filter !== undefined) {
640
+ localVarQueryParameter['filter'] = filter;
641
+ }
642
+
643
+ if (search !== undefined) {
644
+ localVarQueryParameter['search'] = search;
645
+ }
646
+
647
+ if (order !== undefined) {
648
+ localVarQueryParameter['order'] = order;
649
+ }
650
+
651
+ if (expand !== undefined) {
652
+ localVarQueryParameter['expand'] = expand;
653
+ }
654
+
655
+ if (filters !== undefined) {
656
+ localVarQueryParameter['filters'] = filters;
657
+ }
658
+
659
+
660
+
661
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
662
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
663
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
664
+
665
+ return {
666
+ url: toPathString(localVarUrlObj),
667
+ options: localVarRequestOptions,
668
+ };
669
+ },
670
+ /**
671
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
672
+ * @summary Reverses one invoice in full.
673
+ * @param {RevertInvoiceRequest} body The request of &#x60;RevertInvoice&#x60;.
674
+ * @param {*} [options] Override http request option.
675
+ * @throws {RequiredError}
676
+ */
677
+ billingServiceRevertInvoice: async (body: RevertInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
678
+ // verify required parameter 'body' is not null or undefined
679
+ assertParamExists('billingServiceRevertInvoice', 'body', body)
680
+ const localVarPath = `/billingservice/v2/correction-invoices/revert`;
681
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
682
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
683
+ let baseOptions;
684
+ let baseAccessToken;
685
+ if (configuration) {
686
+ baseOptions = configuration.baseOptions;
687
+ baseAccessToken = configuration.accessToken;
688
+ }
689
+
690
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
691
+ const localVarHeaderParameter = {} as any;
692
+ const localVarQueryParameter = {} as any;
693
+
694
+
695
+
696
+ localVarHeaderParameter['Content-Type'] = 'application/json';
697
+
698
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
699
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
700
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
701
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
702
+
703
+ return {
704
+ url: toPathString(localVarUrlObj),
705
+ options: localVarRequestOptions,
706
+ };
707
+ },
708
+ }
709
+ };
710
+
711
+ /**
712
+ * InvoicesApi - functional programming interface
713
+ * @export
714
+ */
715
+ export const InvoicesApiFp = function(configuration?: Configuration) {
716
+ const localVarAxiosParamCreator = InvoicesApiAxiosParamCreator(configuration)
717
+ return {
718
+ /**
719
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
720
+ * @summary Creates correction invoices for a policy.
721
+ * @param {CreateCorrectionInvoicesRequest} body The request of &#x60;CreateCorrectionInvoices&#x60;. Only &#x60;policyCode&#x60;, the billing interval and &#x60;metadata&#x60; are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
722
+ * @param {*} [options] Override http request option.
723
+ * @throws {RequiredError}
724
+ */
725
+ async billingServiceCreateCorrectionInvoices(body: CreateCorrectionInvoicesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCorrectionInvoicesResponse>> {
726
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateCorrectionInvoices(body, options);
727
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
728
+ },
729
+ /**
730
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
731
+ * @summary Creates an estimate for the running period of a policy.
732
+ * @param {CreateEstimatedInvoiceRequest} body The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
733
+ * @param {*} [options] Override http request option.
734
+ * @throws {RequiredError}
735
+ */
736
+ async billingServiceCreateEstimatedInvoice(body: CreateEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEstimatedInvoiceResponse>> {
737
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateEstimatedInvoice(body, options);
738
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
739
+ },
740
+ /**
741
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
742
+ * @summary Creates an estimate for an explicit period of a policy.
743
+ * @param {CreateEstimatedInvoiceForIntervalRequest} body The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
744
+ * @param {*} [options] Override http request option.
745
+ * @throws {RequiredError}
746
+ */
747
+ async billingServiceCreateEstimatedInvoiceForInterval(body: CreateEstimatedInvoiceForIntervalRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEstimatedInvoiceForIntervalResponse>> {
748
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateEstimatedInvoiceForInterval(body, options);
749
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
750
+ },
751
+ /**
752
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
753
+ * @summary Creates the first invoice of a policy.
754
+ * @param {CreateInitialInvoiceRequest} body The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
755
+ * @param {*} [options] Override http request option.
756
+ * @throws {RequiredError}
757
+ */
758
+ async billingServiceCreateInitialInvoice(body: CreateInitialInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInitialInvoiceResponse>> {
759
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateInitialInvoice(body, options);
760
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
761
+ },
762
+ /**
763
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
764
+ * @summary Creates a manual invoice with free items.
765
+ * @param {CreateInvoiceRequest} body The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
766
+ * @param {*} [options] Override http request option.
767
+ * @throws {RequiredError}
768
+ */
769
+ async billingServiceCreateInvoice(body: CreateInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceResponse>> {
770
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateInvoice(body, options);
771
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
772
+ },
773
+ /**
774
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
775
+ * @summary Adds a status row to an invoice.
776
+ * @param {string} invoiceCode The code of the invoice.
777
+ * @param {CreateInvoiceStatusBody} body
778
+ * @param {*} [options] Override http request option.
779
+ * @throws {RequiredError}
780
+ */
781
+ async billingServiceCreateInvoiceStatus(invoiceCode: string, body: CreateInvoiceStatusBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceStatusResponse>> {
782
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateInvoiceStatus(invoiceCode, body, options);
783
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
784
+ },
785
+ /**
786
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
787
+ * @summary Creates the recurring invoice for the next period of a policy.
788
+ * @param {CreateRecurringInvoiceRequest} body The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
789
+ * @param {*} [options] Override http request option.
790
+ * @throws {RequiredError}
791
+ */
792
+ async billingServiceCreateRecurringInvoice(body: CreateRecurringInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateRecurringInvoiceResponse>> {
793
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateRecurringInvoice(body, options);
794
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
795
+ },
796
+ /**
797
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
798
+ * @summary Creates the final invoice of a terminated policy.
799
+ * @param {CreateTerminationInvoiceRequest} body The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
800
+ * @param {*} [options] Override http request option.
801
+ * @throws {RequiredError}
802
+ */
803
+ async billingServiceCreateTerminationInvoice(body: CreateTerminationInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateTerminationInvoiceResponse>> {
804
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateTerminationInvoice(body, options);
805
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
806
+ },
807
+ /**
808
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
809
+ * @summary Creates a withdraw invoice for a policy that never came into force.
810
+ * @param {CreateWithdrawInvoiceRequest} body The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
811
+ * @param {*} [options] Override http request option.
812
+ * @throws {RequiredError}
813
+ */
814
+ async billingServiceCreateWithdrawInvoice(body: CreateWithdrawInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateWithdrawInvoiceResponse>> {
815
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateWithdrawInvoice(body, options);
816
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
817
+ },
818
+ /**
819
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
820
+ * @summary Returns one invoice.
821
+ * @param {string} code The invoice\&#39;s code.
822
+ * @param {string} [expand] The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
823
+ * @param {*} [options] Override http request option.
824
+ * @throws {RequiredError}
825
+ */
826
+ async billingServiceGetInvoice(code: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInvoiceResponse>> {
827
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetInvoice(code, expand, options);
828
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
829
+ },
830
+ /**
831
+ *
832
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
833
+ * @param {*} [options] Override http request option.
834
+ * @throws {RequiredError}
835
+ */
836
+ async billingServiceGetInvoiceFilterCatalog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInvoiceFilterCatalogResponse>> {
837
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetInvoiceFilterCatalog(options);
838
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
839
+ },
840
+ /**
841
+ *
842
+ * @summary Returns the filter catalog of the policies-billing-dates list.
843
+ * @param {*} [options] Override http request option.
844
+ * @throws {RequiredError}
845
+ */
846
+ async billingServiceGetPoliciesBillingDateFilterCatalog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPoliciesBillingDateFilterCatalogResponse>> {
847
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetPoliciesBillingDateFilterCatalog(options);
848
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
849
+ },
850
+ /**
851
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
852
+ * @summary Lists invoices.
853
+ * @param {number} [pageSize]
854
+ * @param {string} [pageToken]
855
+ * @param {string} [filter]
856
+ * @param {string} [search]
857
+ * @param {string} [order]
858
+ * @param {string} [expand]
859
+ * @param {string} [filters]
860
+ * @param {*} [options] Override http request option.
861
+ * @throws {RequiredError}
862
+ */
863
+ async billingServiceListInvoices(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListInvoicesResponse>> {
864
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceListInvoices(pageSize, pageToken, filter, search, order, expand, filters, options);
865
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
866
+ },
867
+ /**
868
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
869
+ * @summary Lists the billing schedule rows.
870
+ * @param {number} [pageSize]
871
+ * @param {string} [pageToken]
872
+ * @param {string} [filter]
873
+ * @param {string} [search]
874
+ * @param {string} [order]
875
+ * @param {string} [expand]
876
+ * @param {string} [filters]
877
+ * @param {*} [options] Override http request option.
878
+ * @throws {RequiredError}
879
+ */
880
+ async billingServiceListPoliciesBillingDates(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesBillingDatesResponse>> {
881
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceListPoliciesBillingDates(pageSize, pageToken, filter, search, order, expand, filters, options);
882
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
883
+ },
884
+ /**
885
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
886
+ * @summary Reverses one invoice in full.
887
+ * @param {RevertInvoiceRequest} body The request of &#x60;RevertInvoice&#x60;.
888
+ * @param {*} [options] Override http request option.
889
+ * @throws {RequiredError}
890
+ */
891
+ async billingServiceRevertInvoice(body: RevertInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RevertInvoiceResponse>> {
892
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceRevertInvoice(body, options);
893
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
894
+ },
895
+ }
896
+ };
897
+
898
+ /**
899
+ * InvoicesApi - factory interface
900
+ * @export
901
+ */
902
+ export const InvoicesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
903
+ const localVarFp = InvoicesApiFp(configuration)
904
+ return {
905
+ /**
906
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
907
+ * @summary Creates correction invoices for a policy.
908
+ * @param {CreateCorrectionInvoicesRequest} body The request of &#x60;CreateCorrectionInvoices&#x60;. Only &#x60;policyCode&#x60;, the billing interval and &#x60;metadata&#x60; are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
909
+ * @param {*} [options] Override http request option.
910
+ * @throws {RequiredError}
911
+ */
912
+ billingServiceCreateCorrectionInvoices(body: CreateCorrectionInvoicesRequest, options?: any): AxiosPromise<CreateCorrectionInvoicesResponse> {
913
+ return localVarFp.billingServiceCreateCorrectionInvoices(body, options).then((request) => request(axios, basePath));
914
+ },
915
+ /**
916
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
917
+ * @summary Creates an estimate for the running period of a policy.
918
+ * @param {CreateEstimatedInvoiceRequest} body The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
919
+ * @param {*} [options] Override http request option.
920
+ * @throws {RequiredError}
921
+ */
922
+ billingServiceCreateEstimatedInvoice(body: CreateEstimatedInvoiceRequest, options?: any): AxiosPromise<CreateEstimatedInvoiceResponse> {
923
+ return localVarFp.billingServiceCreateEstimatedInvoice(body, options).then((request) => request(axios, basePath));
924
+ },
925
+ /**
926
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
927
+ * @summary Creates an estimate for an explicit period of a policy.
928
+ * @param {CreateEstimatedInvoiceForIntervalRequest} body The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
929
+ * @param {*} [options] Override http request option.
930
+ * @throws {RequiredError}
931
+ */
932
+ billingServiceCreateEstimatedInvoiceForInterval(body: CreateEstimatedInvoiceForIntervalRequest, options?: any): AxiosPromise<CreateEstimatedInvoiceForIntervalResponse> {
933
+ return localVarFp.billingServiceCreateEstimatedInvoiceForInterval(body, options).then((request) => request(axios, basePath));
934
+ },
935
+ /**
936
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
937
+ * @summary Creates the first invoice of a policy.
938
+ * @param {CreateInitialInvoiceRequest} body The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
939
+ * @param {*} [options] Override http request option.
940
+ * @throws {RequiredError}
941
+ */
942
+ billingServiceCreateInitialInvoice(body: CreateInitialInvoiceRequest, options?: any): AxiosPromise<CreateInitialInvoiceResponse> {
943
+ return localVarFp.billingServiceCreateInitialInvoice(body, options).then((request) => request(axios, basePath));
944
+ },
945
+ /**
946
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
947
+ * @summary Creates a manual invoice with free items.
948
+ * @param {CreateInvoiceRequest} body The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
949
+ * @param {*} [options] Override http request option.
950
+ * @throws {RequiredError}
951
+ */
952
+ billingServiceCreateInvoice(body: CreateInvoiceRequest, options?: any): AxiosPromise<CreateInvoiceResponse> {
953
+ return localVarFp.billingServiceCreateInvoice(body, options).then((request) => request(axios, basePath));
954
+ },
955
+ /**
956
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
957
+ * @summary Adds a status row to an invoice.
958
+ * @param {string} invoiceCode The code of the invoice.
959
+ * @param {CreateInvoiceStatusBody} body
960
+ * @param {*} [options] Override http request option.
961
+ * @throws {RequiredError}
962
+ */
963
+ billingServiceCreateInvoiceStatus(invoiceCode: string, body: CreateInvoiceStatusBody, options?: any): AxiosPromise<CreateInvoiceStatusResponse> {
964
+ return localVarFp.billingServiceCreateInvoiceStatus(invoiceCode, body, options).then((request) => request(axios, basePath));
965
+ },
966
+ /**
967
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
968
+ * @summary Creates the recurring invoice for the next period of a policy.
969
+ * @param {CreateRecurringInvoiceRequest} body The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
970
+ * @param {*} [options] Override http request option.
971
+ * @throws {RequiredError}
972
+ */
973
+ billingServiceCreateRecurringInvoice(body: CreateRecurringInvoiceRequest, options?: any): AxiosPromise<CreateRecurringInvoiceResponse> {
974
+ return localVarFp.billingServiceCreateRecurringInvoice(body, options).then((request) => request(axios, basePath));
975
+ },
976
+ /**
977
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
978
+ * @summary Creates the final invoice of a terminated policy.
979
+ * @param {CreateTerminationInvoiceRequest} body The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
980
+ * @param {*} [options] Override http request option.
981
+ * @throws {RequiredError}
982
+ */
983
+ billingServiceCreateTerminationInvoice(body: CreateTerminationInvoiceRequest, options?: any): AxiosPromise<CreateTerminationInvoiceResponse> {
984
+ return localVarFp.billingServiceCreateTerminationInvoice(body, options).then((request) => request(axios, basePath));
985
+ },
986
+ /**
987
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
988
+ * @summary Creates a withdraw invoice for a policy that never came into force.
989
+ * @param {CreateWithdrawInvoiceRequest} body The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
990
+ * @param {*} [options] Override http request option.
991
+ * @throws {RequiredError}
992
+ */
993
+ billingServiceCreateWithdrawInvoice(body: CreateWithdrawInvoiceRequest, options?: any): AxiosPromise<CreateWithdrawInvoiceResponse> {
994
+ return localVarFp.billingServiceCreateWithdrawInvoice(body, options).then((request) => request(axios, basePath));
995
+ },
996
+ /**
997
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
998
+ * @summary Returns one invoice.
999
+ * @param {string} code The invoice\&#39;s code.
1000
+ * @param {string} [expand] The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
1001
+ * @param {*} [options] Override http request option.
1002
+ * @throws {RequiredError}
1003
+ */
1004
+ billingServiceGetInvoice(code: string, expand?: string, options?: any): AxiosPromise<GetInvoiceResponse> {
1005
+ return localVarFp.billingServiceGetInvoice(code, expand, options).then((request) => request(axios, basePath));
1006
+ },
1007
+ /**
1008
+ *
1009
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
1010
+ * @param {*} [options] Override http request option.
1011
+ * @throws {RequiredError}
1012
+ */
1013
+ billingServiceGetInvoiceFilterCatalog(options?: any): AxiosPromise<GetInvoiceFilterCatalogResponse> {
1014
+ return localVarFp.billingServiceGetInvoiceFilterCatalog(options).then((request) => request(axios, basePath));
1015
+ },
1016
+ /**
1017
+ *
1018
+ * @summary Returns the filter catalog of the policies-billing-dates list.
1019
+ * @param {*} [options] Override http request option.
1020
+ * @throws {RequiredError}
1021
+ */
1022
+ billingServiceGetPoliciesBillingDateFilterCatalog(options?: any): AxiosPromise<GetPoliciesBillingDateFilterCatalogResponse> {
1023
+ return localVarFp.billingServiceGetPoliciesBillingDateFilterCatalog(options).then((request) => request(axios, basePath));
1024
+ },
1025
+ /**
1026
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
1027
+ * @summary Lists invoices.
1028
+ * @param {number} [pageSize]
1029
+ * @param {string} [pageToken]
1030
+ * @param {string} [filter]
1031
+ * @param {string} [search]
1032
+ * @param {string} [order]
1033
+ * @param {string} [expand]
1034
+ * @param {string} [filters]
1035
+ * @param {*} [options] Override http request option.
1036
+ * @throws {RequiredError}
1037
+ */
1038
+ billingServiceListInvoices(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListInvoicesResponse> {
1039
+ return localVarFp.billingServiceListInvoices(pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
1040
+ },
1041
+ /**
1042
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
1043
+ * @summary Lists the billing schedule rows.
1044
+ * @param {number} [pageSize]
1045
+ * @param {string} [pageToken]
1046
+ * @param {string} [filter]
1047
+ * @param {string} [search]
1048
+ * @param {string} [order]
1049
+ * @param {string} [expand]
1050
+ * @param {string} [filters]
1051
+ * @param {*} [options] Override http request option.
1052
+ * @throws {RequiredError}
1053
+ */
1054
+ billingServiceListPoliciesBillingDates(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListPoliciesBillingDatesResponse> {
1055
+ return localVarFp.billingServiceListPoliciesBillingDates(pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
1056
+ },
1057
+ /**
1058
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
1059
+ * @summary Reverses one invoice in full.
1060
+ * @param {RevertInvoiceRequest} body The request of &#x60;RevertInvoice&#x60;.
1061
+ * @param {*} [options] Override http request option.
1062
+ * @throws {RequiredError}
1063
+ */
1064
+ billingServiceRevertInvoice(body: RevertInvoiceRequest, options?: any): AxiosPromise<RevertInvoiceResponse> {
1065
+ return localVarFp.billingServiceRevertInvoice(body, options).then((request) => request(axios, basePath));
1066
+ },
1067
+ };
1068
+ };
1069
+
1070
+ /**
1071
+ * Request parameters for billingServiceCreateCorrectionInvoices operation in InvoicesApi.
1072
+ * @export
1073
+ * @interface InvoicesApiBillingServiceCreateCorrectionInvoicesRequest
1074
+ */
1075
+ export interface InvoicesApiBillingServiceCreateCorrectionInvoicesRequest {
1076
+ /**
1077
+ * The request of &#x60;CreateCorrectionInvoices&#x60;. Only &#x60;policyCode&#x60;, the billing interval and &#x60;metadata&#x60; are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
1078
+ * @type {CreateCorrectionInvoicesRequest}
1079
+ * @memberof InvoicesApiBillingServiceCreateCorrectionInvoices
1080
+ */
1081
+ readonly body: CreateCorrectionInvoicesRequest
1082
+ }
1083
+
1084
+ /**
1085
+ * Request parameters for billingServiceCreateEstimatedInvoice operation in InvoicesApi.
1086
+ * @export
1087
+ * @interface InvoicesApiBillingServiceCreateEstimatedInvoiceRequest
1088
+ */
1089
+ export interface InvoicesApiBillingServiceCreateEstimatedInvoiceRequest {
1090
+ /**
1091
+ * The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
1092
+ * @type {CreateEstimatedInvoiceRequest}
1093
+ * @memberof InvoicesApiBillingServiceCreateEstimatedInvoice
1094
+ */
1095
+ readonly body: CreateEstimatedInvoiceRequest
1096
+ }
1097
+
1098
+ /**
1099
+ * Request parameters for billingServiceCreateEstimatedInvoiceForInterval operation in InvoicesApi.
1100
+ * @export
1101
+ * @interface InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest
1102
+ */
1103
+ export interface InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest {
1104
+ /**
1105
+ * The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
1106
+ * @type {CreateEstimatedInvoiceForIntervalRequest}
1107
+ * @memberof InvoicesApiBillingServiceCreateEstimatedInvoiceForInterval
1108
+ */
1109
+ readonly body: CreateEstimatedInvoiceForIntervalRequest
1110
+ }
1111
+
1112
+ /**
1113
+ * Request parameters for billingServiceCreateInitialInvoice operation in InvoicesApi.
1114
+ * @export
1115
+ * @interface InvoicesApiBillingServiceCreateInitialInvoiceRequest
1116
+ */
1117
+ export interface InvoicesApiBillingServiceCreateInitialInvoiceRequest {
1118
+ /**
1119
+ * The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
1120
+ * @type {CreateInitialInvoiceRequest}
1121
+ * @memberof InvoicesApiBillingServiceCreateInitialInvoice
1122
+ */
1123
+ readonly body: CreateInitialInvoiceRequest
1124
+ }
1125
+
1126
+ /**
1127
+ * Request parameters for billingServiceCreateInvoice operation in InvoicesApi.
1128
+ * @export
1129
+ * @interface InvoicesApiBillingServiceCreateInvoiceRequest
1130
+ */
1131
+ export interface InvoicesApiBillingServiceCreateInvoiceRequest {
1132
+ /**
1133
+ * The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
1134
+ * @type {CreateInvoiceRequest}
1135
+ * @memberof InvoicesApiBillingServiceCreateInvoice
1136
+ */
1137
+ readonly body: CreateInvoiceRequest
1138
+ }
1139
+
1140
+ /**
1141
+ * Request parameters for billingServiceCreateInvoiceStatus operation in InvoicesApi.
1142
+ * @export
1143
+ * @interface InvoicesApiBillingServiceCreateInvoiceStatusRequest
1144
+ */
1145
+ export interface InvoicesApiBillingServiceCreateInvoiceStatusRequest {
1146
+ /**
1147
+ * The code of the invoice.
1148
+ * @type {string}
1149
+ * @memberof InvoicesApiBillingServiceCreateInvoiceStatus
1150
+ */
1151
+ readonly invoiceCode: string
1152
+
1153
+ /**
1154
+ *
1155
+ * @type {CreateInvoiceStatusBody}
1156
+ * @memberof InvoicesApiBillingServiceCreateInvoiceStatus
1157
+ */
1158
+ readonly body: CreateInvoiceStatusBody
1159
+ }
1160
+
1161
+ /**
1162
+ * Request parameters for billingServiceCreateRecurringInvoice operation in InvoicesApi.
1163
+ * @export
1164
+ * @interface InvoicesApiBillingServiceCreateRecurringInvoiceRequest
1165
+ */
1166
+ export interface InvoicesApiBillingServiceCreateRecurringInvoiceRequest {
1167
+ /**
1168
+ * The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
1169
+ * @type {CreateRecurringInvoiceRequest}
1170
+ * @memberof InvoicesApiBillingServiceCreateRecurringInvoice
1171
+ */
1172
+ readonly body: CreateRecurringInvoiceRequest
1173
+ }
1174
+
1175
+ /**
1176
+ * Request parameters for billingServiceCreateTerminationInvoice operation in InvoicesApi.
1177
+ * @export
1178
+ * @interface InvoicesApiBillingServiceCreateTerminationInvoiceRequest
1179
+ */
1180
+ export interface InvoicesApiBillingServiceCreateTerminationInvoiceRequest {
1181
+ /**
1182
+ * The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
1183
+ * @type {CreateTerminationInvoiceRequest}
1184
+ * @memberof InvoicesApiBillingServiceCreateTerminationInvoice
1185
+ */
1186
+ readonly body: CreateTerminationInvoiceRequest
1187
+ }
1188
+
1189
+ /**
1190
+ * Request parameters for billingServiceCreateWithdrawInvoice operation in InvoicesApi.
1191
+ * @export
1192
+ * @interface InvoicesApiBillingServiceCreateWithdrawInvoiceRequest
1193
+ */
1194
+ export interface InvoicesApiBillingServiceCreateWithdrawInvoiceRequest {
1195
+ /**
1196
+ * The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
1197
+ * @type {CreateWithdrawInvoiceRequest}
1198
+ * @memberof InvoicesApiBillingServiceCreateWithdrawInvoice
1199
+ */
1200
+ readonly body: CreateWithdrawInvoiceRequest
1201
+ }
1202
+
1203
+ /**
1204
+ * Request parameters for billingServiceGetInvoice operation in InvoicesApi.
1205
+ * @export
1206
+ * @interface InvoicesApiBillingServiceGetInvoiceRequest
1207
+ */
1208
+ export interface InvoicesApiBillingServiceGetInvoiceRequest {
1209
+ /**
1210
+ * The invoice\&#39;s code.
1211
+ * @type {string}
1212
+ * @memberof InvoicesApiBillingServiceGetInvoice
1213
+ */
1214
+ readonly code: string
1215
+
1216
+ /**
1217
+ * The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
1218
+ * @type {string}
1219
+ * @memberof InvoicesApiBillingServiceGetInvoice
1220
+ */
1221
+ readonly expand?: string
1222
+ }
1223
+
1224
+ /**
1225
+ * Request parameters for billingServiceListInvoices operation in InvoicesApi.
1226
+ * @export
1227
+ * @interface InvoicesApiBillingServiceListInvoicesRequest
1228
+ */
1229
+ export interface InvoicesApiBillingServiceListInvoicesRequest {
1230
+ /**
1231
+ *
1232
+ * @type {number}
1233
+ * @memberof InvoicesApiBillingServiceListInvoices
1234
+ */
1235
+ readonly pageSize?: number
1236
+
1237
+ /**
1238
+ *
1239
+ * @type {string}
1240
+ * @memberof InvoicesApiBillingServiceListInvoices
1241
+ */
1242
+ readonly pageToken?: string
1243
+
1244
+ /**
1245
+ *
1246
+ * @type {string}
1247
+ * @memberof InvoicesApiBillingServiceListInvoices
1248
+ */
1249
+ readonly filter?: string
1250
+
1251
+ /**
1252
+ *
1253
+ * @type {string}
1254
+ * @memberof InvoicesApiBillingServiceListInvoices
1255
+ */
1256
+ readonly search?: string
1257
+
1258
+ /**
1259
+ *
1260
+ * @type {string}
1261
+ * @memberof InvoicesApiBillingServiceListInvoices
1262
+ */
1263
+ readonly order?: string
1264
+
1265
+ /**
1266
+ *
1267
+ * @type {string}
1268
+ * @memberof InvoicesApiBillingServiceListInvoices
1269
+ */
1270
+ readonly expand?: string
1271
+
1272
+ /**
1273
+ *
1274
+ * @type {string}
1275
+ * @memberof InvoicesApiBillingServiceListInvoices
1276
+ */
1277
+ readonly filters?: string
1278
+ }
1279
+
1280
+ /**
1281
+ * Request parameters for billingServiceListPoliciesBillingDates operation in InvoicesApi.
1282
+ * @export
1283
+ * @interface InvoicesApiBillingServiceListPoliciesBillingDatesRequest
1284
+ */
1285
+ export interface InvoicesApiBillingServiceListPoliciesBillingDatesRequest {
1286
+ /**
1287
+ *
1288
+ * @type {number}
1289
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1290
+ */
1291
+ readonly pageSize?: number
1292
+
1293
+ /**
1294
+ *
1295
+ * @type {string}
1296
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1297
+ */
1298
+ readonly pageToken?: string
1299
+
1300
+ /**
1301
+ *
1302
+ * @type {string}
1303
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1304
+ */
1305
+ readonly filter?: string
1306
+
1307
+ /**
1308
+ *
1309
+ * @type {string}
1310
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1311
+ */
1312
+ readonly search?: string
1313
+
1314
+ /**
1315
+ *
1316
+ * @type {string}
1317
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1318
+ */
1319
+ readonly order?: string
1320
+
1321
+ /**
1322
+ *
1323
+ * @type {string}
1324
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1325
+ */
1326
+ readonly expand?: string
1327
+
1328
+ /**
1329
+ *
1330
+ * @type {string}
1331
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1332
+ */
1333
+ readonly filters?: string
1334
+ }
1335
+
1336
+ /**
1337
+ * Request parameters for billingServiceRevertInvoice operation in InvoicesApi.
1338
+ * @export
1339
+ * @interface InvoicesApiBillingServiceRevertInvoiceRequest
1340
+ */
1341
+ export interface InvoicesApiBillingServiceRevertInvoiceRequest {
1342
+ /**
1343
+ * The request of &#x60;RevertInvoice&#x60;.
1344
+ * @type {RevertInvoiceRequest}
1345
+ * @memberof InvoicesApiBillingServiceRevertInvoice
1346
+ */
1347
+ readonly body: RevertInvoiceRequest
1348
+ }
1349
+
1350
+ /**
1351
+ * InvoicesApi - object-oriented interface
1352
+ * @export
1353
+ * @class InvoicesApi
1354
+ * @extends {BaseAPI}
1355
+ */
1356
+ export class InvoicesApi extends BaseAPI {
1357
+ /**
1358
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
1359
+ * @summary Creates correction invoices for a policy.
1360
+ * @param {InvoicesApiBillingServiceCreateCorrectionInvoicesRequest} requestParameters Request parameters.
1361
+ * @param {*} [options] Override http request option.
1362
+ * @throws {RequiredError}
1363
+ * @memberof InvoicesApi
1364
+ */
1365
+ public billingServiceCreateCorrectionInvoices(requestParameters: InvoicesApiBillingServiceCreateCorrectionInvoicesRequest, options?: AxiosRequestConfig) {
1366
+ return InvoicesApiFp(this.configuration).billingServiceCreateCorrectionInvoices(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1367
+ }
1368
+
1369
+ /**
1370
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
1371
+ * @summary Creates an estimate for the running period of a policy.
1372
+ * @param {InvoicesApiBillingServiceCreateEstimatedInvoiceRequest} requestParameters Request parameters.
1373
+ * @param {*} [options] Override http request option.
1374
+ * @throws {RequiredError}
1375
+ * @memberof InvoicesApi
1376
+ */
1377
+ public billingServiceCreateEstimatedInvoice(requestParameters: InvoicesApiBillingServiceCreateEstimatedInvoiceRequest, options?: AxiosRequestConfig) {
1378
+ return InvoicesApiFp(this.configuration).billingServiceCreateEstimatedInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1379
+ }
1380
+
1381
+ /**
1382
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
1383
+ * @summary Creates an estimate for an explicit period of a policy.
1384
+ * @param {InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest} requestParameters Request parameters.
1385
+ * @param {*} [options] Override http request option.
1386
+ * @throws {RequiredError}
1387
+ * @memberof InvoicesApi
1388
+ */
1389
+ public billingServiceCreateEstimatedInvoiceForInterval(requestParameters: InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest, options?: AxiosRequestConfig) {
1390
+ return InvoicesApiFp(this.configuration).billingServiceCreateEstimatedInvoiceForInterval(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1391
+ }
1392
+
1393
+ /**
1394
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
1395
+ * @summary Creates the first invoice of a policy.
1396
+ * @param {InvoicesApiBillingServiceCreateInitialInvoiceRequest} requestParameters Request parameters.
1397
+ * @param {*} [options] Override http request option.
1398
+ * @throws {RequiredError}
1399
+ * @memberof InvoicesApi
1400
+ */
1401
+ public billingServiceCreateInitialInvoice(requestParameters: InvoicesApiBillingServiceCreateInitialInvoiceRequest, options?: AxiosRequestConfig) {
1402
+ return InvoicesApiFp(this.configuration).billingServiceCreateInitialInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1403
+ }
1404
+
1405
+ /**
1406
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
1407
+ * @summary Creates a manual invoice with free items.
1408
+ * @param {InvoicesApiBillingServiceCreateInvoiceRequest} requestParameters Request parameters.
1409
+ * @param {*} [options] Override http request option.
1410
+ * @throws {RequiredError}
1411
+ * @memberof InvoicesApi
1412
+ */
1413
+ public billingServiceCreateInvoice(requestParameters: InvoicesApiBillingServiceCreateInvoiceRequest, options?: AxiosRequestConfig) {
1414
+ return InvoicesApiFp(this.configuration).billingServiceCreateInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1415
+ }
1416
+
1417
+ /**
1418
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
1419
+ * @summary Adds a status row to an invoice.
1420
+ * @param {InvoicesApiBillingServiceCreateInvoiceStatusRequest} requestParameters Request parameters.
1421
+ * @param {*} [options] Override http request option.
1422
+ * @throws {RequiredError}
1423
+ * @memberof InvoicesApi
1424
+ */
1425
+ public billingServiceCreateInvoiceStatus(requestParameters: InvoicesApiBillingServiceCreateInvoiceStatusRequest, options?: AxiosRequestConfig) {
1426
+ return InvoicesApiFp(this.configuration).billingServiceCreateInvoiceStatus(requestParameters.invoiceCode, requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1427
+ }
1428
+
1429
+ /**
1430
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
1431
+ * @summary Creates the recurring invoice for the next period of a policy.
1432
+ * @param {InvoicesApiBillingServiceCreateRecurringInvoiceRequest} requestParameters Request parameters.
1433
+ * @param {*} [options] Override http request option.
1434
+ * @throws {RequiredError}
1435
+ * @memberof InvoicesApi
1436
+ */
1437
+ public billingServiceCreateRecurringInvoice(requestParameters: InvoicesApiBillingServiceCreateRecurringInvoiceRequest, options?: AxiosRequestConfig) {
1438
+ return InvoicesApiFp(this.configuration).billingServiceCreateRecurringInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1439
+ }
1440
+
1441
+ /**
1442
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
1443
+ * @summary Creates the final invoice of a terminated policy.
1444
+ * @param {InvoicesApiBillingServiceCreateTerminationInvoiceRequest} requestParameters Request parameters.
1445
+ * @param {*} [options] Override http request option.
1446
+ * @throws {RequiredError}
1447
+ * @memberof InvoicesApi
1448
+ */
1449
+ public billingServiceCreateTerminationInvoice(requestParameters: InvoicesApiBillingServiceCreateTerminationInvoiceRequest, options?: AxiosRequestConfig) {
1450
+ return InvoicesApiFp(this.configuration).billingServiceCreateTerminationInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1451
+ }
1452
+
1453
+ /**
1454
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
1455
+ * @summary Creates a withdraw invoice for a policy that never came into force.
1456
+ * @param {InvoicesApiBillingServiceCreateWithdrawInvoiceRequest} requestParameters Request parameters.
1457
+ * @param {*} [options] Override http request option.
1458
+ * @throws {RequiredError}
1459
+ * @memberof InvoicesApi
1460
+ */
1461
+ public billingServiceCreateWithdrawInvoice(requestParameters: InvoicesApiBillingServiceCreateWithdrawInvoiceRequest, options?: AxiosRequestConfig) {
1462
+ return InvoicesApiFp(this.configuration).billingServiceCreateWithdrawInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1463
+ }
1464
+
1465
+ /**
1466
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
1467
+ * @summary Returns one invoice.
1468
+ * @param {InvoicesApiBillingServiceGetInvoiceRequest} requestParameters Request parameters.
1469
+ * @param {*} [options] Override http request option.
1470
+ * @throws {RequiredError}
1471
+ * @memberof InvoicesApi
1472
+ */
1473
+ public billingServiceGetInvoice(requestParameters: InvoicesApiBillingServiceGetInvoiceRequest, options?: AxiosRequestConfig) {
1474
+ return InvoicesApiFp(this.configuration).billingServiceGetInvoice(requestParameters.code, requestParameters.expand, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1475
+ }
1476
+
1477
+ /**
1478
+ *
1479
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
1480
+ * @param {*} [options] Override http request option.
1481
+ * @throws {RequiredError}
1482
+ * @memberof InvoicesApi
1483
+ */
1484
+ public billingServiceGetInvoiceFilterCatalog(options?: AxiosRequestConfig) {
1485
+ return InvoicesApiFp(this.configuration).billingServiceGetInvoiceFilterCatalog(this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1486
+ }
1487
+
1488
+ /**
1489
+ *
1490
+ * @summary Returns the filter catalog of the policies-billing-dates list.
1491
+ * @param {*} [options] Override http request option.
1492
+ * @throws {RequiredError}
1493
+ * @memberof InvoicesApi
1494
+ */
1495
+ public billingServiceGetPoliciesBillingDateFilterCatalog(options?: AxiosRequestConfig) {
1496
+ return InvoicesApiFp(this.configuration).billingServiceGetPoliciesBillingDateFilterCatalog(this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1497
+ }
1498
+
1499
+ /**
1500
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
1501
+ * @summary Lists invoices.
1502
+ * @param {InvoicesApiBillingServiceListInvoicesRequest} requestParameters Request parameters.
1503
+ * @param {*} [options] Override http request option.
1504
+ * @throws {RequiredError}
1505
+ * @memberof InvoicesApi
1506
+ */
1507
+ public billingServiceListInvoices(requestParameters: InvoicesApiBillingServiceListInvoicesRequest = {}, options?: AxiosRequestConfig) {
1508
+ return InvoicesApiFp(this.configuration).billingServiceListInvoices(requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1509
+ }
1510
+
1511
+ /**
1512
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
1513
+ * @summary Lists the billing schedule rows.
1514
+ * @param {InvoicesApiBillingServiceListPoliciesBillingDatesRequest} requestParameters Request parameters.
1515
+ * @param {*} [options] Override http request option.
1516
+ * @throws {RequiredError}
1517
+ * @memberof InvoicesApi
1518
+ */
1519
+ public billingServiceListPoliciesBillingDates(requestParameters: InvoicesApiBillingServiceListPoliciesBillingDatesRequest = {}, options?: AxiosRequestConfig) {
1520
+ return InvoicesApiFp(this.configuration).billingServiceListPoliciesBillingDates(requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1521
+ }
1522
+
1523
+ /**
1524
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
1525
+ * @summary Reverses one invoice in full.
1526
+ * @param {InvoicesApiBillingServiceRevertInvoiceRequest} requestParameters Request parameters.
1527
+ * @param {*} [options] Override http request option.
1528
+ * @throws {RequiredError}
1529
+ * @memberof InvoicesApi
1530
+ */
1531
+ public billingServiceRevertInvoice(requestParameters: InvoicesApiBillingServiceRevertInvoiceRequest, options?: AxiosRequestConfig) {
1532
+ return InvoicesApiFp(this.configuration).billingServiceRevertInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1533
+ }
1534
+ }