@gofynd/fdk-client-javascript 3.21.0 → 3.23.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 (31) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationAPIClient.d.ts +1 -1
  4. package/sdk/application/ApplicationClient.d.ts +1 -1
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +4 -4
  6. package/sdk/application/Cart/CartApplicationClient.js +9 -2
  7. package/sdk/partner/OAuthClient.d.ts +3 -3
  8. package/sdk/partner/PartnerAPIClient.d.ts +1 -1
  9. package/sdk/partner/PartnerClient.d.ts +2 -2
  10. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +3 -3
  11. package/sdk/platform/Cart/CartPlatformApplicationClient.js +12 -0
  12. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +21 -0
  13. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +9 -0
  14. package/sdk/platform/Cart/CartPlatformModel.d.ts +7 -0
  15. package/sdk/platform/Cart/CartPlatformModel.js +3 -0
  16. package/sdk/platform/OAuthClient.d.ts +3 -3
  17. package/sdk/platform/Order/OrderPlatformModel.d.ts +24 -0
  18. package/sdk/platform/Order/OrderPlatformModel.js +11 -0
  19. package/sdk/platform/PlatformAPIClient.d.ts +1 -1
  20. package/sdk/platform/PlatformClient.d.ts +2 -2
  21. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +94 -0
  22. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +574 -0
  23. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +70 -1
  24. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  25. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +14 -0
  26. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +85 -0
  27. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1364 -192
  28. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +941 -159
  29. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +10 -1
  30. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +12 -0
  31. package/sdk/public/PublicAPIClient.d.ts +1 -1
@@ -508,6 +508,89 @@ class Serviceability {
508
508
  return response;
509
509
  }
510
510
 
