@emilgroup/customer-sdk-node 1.6.0 → 1.9.0-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 (201) hide show
  1. package/.openapi-generator/FILES +19 -0
  2. package/README.md +2 -2
  3. package/api/claims-api.ts +557 -0
  4. package/api/customers-api.ts +248 -712
  5. package/api/policies-api.ts +856 -0
  6. package/api.ts +5 -1
  7. package/base.ts +24 -32
  8. package/common.ts +2 -1
  9. package/configuration.ts +1 -1
  10. package/dist/api/claims-api.d.ts +327 -0
  11. package/dist/api/claims-api.js +508 -0
  12. package/dist/api/customers-api.d.ts +171 -448
  13. package/dist/api/customers-api.js +189 -508
  14. package/dist/api/policies-api.d.ts +505 -0
  15. package/dist/api/policies-api.js +714 -0
  16. package/dist/api.d.ts +3 -1
  17. package/dist/api.js +3 -1
  18. package/dist/base.d.ts +2 -3
  19. package/dist/base.js +20 -21
  20. package/dist/common.d.ts +1 -1
  21. package/dist/common.js +2 -2
  22. package/dist/configuration.d.ts +1 -1
  23. package/dist/configuration.js +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/models/account-class.d.ts +4 -3
  27. package/dist/models/account-class.js +1 -1
  28. package/dist/models/account-policy-class.d.ts +30 -0
  29. package/dist/models/account-policy-class.js +15 -0
  30. package/dist/models/authentication-result-class.d.ts +1 -1
  31. package/dist/models/authentication-result-class.js +1 -1
  32. package/dist/models/complete-braintree-payment-setup-request-dto.d.ts +48 -0
  33. package/dist/models/complete-braintree-payment-setup-request-dto.js +15 -0
  34. package/dist/models/complete-payment-setup-psp-request.d.ts +32 -0
  35. package/dist/models/complete-payment-setup-psp-request.js +15 -0
  36. package/dist/models/complete-payment-setup-response-class.d.ts +24 -0
  37. package/dist/models/complete-payment-setup-response-class.js +15 -0
  38. package/dist/models/complete-stripe-payment-setup-request-dto.d.ts +60 -0
  39. package/dist/models/complete-stripe-payment-setup-request-dto.js +15 -0
  40. package/dist/models/create-account-request-dto.d.ts +96 -0
  41. package/dist/models/create-account-request-dto.js +21 -0
  42. package/dist/models/create-customer-claim-request-dto.d.ts +108 -0
  43. package/dist/models/create-customer-claim-request-dto.js +15 -0
  44. package/dist/models/create-customer-request-dto.d.ts +8 -1
  45. package/dist/models/create-customer-request-dto.js +1 -1
  46. package/dist/models/create-customer-response-class.d.ts +1 -1
  47. package/dist/models/create-customer-response-class.js +1 -1
  48. package/dist/models/create-presigned-post-response-class.d.ts +30 -0
  49. package/dist/models/create-presigned-post-response-class.js +15 -0
  50. package/dist/models/customer-class.d.ts +8 -2
  51. package/dist/models/customer-class.js +1 -1
  52. package/dist/models/customer-document-class.d.ts +2 -2
  53. package/dist/models/customer-document-class.js +1 -1
  54. package/dist/models/forgot-password-request-dto.d.ts +1 -1
  55. package/dist/models/forgot-password-request-dto.js +1 -1
  56. package/dist/models/get-customer-document-download-url-response-class.d.ts +1 -1
  57. package/dist/models/get-customer-document-download-url-response-class.js +1 -1
  58. package/dist/models/get-customer-response-class.d.ts +1 -1
  59. package/dist/models/get-customer-response-class.js +1 -1
  60. package/dist/models/get-policy-response-class.d.ts +1 -1
  61. package/dist/models/get-policy-response-class.js +1 -1
  62. package/dist/models/index.d.ts +17 -0
  63. package/dist/models/index.js +17 -0
  64. package/dist/models/initiate-auth-request-dto.d.ts +1 -1
  65. package/dist/models/initiate-auth-request-dto.js +1 -1
  66. package/dist/models/initiate-auth-response-class.d.ts +1 -1
  67. package/dist/models/initiate-auth-response-class.js +1 -1
  68. package/dist/models/initiate-braintree-payment-setup-response-class.d.ts +24 -0
  69. package/dist/models/initiate-braintree-payment-setup-response-class.js +15 -0
  70. package/dist/models/initiate-payment-setup-response-class.d.ts +32 -0
  71. package/dist/models/initiate-payment-setup-response-class.js +15 -0
  72. package/dist/models/initiate-stripe-payment-setup-response-class.d.ts +30 -0
  73. package/dist/models/initiate-stripe-payment-setup-response-class.js +15 -0
  74. package/dist/models/invite-by-customer-request-dto.d.ts +1 -1
  75. package/dist/models/invite-by-customer-request-dto.js +1 -1
  76. package/dist/models/invite-by-customer-response-class.d.ts +1 -1
  77. package/dist/models/invite-by-customer-response-class.js +1 -1
  78. package/dist/models/invite-by-tenant-response-class.d.ts +1 -1
  79. package/dist/models/invite-by-tenant-response-class.js +1 -1
  80. package/dist/models/invite-class.d.ts +1 -1
  81. package/dist/models/invite-class.js +1 -1
  82. package/dist/models/invoice-class.d.ts +3 -3
  83. package/dist/models/invoice-class.js +1 -1
  84. package/dist/models/list-documents-response-class.d.ts +1 -1
  85. package/dist/models/list-documents-response-class.js +1 -1
  86. package/dist/models/list-invoices-response-class.d.ts +1 -1
  87. package/dist/models/list-invoices-response-class.js +1 -1
  88. package/dist/models/list-policies-response-class.d.ts +1 -1
  89. package/dist/models/list-policies-response-class.js +1 -1
  90. package/dist/models/policy-class.d.ts +14 -1
  91. package/dist/models/policy-class.js +1 -1
  92. package/dist/models/policy-object-class.d.ts +1 -1
  93. package/dist/models/policy-object-class.js +1 -1
  94. package/dist/models/policy-premium-class.d.ts +1 -1
  95. package/dist/models/policy-premium-class.js +1 -1
  96. package/dist/models/policy-premium-item-class.d.ts +1 -1
  97. package/dist/models/policy-premium-item-class.js +1 -1
  98. package/dist/models/policy-version-class.d.ts +1 -1
  99. package/dist/models/policy-version-class.js +1 -1
  100. package/dist/models/refresh-token-dto.d.ts +1 -1
  101. package/dist/models/refresh-token-dto.js +1 -1
  102. package/dist/models/request-policy-update-request-dto.d.ts +4 -3
  103. package/dist/models/request-policy-update-request-dto.js +1 -1
  104. package/dist/models/request-policy-update-response-class.d.ts +1 -1
  105. package/dist/models/request-policy-update-response-class.js +1 -1
  106. package/dist/models/reset-password-by-customer-request-dto.d.ts +1 -1
  107. package/dist/models/reset-password-by-customer-request-dto.js +1 -1
  108. package/dist/models/respond-to-auth-challenge-class.d.ts +1 -1
  109. package/dist/models/respond-to-auth-challenge-class.js +1 -1
  110. package/dist/models/respond-to-auth-challenge-request-dto.d.ts +1 -1
  111. package/dist/models/respond-to-auth-challenge-request-dto.js +1 -1
  112. package/dist/models/shared-customer-policy-object-request-dto.d.ts +30 -0
  113. package/dist/models/shared-customer-policy-object-request-dto.js +15 -0
  114. package/dist/models/shared-customer-product-class.d.ts +54 -0
  115. package/dist/models/shared-customer-product-class.js +15 -0
  116. package/dist/models/shared-invoice-item-class.d.ts +1 -1
  117. package/dist/models/shared-invoice-item-class.js +1 -1
  118. package/dist/models/terminate-customer-policy-request-dto.d.ts +1 -1
  119. package/dist/models/terminate-customer-policy-request-dto.js +1 -1
  120. package/dist/models/terminate-customer-policy-response-class.d.ts +1 -1
  121. package/dist/models/terminate-customer-policy-response-class.js +1 -1
  122. package/dist/models/timeslice-class.d.ts +1 -1
  123. package/dist/models/timeslice-class.js +1 -1
  124. package/dist/models/to-grpc-customer-product-class.d.ts +54 -0
  125. package/dist/models/to-grpc-customer-product-class.js +15 -0
  126. package/dist/models/update-account-request-dto.d.ts +2 -2
  127. package/dist/models/update-account-request-dto.js +1 -1
  128. package/dist/models/update-customer-claim-request-dto.d.ts +120 -0
  129. package/dist/models/update-customer-claim-request-dto.js +15 -0
  130. package/dist/models/update-customer-request-dto.d.ts +1 -1
  131. package/dist/models/update-customer-request-dto.js +1 -1
  132. package/dist/models/update-customer-response-class.d.ts +1 -1
  133. package/dist/models/update-customer-response-class.js +1 -1
  134. package/dist/models/upload-customer-claim-documents-request-dto.d.ts +36 -0
  135. package/dist/models/upload-customer-claim-documents-request-dto.js +15 -0
  136. package/dist/models/upload-customer-policy-documents-request-dto.d.ts +47 -0
  137. package/dist/models/upload-customer-policy-documents-request-dto.js +20 -0
  138. package/dist/models/verify-customer-invite-response-class.d.ts +1 -1
  139. package/dist/models/verify-customer-invite-response-class.js +1 -1
  140. package/dist/models/withdraw-customer-policy-response-class.d.ts +1 -1
  141. package/dist/models/withdraw-customer-policy-response-class.js +1 -1
  142. package/index.ts +1 -1
  143. package/models/account-class.ts +4 -3
  144. package/models/account-policy-class.ts +36 -0
  145. package/models/authentication-result-class.ts +1 -1
  146. package/models/complete-braintree-payment-setup-request-dto.ts +54 -0
  147. package/models/complete-payment-setup-psp-request.ts +38 -0
  148. package/models/complete-payment-setup-response-class.ts +30 -0
  149. package/models/complete-stripe-payment-setup-request-dto.ts +66 -0
  150. package/models/create-account-request-dto.ts +105 -0
  151. package/models/create-customer-claim-request-dto.ts +114 -0
  152. package/models/create-customer-request-dto.ts +8 -1
  153. package/models/create-customer-response-class.ts +1 -1
  154. package/models/create-presigned-post-response-class.ts +36 -0
  155. package/models/customer-class.ts +8 -2
  156. package/models/customer-document-class.ts +1 -1
  157. package/models/forgot-password-request-dto.ts +1 -1
  158. package/models/get-customer-document-download-url-response-class.ts +1 -1
  159. package/models/get-customer-response-class.ts +1 -1
  160. package/models/get-policy-response-class.ts +1 -1
  161. package/models/index.ts +17 -0
  162. package/models/initiate-auth-request-dto.ts +1 -1
  163. package/models/initiate-auth-response-class.ts +1 -1
  164. package/models/initiate-braintree-payment-setup-response-class.ts +30 -0
  165. package/models/initiate-payment-setup-response-class.ts +38 -0
  166. package/models/initiate-stripe-payment-setup-response-class.ts +36 -0
  167. package/models/invite-by-customer-request-dto.ts +1 -1
  168. package/models/invite-by-customer-response-class.ts +1 -1
  169. package/models/invite-by-tenant-response-class.ts +1 -1
  170. package/models/invite-class.ts +1 -1
  171. package/models/invoice-class.ts +1 -1
  172. package/models/list-documents-response-class.ts +1 -1
  173. package/models/list-invoices-response-class.ts +1 -1
  174. package/models/list-policies-response-class.ts +1 -1
  175. package/models/policy-class.ts +14 -1
  176. package/models/policy-object-class.ts +1 -1
  177. package/models/policy-premium-class.ts +1 -1
  178. package/models/policy-premium-item-class.ts +1 -1
  179. package/models/policy-version-class.ts +1 -1
  180. package/models/refresh-token-dto.ts +1 -1
  181. package/models/request-policy-update-request-dto.ts +4 -3
  182. package/models/request-policy-update-response-class.ts +1 -1
  183. package/models/reset-password-by-customer-request-dto.ts +1 -1
  184. package/models/respond-to-auth-challenge-class.ts +1 -1
  185. package/models/respond-to-auth-challenge-request-dto.ts +1 -1
  186. package/models/shared-customer-policy-object-request-dto.ts +36 -0
  187. package/models/shared-customer-product-class.ts +60 -0
  188. package/models/shared-invoice-item-class.ts +1 -1
  189. package/models/terminate-customer-policy-request-dto.ts +1 -1
  190. package/models/terminate-customer-policy-response-class.ts +1 -1
  191. package/models/timeslice-class.ts +1 -1
  192. package/models/to-grpc-customer-product-class.ts +60 -0
  193. package/models/update-account-request-dto.ts +1 -1
  194. package/models/update-customer-claim-request-dto.ts +126 -0
  195. package/models/update-customer-request-dto.ts +1 -1
  196. package/models/update-customer-response-class.ts +1 -1
  197. package/models/upload-customer-claim-documents-request-dto.ts +42 -0
  198. package/models/upload-customer-policy-documents-request-dto.ts +56 -0
  199. package/models/verify-customer-invite-response-class.ts +1 -1
  200. package/models/withdraw-customer-policy-response-class.ts +1 -1
  201. package/package.json +2 -3
