@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,595 @@
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 { CreatePolicyBillingRequest } from '../models';
25
+ // @ts-ignore
26
+ import { CreatePolicyBillingResponse } from '../models';
27
+ // @ts-ignore
28
+ import { GetPoliciesBillingFilterCatalogResponse } from '../models';
29
+ // @ts-ignore
30
+ import { GetPolicyBillingResponse } from '../models';
31
+ // @ts-ignore
32
+ import { ListPoliciesBillingsResponse } from '../models';
33
+ // @ts-ignore
34
+ import { Status } from '../models';
35
+ // @ts-ignore
36
+ import { UpdatePolicyBillingBody } from '../models';
37
+ // @ts-ignore
38
+ import { UpdatePolicyBillingResponse } from '../models';
39
+ // URLSearchParams not necessarily used
40
+ // @ts-ignore
41
+ import { URL, URLSearchParams } from 'url';
42
+ const FormData = require('form-data');
43
+ /**
44
+ * PolicyBillingsApi - axios parameter creator
45
+ * @export
46
+ */
47
+ export const PolicyBillingsApiAxiosParamCreator = function (configuration?: Configuration) {
48
+ return {
49
+ /**
50
+ * The row is computed from the policy and its billing configuration. When the policy already has a row, it is returned unchanged. Only `policyCode` is read. `policyCode` may also name a group policy: it gets a row only when it is active and bills its members\' premiums together. A member billed through its group policy gets a row with status `via_master`.
51
+ * @summary Opens the billing schedule row of a policy.
52
+ * @param {CreatePolicyBillingRequest} body The request of `CreatePolicyBilling`.
53
+ * @param {*} [options] Override http request option.
54
+ * @throws {RequiredError}
55
+ */
56
+ billingServiceCreatePolicyBilling: async (body: CreatePolicyBillingRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
57
+ // verify required parameter 'body' is not null or undefined
58
+ assertParamExists('billingServiceCreatePolicyBilling', 'body', body)
59
+ const localVarPath = `/billingservice/v2/policies-billings`;
60
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
61
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
62
+ let baseOptions;
63
+ let baseAccessToken;
64
+ if (configuration) {
65
+ baseOptions = configuration.baseOptions;
66
+ baseAccessToken = configuration.accessToken;
67
+ }
68
+
69
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
70
+ const localVarHeaderParameter = {} as any;
71
+ const localVarQueryParameter = {} as any;
72
+
73
+
74
+
75
+ localVarHeaderParameter['Content-Type'] = 'application/json';
76
+
77
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
78
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
79
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
80
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
81
+
82
+ return {
83
+ url: toPathString(localVarUrlObj),
84
+ options: localVarRequestOptions,
85
+ };
86
+ },
87
+ /**
88
+ *
89
+ * @summary Returns the filter catalog of the billing schedule list.
90
+ * @param {*} [options] Override http request option.
91
+ * @throws {RequiredError}
92
+ */
93
+ billingServiceGetPoliciesBillingFilterCatalog: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
94
+ const localVarPath = `/billingservice/v2/policies-billings:filterCatalog`;
95
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
96
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
97
+ let baseOptions;
98
+ let baseAccessToken;
99
+ if (configuration) {
100
+ baseOptions = configuration.baseOptions;
101
+ baseAccessToken = configuration.accessToken;
102
+ }
103
+
104
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
105
+ const localVarHeaderParameter = {} as any;
106
+ const localVarQueryParameter = {} as any;
107
+
108
+
109
+
110
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
111
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
112
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
113
+
114
+ return {
115
+ url: toPathString(localVarUrlObj),
116
+ options: localVarRequestOptions,
117
+ };
118
+ },
119
+ /**
120
+ * The row carries its `etag`, which `UpdatePolicyBilling` takes in the `If-Match` header.
121
+ * @summary Returns one billing schedule row.
122
+ * @param {string} code The code of the schedule row.
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ billingServiceGetPolicyBilling: async (code: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
127
+ // verify required parameter 'code' is not null or undefined
128
+ assertParamExists('billingServiceGetPolicyBilling', 'code', code)
129
+ const localVarPath = `/billingservice/v2/policies-billings/{code}`
130
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
131
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
132
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
133
+ let baseOptions;
134
+ let baseAccessToken;
135
+ if (configuration) {
136
+ baseOptions = configuration.baseOptions;
137
+ baseAccessToken = configuration.accessToken;
138
+ }
139
+
140
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
141
+ const localVarHeaderParameter = {} as any;
142
+ const localVarQueryParameter = {} as any;
143
+
144
+
145
+
146
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
147
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
148
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
149
+
150
+ return {
151
+ url: toPathString(localVarUrlObj),
152
+ options: localVarRequestOptions,
153
+ };
154
+ },
155
+ /**
156
+ * An item is the schedule row, with `match` when `search` is set. - Search: the policy and group policy codes.
157
+ * @summary Lists the billing schedule rows.
158
+ * @param {number} [pageSize]
159
+ * @param {string} [pageToken]
160
+ * @param {string} [filter]
161
+ * @param {string} [search]
162
+ * @param {string} [order]
163
+ * @param {string} [expand]
164
+ * @param {string} [filters]
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ */
168
+ billingServiceListPoliciesBillings: async (pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
169
+ const localVarPath = `/billingservice/v2/policies-billings`;
170
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
171
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
172
+ let baseOptions;
173
+ let baseAccessToken;
174
+ if (configuration) {
175
+ baseOptions = configuration.baseOptions;
176
+ baseAccessToken = configuration.accessToken;
177
+ }
178
+
179
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
180
+ const localVarHeaderParameter = {} as any;
181
+ const localVarQueryParameter = {} as any;
182
+
183
+ if (pageSize !== undefined) {
184
+ localVarQueryParameter['pageSize'] = pageSize;
185
+ }
186
+
187
+ if (pageToken !== undefined) {
188
+ localVarQueryParameter['pageToken'] = pageToken;
189
+ }
190
+
191
+ if (filter !== undefined) {
192
+ localVarQueryParameter['filter'] = filter;
193
+ }
194
+
195
+ if (search !== undefined) {
196
+ localVarQueryParameter['search'] = search;
197
+ }
198
+
199
+ if (order !== undefined) {
200
+ localVarQueryParameter['order'] = order;
201
+ }
202
+
203
+ if (expand !== undefined) {
204
+ localVarQueryParameter['expand'] = expand;
205
+ }
206
+
207
+ if (filters !== undefined) {
208
+ localVarQueryParameter['filters'] = filters;
209
+ }
210
+
211
+
212
+
213
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
214
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
215
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
216
+
217
+ return {
218
+ url: toPathString(localVarUrlObj),
219
+ options: localVarRequestOptions,
220
+ };
221
+ },
222
+ /**
223
+ * The new `status` is `paused` or `pending`.
224
+ * @summary Pauses or resumes a billing schedule row.
225
+ * @param {string} code The code of the schedule row.
226
+ * @param {string} ifMatch The billing row\&#39;s &#x60;etag&#x60; as last read, sent back unchanged.
227
+ * @param {UpdatePolicyBillingBody} body
228
+ * @param {*} [options] Override http request option.
229
+ * @throws {RequiredError}
230
+ */
231
+ billingServiceUpdatePolicyBilling: async (code: string, ifMatch: string, body: UpdatePolicyBillingBody, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
232
+ // verify required parameter 'code' is not null or undefined
233
+ assertParamExists('billingServiceUpdatePolicyBilling', 'code', code)
234
+ // verify required parameter 'ifMatch' is not null or undefined
235
+ assertParamExists('billingServiceUpdatePolicyBilling', 'ifMatch', ifMatch)
236
+ // verify required parameter 'body' is not null or undefined
237
+ assertParamExists('billingServiceUpdatePolicyBilling', 'body', body)
238
+ const localVarPath = `/billingservice/v2/policies-billings/{code}`
239
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
240
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
241
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
242
+ let baseOptions;
243
+ let baseAccessToken;
244
+ if (configuration) {
245
+ baseOptions = configuration.baseOptions;
246
+ baseAccessToken = configuration.accessToken;
247
+ }
248
+
249
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
250
+ const localVarHeaderParameter = {} as any;
251
+ const localVarQueryParameter = {} as any;
252
+
253
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
254
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
255
+ const ifMatchIsAuth = 'If-Match'.toLowerCase() === 'authorization';
256
+ const ifMatchValue = ifMatchIsAuth ? (ifMatch || baseAccessToken) : ifMatch;
257
+ const ifMatchKeepEmpty = ifMatchIsAuth && ifMatchValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
258
+ if (ifMatchValue || ifMatchKeepEmpty) {
259
+ localVarHeaderParameter['If-Match'] = String(ifMatchValue);
260
+ }
261
+
262
+
263
+
264
+ localVarHeaderParameter['Content-Type'] = 'application/json';
265
+
266
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
267
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
268
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
269
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
270
+
271
+ return {
272
+ url: toPathString(localVarUrlObj),
273
+ options: localVarRequestOptions,
274
+ };
275
+ },
276
+ }
277
+ };
278
+
279
+ /**
280
+ * PolicyBillingsApi - functional programming interface
281
+ * @export
282
+ */
283
+ export const PolicyBillingsApiFp = function(configuration?: Configuration) {
284
+ const localVarAxiosParamCreator = PolicyBillingsApiAxiosParamCreator(configuration)
285
+ return {
286
+ /**
287
+ * The row is computed from the policy and its billing configuration. When the policy already has a row, it is returned unchanged. Only `policyCode` is read. `policyCode` may also name a group policy: it gets a row only when it is active and bills its members\' premiums together. A member billed through its group policy gets a row with status `via_master`.
288
+ * @summary Opens the billing schedule row of a policy.
289
+ * @param {CreatePolicyBillingRequest} body The request of &#x60;CreatePolicyBilling&#x60;.
290
+ * @param {*} [options] Override http request option.
291
+ * @throws {RequiredError}
292
+ */
293
+ async billingServiceCreatePolicyBilling(body: CreatePolicyBillingRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePolicyBillingResponse>> {
294
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreatePolicyBilling(body, options);
295
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
296
+ },
297
+ /**
298
+ *
299
+ * @summary Returns the filter catalog of the billing schedule list.
300
+ * @param {*} [options] Override http request option.
301
+ * @throws {RequiredError}
302
+ */
303
+ async billingServiceGetPoliciesBillingFilterCatalog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPoliciesBillingFilterCatalogResponse>> {
304
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetPoliciesBillingFilterCatalog(options);
305
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
306
+ },
307
+ /**
308
+ * The row carries its `etag`, which `UpdatePolicyBilling` takes in the `If-Match` header.
309
+ * @summary Returns one billing schedule row.
310
+ * @param {string} code The code of the schedule row.
311
+ * @param {*} [options] Override http request option.
312
+ * @throws {RequiredError}
313
+ */
314
+ async billingServiceGetPolicyBilling(code: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPolicyBillingResponse>> {
315
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetPolicyBilling(code, options);
316
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
317
+ },
318
+ /**
319
+ * An item is the schedule row, with `match` when `search` is set. - Search: the policy and group policy codes.
320
+ * @summary Lists the billing schedule rows.
321
+ * @param {number} [pageSize]
322
+ * @param {string} [pageToken]
323
+ * @param {string} [filter]
324
+ * @param {string} [search]
325
+ * @param {string} [order]
326
+ * @param {string} [expand]
327
+ * @param {string} [filters]
328
+ * @param {*} [options] Override http request option.
329
+ * @throws {RequiredError}
330
+ */
331
+ async billingServiceListPoliciesBillings(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesBillingsResponse>> {
332
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceListPoliciesBillings(pageSize, pageToken, filter, search, order, expand, filters, options);
333
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
334
+ },
335
+ /**
336
+ * The new `status` is `paused` or `pending`.
337
+ * @summary Pauses or resumes a billing schedule row.
338
+ * @param {string} code The code of the schedule row.
339
+ * @param {string} ifMatch The billing row\&#39;s &#x60;etag&#x60; as last read, sent back unchanged.
340
+ * @param {UpdatePolicyBillingBody} body
341
+ * @param {*} [options] Override http request option.
342
+ * @throws {RequiredError}
343
+ */
344
+ async billingServiceUpdatePolicyBilling(code: string, ifMatch: string, body: UpdatePolicyBillingBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdatePolicyBillingResponse>> {
345
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceUpdatePolicyBilling(code, ifMatch, body, options);
346
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
347
+ },
348
+ }
349
+ };
350
+
351
+ /**
352
+ * PolicyBillingsApi - factory interface
353
+ * @export
354
+ */
355
+ export const PolicyBillingsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
356
+ const localVarFp = PolicyBillingsApiFp(configuration)
357
+ return {
358
+ /**
359
+ * The row is computed from the policy and its billing configuration. When the policy already has a row, it is returned unchanged. Only `policyCode` is read. `policyCode` may also name a group policy: it gets a row only when it is active and bills its members\' premiums together. A member billed through its group policy gets a row with status `via_master`.
360
+ * @summary Opens the billing schedule row of a policy.
361
+ * @param {CreatePolicyBillingRequest} body The request of &#x60;CreatePolicyBilling&#x60;.
362
+ * @param {*} [options] Override http request option.
363
+ * @throws {RequiredError}
364
+ */
365
+ billingServiceCreatePolicyBilling(body: CreatePolicyBillingRequest, options?: any): AxiosPromise<CreatePolicyBillingResponse> {
366
+ return localVarFp.billingServiceCreatePolicyBilling(body, options).then((request) => request(axios, basePath));
367
+ },
368
+ /**
369
+ *
370
+ * @summary Returns the filter catalog of the billing schedule list.
371
+ * @param {*} [options] Override http request option.
372
+ * @throws {RequiredError}
373
+ */
374
+ billingServiceGetPoliciesBillingFilterCatalog(options?: any): AxiosPromise<GetPoliciesBillingFilterCatalogResponse> {
375
+ return localVarFp.billingServiceGetPoliciesBillingFilterCatalog(options).then((request) => request(axios, basePath));
376
+ },
377
+ /**
378
+ * The row carries its `etag`, which `UpdatePolicyBilling` takes in the `If-Match` header.
379
+ * @summary Returns one billing schedule row.
380
+ * @param {string} code The code of the schedule row.
381
+ * @param {*} [options] Override http request option.
382
+ * @throws {RequiredError}
383
+ */
384
+ billingServiceGetPolicyBilling(code: string, options?: any): AxiosPromise<GetPolicyBillingResponse> {
385
+ return localVarFp.billingServiceGetPolicyBilling(code, options).then((request) => request(axios, basePath));
386
+ },
387
+ /**
388
+ * An item is the schedule row, with `match` when `search` is set. - Search: the policy and group policy codes.
389
+ * @summary Lists the billing schedule rows.
390
+ * @param {number} [pageSize]
391
+ * @param {string} [pageToken]
392
+ * @param {string} [filter]
393
+ * @param {string} [search]
394
+ * @param {string} [order]
395
+ * @param {string} [expand]
396
+ * @param {string} [filters]
397
+ * @param {*} [options] Override http request option.
398
+ * @throws {RequiredError}
399
+ */
400
+ billingServiceListPoliciesBillings(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListPoliciesBillingsResponse> {
401
+ return localVarFp.billingServiceListPoliciesBillings(pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
402
+ },
403
+ /**
404
+ * The new `status` is `paused` or `pending`.
405
+ * @summary Pauses or resumes a billing schedule row.
406
+ * @param {string} code The code of the schedule row.
407
+ * @param {string} ifMatch The billing row\&#39;s &#x60;etag&#x60; as last read, sent back unchanged.
408
+ * @param {UpdatePolicyBillingBody} body
409
+ * @param {*} [options] Override http request option.
410
+ * @throws {RequiredError}
411
+ */
412
+ billingServiceUpdatePolicyBilling(code: string, ifMatch: string, body: UpdatePolicyBillingBody, options?: any): AxiosPromise<UpdatePolicyBillingResponse> {
413
+ return localVarFp.billingServiceUpdatePolicyBilling(code, ifMatch, body, options).then((request) => request(axios, basePath));
414
+ },
415
+ };
416
+ };
417
+
418
+ /**
419
+ * Request parameters for billingServiceCreatePolicyBilling operation in PolicyBillingsApi.
420
+ * @export
421
+ * @interface PolicyBillingsApiBillingServiceCreatePolicyBillingRequest
422
+ */
423
+ export interface PolicyBillingsApiBillingServiceCreatePolicyBillingRequest {
424
+ /**
425
+ * The request of &#x60;CreatePolicyBilling&#x60;.
426
+ * @type {CreatePolicyBillingRequest}
427
+ * @memberof PolicyBillingsApiBillingServiceCreatePolicyBilling
428
+ */
429
+ readonly body: CreatePolicyBillingRequest
430
+ }
431
+
432
+ /**
433
+ * Request parameters for billingServiceGetPolicyBilling operation in PolicyBillingsApi.
434
+ * @export
435
+ * @interface PolicyBillingsApiBillingServiceGetPolicyBillingRequest
436
+ */
437
+ export interface PolicyBillingsApiBillingServiceGetPolicyBillingRequest {
438
+ /**
439
+ * The code of the schedule row.
440
+ * @type {string}
441
+ * @memberof PolicyBillingsApiBillingServiceGetPolicyBilling
442
+ */
443
+ readonly code: string
444
+ }
445
+
446
+ /**
447
+ * Request parameters for billingServiceListPoliciesBillings operation in PolicyBillingsApi.
448
+ * @export
449
+ * @interface PolicyBillingsApiBillingServiceListPoliciesBillingsRequest
450
+ */
451
+ export interface PolicyBillingsApiBillingServiceListPoliciesBillingsRequest {
452
+ /**
453
+ *
454
+ * @type {number}
455
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
456
+ */
457
+ readonly pageSize?: number
458
+
459
+ /**
460
+ *
461
+ * @type {string}
462
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
463
+ */
464
+ readonly pageToken?: string
465
+
466
+ /**
467
+ *
468
+ * @type {string}
469
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
470
+ */
471
+ readonly filter?: string
472
+
473
+ /**
474
+ *
475
+ * @type {string}
476
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
477
+ */
478
+ readonly search?: string
479
+
480
+ /**
481
+ *
482
+ * @type {string}
483
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
484
+ */
485
+ readonly order?: string
486
+
487
+ /**
488
+ *
489
+ * @type {string}
490
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
491
+ */
492
+ readonly expand?: string
493
+
494
+ /**
495
+ *
496
+ * @type {string}
497
+ * @memberof PolicyBillingsApiBillingServiceListPoliciesBillings
498
+ */
499
+ readonly filters?: string
500
+ }
501
+
502
+ /**
503
+ * Request parameters for billingServiceUpdatePolicyBilling operation in PolicyBillingsApi.
504
+ * @export
505
+ * @interface PolicyBillingsApiBillingServiceUpdatePolicyBillingRequest
506
+ */
507
+ export interface PolicyBillingsApiBillingServiceUpdatePolicyBillingRequest {
508
+ /**
509
+ * The code of the schedule row.
510
+ * @type {string}
511
+ * @memberof PolicyBillingsApiBillingServiceUpdatePolicyBilling
512
+ */
513
+ readonly code: string
514
+
515
+ /**
516
+ * The billing row\&#39;s &#x60;etag&#x60; as last read, sent back unchanged.
517
+ * @type {string}
518
+ * @memberof PolicyBillingsApiBillingServiceUpdatePolicyBilling
519
+ */
520
+ readonly ifMatch: string
521
+
522
+ /**
523
+ *
524
+ * @type {UpdatePolicyBillingBody}
525
+ * @memberof PolicyBillingsApiBillingServiceUpdatePolicyBilling
526
+ */
527
+ readonly body: UpdatePolicyBillingBody
528
+ }
529
+
530
+ /**
531
+ * PolicyBillingsApi - object-oriented interface
532
+ * @export
533
+ * @class PolicyBillingsApi
534
+ * @extends {BaseAPI}
535
+ */
536
+ export class PolicyBillingsApi extends BaseAPI {
537
+ /**
538
+ * The row is computed from the policy and its billing configuration. When the policy already has a row, it is returned unchanged. Only `policyCode` is read. `policyCode` may also name a group policy: it gets a row only when it is active and bills its members\' premiums together. A member billed through its group policy gets a row with status `via_master`.
539
+ * @summary Opens the billing schedule row of a policy.
540
+ * @param {PolicyBillingsApiBillingServiceCreatePolicyBillingRequest} requestParameters Request parameters.
541
+ * @param {*} [options] Override http request option.
542
+ * @throws {RequiredError}
543
+ * @memberof PolicyBillingsApi
544
+ */
545
+ public billingServiceCreatePolicyBilling(requestParameters: PolicyBillingsApiBillingServiceCreatePolicyBillingRequest, options?: AxiosRequestConfig) {
546
+ return PolicyBillingsApiFp(this.configuration).billingServiceCreatePolicyBilling(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
547
+ }
548
+
549
+ /**
550
+ *
551
+ * @summary Returns the filter catalog of the billing schedule list.
552
+ * @param {*} [options] Override http request option.
553
+ * @throws {RequiredError}
554
+ * @memberof PolicyBillingsApi
555
+ */
556
+ public billingServiceGetPoliciesBillingFilterCatalog(options?: AxiosRequestConfig) {
557
+ return PolicyBillingsApiFp(this.configuration).billingServiceGetPoliciesBillingFilterCatalog(this.withOwner(options)).then((request) => request(this.axios, this.basePath));
558
+ }
559
+
560
+ /**
561
+ * The row carries its `etag`, which `UpdatePolicyBilling` takes in the `If-Match` header.
562
+ * @summary Returns one billing schedule row.
563
+ * @param {PolicyBillingsApiBillingServiceGetPolicyBillingRequest} requestParameters Request parameters.
564
+ * @param {*} [options] Override http request option.
565
+ * @throws {RequiredError}
566
+ * @memberof PolicyBillingsApi
567
+ */
568
+ public billingServiceGetPolicyBilling(requestParameters: PolicyBillingsApiBillingServiceGetPolicyBillingRequest, options?: AxiosRequestConfig) {
569
+ return PolicyBillingsApiFp(this.configuration).billingServiceGetPolicyBilling(requestParameters.code, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
570
+ }
571
+
572
+ /**
573
+ * An item is the schedule row, with `match` when `search` is set. - Search: the policy and group policy codes.
574
+ * @summary Lists the billing schedule rows.
575
+ * @param {PolicyBillingsApiBillingServiceListPoliciesBillingsRequest} requestParameters Request parameters.
576
+ * @param {*} [options] Override http request option.
577
+ * @throws {RequiredError}
578
+ * @memberof PolicyBillingsApi
579
+ */
580
+ public billingServiceListPoliciesBillings(requestParameters: PolicyBillingsApiBillingServiceListPoliciesBillingsRequest = {}, options?: AxiosRequestConfig) {
581
+ return PolicyBillingsApiFp(this.configuration).billingServiceListPoliciesBillings(requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
582
+ }
583
+
584
+ /**
585
+ * The new `status` is `paused` or `pending`.
586
+ * @summary Pauses or resumes a billing schedule row.
587
+ * @param {PolicyBillingsApiBillingServiceUpdatePolicyBillingRequest} requestParameters Request parameters.
588
+ * @param {*} [options] Override http request option.
589
+ * @throws {RequiredError}
590
+ * @memberof PolicyBillingsApi
591
+ */
592
+ public billingServiceUpdatePolicyBilling(requestParameters: PolicyBillingsApiBillingServiceUpdatePolicyBillingRequest, options?: AxiosRequestConfig) {
593
+ return PolicyBillingsApiFp(this.configuration).billingServiceUpdatePolicyBilling(requestParameters.code, requestParameters.ifMatch, requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
594
+ }
595
+ }
package/api.ts ADDED
@@ -0,0 +1,39 @@
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 { Configuration } from './configuration';
17
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
18
+ // URLSearchParams not necessarily used
19
+ // @ts-ignore
20
+ import { URL, URLSearchParams } from 'url';
21
+ import FormData from 'form-data'
22
+ // Some imports not used depending on template conditions
23
+ // @ts-ignore
24
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
25
+ // @ts-ignore
26
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
27
+ import { BillRunsApi } from './api';
28
+ import { BillsApi } from './api';
29
+ import { InvoicesApi } from './api';
30
+ import { JobsApi } from './api';
31
+ import { PolicyBillingsApi } from './api';
32
+
33
+
34
+ export * from './api/bill-runs-api';
35
+ export * from './api/bills-api';
36
+ export * from './api/invoices-api';
37
+ export * from './api/jobs-api';
38
+ export * from './api/policy-billings-api';
39
+