511
+ /**
512
+ * @param {ServiceabilityPlatformApplicationValidator.CreatePolygonParam} arg
513
+ * - Arg object
514
+ *
515
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
516
+ * @param {import("../PlatformAPIClient").Options} - Options
517
+ * @returns {Promise<ServiceabilityPlatformModel.StorePolygonServiceabilityResult>}
518
+ * - Success response
519
+ *
520
+ * @name createPolygon
521
+ * @summary: Create polygon-based serviceability for stores
522
+ * @description: Creates polygon-based serviceability regions for one or more stores for quick commerce. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/createPolygon/).
523
+ */
524
+ async createPolygon(
525
+ { body, requestHeaders } = { requestHeaders: {} },
526
+ { responseHeaders } = { responseHeaders: false }
527
+ ) {
528
+ const {
529
+ error,
530
+ } = ServiceabilityPlatformApplicationValidator.createPolygon().validate(
531
+ {
532
+ body,
533
+ },
534
+ { abortEarly: false, allowUnknown: true }
535
+ );
536
+ if (error) {
537
+ return Promise.reject(new FDKClientValidationError(error));
538
+ }
539
+
540
+ // Showing warrnings if extra unknown parameters are found
541
+ const {
542
+ error: warrning,
543
+ } = ServiceabilityPlatformApplicationValidator.createPolygon().validate(
544
+ {
545
+ body,
546
+ },
547
+ { abortEarly: false, allowUnknown: false }
548
+ );
549
+ if (warrning) {
550
+ Logger({
551
+ level: "WARN",
552
+ message: `Parameter Validation warrnings for platform > Serviceability > createPolygon \n ${warrning}`,
553
+ });
554
+ }
555
+
556
+ const query_params = {};
557
+
558
+ const response = await PlatformAPIClient.execute(
559
+ this.config,
560
+ "post",
561
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/polygon`,
562
+ query_params,
563
+ body,
564
+ requestHeaders,
565
+ { responseHeaders }
566
+ );
567
+
568
+ let responseData = response;
569
+ if (responseHeaders) {
570
+ responseData = response[0];
571
+ }
572
+
573
+ const {
574
+ error: res_error,
575
+ } = ServiceabilityPlatformModel.StorePolygonServiceabilityResult().validate(
576
+ responseData,
577
+ { abortEarly: false, allowUnknown: true }
578
+ );
579
+
580
+ if (res_error) {
581
+ if (this.config.options.strictResponseCheck === true) {
582
+ return Promise.reject(new FDKResponseValidationError(res_error));
583
+ } else {
584
+ Logger({
585
+ level: "WARN",
586
+ message: `Response Validation Warnings for platform > Serviceability > createPolygon \n ${res_error}`,
587
+ });
588
+ }
589
+ }
590
+
591
+ return response;
592
+ }
593
+
511
594
  /**
512
595
  * @param {ServiceabilityPlatformApplicationValidator.CreateShipmentsParam} arg
513
596
  * - Arg object
@@ -756,6 +839,87 @@ class Serviceability {
756
839
  return response;
757
840
  }
758
841
 
842
+ /**
843
+ * @param {ServiceabilityPlatformApplicationValidator.CreateZoneProductsBulkPatchJobParam} arg
844
+ * - Arg object
845
+ *
846
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
847
+ * @param {import("../PlatformAPIClient").Options} - Options
848
+ * @returns {Promise<ServiceabilityPlatformModel.ZoneBulkExport>} - Success response
849
+ * @name createZoneProductsBulkPatchJob
850
+ * @summary: Create bulk zone products patch job
851
+ * @description: Initiates a bulk zone products patch operation by accepting a CSV file URL. The file is validated and a background job is created for processing zone product additions or removals. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/createZoneProductsBulkPatchJob/).
852
+ */
853
+ async createZoneProductsBulkPatchJob(
854
+ { body, requestHeaders } = { requestHeaders: {} },
855
+ { responseHeaders } = { responseHeaders: false }
856
+ ) {
857
+ const {
858
+ error,
859
+ } = ServiceabilityPlatformApplicationValidator.createZoneProductsBulkPatchJob().validate(
860
+ {
861
+ body,
862
+ },
863
+ { abortEarly: false, allowUnknown: true }
864
+ );
865
+ if (error) {
866
+ return Promise.reject(new FDKClientValidationError(error));
867
+ }
868
+
869
+ // Showing warrnings if extra unknown parameters are found
870
+ const {
871
+ error: warrning,
872
+ } = ServiceabilityPlatformApplicationValidator.createZoneProductsBulkPatchJob().validate(
873
+ {
874
+ body,
875
+ },
876
+ { abortEarly: false, allowUnknown: false }
877
+ );
878
+ if (warrning) {
879
+ Logger({
880
+ level: "WARN",
881
+ message: `Parameter Validation warrnings for platform > Serviceability > createZoneProductsBulkPatchJob \n ${warrning}`,
882
+ });
883
+ }
884
+
885
+ const query_params = {};
886
+
887
+ const response = await PlatformAPIClient.execute(
888
+ this.config,
889
+ "post",
890
+ `/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/bulk/products`,
891
+ query_params,
892
+ body,
893
+ requestHeaders,
894
+ { responseHeaders }
895
+ );
896
+
897
+ let responseData = response;
898
+ if (responseHeaders) {
899
+ responseData = response[0];
900
+ }
901
+
902
+ const {
903
+ error: res_error,
904
+ } = ServiceabilityPlatformModel.ZoneBulkExport().validate(responseData, {
905
+ abortEarly: false,
906
+ allowUnknown: true,
907
+ });
908
+
909
+ if (res_error) {
910
+ if (this.config.options.strictResponseCheck === true) {
911
+ return Promise.reject(new FDKResponseValidationError(res_error));
912
+ } else {
913
+ Logger({
914
+ level: "WARN",
915
+ message: `Response Validation Warnings for platform > Serviceability > createZoneProductsBulkPatchJob \n ${res_error}`,
916
+ });
917
+ }
918
+ }
919
+
920
+ return response;
921
+ }
922
+
759
923
  /**
760
924
  * @param {ServiceabilityPlatformApplicationValidator.DeleteFulfillmentOptionsParam} arg
761
925
  * - Arg object
@@ -996,6 +1160,80 @@ class Serviceability {
996
1160
  return response;
997
1161
  }
998
1162
 
1163
+ /**
1164
+ * @param {ServiceabilityPlatformApplicationValidator.DownloadZoneProductsBulkSampleFileParam} arg
1165
+ * - Arg object
1166
+ *
1167
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1168
+ * @param {import("../PlatformAPIClient").Options} - Options
1169
+ * @returns {Promise<string>} - Success response
1170
+ * @name downloadZoneProductsBulkSampleFile
1171
+ * @summary: Download zone products bulk patch sample file
1172
+ * @description: Downloads a CSV sample template file for bulk patching zone products. The template includes headers for zone_id, product_type, products, and action. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/downloadZoneProductsBulkSampleFile/).
1173
+ */
1174
+ async downloadZoneProductsBulkSampleFile(
1175
+ { requestHeaders } = { requestHeaders: {} },
1176
+ { responseHeaders } = { responseHeaders: false }
1177
+ ) {
1178
+ const {
1179
+ error,
1180
+ } = ServiceabilityPlatformApplicationValidator.downloadZoneProductsBulkSampleFile().validate(
1181
+ {},
1182
+ { abortEarly: false, allowUnknown: true }
1183
+ );
1184
+ if (error) {
1185
+ return Promise.reject(new FDKClientValidationError(error));
1186
+ }
1187
+
1188
+ // Showing warrnings if extra unknown parameters are found
1189
+ const {
1190
+ error: warrning,
1191
+ } = ServiceabilityPlatformApplicationValidator.downloadZoneProductsBulkSampleFile().validate(
1192
+ {},
1193
+ { abortEarly: false, allowUnknown: false }
1194
+ );
1195
+ if (warrning) {
1196
+ Logger({
1197
+ level: "WARN",
1198
+ message: `Parameter Validation warrnings for platform > Serviceability > downloadZoneProductsBulkSampleFile \n ${warrning}`,
1199
+ });
1200
+ }
1201
+
1202
+ const query_params = {};
1203
+
1204
+ const response = await PlatformAPIClient.execute(
1205
+ this.config,
1206
+ "get",
1207
+ `/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/bulk/products/sample`,
1208
+ query_params,
1209
+ undefined,
1210
+ requestHeaders,
1211
+ { responseHeaders }
1212
+ );
1213
+
1214
+ let responseData = response;
1215
+ if (responseHeaders) {
1216
+ responseData = response[0];
1217
+ }
1218
+
1219
+ const { error: res_error } = Joi.string()
1220
+ .allow("")
1221
+ .validate(responseData, { abortEarly: false, allowUnknown: true });
1222
+
1223
+ if (res_error) {
1224
+ if (this.config.options.strictResponseCheck === true) {
1225
+ return Promise.reject(new FDKResponseValidationError(res_error));
1226
+ } else {
1227
+ Logger({
1228
+ level: "WARN",
1229
+ message: `Response Validation Warnings for platform > Serviceability > downloadZoneProductsBulkSampleFile \n ${res_error}`,
1230
+ });
1231
+ }
1232
+ }
1233
+
1234
+ return response;
1235
+ }
1236
+
999
1237
  /**
1000
1238
  * @param {ServiceabilityPlatformApplicationValidator.GetApplicationConfigParam} arg
1001
1239
  * - Arg object
@@ -1153,6 +1391,89 @@ class Serviceability {
1153
1391
  return response;
1154
1392
  }
1155
1393
 
1394
+ /**
1395
+ * @param {ServiceabilityPlatformApplicationValidator.GetApplicationCourierPartnersListParam} arg
1396
+ * - Arg object
1397
+ *
1398
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1399
+ * @param {import("../PlatformAPIClient").Options} - Options
1400
+ * @returns {Promise<ServiceabilityPlatformModel.GenerateShipmentsAndCourierPartnerResult>}
1401
+ * - Success response
1402
+ *
1403
+ * @name getApplicationCourierPartnersList
1404
+ * @summary: Get available application courier partners
1405
+ * @description: Retrieves a list of courier partners available for shipping based on serviceability criteria, shipment details, and delivery rules. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getApplicationCourierPartnersList/).
1406
+ */
1407
+ async getApplicationCourierPartnersList(
1408
+ { body, requestHeaders } = { requestHeaders: {} },
1409
+ { responseHeaders } = { responseHeaders: false }
1410
+ ) {
1411
+ const {
1412
+ error,
1413
+ } = ServiceabilityPlatformApplicationValidator.getApplicationCourierPartnersList().validate(
1414
+ {
1415
+ body,
1416
+ },
1417
+ { abortEarly: false, allowUnknown: true }
1418
+ );
1419
+ if (error) {
1420
+ return Promise.reject(new FDKClientValidationError(error));
1421
+ }
1422
+
1423
+ // Showing warrnings if extra unknown parameters are found
1424
+ const {
1425
+ error: warrning,
1426
+ } = ServiceabilityPlatformApplicationValidator.getApplicationCourierPartnersList().validate(
1427
+ {
1428
+ body,
1429
+ },
1430
+ { abortEarly: false, allowUnknown: false }
1431
+ );
1432
+ if (warrning) {
1433
+ Logger({
1434
+ level: "WARN",
1435
+ message: `Parameter Validation warrnings for platform > Serviceability > getApplicationCourierPartnersList \n ${warrning}`,
1436
+ });
1437
+ }
1438
+
1439
+ const query_params = {};
1440
+
1441
+ const response = await PlatformAPIClient.execute(
1442
+ this.config,
1443
+ "post",
1444
+ `/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/courier-partners`,
1445
+ query_params,
1446
+ body,
1447
+ requestHeaders,
1448
+ { responseHeaders }
1449
+ );
1450
+
1451
+ let responseData = response;
1452
+ if (responseHeaders) {
1453
+ responseData = response[0];
1454
+ }
1455
+
1456
+ const {
1457
+ error: res_error,
1458
+ } = ServiceabilityPlatformModel.GenerateShipmentsAndCourierPartnerResult().validate(
1459
+ responseData,
1460
+ { abortEarly: false, allowUnknown: true }
1461
+ );
1462
+
1463
+ if (res_error) {
1464
+ if (this.config.options.strictResponseCheck === true) {
1465
+ return Promise.reject(new FDKResponseValidationError(res_error));
1466
+ } else {
1467
+ Logger({
1468
+ level: "WARN",
1469
+ message: `Response Validation Warnings for platform > Serviceability > getApplicationCourierPartnersList \n ${res_error}`,
1470
+ });
1471
+ }
1472
+ }
1473
+
1474
+ return response;
1475
+ }
1476
+
1156
1477
  /**
1157
1478
  * @param {ServiceabilityPlatformApplicationValidator.GetBulkExportParam} arg
1158
1479
  * - Arg object
@@ -2294,6 +2615,93 @@ class Serviceability {
2294
2615
  return response;
2295
2616
  }
2296
2617
 
2618
+ /**
2619
+ * @param {ServiceabilityPlatformApplicationValidator.GetPolygonParam} arg
2620
+ * - Arg object
2621
+ *
2622
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2623
+ * @param {import("../PlatformAPIClient").Options} - Options
2624
+ * @returns {Promise<ServiceabilityPlatformModel.StorePolygonServiceabilityGetResult>}
2625
+ * - Success response
2626
+ *
2627
+ * @name getPolygon
2628
+ * @summary: Get polygon-based serviceability for stores
2629
+ * @description: Retrieves polygon-based serviceability configurations for stores for quick commerce. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getPolygon/).
2630
+ */
2631
+ async getPolygon(
2632
+ { pageNumber, pageSize, requestHeaders } = { requestHeaders: {} },
2633
+ { responseHeaders } = { responseHeaders: false }
2634
+ ) {
2635
+ const {
2636
+ error,
2637
+ } = ServiceabilityPlatformApplicationValidator.getPolygon().validate(
2638
+ {
2639
+ pageNumber,
2640
+ pageSize,
2641
+ },
2642
+ { abortEarly: false, allowUnknown: true }
2643
+ );
2644
+ if (error) {
2645
+ return Promise.reject(new FDKClientValidationError(error));
2646
+ }
2647
+
2648
+ // Showing warrnings if extra unknown parameters are found
2649
+ const {
2650
+ error: warrning,
2651
+ } = ServiceabilityPlatformApplicationValidator.getPolygon().validate(
2652
+ {
2653
+ pageNumber,
2654
+ pageSize,
2655
+ },
2656
+ { abortEarly: false, allowUnknown: false }
2657
+ );
2658
+ if (warrning) {
2659
+ Logger({
2660
+ level: "WARN",
2661
+ message: `Parameter Validation warrnings for platform > Serviceability > getPolygon \n ${warrning}`,
2662
+ });
2663
+ }
2664
+
2665
+ const query_params = {};
2666
+ query_params["page_number"] = pageNumber;
2667
+ query_params["page_size"] = pageSize;
2668
+
2669
+ const response = await PlatformAPIClient.execute(
2670
+ this.config,
2671
+ "get",
2672
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/polygon`,
2673
+ query_params,
2674
+ undefined,
2675
+ requestHeaders,
2676
+ { responseHeaders }
2677
+ );
2678
+
2679
+ let responseData = response;
2680
+ if (responseHeaders) {
2681
+ responseData = response[0];
2682
+ }
2683
+
2684
+ const {
2685
+ error: res_error,
2686
+ } = ServiceabilityPlatformModel.StorePolygonServiceabilityGetResult().validate(
2687
+ responseData,
2688
+ { abortEarly: false, allowUnknown: true }
2689
+ );
2690
+
2691
+ if (res_error) {
2692
+ if (this.config.options.strictResponseCheck === true) {
2693
+ return Promise.reject(new FDKResponseValidationError(res_error));
2694
+ } else {
2695
+ Logger({
2696
+ level: "WARN",
2697
+ message: `Response Validation Warnings for platform > Serviceability > getPolygon \n ${res_error}`,
2698
+ });
2699
+ }
2700
+ }
2701
+
2702
+ return response;
2703
+ }
2704
+
2297
2705
  /**
2298
2706
  * @param {ServiceabilityPlatformApplicationValidator.GetStoreRuleParam} arg
2299
2707
  * - Arg object
@@ -2545,6 +2953,89 @@ class Serviceability {
2545
2953
  return response;
2546
2954
  }
2547
2955
 
2956
+ /**
2957
+ * @param {ServiceabilityPlatformApplicationValidator.GetZoneProductsBulkPatchJobStatusParam} arg
2958
+ * - Arg object
2959
+ *
2960
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2961
+ * @param {import("../PlatformAPIClient").Options} - Options
2962
+ * @returns {Promise<ServiceabilityPlatformModel.GetZoneProductsBulkPatchResult>}
2963
+ * - Success response
2964
+ *
2965
+ * @name getZoneProductsBulkPatchJobStatus
2966
+ * @summary: Get bulk zone products patch job status
2967
+ * @description: Retrieves the status and details of a specific bulk zone products patch job by its batch identifier. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/getZoneProductsBulkPatchJobStatus/).
2968
+ */
2969
+ async getZoneProductsBulkPatchJobStatus(
2970
+ { batchId, requestHeaders } = { requestHeaders: {} },
2971
+ { responseHeaders } = { responseHeaders: false }
2972
+ ) {
2973
+ const {
2974
+ error,
2975
+ } = ServiceabilityPlatformApplicationValidator.getZoneProductsBulkPatchJobStatus().validate(
2976
+ {
2977
+ batchId,
2978
+ },
2979
+ { abortEarly: false, allowUnknown: true }
2980
+ );
2981
+ if (error) {
2982
+ return Promise.reject(new FDKClientValidationError(error));
2983
+ }
2984
+
2985
+ // Showing warrnings if extra unknown parameters are found
2986
+ const {
2987
+ error: warrning,
2988
+ } = ServiceabilityPlatformApplicationValidator.getZoneProductsBulkPatchJobStatus().validate(
2989
+ {
2990
+ batchId,
2991
+ },
2992
+ { abortEarly: false, allowUnknown: false }
2993
+ );
2994
+ if (warrning) {
2995
+ Logger({
2996
+ level: "WARN",
2997
+ message: `Parameter Validation warrnings for platform > Serviceability > getZoneProductsBulkPatchJobStatus \n ${warrning}`,
2998
+ });
2999
+ }
3000
+
3001
+ const query_params = {};
3002
+
3003
+ const response = await PlatformAPIClient.execute(
3004
+ this.config,
3005
+ "get",
3006
+ `/service/platform/logistics/v2.0/company/${this.config.companyId}/application/${this.applicationId}/zones/bulk/products/${batchId}`,
3007
+ query_params,
3008
+ undefined,
3009
+ requestHeaders,
3010
+ { responseHeaders }
3011
+ );
3012
+
3013
+ let responseData = response;
3014
+ if (responseHeaders) {
3015
+ responseData = response[0];
3016
+ }
3017
+
3018
+ const {
3019
+ error: res_error,
3020
+ } = ServiceabilityPlatformModel.GetZoneProductsBulkPatchResult().validate(
3021
+ responseData,
3022
+ { abortEarly: false, allowUnknown: true }
3023
+ );
3024
+
3025
+ if (res_error) {
3026
+ if (this.config.options.strictResponseCheck === true) {
3027
+ return Promise.reject(new FDKResponseValidationError(res_error));
3028
+ } else {
3029
+ Logger({
3030
+ level: "WARN",
3031
+ message: `Response Validation Warnings for platform > Serviceability > getZoneProductsBulkPatchJobStatus \n ${res_error}`,
3032
+ });
3033
+ }
3034
+ }
3035
+
3036
+ return response;
3037
+ }
3038
+
2548
3039
  /**
2549
3040
  * @param {ServiceabilityPlatformApplicationValidator.GetZonesParam} arg - Arg object
2550
3041
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
@@ -3595,6 +4086,89 @@ class Serviceability {
3595
4086
  return response;
3596
4087
  }
3597
4088
 
4089
+ /**
4090
+ * @param {ServiceabilityPlatformApplicationValidator.UpdatePolygonParam} arg
4091
+ * - Arg object
4092
+ *
4093
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
4094
+ * @param {import("../PlatformAPIClient").Options} - Options
4095
+ * @returns {Promise<ServiceabilityPlatformModel.StorePolygonServiceabilityResult>}
4096
+ * - Success response
4097
+ *
4098
+ * @name updatePolygon
4099
+ * @summary: Update polygon-based serviceability for stores
4100
+ * @description: Updates polygon-based serviceability regions for one or more stores for quick commerce. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/serviceability/updatePolygon/).
4101
+ */
4102
+ async updatePolygon(
4103
+ { body, requestHeaders } = { requestHeaders: {} },
4104
+ { responseHeaders } = { responseHeaders: false }
4105
+ ) {
4106
+ const {
4107
+ error,
4108
+ } = ServiceabilityPlatformApplicationValidator.updatePolygon().validate(
4109
+ {
4110
+ body,
4111
+ },
4112
+ { abortEarly: false, allowUnknown: true }
4113
+ );
4114
+ if (error) {
4115
+ return Promise.reject(new FDKClientValidationError(error));
4116
+ }
4117
+
4118
+ // Showing warrnings if extra unknown parameters are found
4119
+ const {
4120
+ error: warrning,
4121
+ } = ServiceabilityPlatformApplicationValidator.updatePolygon().validate(
4122
+ {
4123
+ body,
4124
+ },
4125
+ { abortEarly: false, allowUnknown: false }
4126
+ );
4127
+ if (warrning) {
4128
+ Logger({
4129
+ level: "WARN",
4130
+ message: `Parameter Validation warrnings for platform > Serviceability > updatePolygon \n ${warrning}`,
4131
+ });
4132
+ }
4133
+
4134
+ const query_params = {};
4135
+
4136
+ const response = await PlatformAPIClient.execute(
4137
+ this.config,
4138
+ "patch",
4139
+ `/service/platform/logistics/v1.0/company/${this.config.companyId}/application/${this.applicationId}/polygon`,
4140
+ query_params,
4141
+ body,
4142
+ requestHeaders,
4143
+ { responseHeaders }
4144
+ );
4145
+
4146
+ let responseData = response;
4147
+ if (responseHeaders) {
4148
+ responseData = response[0];
4149
+ }
4150
+
4151
+ const {
4152
+ error: res_error,
4153
+ } = ServiceabilityPlatformModel.StorePolygonServiceabilityResult().validate(
4154
+ responseData,
4155
+ { abortEarly: false, allowUnknown: true }
4156
+ );
4157
+
4158
+ if (res_error) {
4159
+ if (this.config.options.strictResponseCheck === true) {
4160
+ return Promise.reject(new FDKResponseValidationError(res_error));
4161
+ } else {
4162
+ Logger({
4163
+ level: "WARN",
4164
+ message: `Response Validation Warnings for platform > Serviceability > updatePolygon \n ${res_error}`,
4165
+ });
4166
+ }
4167
+ }
4168
+
4169
+ return response;
4170
+ }
4171
+
3598
4172
  /**
3599
4173
  * @param {ServiceabilityPlatformApplicationValidator.UpdateStoreRulePriorityParam} arg
3600
4174
  * - Arg object