@@ -0,0 +1,856 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL CustomerService
5
+ * The EMIL CustomerService API description
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ * Contact: kontakt@emil.de
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 { CreatePresignedPostResponseClass } from '../models';
25
+ // @ts-ignore
26
+ import { GetPolicyResponseClass } from '../models';
27
+ // @ts-ignore
28
+ import { ListPoliciesResponseClass } from '../models';
29
+ // @ts-ignore
30
+ import { RequestPolicyUpdateRequestDto } from '../models';
31
+ // @ts-ignore
32
+ import { RequestPolicyUpdateResponseClass } from '../models';
33
+ // @ts-ignore
34
+ import { TerminateCustomerPolicyRequestDto } from '../models';
35
+ // @ts-ignore
36
+ import { TerminateCustomerPolicyResponseClass } from '../models';
37
+ // @ts-ignore
38
+ import { UploadCustomerPolicyDocumentsRequestDto } from '../models';
39
+ // @ts-ignore
40
+ import { WithdrawCustomerPolicyResponseClass } from '../models';
41
+ // URLSearchParams not necessarily used
42
+ // @ts-ignore
43
+ import { URL, URLSearchParams } from 'url';
44
+ const FormData = require('form-data');
45
+ /**
46
+ * PoliciesApi - axios parameter creator
47
+ * @export
48
+ */
49
+ export const PoliciesApiAxiosParamCreator = function (configuration?: Configuration) {
50
+ return {
51
+ /**
52
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
53
+ * @summary Get policy details
54
+ * @param {string} policyCode The code of the policy that the customer wants to fetch
55
+ * @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
56
+ * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
57
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
58
+ * @param {*} [options] Override http request option.
59
+ * @throws {RequiredError}
60
+ */
61
+ getPolicy: async (policyCode: string, customerCode: string, expand?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
62
+ // verify required parameter 'policyCode' is not null or undefined
63
+ assertParamExists('getPolicy', 'policyCode', policyCode)
64
+ // verify required parameter 'customerCode' is not null or undefined
65
+ assertParamExists('getPolicy', 'customerCode', customerCode)
66
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}`
67
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
68
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
69
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
70
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
71
+ let baseOptions;
72
+ let baseAccessToken;
73
+ if (configuration) {
74
+ baseOptions = configuration.baseOptions;
75
+ baseAccessToken = configuration.accessToken;
76
+ }
77
+
78
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
79
+ const localVarHeaderParameter = {} as any;
80
+ const localVarQueryParameter = {} as any;
81
+
82
+ if (expand !== undefined) {
83
+ localVarQueryParameter['expand'] = expand;
84
+ }
85
+
86
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
87
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
88
+ }
89
+
90
+
91
+
92
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
93
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
94
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
95
+
96
+ return {
97
+ url: toPathString(localVarUrlObj),
98
+ options: localVarRequestOptions,
99
+ };
100
+ },
101
+ /**
102
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
103
+ * @summary List policies of a customer
104
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
105
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
106
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
107
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
108
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
109
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
110
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
111
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ */
115
+ listPolicies: async (customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
116
+ // verify required parameter 'customerCode' is not null or undefined
117
+ assertParamExists('listPolicies', 'customerCode', customerCode)
118
+ const localVarPath = `/v1/customers/{customerCode}/policies`
119
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
120
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
121
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
122
+ let baseOptions;
123
+ let baseAccessToken;
124
+ if (configuration) {
125
+ baseOptions = configuration.baseOptions;
126
+ baseAccessToken = configuration.accessToken;
127
+ }
128
+
129
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
130
+ const localVarHeaderParameter = {} as any;
131
+ const localVarQueryParameter = {} as any;
132
+
133
+ if (pageSize !== undefined) {
134
+ localVarQueryParameter['pageSize'] = pageSize;
135
+ }
136
+
137
+ if (pageToken !== undefined) {
138
+ localVarQueryParameter['pageToken'] = pageToken;
139
+ }
140
+
141
+ if (filter !== undefined) {
142
+ localVarQueryParameter['filter'] = filter;
143
+ }
144
+
145
+ if (search !== undefined) {
146
+ localVarQueryParameter['search'] = search;
147
+ }
148
+
149
+ if (order !== undefined) {
150
+ localVarQueryParameter['order'] = order;
151
+ }
152
+
153
+ if (expand !== undefined) {
154
+ localVarQueryParameter['expand'] = expand;
155
+ }
156
+
157
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
158
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
159
+ }
160
+
161
+
162
+
163
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
164
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
165
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
166
+
167
+ return {
168
+ url: toPathString(localVarUrlObj),
169
+ options: localVarRequestOptions,
170
+ };
171
+ },
172
+ /**
173
+ * Request to update an existing policy by customer.
174
+ * @summary Request policy update by customer
175
+ * @param {string} policyCode The code of the policy that the customer wants to update.
176
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
177
+ * @param {RequestPolicyUpdateRequestDto} requestPolicyUpdateRequestDto
178
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
179
+ * @param {*} [options] Override http request option.
180
+ * @throws {RequiredError}
181
+ */
182
+ requestPolicyUpdate: async (policyCode: string, customerCode: string, requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
183
+ // verify required parameter 'policyCode' is not null or undefined
184
+ assertParamExists('requestPolicyUpdate', 'policyCode', policyCode)
185
+ // verify required parameter 'customerCode' is not null or undefined
186
+ assertParamExists('requestPolicyUpdate', 'customerCode', customerCode)
187
+ // verify required parameter 'requestPolicyUpdateRequestDto' is not null or undefined
188
+ assertParamExists('requestPolicyUpdate', 'requestPolicyUpdateRequestDto', requestPolicyUpdateRequestDto)
189
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/request-update`
190
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
191
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
192
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
193
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
194
+ let baseOptions;
195
+ let baseAccessToken;
196
+ if (configuration) {
197
+ baseOptions = configuration.baseOptions;
198
+ baseAccessToken = configuration.accessToken;
199
+ }
200
+
201
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
202
+ const localVarHeaderParameter = {} as any;
203
+ const localVarQueryParameter = {} as any;
204
+
205
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
206
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
207
+ }
208
+
209
+
210
+
211
+ localVarHeaderParameter['Content-Type'] = 'application/json';
212
+
213
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
214
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
215
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
216
+ localVarRequestOptions.data = serializeDataIfNeeded(requestPolicyUpdateRequestDto, localVarRequestOptions, configuration)
217
+
218
+ return {
219
+ url: toPathString(localVarUrlObj),
220
+ options: localVarRequestOptions,
221
+ };
222
+ },
223
+ /**
224
+ * Request to terminate an existing policy by customer.
225
+ * @summary Terminate a policy by customer
226
+ * @param {string} policyCode The code of the policy that the customer wants to terminate.
227
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
228
+ * @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
229
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ */
233
+ terminateCustomerPolicy: async (policyCode: string, customerCode: string, terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
234
+ // verify required parameter 'policyCode' is not null or undefined
235
+ assertParamExists('terminateCustomerPolicy', 'policyCode', policyCode)
236
+ // verify required parameter 'customerCode' is not null or undefined
237
+ assertParamExists('terminateCustomerPolicy', 'customerCode', customerCode)
238
+ // verify required parameter 'terminateCustomerPolicyRequestDto' is not null or undefined
239
+ assertParamExists('terminateCustomerPolicy', 'terminateCustomerPolicyRequestDto', terminateCustomerPolicyRequestDto)
240
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/terminate`
241
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
242
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
243
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
244
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
245
+ let baseOptions;
246
+ let baseAccessToken;
247
+ if (configuration) {
248
+ baseOptions = configuration.baseOptions;
249
+ baseAccessToken = configuration.accessToken;
250
+ }
251
+
252
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
253
+ const localVarHeaderParameter = {} as any;
254
+ const localVarQueryParameter = {} as any;
255
+
256
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
257
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
258
+ }
259
+
260
+
261
+
262
+ localVarHeaderParameter['Content-Type'] = 'application/json';
263
+
264
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
265
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
266
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
267
+ localVarRequestOptions.data = serializeDataIfNeeded(terminateCustomerPolicyRequestDto, localVarRequestOptions, configuration)
268
+
269
+ return {
270
+ url: toPathString(localVarUrlObj),
271
+ options: localVarRequestOptions,
272
+ };
273
+ },
274
+ /**
275
+ * API to upload and attach documents to a policy.
276
+ * @summary Upload policy documents
277
+ * @param {string} customerCode
278
+ * @param {string} policyCode The policy code to identify a policy.
279
+ * @param {UploadCustomerPolicyDocumentsRequestDto} uploadCustomerPolicyDocumentsRequestDto
280
+ * @param {*} [options] Override http request option.
281
+ * @throws {RequiredError}
282
+ */
283
+ uploadCustomerPolicyDocuments: async (customerCode: string, policyCode: string, uploadCustomerPolicyDocumentsRequestDto: UploadCustomerPolicyDocumentsRequestDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
284
+ // verify required parameter 'customerCode' is not null or undefined
285
+ assertParamExists('uploadCustomerPolicyDocuments', 'customerCode', customerCode)
286
+ // verify required parameter 'policyCode' is not null or undefined
287
+ assertParamExists('uploadCustomerPolicyDocuments', 'policyCode', policyCode)
288
+ // verify required parameter 'uploadCustomerPolicyDocumentsRequestDto' is not null or undefined
289
+ assertParamExists('uploadCustomerPolicyDocuments', 'uploadCustomerPolicyDocumentsRequestDto', uploadCustomerPolicyDocumentsRequestDto)
290
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/documents`
291
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)))
292
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)));
293
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
294
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
295
+ let baseOptions;
296
+ let baseAccessToken;
297
+ if (configuration) {
298
+ baseOptions = configuration.baseOptions;
299
+ baseAccessToken = configuration.accessToken;
300
+ }
301
+
302
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
303
+ const localVarHeaderParameter = {} as any;
304
+ const localVarQueryParameter = {} as any;
305
+
306
+
307
+
308
+ localVarHeaderParameter['Content-Type'] = 'application/json';
309
+
310
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
311
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
312
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
313
+ localVarRequestOptions.data = serializeDataIfNeeded(uploadCustomerPolicyDocumentsRequestDto, localVarRequestOptions, configuration)
314
+
315
+ return {
316
+ url: toPathString(localVarUrlObj),
317
+ options: localVarRequestOptions,
318
+ };
319
+ },
320
+ /**
321
+ * Withdraw policy by customer.
322
+ * @summary Withdraw policy by customer
323
+ * @param {string} policyCode The code of the policy that the customer wants to withdraw.
324
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
325
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
326
+ * @param {*} [options] Override http request option.
327
+ * @throws {RequiredError}
328
+ */
329
+ withdrawCustomerPolicy: async (policyCode: string, customerCode: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
330
+ // verify required parameter 'policyCode' is not null or undefined
331
+ assertParamExists('withdrawCustomerPolicy', 'policyCode', policyCode)
332
+ // verify required parameter 'customerCode' is not null or undefined
333
+ assertParamExists('withdrawCustomerPolicy', 'customerCode', customerCode)
334
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/withdraw`
335
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
336
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
337
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
338
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
339
+ let baseOptions;
340
+ let baseAccessToken;
341
+ if (configuration) {
342
+ baseOptions = configuration.baseOptions;
343
+ baseAccessToken = configuration.accessToken;
344
+ }
345
+
346
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
347
+ const localVarHeaderParameter = {} as any;
348
+ const localVarQueryParameter = {} as any;
349
+
350
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
351
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
352
+ }
353
+
354
+
355
+
356
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
357
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
358
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
359
+
360
+ return {
361
+ url: toPathString(localVarUrlObj),
362
+ options: localVarRequestOptions,
363
+ };
364
+ },
365
+ }
366
+ };
367
+
368
+ /**
369
+ * PoliciesApi - functional programming interface
370
+ * @export
371
+ */
372
+ export const PoliciesApiFp = function(configuration?: Configuration) {
373
+ const localVarAxiosParamCreator = PoliciesApiAxiosParamCreator(configuration)
374
+ return {
375
+ /**
376
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
377
+ * @summary Get policy details
378
+ * @param {string} policyCode The code of the policy that the customer wants to fetch
379
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
380
+ * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
381
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
382
+ * @param {*} [options] Override http request option.
383
+ * @throws {RequiredError}
384
+ */
385
+ async getPolicy(policyCode: string, customerCode: string, expand?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPolicyResponseClass>> {
386
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPolicy(policyCode, customerCode, expand, authorization, options);
387
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
388
+ },
389
+ /**
390
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
391
+ * @summary List policies of a customer
392
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
393
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
394
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
395
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
396
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
397
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
398
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
399
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
400
+ * @param {*} [options] Override http request option.
401
+ * @throws {RequiredError}
402
+ */
403
+ async listPolicies(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesResponseClass>> {
404
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listPolicies(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options);
405
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
406
+ },
407
+ /**
408
+ * Request to update an existing policy by customer.
409
+ * @summary Request policy update by customer
410
+ * @param {string} policyCode The code of the policy that the customer wants to update.
411
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
412
+ * @param {RequestPolicyUpdateRequestDto} requestPolicyUpdateRequestDto
413
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
414
+ * @param {*} [options] Override http request option.
415
+ * @throws {RequiredError}
416
+ */
417
+ async requestPolicyUpdate(policyCode: string, customerCode: string, requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RequestPolicyUpdateResponseClass>> {
418
+ const localVarAxiosArgs = await localVarAxiosParamCreator.requestPolicyUpdate(policyCode, customerCode, requestPolicyUpdateRequestDto, authorization, options);
419
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
420
+ },
421
+ /**
422
+ * Request to terminate an existing policy by customer.
423
+ * @summary Terminate a policy by customer
424
+ * @param {string} policyCode The code of the policy that the customer wants to terminate.
425
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
426
+ * @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
427
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
428
+ * @param {*} [options] Override http request option.
429
+ * @throws {RequiredError}
430
+ */
431
+ async terminateCustomerPolicy(policyCode: string, customerCode: string, terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TerminateCustomerPolicyResponseClass>> {
432
+ const localVarAxiosArgs = await localVarAxiosParamCreator.terminateCustomerPolicy(policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options);
433
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
434
+ },
435
+ /**
436
+ * API to upload and attach documents to a policy.
437
+ * @summary Upload policy documents
438
+ * @param {string} customerCode
439
+ * @param {string} policyCode The policy code to identify a policy.
440
+ * @param {UploadCustomerPolicyDocumentsRequestDto} uploadCustomerPolicyDocumentsRequestDto
441
+ * @param {*} [options] Override http request option.
442
+ * @throws {RequiredError}
443
+ */
444
+ async uploadCustomerPolicyDocuments(customerCode: string, policyCode: string, uploadCustomerPolicyDocumentsRequestDto: UploadCustomerPolicyDocumentsRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePresignedPostResponseClass>> {
445
+ const localVarAxiosArgs = await localVarAxiosParamCreator.uploadCustomerPolicyDocuments(customerCode, policyCode, uploadCustomerPolicyDocumentsRequestDto, options);
446
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
447
+ },
448
+ /**
449
+ * Withdraw policy by customer.
450
+ * @summary Withdraw policy by customer
451
+ * @param {string} policyCode The code of the policy that the customer wants to withdraw.
452
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
453
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
454
+ * @param {*} [options] Override http request option.
455
+ * @throws {RequiredError}
456
+ */
457
+ async withdrawCustomerPolicy(policyCode: string, customerCode: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WithdrawCustomerPolicyResponseClass>> {
458
+ const localVarAxiosArgs = await localVarAxiosParamCreator.withdrawCustomerPolicy(policyCode, customerCode, authorization, options);
459
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
460
+ },
461
+ }
462
+ };
463
+
464
+ /**
465
+ * PoliciesApi - factory interface
466
+ * @export
467
+ */
468
+ export const PoliciesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
469
+ const localVarFp = PoliciesApiFp(configuration)
470
+ return {
471
+ /**
472
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
473
+ * @summary Get policy details
474
+ * @param {string} policyCode The code of the policy that the customer wants to fetch
475
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
476
+ * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
477
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
478
+ * @param {*} [options] Override http request option.
479
+ * @throws {RequiredError}
480
+ */
481
+ getPolicy(policyCode: string, customerCode: string, expand?: string, authorization?: string, options?: any): AxiosPromise<GetPolicyResponseClass> {
482
+ return localVarFp.getPolicy(policyCode, customerCode, expand, authorization, options).then((request) => request(axios, basePath));
483
+ },
484
+ /**
485
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
486
+ * @summary List policies of a customer
487
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
488
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
489
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
490
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
491
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
492
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
493
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
494
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
495
+ * @param {*} [options] Override http request option.
496
+ * @throws {RequiredError}
497
+ */
498
+ listPolicies(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: any): AxiosPromise<ListPoliciesResponseClass> {
499
+ return localVarFp.listPolicies(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options).then((request) => request(axios, basePath));
500
+ },
501
+ /**
502
+ * Request to update an existing policy by customer.
503
+ * @summary Request policy update by customer
504
+ * @param {string} policyCode The code of the policy that the customer wants to update.
505
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
506
+ * @param {RequestPolicyUpdateRequestDto} requestPolicyUpdateRequestDto
507
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
508
+ * @param {*} [options] Override http request option.
509
+ * @throws {RequiredError}
510
+ */
511
+ requestPolicyUpdate(policyCode: string, customerCode: string, requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto, authorization?: string, options?: any): AxiosPromise<RequestPolicyUpdateResponseClass> {
512
+ return localVarFp.requestPolicyUpdate(policyCode, customerCode, requestPolicyUpdateRequestDto, authorization, options).then((request) => request(axios, basePath));
513
+ },
514
+ /**
515
+ * Request to terminate an existing policy by customer.
516
+ * @summary Terminate a policy by customer
517
+ * @param {string} policyCode The code of the policy that the customer wants to terminate.
518
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
519
+ * @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
520
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
521
+ * @param {*} [options] Override http request option.
522
+ * @throws {RequiredError}
523
+ */
524
+ terminateCustomerPolicy(policyCode: string, customerCode: string, terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto, authorization?: string, options?: any): AxiosPromise<TerminateCustomerPolicyResponseClass> {
525
+ return localVarFp.terminateCustomerPolicy(policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options).then((request) => request(axios, basePath));
526
+ },
527
+ /**
528
+ * API to upload and attach documents to a policy.
529
+ * @summary Upload policy documents
530
+ * @param {string} customerCode
531
+ * @param {string} policyCode The policy code to identify a policy.
532
+ * @param {UploadCustomerPolicyDocumentsRequestDto} uploadCustomerPolicyDocumentsRequestDto
533
+ * @param {*} [options] Override http request option.
534
+ * @throws {RequiredError}
535
+ */
536
+ uploadCustomerPolicyDocuments(customerCode: string, policyCode: string, uploadCustomerPolicyDocumentsRequestDto: UploadCustomerPolicyDocumentsRequestDto, options?: any): AxiosPromise<CreatePresignedPostResponseClass> {
537
+ return localVarFp.uploadCustomerPolicyDocuments(customerCode, policyCode, uploadCustomerPolicyDocumentsRequestDto, options).then((request) => request(axios, basePath));
538
+ },
539
+ /**
540
+ * Withdraw policy by customer.
541
+ * @summary Withdraw policy by customer
542
+ * @param {string} policyCode The code of the policy that the customer wants to withdraw.
543
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
544
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
545
+ * @param {*} [options] Override http request option.
546
+ * @throws {RequiredError}
547
+ */
548
+ withdrawCustomerPolicy(policyCode: string, customerCode: string, authorization?: string, options?: any): AxiosPromise<WithdrawCustomerPolicyResponseClass> {
549
+ return localVarFp.withdrawCustomerPolicy(policyCode, customerCode, authorization, options).then((request) => request(axios, basePath));
550
+ },
551
+ };
552
+ };
553
+
554
+ /**
555
+ * Request parameters for getPolicy operation in PoliciesApi.
556
+ * @export
557
+ * @interface PoliciesApiGetPolicyRequest
558
+ */
559
+ export interface PoliciesApiGetPolicyRequest {
560
+ /**
561
+ * The code of the policy that the customer wants to fetch
562
+ * @type {string}
563
+ * @memberof PoliciesApiGetPolicy
564
+ */
565
+ readonly policyCode: string
566
+
567
+ /**
568
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
569
+ * @type {string}
570
+ * @memberof PoliciesApiGetPolicy
571
+ */
572
+ readonly customerCode: string
573
+
574
+ /**
575
+ * Fields to expand response by - [versions, premiumItems]
576
+ * @type {string}
577
+ * @memberof PoliciesApiGetPolicy
578
+ */
579
+ readonly expand?: string
580
+
581
+ /**
582
+ * Bearer Token: provided by the login endpoint under the name accessToken.
583
+ * @type {string}
584
+ * @memberof PoliciesApiGetPolicy
585
+ */
586
+ readonly authorization?: string
587
+ }
588
+
589
+ /**
590
+ * Request parameters for listPolicies operation in PoliciesApi.
591
+ * @export
592
+ * @interface PoliciesApiListPoliciesRequest
593
+ */
594
+ export interface PoliciesApiListPoliciesRequest {
595
+ /**
596
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
597
+ * @type {string}
598
+ * @memberof PoliciesApiListPolicies
599
+ */
600
+ readonly customerCode: string
601
+
602
+ /**
603
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
604
+ * @type {any}
605
+ * @memberof PoliciesApiListPolicies
606
+ */
607
+ readonly pageSize?: any
608
+
609
+ /**
610
+ * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
611
+ * @type {any}
612
+ * @memberof PoliciesApiListPolicies
613
+ */
614
+ readonly pageToken?: any
615
+
616
+ /**
617
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
618
+ * @type {any}
619
+ * @memberof PoliciesApiListPolicies
620
+ */
621
+ readonly filter?: any
622
+
623
+ /**
624
+ * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
625
+ * @type {any}
626
+ * @memberof PoliciesApiListPolicies
627
+ */
628
+ readonly search?: any
629
+
630
+ /**
631
+ * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
632
+ * @type {any}
633
+ * @memberof PoliciesApiListPolicies
634
+ */
635
+ readonly order?: any
636
+
637
+ /**
638
+ * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
639
+ * @type {any}
640
+ * @memberof PoliciesApiListPolicies
641
+ */
642
+ readonly expand?: any
643
+
644
+ /**
645
+ * Bearer Token: provided by the login endpoint under the name accessToken.
646
+ * @type {string}
647
+ * @memberof PoliciesApiListPolicies
648
+ */
649
+ readonly authorization?: string
650
+ }
651
+
652
+ /**
653
+ * Request parameters for requestPolicyUpdate operation in PoliciesApi.
654
+ * @export
655
+ * @interface PoliciesApiRequestPolicyUpdateRequest
656
+ */
657
+ export interface PoliciesApiRequestPolicyUpdateRequest {
658
+ /**
659
+ * The code of the policy that the customer wants to update.
660
+ * @type {string}
661
+ * @memberof PoliciesApiRequestPolicyUpdate
662
+ */
663
+ readonly policyCode: string
664
+
665
+ /**
666
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
667
+ * @type {string}
668
+ * @memberof PoliciesApiRequestPolicyUpdate
669
+ */
670
+ readonly customerCode: string
671
+
672
+ /**
673
+ *
674
+ * @type {RequestPolicyUpdateRequestDto}
675
+ * @memberof PoliciesApiRequestPolicyUpdate
676
+ */
677
+ readonly requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto
678
+
679
+ /**
680
+ * Bearer Token: provided by the login endpoint under the name accessToken.
681
+ * @type {string}
682
+ * @memberof PoliciesApiRequestPolicyUpdate
683
+ */
684
+ readonly authorization?: string
685
+ }
686
+
687
+ /**
688
+ * Request parameters for terminateCustomerPolicy operation in PoliciesApi.
689
+ * @export
690
+ * @interface PoliciesApiTerminateCustomerPolicyRequest
691
+ */
692
+ export interface PoliciesApiTerminateCustomerPolicyRequest {
693
+ /**
694
+ * The code of the policy that the customer wants to terminate.
695
+ * @type {string}
696
+ * @memberof PoliciesApiTerminateCustomerPolicy
697
+ */
698
+ readonly policyCode: string
699
+
700
+ /**
701
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
702
+ * @type {string}
703
+ * @memberof PoliciesApiTerminateCustomerPolicy
704
+ */
705
+ readonly customerCode: string
706
+
707
+ /**
708
+ *
709
+ * @type {TerminateCustomerPolicyRequestDto}
710
+ * @memberof PoliciesApiTerminateCustomerPolicy
711
+ */
712
+ readonly terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto
713
+
714
+ /**
715
+ * Bearer Token: provided by the login endpoint under the name accessToken.
716
+ * @type {string}
717
+ * @memberof PoliciesApiTerminateCustomerPolicy
718
+ */
719
+ readonly authorization?: string
720
+ }
721
+
722
+ /**
723
+ * Request parameters for uploadCustomerPolicyDocuments operation in PoliciesApi.
724
+ * @export
725
+ * @interface PoliciesApiUploadCustomerPolicyDocumentsRequest
726
+ */
727
+ export interface PoliciesApiUploadCustomerPolicyDocumentsRequest {
728
+ /**
729
+ *
730
+ * @type {string}
731
+ * @memberof PoliciesApiUploadCustomerPolicyDocuments
732
+ */
733
+ readonly customerCode: string
734
+
735
+ /**
736
+ * The policy code to identify a policy.
737
+ * @type {string}
738
+ * @memberof PoliciesApiUploadCustomerPolicyDocuments
739
+ */
740
+ readonly policyCode: string
741
+
742
+ /**
743
+ *
744
+ * @type {UploadCustomerPolicyDocumentsRequestDto}
745
+ * @memberof PoliciesApiUploadCustomerPolicyDocuments
746
+ */
747
+ readonly uploadCustomerPolicyDocumentsRequestDto: UploadCustomerPolicyDocumentsRequestDto
748
+ }
749
+
750
+ /**
751
+ * Request parameters for withdrawCustomerPolicy operation in PoliciesApi.
752
+ * @export
753
+ * @interface PoliciesApiWithdrawCustomerPolicyRequest
754
+ */
755
+ export interface PoliciesApiWithdrawCustomerPolicyRequest {
756
+ /**
757
+ * The code of the policy that the customer wants to withdraw.
758
+ * @type {string}
759
+ * @memberof PoliciesApiWithdrawCustomerPolicy
760
+ */
761
+ readonly policyCode: string
762
+
763
+ /**
764
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
765
+ * @type {string}
766
+ * @memberof PoliciesApiWithdrawCustomerPolicy
767
+ */
768
+ readonly customerCode: string
769
+
770
+ /**
771
+ * Bearer Token: provided by the login endpoint under the name accessToken.
772
+ * @type {string}
773
+ * @memberof PoliciesApiWithdrawCustomerPolicy
774
+ */
775
+ readonly authorization?: string
776
+ }
777
+
778
+ /**
779
+ * PoliciesApi - object-oriented interface
780
+ * @export
781
+ * @class PoliciesApi
782
+ * @extends {BaseAPI}
783
+ */
784
+ export class PoliciesApi extends BaseAPI {
785
+ /**
786
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
787
+ * @summary Get policy details
788
+ * @param {PoliciesApiGetPolicyRequest} requestParameters Request parameters.
789
+ * @param {*} [options] Override http request option.
790
+ * @throws {RequiredError}
791
+ * @memberof PoliciesApi
792
+ */
793
+ public getPolicy(requestParameters: PoliciesApiGetPolicyRequest, options?: AxiosRequestConfig) {
794
+ return PoliciesApiFp(this.configuration).getPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.expand, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
795
+ }
796
+
797
+ /**
798
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
799
+ * @summary List policies of a customer
800
+ * @param {PoliciesApiListPoliciesRequest} requestParameters Request parameters.
801
+ * @param {*} [options] Override http request option.
802
+ * @throws {RequiredError}
803
+ * @memberof PoliciesApi
804
+ */
805
+ public listPolicies(requestParameters: PoliciesApiListPoliciesRequest, options?: AxiosRequestConfig) {
806
+ return PoliciesApiFp(this.configuration).listPolicies(requestParameters.customerCode, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
807
+ }
808
+
809
+ /**
810
+ * Request to update an existing policy by customer.
811
+ * @summary Request policy update by customer
812
+ * @param {PoliciesApiRequestPolicyUpdateRequest} requestParameters Request parameters.
813
+ * @param {*} [options] Override http request option.
814
+ * @throws {RequiredError}
815
+ * @memberof PoliciesApi
816
+ */
817
+ public requestPolicyUpdate(requestParameters: PoliciesApiRequestPolicyUpdateRequest, options?: AxiosRequestConfig) {
818
+ return PoliciesApiFp(this.configuration).requestPolicyUpdate(requestParameters.policyCode, requestParameters.customerCode, requestParameters.requestPolicyUpdateRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
819
+ }
820
+
821
+ /**
822
+ * Request to terminate an existing policy by customer.
823
+ * @summary Terminate a policy by customer
824
+ * @param {PoliciesApiTerminateCustomerPolicyRequest} requestParameters Request parameters.
825
+ * @param {*} [options] Override http request option.
826
+ * @throws {RequiredError}
827
+ * @memberof PoliciesApi
828
+ */
829
+ public terminateCustomerPolicy(requestParameters: PoliciesApiTerminateCustomerPolicyRequest, options?: AxiosRequestConfig) {
830
+ return PoliciesApiFp(this.configuration).terminateCustomerPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.terminateCustomerPolicyRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
831
+ }
832
+
833
+ /**
834
+ * API to upload and attach documents to a policy.
835
+ * @summary Upload policy documents
836
+ * @param {PoliciesApiUploadCustomerPolicyDocumentsRequest} requestParameters Request parameters.
837
+ * @param {*} [options] Override http request option.
838
+ * @throws {RequiredError}
839
+ * @memberof PoliciesApi
840
+ */
841
+ public uploadCustomerPolicyDocuments(requestParameters: PoliciesApiUploadCustomerPolicyDocumentsRequest, options?: AxiosRequestConfig) {
842
+ return PoliciesApiFp(this.configuration).uploadCustomerPolicyDocuments(requestParameters.customerCode, requestParameters.policyCode, requestParameters.uploadCustomerPolicyDocumentsRequestDto, options).then((request) => request(this.axios, this.basePath));
843
+ }
844
+
845
+ /**
846
+ * Withdraw policy by customer.
847
+ * @summary Withdraw policy by customer
848
+ * @param {PoliciesApiWithdrawCustomerPolicyRequest} requestParameters Request parameters.
849
+ * @param {*} [options] Override http request option.
850
+ * @throws {RequiredError}
851
+ * @memberof PoliciesApi
852
+ */
853
+ public withdrawCustomerPolicy(requestParameters: PoliciesApiWithdrawCustomerPolicyRequest, options?: AxiosRequestConfig) {
854
+ return PoliciesApiFp(this.configuration).withdrawCustomerPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
855
+ }
856
+ }