@emilgroup/customer-sdk-node 1.3.0 → 1.6.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 (65) hide show
  1. package/.openapi-generator/FILES +15 -1
  2. package/README.md +2 -2
  3. package/api/customers-api.ts +798 -82
  4. package/base.ts +56 -13
  5. package/dist/api/customers-api.d.ts +456 -36
  6. package/dist/api/customers-api.js +579 -40
  7. package/dist/base.d.ts +1 -0
  8. package/dist/base.js +46 -8
  9. package/dist/models/account-class.d.ts +132 -0
  10. package/dist/models/account-class.js +15 -0
  11. package/dist/models/create-customer-request-dto.d.ts +0 -7
  12. package/dist/models/create-customer-response-class.d.ts +3 -2
  13. package/dist/models/customer-class.d.ts +67 -0
  14. package/dist/models/customer-class.js +15 -0
  15. package/dist/models/customer-document-class.d.ts +99 -0
  16. package/dist/models/customer-document-class.js +36 -0
  17. package/dist/models/get-customer-document-download-url-response-class.d.ts +24 -0
  18. package/dist/models/get-customer-document-download-url-response-class.js +15 -0
  19. package/dist/models/get-customer-response-class.d.ts +25 -0
  20. package/dist/models/get-customer-response-class.js +15 -0
  21. package/dist/models/index.d.ts +15 -1
  22. package/dist/models/index.js +15 -1
  23. package/dist/models/invoice-class.d.ts +135 -0
  24. package/dist/models/invoice-class.js +28 -0
  25. package/dist/models/list-documents-response-class.d.ts +31 -0
  26. package/dist/models/list-documents-response-class.js +15 -0
  27. package/dist/models/list-invoices-response-class.d.ts +3 -2
  28. package/dist/models/request-policy-update-request-dto.d.ts +42 -0
  29. package/dist/models/request-policy-update-request-dto.js +15 -0
  30. package/dist/models/reset-password-by-customer-request-dto.d.ts +1 -1
  31. package/dist/models/shared-invoice-item-class.d.ts +102 -0
  32. package/dist/models/shared-invoice-item-class.js +15 -0
  33. package/dist/models/terminate-customer-policy-request-dto.d.ts +24 -0
  34. package/dist/models/terminate-customer-policy-request-dto.js +15 -0
  35. package/dist/models/terminate-customer-policy-response-class.d.ts +25 -0
  36. package/dist/models/terminate-customer-policy-response-class.js +15 -0
  37. package/dist/models/{create-account-request-dto.d.ts → update-account-request-dto.d.ts} +26 -32
  38. package/dist/models/{create-account-request-dto.js → update-account-request-dto.js} +2 -2
  39. package/dist/models/update-customer-request-dto.d.ts +31 -0
  40. package/dist/models/update-customer-request-dto.js +15 -0
  41. package/dist/models/update-customer-response-class.d.ts +25 -0
  42. package/dist/models/update-customer-response-class.js +15 -0
  43. package/dist/models/withdraw-customer-policy-response-class.d.ts +25 -0
  44. package/dist/models/withdraw-customer-policy-response-class.js +15 -0
  45. package/models/account-class.ts +138 -0
  46. package/models/create-customer-request-dto.ts +0 -7
  47. package/models/create-customer-response-class.ts +3 -2
  48. package/models/customer-class.ts +73 -0
  49. package/models/customer-document-class.ts +108 -0
  50. package/models/get-customer-document-download-url-response-class.ts +30 -0
  51. package/models/get-customer-response-class.ts +31 -0
  52. package/models/index.ts +15 -1
  53. package/models/invoice-class.ts +145 -0
  54. package/models/list-documents-response-class.ts +37 -0
  55. package/models/list-invoices-response-class.ts +3 -2
  56. package/models/request-policy-update-request-dto.ts +48 -0
  57. package/models/reset-password-by-customer-request-dto.ts +1 -1
  58. package/models/shared-invoice-item-class.ts +108 -0
  59. package/models/terminate-customer-policy-request-dto.ts +30 -0
  60. package/models/terminate-customer-policy-response-class.ts +31 -0
  61. package/models/{create-account-request-dto.ts → update-account-request-dto.ts} +26 -32
  62. package/models/update-customer-request-dto.ts +37 -0
  63. package/models/update-customer-response-class.ts +31 -0
  64. package/models/withdraw-customer-policy-response-class.ts +31 -0
  65. package/package.json +1 -1
@@ -27,6 +27,10 @@ import { CreateCustomerResponseClass } from '../models';
27
27
  // @ts-ignore
28
28
  import { ForgotPasswordRequestDto } from '../models';
29
29
  // @ts-ignore
30
+ import { GetCustomerDocumentDownloadUrlResponseClass } from '../models';
31
+ // @ts-ignore
32
+ import { GetCustomerResponseClass } from '../models';
33
+ // @ts-ignore
30
34
  import { GetPolicyResponseClass } from '../models';
31
35
  // @ts-ignore
32
36
  import { InitiateAuthRequestDto } from '../models';
@@ -39,12 +43,16 @@ import { InviteByCustomerResponseClass } from '../models';
39
43
  // @ts-ignore
40
44
  import { InviteByTenantResponseClass } from '../models';
41
45
  // @ts-ignore
46
+ import { ListDocumentsResponseClass } from '../models';
47
+ // @ts-ignore
42
48
  import { ListInvoicesResponseClass } from '../models';
43
49
  // @ts-ignore
44
50
  import { ListPoliciesResponseClass } from '../models';
45
51
  // @ts-ignore
46
52
  import { RefreshTokenDto } from '../models';
47
53
  // @ts-ignore
54
+ import { RequestPolicyUpdateRequestDto } from '../models';
55
+ // @ts-ignore
48
56
  import { RequestPolicyUpdateResponseClass } from '../models';
49
57
  // @ts-ignore
50
58
  import { ResetPasswordByCustomerRequestDto } from '../models';
@@ -53,7 +61,17 @@ import { RespondToAuthChallengeClass } from '../models';
53
61
  // @ts-ignore
54
62
  import { RespondToAuthChallengeRequestDto } from '../models';
55
63
  // @ts-ignore
64
+ import { TerminateCustomerPolicyRequestDto } from '../models';
65
+ // @ts-ignore
66
+ import { TerminateCustomerPolicyResponseClass } from '../models';
67
+ // @ts-ignore
68
+ import { UpdateCustomerRequestDto } from '../models';
69
+ // @ts-ignore
70
+ import { UpdateCustomerResponseClass } from '../models';
71
+ // @ts-ignore
56
72
  import { VerifyCustomerInviteResponseClass } from '../models';
73
+ // @ts-ignore
74
+ import { WithdrawCustomerPolicyResponseClass } from '../models';
57
75
  // URLSearchParams not necessarily used
58
76
  // @ts-ignore
59
77
  import { URL, URLSearchParams } from 'url';
@@ -140,6 +158,97 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
140
158
  options: localVarRequestOptions,
141
159
  };
142
160
  },
161
+ /**
162
+ * Get customer details
163
+ * @summary Get customer details
164
+ * @param {string} customerCode The customer code or \"me\" for the currently logged in customer
165
+ * @param {string} [expand] Fields to expand response by - [account]
166
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
167
+ * @param {*} [options] Override http request option.
168
+ * @throws {RequiredError}
169
+ */
170
+ getCustomer: async (customerCode: string, expand?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
171
+ // verify required parameter 'customerCode' is not null or undefined
172
+ assertParamExists('getCustomer', 'customerCode', customerCode)
173
+ const localVarPath = `/v1/customers/{customerCode}`
174
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
175
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
176
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
177
+ let baseOptions;
178
+ let baseAccessToken;
179
+ if (configuration) {
180
+ baseOptions = configuration.baseOptions;
181
+ baseAccessToken = configuration.accessToken;
182
+ }
183
+
184
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
185
+ const localVarHeaderParameter = {} as any;
186
+ const localVarQueryParameter = {} as any;
187
+
188
+ if (expand !== undefined) {
189
+ localVarQueryParameter['expand'] = expand;
190
+ }
191
+
192
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
193
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
194
+ }
195
+
196
+
197
+
198
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
199
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
200
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
201
+
202
+ return {
203
+ url: toPathString(localVarUrlObj),
204
+ options: localVarRequestOptions,
205
+ };
206
+ },
207
+ /**
208
+ * Get a presigned download url for document
209
+ * @summary Get a presigned download url for document
210
+ * @param {string} documentCode The document code
211
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
212
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
213
+ * @param {*} [options] Override http request option.
214
+ * @throws {RequiredError}
215
+ */
216
+ getCustomerDocumentDownloadUrl: async (documentCode: string, customerCode: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
217
+ // verify required parameter 'documentCode' is not null or undefined
218
+ assertParamExists('getCustomerDocumentDownloadUrl', 'documentCode', documentCode)
219
+ // verify required parameter 'customerCode' is not null or undefined
220
+ assertParamExists('getCustomerDocumentDownloadUrl', 'customerCode', customerCode)
221
+ const localVarPath = `/v1/customers/{customerCode}/documents/{documentCode}/download-url`
222
+ .replace(`{${"documentCode"}}`, encodeURIComponent(String(documentCode)))
223
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
224
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
225
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
226
+ let baseOptions;
227
+ let baseAccessToken;
228
+ if (configuration) {
229
+ baseOptions = configuration.baseOptions;
230
+ baseAccessToken = configuration.accessToken;
231
+ }
232
+
233
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
234
+ const localVarHeaderParameter = {} as any;
235
+ const localVarQueryParameter = {} as any;
236
+
237
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
238
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
239
+ }
240
+
241
+
242
+
243
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
244
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
245
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
246
+
247
+ return {
248
+ url: toPathString(localVarUrlObj),
249
+ options: localVarRequestOptions,
250
+ };
251
+ },
143
252
  /**
144
253
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
145
254
  * @summary Get policy details
@@ -314,6 +423,77 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
314
423
  options: localVarRequestOptions,
315
424
  };
316
425
  },
426
+ /**
427
+ * List all the documents of a customer
428
+ * @summary List documents of a customer
429
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
430
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
431
+ * @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.
432
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
433
+ * @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.
434
+ * @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.
435
+ * @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.
436
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
437
+ * @param {*} [options] Override http request option.
438
+ * @throws {RequiredError}
439
+ */
440
+ listDocuments: async (customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
441
+ // verify required parameter 'customerCode' is not null or undefined
442
+ assertParamExists('listDocuments', 'customerCode', customerCode)
443
+ const localVarPath = `/v1/customers/{customerCode}/documents`
444
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
445
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
446
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
447
+ let baseOptions;
448
+ let baseAccessToken;
449
+ if (configuration) {
450
+ baseOptions = configuration.baseOptions;
451
+ baseAccessToken = configuration.accessToken;
452
+ }
453
+
454
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
455
+ const localVarHeaderParameter = {} as any;
456
+ const localVarQueryParameter = {} as any;
457
+
458
+ if (pageSize !== undefined) {
459
+ localVarQueryParameter['pageSize'] = pageSize;
460
+ }
461
+
462
+ if (pageToken !== undefined) {
463
+ localVarQueryParameter['pageToken'] = pageToken;
464
+ }
465
+
466
+ if (filter !== undefined) {
467
+ localVarQueryParameter['filter'] = filter;
468
+ }
469
+
470
+ if (search !== undefined) {
471
+ localVarQueryParameter['search'] = search;
472
+ }
473
+
474
+ if (order !== undefined) {
475
+ localVarQueryParameter['order'] = order;
476
+ }
477
+
478
+ if (expand !== undefined) {
479
+ localVarQueryParameter['expand'] = expand;
480
+ }
481
+
482
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
483
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
484
+ }
485
+
486
+
487
+
488
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
489
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
490
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
491
+
492
+ return {
493
+ url: toPathString(localVarUrlObj),
494
+ options: localVarRequestOptions,
495
+ };
496
+ },
317
497
  /**
318
498
  * List all the invoices of a customer
319
499
  * @summary List invoices of a customer
@@ -504,25 +684,18 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
504
684
  * @summary Request policy update by customer
505
685
  * @param {string} policyCode The policy code
506
686
  * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
507
- * @param {string} code Policy code
508
- * @param {Array<string>} policyObjects Policy objects
509
- * @param {string} from Update from
510
- * @param {string} [to] Update to
687
+ * @param {RequestPolicyUpdateRequestDto} requestPolicyUpdateRequestDto
511
688
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
512
689
  * @param {*} [options] Override http request option.
513
690
  * @throws {RequiredError}
514
691
  */
515
- requestPolicyUpdate: async (policyCode: string, customerCode: string, code: string, policyObjects: Array<string>, from: string, to?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
692
+ requestPolicyUpdate: async (policyCode: string, customerCode: string, requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
516
693
  // verify required parameter 'policyCode' is not null or undefined
517
694
  assertParamExists('requestPolicyUpdate', 'policyCode', policyCode)
518
695
  // verify required parameter 'customerCode' is not null or undefined
519
696
  assertParamExists('requestPolicyUpdate', 'customerCode', customerCode)
520
- // verify required parameter 'code' is not null or undefined
521
- assertParamExists('requestPolicyUpdate', 'code', code)
522
- // verify required parameter 'policyObjects' is not null or undefined
523
- assertParamExists('requestPolicyUpdate', 'policyObjects', policyObjects)
524
- // verify required parameter 'from' is not null or undefined
525
- assertParamExists('requestPolicyUpdate', 'from', from)
697
+ // verify required parameter 'requestPolicyUpdateRequestDto' is not null or undefined
698
+ assertParamExists('requestPolicyUpdate', 'requestPolicyUpdateRequestDto', requestPolicyUpdateRequestDto)
526
699
  const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/request-update`
527
700
  .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
528
701
  .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
@@ -539,35 +712,18 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
539
712
  const localVarHeaderParameter = {} as any;
540
713
  const localVarQueryParameter = {} as any;
541
714
 
542
- if (code !== undefined) {
543
- localVarQueryParameter['code'] = code;
544
- }
545
-
546
- if (policyObjects) {
547
- localVarQueryParameter['policyObjects'] = policyObjects;
548
- }
549
-
550
- if (from !== undefined) {
551
- localVarQueryParameter['from'] = (from as any instanceof Date) ?
552
- (from as any).toISOString() :
553
- from;
554
- }
555
-
556
- if (to !== undefined) {
557
- localVarQueryParameter['to'] = (to as any instanceof Date) ?
558
- (to as any).toISOString() :
559
- to;
560
- }
561
-
562
715
  if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
563
716
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
564
717
  }
565
718
 
566
719
 
567
720
 
721
+ localVarHeaderParameter['Content-Type'] = 'application/json';
722
+
568
723
  setSearchParams(localVarUrlObj, localVarQueryParameter);
569
724
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
570
725
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
726
+ localVarRequestOptions.data = serializeDataIfNeeded(requestPolicyUpdateRequestDto, localVarRequestOptions, configuration)
571
727
 
572
728
  return {
573
729
  url: toPathString(localVarUrlObj),
@@ -650,6 +806,104 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
650
806
  options: localVarRequestOptions,
651
807
  };
652
808
  },
809
+ /**
810
+ * Request to terminate an existing policy by customer
811
+ * @summary Terminate a policy by customer
812
+ * @param {string} policyCode The policy code
813
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
814
+ * @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
815
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
816
+ * @param {*} [options] Override http request option.
817
+ * @throws {RequiredError}
818
+ */
819
+ terminateCustomerPolicy: async (policyCode: string, customerCode: string, terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
820
+ // verify required parameter 'policyCode' is not null or undefined
821
+ assertParamExists('terminateCustomerPolicy', 'policyCode', policyCode)
822
+ // verify required parameter 'customerCode' is not null or undefined
823
+ assertParamExists('terminateCustomerPolicy', 'customerCode', customerCode)
824
+ // verify required parameter 'terminateCustomerPolicyRequestDto' is not null or undefined
825
+ assertParamExists('terminateCustomerPolicy', 'terminateCustomerPolicyRequestDto', terminateCustomerPolicyRequestDto)
826
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/terminate`
827
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
828
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
829
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
830
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
831
+ let baseOptions;
832
+ let baseAccessToken;
833
+ if (configuration) {
834
+ baseOptions = configuration.baseOptions;
835
+ baseAccessToken = configuration.accessToken;
836
+ }
837
+
838
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
839
+ const localVarHeaderParameter = {} as any;
840
+ const localVarQueryParameter = {} as any;
841
+
842
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
843
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
844
+ }
845
+
846
+
847
+
848
+ localVarHeaderParameter['Content-Type'] = 'application/json';
849
+
850
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
851
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
852
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
853
+ localVarRequestOptions.data = serializeDataIfNeeded(terminateCustomerPolicyRequestDto, localVarRequestOptions, configuration)
854
+
855
+ return {
856
+ url: toPathString(localVarUrlObj),
857
+ options: localVarRequestOptions,
858
+ };
859
+ },
860
+ /**
861
+ * Update customer details like phone, email, names, addresses etc
862
+ * @summary Update customer details
863
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
864
+ * @param {UpdateCustomerRequestDto} updateCustomerRequestDto
865
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
866
+ * @param {*} [options] Override http request option.
867
+ * @throws {RequiredError}
868
+ */
869
+ updateCustomer: async (customerCode: string, updateCustomerRequestDto: UpdateCustomerRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
870
+ // verify required parameter 'customerCode' is not null or undefined
871
+ assertParamExists('updateCustomer', 'customerCode', customerCode)
872
+ // verify required parameter 'updateCustomerRequestDto' is not null or undefined
873
+ assertParamExists('updateCustomer', 'updateCustomerRequestDto', updateCustomerRequestDto)
874
+ const localVarPath = `/v1/customers/{customerCode}`
875
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
876
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
877
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
878
+ let baseOptions;
879
+ let baseAccessToken;
880
+ if (configuration) {
881
+ baseOptions = configuration.baseOptions;
882
+ baseAccessToken = configuration.accessToken;
883
+ }
884
+
885
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
886
+ const localVarHeaderParameter = {} as any;
887
+ const localVarQueryParameter = {} as any;
888
+
889
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
890
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
891
+ }
892
+
893
+
894
+
895
+ localVarHeaderParameter['Content-Type'] = 'application/json';
896
+
897
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
898
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
899
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
900
+ localVarRequestOptions.data = serializeDataIfNeeded(updateCustomerRequestDto, localVarRequestOptions, configuration)
901
+
902
+ return {
903
+ url: toPathString(localVarUrlObj),
904
+ options: localVarRequestOptions,
905
+ };
906
+ },
653
907
  /**
654
908
  * Verify the invite sent to the customer via email.
655
909
  * @summary Verify customer\'s invite token
@@ -728,24 +982,69 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
728
982
  options: localVarRequestOptions,
729
983
  };
730
984
  },
731
- }
732
- };
733
-
734
- /**
735
- * CustomersApi - functional programming interface
736
- * @export
737
- */
738
- export const CustomersApiFp = function(configuration?: Configuration) {
739
- const localVarAxiosParamCreator = CustomersApiAxiosParamCreator(configuration)
740
- return {
741
985
  /**
742
- * Register a customer using the invite token sent to customer\'s email address. Customer can set a new password for his account created during booking a policy.
743
- * @summary Register a customer after invite
744
- * @param {CreateCustomerRequestDto} createCustomerRequestDto
986
+ * Withdraw policy by customer
987
+ * @summary Withdraw policy by customer
988
+ * @param {string} policyCode The policy code
989
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
990
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
745
991
  * @param {*} [options] Override http request option.
746
992
  * @throws {RequiredError}
747
993
  */
748
- async createCustomer(createCustomerRequestDto: CreateCustomerRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCustomerResponseClass>> {
994
+ withdrawCustomerPolicy: async (policyCode: string, customerCode: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
995
+ // verify required parameter 'policyCode' is not null or undefined
996
+ assertParamExists('withdrawCustomerPolicy', 'policyCode', policyCode)
997
+ // verify required parameter 'customerCode' is not null or undefined
998
+ assertParamExists('withdrawCustomerPolicy', 'customerCode', customerCode)
999
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/withdraw`
1000
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
1001
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
1002
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1003
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1004
+ let baseOptions;
1005
+ let baseAccessToken;
1006
+ if (configuration) {
1007
+ baseOptions = configuration.baseOptions;
1008
+ baseAccessToken = configuration.accessToken;
1009
+ }
1010
+
1011
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
1012
+ const localVarHeaderParameter = {} as any;
1013
+ const localVarQueryParameter = {} as any;
1014
+
1015
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
1016
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
1017
+ }
1018
+
1019
+
1020
+
1021
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1022
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1023
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
1024
+
1025
+ return {
1026
+ url: toPathString(localVarUrlObj),
1027
+ options: localVarRequestOptions,
1028
+ };
1029
+ },
1030
+ }
1031
+ };
1032
+
1033
+ /**
1034
+ * CustomersApi - functional programming interface
1035
+ * @export
1036
+ */
1037
+ export const CustomersApiFp = function(configuration?: Configuration) {
1038
+ const localVarAxiosParamCreator = CustomersApiAxiosParamCreator(configuration)
1039
+ return {
1040
+ /**
1041
+ * Register a customer using the invite token sent to customer\'s email address. Customer can set a new password for his account created during booking a policy.
1042
+ * @summary Register a customer after invite
1043
+ * @param {CreateCustomerRequestDto} createCustomerRequestDto
1044
+ * @param {*} [options] Override http request option.
1045
+ * @throws {RequiredError}
1046
+ */
1047
+ async createCustomer(createCustomerRequestDto: CreateCustomerRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCustomerResponseClass>> {
749
1048
  const localVarAxiosArgs = await localVarAxiosParamCreator.createCustomer(createCustomerRequestDto, options);
750
1049
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
751
1050
  },
@@ -760,6 +1059,32 @@ export const CustomersApiFp = function(configuration?: Configuration) {
760
1059
  const localVarAxiosArgs = await localVarAxiosParamCreator.forgotPassword(forgotPasswordRequestDto, options);
761
1060
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
762
1061
  },
1062
+ /**
1063
+ * Get customer details
1064
+ * @summary Get customer details
1065
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1066
+ * @param {string} [expand] Fields to expand response by - [account]
1067
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1068
+ * @param {*} [options] Override http request option.
1069
+ * @throws {RequiredError}
1070
+ */
1071
+ async getCustomer(customerCode: string, expand?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetCustomerResponseClass>> {
1072
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCustomer(customerCode, expand, authorization, options);
1073
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1074
+ },
1075
+ /**
1076
+ * Get a presigned download url for document
1077
+ * @summary Get a presigned download url for document
1078
+ * @param {string} documentCode The document code
1079
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1080
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1081
+ * @param {*} [options] Override http request option.
1082
+ * @throws {RequiredError}
1083
+ */
1084
+ async getCustomerDocumentDownloadUrl(documentCode: string, customerCode: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetCustomerDocumentDownloadUrlResponseClass>> {
1085
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCustomerDocumentDownloadUrl(documentCode, customerCode, authorization, options);
1086
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1087
+ },
763
1088
  /**
764
1089
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
765
1090
  * @summary Get policy details
@@ -809,6 +1134,24 @@ export const CustomersApiFp = function(configuration?: Configuration) {
809
1134
  const localVarAxiosArgs = await localVarAxiosParamCreator.inviteByTenant(inviteByCustomerRequestDto, authorization, options);
810
1135
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
811
1136
  },
1137
+ /**
1138
+ * List all the documents of a customer
1139
+ * @summary List documents of a customer
1140
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1141
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
1142
+ * @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.
1143
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
1144
+ * @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.
1145
+ * @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.
1146
+ * @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.
1147
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1148
+ * @param {*} [options] Override http request option.
1149
+ * @throws {RequiredError}
1150
+ */
1151
+ async listDocuments(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListDocumentsResponseClass>> {
1152
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listDocuments(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options);
1153
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1154
+ },
812
1155
  /**
813
1156
  * List all the invoices of a customer
814
1157
  * @summary List invoices of a customer
@@ -862,16 +1205,13 @@ export const CustomersApiFp = function(configuration?: Configuration) {
862
1205
  * @summary Request policy update by customer
863
1206
  * @param {string} policyCode The policy code
864
1207
  * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
865
- * @param {string} code Policy code
866
- * @param {Array<string>} policyObjects Policy objects
867
- * @param {string} from Update from
868
- * @param {string} [to] Update to
1208
+ * @param {RequestPolicyUpdateRequestDto} requestPolicyUpdateRequestDto
869
1209
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
870
1210
  * @param {*} [options] Override http request option.
871
1211
  * @throws {RequiredError}
872
1212
  */
873
- async requestPolicyUpdate(policyCode: string, customerCode: string, code: string, policyObjects: Array<string>, from: string, to?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RequestPolicyUpdateResponseClass>> {
874
- const localVarAxiosArgs = await localVarAxiosParamCreator.requestPolicyUpdate(policyCode, customerCode, code, policyObjects, from, to, authorization, options);
1213
+ async requestPolicyUpdate(policyCode: string, customerCode: string, requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RequestPolicyUpdateResponseClass>> {
1214
+ const localVarAxiosArgs = await localVarAxiosParamCreator.requestPolicyUpdate(policyCode, customerCode, requestPolicyUpdateRequestDto, authorization, options);
875
1215
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
876
1216
  },
877
1217
  /**
@@ -896,6 +1236,33 @@ export const CustomersApiFp = function(configuration?: Configuration) {
896
1236
  const localVarAxiosArgs = await localVarAxiosParamCreator.respondToAuthChallenge(respondToAuthChallengeRequestDto, options);
897
1237
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
898
1238
  },
1239
+ /**
1240
+ * Request to terminate an existing policy by customer
1241
+ * @summary Terminate a policy by customer
1242
+ * @param {string} policyCode The policy code
1243
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1244
+ * @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
1245
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1246
+ * @param {*} [options] Override http request option.
1247
+ * @throws {RequiredError}
1248
+ */
1249
+ async terminateCustomerPolicy(policyCode: string, customerCode: string, terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TerminateCustomerPolicyResponseClass>> {
1250
+ const localVarAxiosArgs = await localVarAxiosParamCreator.terminateCustomerPolicy(policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options);
1251
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1252
+ },
1253
+ /**
1254
+ * Update customer details like phone, email, names, addresses etc
1255
+ * @summary Update customer details
1256
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1257
+ * @param {UpdateCustomerRequestDto} updateCustomerRequestDto
1258
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1259
+ * @param {*} [options] Override http request option.
1260
+ * @throws {RequiredError}
1261
+ */
1262
+ async updateCustomer(customerCode: string, updateCustomerRequestDto: UpdateCustomerRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateCustomerResponseClass>> {
1263
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateCustomer(customerCode, updateCustomerRequestDto, authorization, options);
1264
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1265
+ },
899
1266
  /**
900
1267
  * Verify the invite sent to the customer via email.
901
1268
  * @summary Verify customer\'s invite token
@@ -918,6 +1285,19 @@ export const CustomersApiFp = function(configuration?: Configuration) {
918
1285
  const localVarAxiosArgs = await localVarAxiosParamCreator.verifyResetPasswordToken(resetToken, options);
919
1286
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
920
1287
  },
1288
+ /**
1289
+ * Withdraw policy by customer
1290
+ * @summary Withdraw policy by customer
1291
+ * @param {string} policyCode The policy code
1292
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1293
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1294
+ * @param {*} [options] Override http request option.
1295
+ * @throws {RequiredError}
1296
+ */
1297
+ async withdrawCustomerPolicy(policyCode: string, customerCode: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WithdrawCustomerPolicyResponseClass>> {
1298
+ const localVarAxiosArgs = await localVarAxiosParamCreator.withdrawCustomerPolicy(policyCode, customerCode, authorization, options);
1299
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1300
+ },
921
1301
  }
922
1302
  };
923
1303
 
@@ -948,6 +1328,30 @@ export const CustomersApiFactory = function (configuration?: Configuration, base
948
1328
  forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: any): AxiosPromise<void> {
949
1329
  return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then((request) => request(axios, basePath));
950
1330
  },
1331
+ /**
1332
+ * Get customer details
1333
+ * @summary Get customer details
1334
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1335
+ * @param {string} [expand] Fields to expand response by - [account]
1336
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1337
+ * @param {*} [options] Override http request option.
1338
+ * @throws {RequiredError}
1339
+ */
1340
+ getCustomer(customerCode: string, expand?: string, authorization?: string, options?: any): AxiosPromise<GetCustomerResponseClass> {
1341
+ return localVarFp.getCustomer(customerCode, expand, authorization, options).then((request) => request(axios, basePath));
1342
+ },
1343
+ /**
1344
+ * Get a presigned download url for document
1345
+ * @summary Get a presigned download url for document
1346
+ * @param {string} documentCode The document code
1347
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1348
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1349
+ * @param {*} [options] Override http request option.
1350
+ * @throws {RequiredError}
1351
+ */
1352
+ getCustomerDocumentDownloadUrl(documentCode: string, customerCode: string, authorization?: string, options?: any): AxiosPromise<GetCustomerDocumentDownloadUrlResponseClass> {
1353
+ return localVarFp.getCustomerDocumentDownloadUrl(documentCode, customerCode, authorization, options).then((request) => request(axios, basePath));
1354
+ },
951
1355
  /**
952
1356
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
953
1357
  * @summary Get policy details
@@ -993,6 +1397,23 @@ export const CustomersApiFactory = function (configuration?: Configuration, base
993
1397
  inviteByTenant(inviteByCustomerRequestDto: InviteByCustomerRequestDto, authorization?: string, options?: any): AxiosPromise<InviteByTenantResponseClass> {
994
1398
  return localVarFp.inviteByTenant(inviteByCustomerRequestDto, authorization, options).then((request) => request(axios, basePath));
995
1399
  },
1400
+ /**
1401
+ * List all the documents of a customer
1402
+ * @summary List documents of a customer
1403
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1404
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
1405
+ * @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.
1406
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
1407
+ * @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.
1408
+ * @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.
1409
+ * @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.
1410
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1411
+ * @param {*} [options] Override http request option.
1412
+ * @throws {RequiredError}
1413
+ */
1414
+ listDocuments(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: any): AxiosPromise<ListDocumentsResponseClass> {
1415
+ return localVarFp.listDocuments(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options).then((request) => request(axios, basePath));
1416
+ },
996
1417
  /**
997
1418
  * List all the invoices of a customer
998
1419
  * @summary List invoices of a customer
@@ -1043,16 +1464,13 @@ export const CustomersApiFactory = function (configuration?: Configuration, base
1043
1464
  * @summary Request policy update by customer
1044
1465
  * @param {string} policyCode The policy code
1045
1466
  * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1046
- * @param {string} code Policy code
1047
- * @param {Array<string>} policyObjects Policy objects
1048
- * @param {string} from Update from
1049
- * @param {string} [to] Update to
1467
+ * @param {RequestPolicyUpdateRequestDto} requestPolicyUpdateRequestDto
1050
1468
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1051
1469
  * @param {*} [options] Override http request option.
1052
1470
  * @throws {RequiredError}
1053
1471
  */
1054
- requestPolicyUpdate(policyCode: string, customerCode: string, code: string, policyObjects: Array<string>, from: string, to?: string, authorization?: string, options?: any): AxiosPromise<RequestPolicyUpdateResponseClass> {
1055
- return localVarFp.requestPolicyUpdate(policyCode, customerCode, code, policyObjects, from, to, authorization, options).then((request) => request(axios, basePath));
1472
+ requestPolicyUpdate(policyCode: string, customerCode: string, requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto, authorization?: string, options?: any): AxiosPromise<RequestPolicyUpdateResponseClass> {
1473
+ return localVarFp.requestPolicyUpdate(policyCode, customerCode, requestPolicyUpdateRequestDto, authorization, options).then((request) => request(axios, basePath));
1056
1474
  },
1057
1475
  /**
1058
1476
  * Change customer\'s password using the token provided by the reset password endpoint.
@@ -1074,6 +1492,31 @@ export const CustomersApiFactory = function (configuration?: Configuration, base
1074
1492
  respondToAuthChallenge(respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto, options?: any): AxiosPromise<RespondToAuthChallengeClass> {
1075
1493
  return localVarFp.respondToAuthChallenge(respondToAuthChallengeRequestDto, options).then((request) => request(axios, basePath));
1076
1494
  },
1495
+ /**
1496
+ * Request to terminate an existing policy by customer
1497
+ * @summary Terminate a policy by customer
1498
+ * @param {string} policyCode The policy code
1499
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1500
+ * @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
1501
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1502
+ * @param {*} [options] Override http request option.
1503
+ * @throws {RequiredError}
1504
+ */
1505
+ terminateCustomerPolicy(policyCode: string, customerCode: string, terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto, authorization?: string, options?: any): AxiosPromise<TerminateCustomerPolicyResponseClass> {
1506
+ return localVarFp.terminateCustomerPolicy(policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options).then((request) => request(axios, basePath));
1507
+ },
1508
+ /**
1509
+ * Update customer details like phone, email, names, addresses etc
1510
+ * @summary Update customer details
1511
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1512
+ * @param {UpdateCustomerRequestDto} updateCustomerRequestDto
1513
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1514
+ * @param {*} [options] Override http request option.
1515
+ * @throws {RequiredError}
1516
+ */
1517
+ updateCustomer(customerCode: string, updateCustomerRequestDto: UpdateCustomerRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateCustomerResponseClass> {
1518
+ return localVarFp.updateCustomer(customerCode, updateCustomerRequestDto, authorization, options).then((request) => request(axios, basePath));
1519
+ },
1077
1520
  /**
1078
1521
  * Verify the invite sent to the customer via email.
1079
1522
  * @summary Verify customer\'s invite token
@@ -1094,6 +1537,18 @@ export const CustomersApiFactory = function (configuration?: Configuration, base
1094
1537
  verifyResetPasswordToken(resetToken: string, options?: any): AxiosPromise<void> {
1095
1538
  return localVarFp.verifyResetPasswordToken(resetToken, options).then((request) => request(axios, basePath));
1096
1539
  },
1540
+ /**
1541
+ * Withdraw policy by customer
1542
+ * @summary Withdraw policy by customer
1543
+ * @param {string} policyCode The policy code
1544
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
1545
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
1546
+ * @param {*} [options] Override http request option.
1547
+ * @throws {RequiredError}
1548
+ */
1549
+ withdrawCustomerPolicy(policyCode: string, customerCode: string, authorization?: string, options?: any): AxiosPromise<WithdrawCustomerPolicyResponseClass> {
1550
+ return localVarFp.withdrawCustomerPolicy(policyCode, customerCode, authorization, options).then((request) => request(axios, basePath));
1551
+ },
1097
1552
  };
1098
1553
  };
1099
1554
 
@@ -1125,6 +1580,62 @@ export interface CustomersApiForgotPasswordRequest {
1125
1580
  readonly forgotPasswordRequestDto: ForgotPasswordRequestDto
1126
1581
  }
1127
1582
 
1583
+ /**
1584
+ * Request parameters for getCustomer operation in CustomersApi.
1585
+ * @export
1586
+ * @interface CustomersApiGetCustomerRequest
1587
+ */
1588
+ export interface CustomersApiGetCustomerRequest {
1589
+ /**
1590
+ * The customer code or \&quot;me\&quot; for the currently logged in customer
1591
+ * @type {string}
1592
+ * @memberof CustomersApiGetCustomer
1593
+ */
1594
+ readonly customerCode: string
1595
+
1596
+ /**
1597
+ * Fields to expand response by - [account]
1598
+ * @type {string}
1599
+ * @memberof CustomersApiGetCustomer
1600
+ */
1601
+ readonly expand?: string
1602
+
1603
+ /**
1604
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1605
+ * @type {string}
1606
+ * @memberof CustomersApiGetCustomer
1607
+ */
1608
+ readonly authorization?: string
1609
+ }
1610
+
1611
+ /**
1612
+ * Request parameters for getCustomerDocumentDownloadUrl operation in CustomersApi.
1613
+ * @export
1614
+ * @interface CustomersApiGetCustomerDocumentDownloadUrlRequest
1615
+ */
1616
+ export interface CustomersApiGetCustomerDocumentDownloadUrlRequest {
1617
+ /**
1618
+ * The document code
1619
+ * @type {string}
1620
+ * @memberof CustomersApiGetCustomerDocumentDownloadUrl
1621
+ */
1622
+ readonly documentCode: string
1623
+
1624
+ /**
1625
+ * The customer code or \&quot;me\&quot; for the currently logged in customer
1626
+ * @type {string}
1627
+ * @memberof CustomersApiGetCustomerDocumentDownloadUrl
1628
+ */
1629
+ readonly customerCode: string
1630
+
1631
+ /**
1632
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1633
+ * @type {string}
1634
+ * @memberof CustomersApiGetCustomerDocumentDownloadUrl
1635
+ */
1636
+ readonly authorization?: string
1637
+ }
1638
+
1128
1639
  /**
1129
1640
  * Request parameters for getPolicy operation in CustomersApi.
1130
1641
  * @export
@@ -1216,6 +1727,69 @@ export interface CustomersApiInviteByTenantRequest {
1216
1727
  readonly authorization?: string
1217
1728
  }
1218
1729
 
1730
+ /**
1731
+ * Request parameters for listDocuments operation in CustomersApi.
1732
+ * @export
1733
+ * @interface CustomersApiListDocumentsRequest
1734
+ */
1735
+ export interface CustomersApiListDocumentsRequest {
1736
+ /**
1737
+ * The customer code or \&quot;me\&quot; for the currently logged in customer
1738
+ * @type {string}
1739
+ * @memberof CustomersApiListDocuments
1740
+ */
1741
+ readonly customerCode: string
1742
+
1743
+ /**
1744
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
1745
+ * @type {any}
1746
+ * @memberof CustomersApiListDocuments
1747
+ */
1748
+ readonly pageSize?: any
1749
+
1750
+ /**
1751
+ * 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.
1752
+ * @type {any}
1753
+ * @memberof CustomersApiListDocuments
1754
+ */
1755
+ readonly pageToken?: any
1756
+
1757
+ /**
1758
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
1759
+ * @type {any}
1760
+ * @memberof CustomersApiListDocuments
1761
+ */
1762
+ readonly filter?: any
1763
+
1764
+ /**
1765
+ * 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.
1766
+ * @type {any}
1767
+ * @memberof CustomersApiListDocuments
1768
+ */
1769
+ readonly search?: any
1770
+
1771
+ /**
1772
+ * 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.
1773
+ * @type {any}
1774
+ * @memberof CustomersApiListDocuments
1775
+ */
1776
+ readonly order?: any
1777
+
1778
+ /**
1779
+ * 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.
1780
+ * @type {any}
1781
+ * @memberof CustomersApiListDocuments
1782
+ */
1783
+ readonly expand?: any
1784
+
1785
+ /**
1786
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1787
+ * @type {string}
1788
+ * @memberof CustomersApiListDocuments
1789
+ */
1790
+ readonly authorization?: string
1791
+ }
1792
+
1219
1793
  /**
1220
1794
  * Request parameters for listInvoices operation in CustomersApi.
1221
1795
  * @export
@@ -1384,32 +1958,11 @@ export interface CustomersApiRequestPolicyUpdateRequest {
1384
1958
  readonly customerCode: string
1385
1959
 
1386
1960
  /**
1387
- * Policy code
1388
- * @type {string}
1389
- * @memberof CustomersApiRequestPolicyUpdate
1390
- */
1391
- readonly code: string
1392
-
1393
- /**
1394
- * Policy objects
1395
- * @type {Array<string>}
1396
- * @memberof CustomersApiRequestPolicyUpdate
1397
- */
1398
- readonly policyObjects: Array<string>
1399
-
1400
- /**
1401
- * Update from
1402
- * @type {string}
1403
- * @memberof CustomersApiRequestPolicyUpdate
1404
- */
1405
- readonly from: string
1406
-
1407
- /**
1408
- * Update to
1409
- * @type {string}
1961
+ *
1962
+ * @type {RequestPolicyUpdateRequestDto}
1410
1963
  * @memberof CustomersApiRequestPolicyUpdate
1411
1964
  */
1412
- readonly to?: string
1965
+ readonly requestPolicyUpdateRequestDto: RequestPolicyUpdateRequestDto
1413
1966
 
1414
1967
  /**
1415
1968
  * Bearer Token: provided by the login endpoint under the name accessToken.
@@ -1447,6 +2000,69 @@ export interface CustomersApiRespondToAuthChallengeRequest {
1447
2000
  readonly respondToAuthChallengeRequestDto: RespondToAuthChallengeRequestDto
1448
2001
  }
1449
2002
 
2003
+ /**
2004
+ * Request parameters for terminateCustomerPolicy operation in CustomersApi.
2005
+ * @export
2006
+ * @interface CustomersApiTerminateCustomerPolicyRequest
2007
+ */
2008
+ export interface CustomersApiTerminateCustomerPolicyRequest {
2009
+ /**
2010
+ * The policy code
2011
+ * @type {string}
2012
+ * @memberof CustomersApiTerminateCustomerPolicy
2013
+ */
2014
+ readonly policyCode: string
2015
+
2016
+ /**
2017
+ * The customer code or \&quot;me\&quot; for the currently logged in customer
2018
+ * @type {string}
2019
+ * @memberof CustomersApiTerminateCustomerPolicy
2020
+ */
2021
+ readonly customerCode: string
2022
+
2023
+ /**
2024
+ *
2025
+ * @type {TerminateCustomerPolicyRequestDto}
2026
+ * @memberof CustomersApiTerminateCustomerPolicy
2027
+ */
2028
+ readonly terminateCustomerPolicyRequestDto: TerminateCustomerPolicyRequestDto
2029
+
2030
+ /**
2031
+ * Bearer Token: provided by the login endpoint under the name accessToken.
2032
+ * @type {string}
2033
+ * @memberof CustomersApiTerminateCustomerPolicy
2034
+ */
2035
+ readonly authorization?: string
2036
+ }
2037
+
2038
+ /**
2039
+ * Request parameters for updateCustomer operation in CustomersApi.
2040
+ * @export
2041
+ * @interface CustomersApiUpdateCustomerRequest
2042
+ */
2043
+ export interface CustomersApiUpdateCustomerRequest {
2044
+ /**
2045
+ * The customer code or \&quot;me\&quot; for the currently logged in customer
2046
+ * @type {string}
2047
+ * @memberof CustomersApiUpdateCustomer
2048
+ */
2049
+ readonly customerCode: string
2050
+
2051
+ /**
2052
+ *
2053
+ * @type {UpdateCustomerRequestDto}
2054
+ * @memberof CustomersApiUpdateCustomer
2055
+ */
2056
+ readonly updateCustomerRequestDto: UpdateCustomerRequestDto
2057
+
2058
+ /**
2059
+ * Bearer Token: provided by the login endpoint under the name accessToken.
2060
+ * @type {string}
2061
+ * @memberof CustomersApiUpdateCustomer
2062
+ */
2063
+ readonly authorization?: string
2064
+ }
2065
+
1450
2066
  /**
1451
2067
  * Request parameters for verifyInvite operation in CustomersApi.
1452
2068
  * @export
@@ -1475,6 +2091,34 @@ export interface CustomersApiVerifyResetPasswordTokenRequest {
1475
2091
  readonly resetToken: string
1476
2092
  }
1477
2093
 
2094
+ /**
2095
+ * Request parameters for withdrawCustomerPolicy operation in CustomersApi.
2096
+ * @export
2097
+ * @interface CustomersApiWithdrawCustomerPolicyRequest
2098
+ */
2099
+ export interface CustomersApiWithdrawCustomerPolicyRequest {
2100
+ /**
2101
+ * The policy code
2102
+ * @type {string}
2103
+ * @memberof CustomersApiWithdrawCustomerPolicy
2104
+ */
2105
+ readonly policyCode: string
2106
+
2107
+ /**
2108
+ * The customer code or \&quot;me\&quot; for the currently logged in customer
2109
+ * @type {string}
2110
+ * @memberof CustomersApiWithdrawCustomerPolicy
2111
+ */
2112
+ readonly customerCode: string
2113
+
2114
+ /**
2115
+ * Bearer Token: provided by the login endpoint under the name accessToken.
2116
+ * @type {string}
2117
+ * @memberof CustomersApiWithdrawCustomerPolicy
2118
+ */
2119
+ readonly authorization?: string
2120
+ }
2121
+
1478
2122
  /**
1479
2123
  * CustomersApi - object-oriented interface
1480
2124
  * @export
@@ -1506,6 +2150,30 @@ export class CustomersApi extends BaseAPI {
1506
2150
  return CustomersApiFp(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then((request) => request(this.axios, this.basePath));
1507
2151
  }
1508
2152
 
2153
+ /**
2154
+ * Get customer details
2155
+ * @summary Get customer details
2156
+ * @param {CustomersApiGetCustomerRequest} requestParameters Request parameters.
2157
+ * @param {*} [options] Override http request option.
2158
+ * @throws {RequiredError}
2159
+ * @memberof CustomersApi
2160
+ */
2161
+ public getCustomer(requestParameters: CustomersApiGetCustomerRequest, options?: AxiosRequestConfig) {
2162
+ return CustomersApiFp(this.configuration).getCustomer(requestParameters.customerCode, requestParameters.expand, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2163
+ }
2164
+
2165
+ /**
2166
+ * Get a presigned download url for document
2167
+ * @summary Get a presigned download url for document
2168
+ * @param {CustomersApiGetCustomerDocumentDownloadUrlRequest} requestParameters Request parameters.
2169
+ * @param {*} [options] Override http request option.
2170
+ * @throws {RequiredError}
2171
+ * @memberof CustomersApi
2172
+ */
2173
+ public getCustomerDocumentDownloadUrl(requestParameters: CustomersApiGetCustomerDocumentDownloadUrlRequest, options?: AxiosRequestConfig) {
2174
+ return CustomersApiFp(this.configuration).getCustomerDocumentDownloadUrl(requestParameters.documentCode, requestParameters.customerCode, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2175
+ }
2176
+
1509
2177
  /**
1510
2178
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
1511
2179
  * @summary Get policy details
@@ -1554,6 +2222,18 @@ export class CustomersApi extends BaseAPI {
1554
2222
  return CustomersApiFp(this.configuration).inviteByTenant(requestParameters.inviteByCustomerRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1555
2223
  }
1556
2224
 
2225
+ /**
2226
+ * List all the documents of a customer
2227
+ * @summary List documents of a customer
2228
+ * @param {CustomersApiListDocumentsRequest} requestParameters Request parameters.
2229
+ * @param {*} [options] Override http request option.
2230
+ * @throws {RequiredError}
2231
+ * @memberof CustomersApi
2232
+ */
2233
+ public listDocuments(requestParameters: CustomersApiListDocumentsRequest, options?: AxiosRequestConfig) {
2234
+ return CustomersApiFp(this.configuration).listDocuments(requestParameters.customerCode, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2235
+ }
2236
+
1557
2237
  /**
1558
2238
  * List all the invoices of a customer
1559
2239
  * @summary List invoices of a customer
@@ -1599,7 +2279,7 @@ export class CustomersApi extends BaseAPI {
1599
2279
  * @memberof CustomersApi
1600
2280
  */
1601
2281
  public requestPolicyUpdate(requestParameters: CustomersApiRequestPolicyUpdateRequest, options?: AxiosRequestConfig) {
1602
- return CustomersApiFp(this.configuration).requestPolicyUpdate(requestParameters.policyCode, requestParameters.customerCode, requestParameters.code, requestParameters.policyObjects, requestParameters.from, requestParameters.to, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2282
+ return CustomersApiFp(this.configuration).requestPolicyUpdate(requestParameters.policyCode, requestParameters.customerCode, requestParameters.requestPolicyUpdateRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1603
2283
  }
1604
2284
 
1605
2285
  /**
@@ -1626,6 +2306,30 @@ export class CustomersApi extends BaseAPI {
1626
2306
  return CustomersApiFp(this.configuration).respondToAuthChallenge(requestParameters.respondToAuthChallengeRequestDto, options).then((request) => request(this.axios, this.basePath));
1627
2307
  }
1628
2308
 
2309
+ /**
2310
+ * Request to terminate an existing policy by customer
2311
+ * @summary Terminate a policy by customer
2312
+ * @param {CustomersApiTerminateCustomerPolicyRequest} requestParameters Request parameters.
2313
+ * @param {*} [options] Override http request option.
2314
+ * @throws {RequiredError}
2315
+ * @memberof CustomersApi
2316
+ */
2317
+ public terminateCustomerPolicy(requestParameters: CustomersApiTerminateCustomerPolicyRequest, options?: AxiosRequestConfig) {
2318
+ return CustomersApiFp(this.configuration).terminateCustomerPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.terminateCustomerPolicyRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2319
+ }
2320
+
2321
+ /**
2322
+ * Update customer details like phone, email, names, addresses etc
2323
+ * @summary Update customer details
2324
+ * @param {CustomersApiUpdateCustomerRequest} requestParameters Request parameters.
2325
+ * @param {*} [options] Override http request option.
2326
+ * @throws {RequiredError}
2327
+ * @memberof CustomersApi
2328
+ */
2329
+ public updateCustomer(requestParameters: CustomersApiUpdateCustomerRequest, options?: AxiosRequestConfig) {
2330
+ return CustomersApiFp(this.configuration).updateCustomer(requestParameters.customerCode, requestParameters.updateCustomerRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2331
+ }
2332
+
1629
2333
  /**
1630
2334
  * Verify the invite sent to the customer via email.
1631
2335
  * @summary Verify customer\'s invite token
@@ -1649,4 +2353,16 @@ export class CustomersApi extends BaseAPI {
1649
2353
  public verifyResetPasswordToken(requestParameters: CustomersApiVerifyResetPasswordTokenRequest, options?: AxiosRequestConfig) {
1650
2354
  return CustomersApiFp(this.configuration).verifyResetPasswordToken(requestParameters.resetToken, options).then((request) => request(this.axios, this.basePath));
1651
2355
  }
2356
+
2357
+ /**
2358
+ * Withdraw policy by customer
2359
+ * @summary Withdraw policy by customer
2360
+ * @param {CustomersApiWithdrawCustomerPolicyRequest} requestParameters Request parameters.
2361
+ * @param {*} [options] Override http request option.
2362
+ * @throws {RequiredError}
2363
+ * @memberof CustomersApi
2364
+ */
2365
+ public withdrawCustomerPolicy(requestParameters: CustomersApiWithdrawCustomerPolicyRequest, options?: AxiosRequestConfig) {
2366
+ return CustomersApiFp(this.configuration).withdrawCustomerPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2367
+ }
1652
2368
  }