@nutanix-scratch/dataprotection-js-client 4.1.1 → 4.2.1

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 (686) hide show
  1. package/README.md +39 -33
  2. package/dist/Ntnx-Dataprotection-js-client-prod.js +1 -1
  3. package/dist/Ntnx-Dataprotection-js-client.js +1273 -541
  4. package/dist/es/ApiClient.d.ts +29 -7
  5. package/dist/es/ApiClient.js +854 -667
  6. package/dist/es/Paginable.d.ts +1 -1
  7. package/dist/es/Paginable.js +144 -183
  8. package/dist/es/apis/consistencygroups-endpoints.d.ts +84 -0
  9. package/dist/es/apis/consistencygroups-endpoints.js +267 -0
  10. package/dist/es/apis/dataprotectionclustercapabilities-endpoints.d.ts +46 -0
  11. package/dist/es/apis/dataprotectionclustercapabilities-endpoints.js +107 -0
  12. package/dist/es/apis/protectedresources-endpoints.d.ts +1 -1
  13. package/dist/es/apis/protectedresources-endpoints.js +128 -146
  14. package/dist/es/apis/recoveryplanactions-endpoints.d.ts +76 -0
  15. package/dist/es/apis/recoveryplanactions-endpoints.js +282 -0
  16. package/dist/es/apis/recoveryplanjobs-endpoints.d.ts +108 -0
  17. package/dist/es/apis/recoveryplanjobs-endpoints.js +291 -0
  18. package/dist/es/apis/recoverypoints-endpoints.d.ts +2 -2
  19. package/dist/es/apis/recoverypoints-endpoints.js +530 -552
  20. package/dist/es/index.d.ts +133 -1
  21. package/dist/es/index.js +849 -321
  22. package/dist/es/models/common/v1/config/EntityReference.d.ts +79 -0
  23. package/dist/es/models/common/v1/config/EntityReference.js +355 -0
  24. package/dist/es/models/common/v1/config/EntityType.d.ts +19 -0
  25. package/dist/es/models/common/v1/config/EntityType.js +239 -0
  26. package/dist/es/models/common/v1/config/Flag.d.ts +2 -8
  27. package/dist/es/models/common/v1/config/Flag.js +170 -211
  28. package/dist/es/models/common/v1/config/IPAddress.d.ts +2 -20
  29. package/dist/es/models/common/v1/config/IPAddress.js +170 -217
  30. package/dist/es/models/common/v1/config/IPv4Address.d.ts +2 -8
  31. package/dist/es/models/common/v1/config/IPv4Address.js +174 -215
  32. package/dist/es/models/common/v1/config/IPv6Address.d.ts +2 -8
  33. package/dist/es/models/common/v1/config/IPv6Address.js +174 -215
  34. package/dist/es/models/common/v1/config/KVPair.d.ts +2 -8
  35. package/dist/es/models/common/v1/config/KVPair.js +225 -270
  36. package/dist/es/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
  37. package/dist/es/models/common/v1/config/MapOfStringWrapper.js +139 -178
  38. package/dist/es/models/common/v1/config/Message.d.ts +2 -10
  39. package/dist/es/models/common/v1/config/Message.js +213 -258
  40. package/dist/es/models/common/v1/config/MessageSeverity.js +7 -9
  41. package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +2 -7
  42. package/dist/es/models/common/v1/config/TenantAwareModel.js +137 -177
  43. package/dist/es/models/common/v1/response/ApiLink.d.ts +2 -8
  44. package/dist/es/models/common/v1/response/ApiLink.js +165 -206
  45. package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
  46. package/dist/es/models/common/v1/response/ApiResponseMetadata.js +281 -344
  47. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
  48. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +154 -202
  49. package/dist/es/models/dataprotection/v4/common/BackupType.js +7 -9
  50. package/dist/es/models/dataprotection/v4/common/BaseRecoveryPoint.d.ts +12 -21
  51. package/dist/es/models/dataprotection/v4/common/BaseRecoveryPoint.js +280 -301
  52. package/dist/es/models/dataprotection/v4/common/BaseVmRecoveryPoint.d.ts +1 -32
  53. package/dist/es/models/dataprotection/v4/common/BaseVmRecoveryPoint.js +294 -335
  54. package/dist/es/models/dataprotection/v4/common/ClusterInfo.d.ts +5 -29
  55. package/dist/es/models/dataprotection/v4/common/ClusterInfo.js +166 -207
  56. package/dist/es/models/dataprotection/v4/common/DiskRecoveryPoint.d.ts +2 -8
  57. package/dist/es/models/dataprotection/v4/common/DiskRecoveryPoint.js +163 -206
  58. package/dist/es/models/dataprotection/v4/common/RecoveryPointStatus.js +7 -9
  59. package/dist/es/models/dataprotection/v4/common/RecoveryPointType.js +7 -9
  60. package/dist/es/models/dataprotection/v4/common/VssProperties.d.ts +2 -10
  61. package/dist/es/models/dataprotection/v4/common/VssProperties.js +222 -267
  62. package/dist/es/models/dataprotection/v4/config/AhvVmOverrideSpec.d.ts +1 -1
  63. package/dist/es/models/dataprotection/v4/config/AhvVmOverrideSpec.js +75 -106
  64. package/dist/es/models/dataprotection/v4/config/AmazonS3Bucket.d.ts +2 -8
  65. package/dist/es/models/dataprotection/v4/config/AmazonS3Bucket.js +171 -212
  66. package/dist/es/models/dataprotection/v4/config/AzureBlobStorageContainer.d.ts +2 -8
  67. package/dist/es/models/dataprotection/v4/config/AzureBlobStorageContainer.js +171 -212
  68. package/dist/es/models/dataprotection/v4/config/Capability.d.ts +71 -0
  69. package/dist/es/models/dataprotection/v4/config/Capability.js +279 -0
  70. package/dist/es/models/dataprotection/v4/config/ClusterInfoApiResponse.d.ts +2 -43
  71. package/dist/es/models/dataprotection/v4/config/ClusterInfoApiResponse.js +187 -242
  72. package/dist/es/models/dataprotection/v4/config/ConsistencyGroup.d.ts +1 -26
  73. package/dist/es/models/dataprotection/v4/config/ConsistencyGroup.js +246 -301
  74. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMember.d.ts +2 -8
  75. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMember.js +166 -207
  76. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMemberType.js +7 -9
  77. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.d.ts +2 -8
  78. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.js +171 -212
  79. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupProjection.d.ts +1 -1
  80. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupProjection.js +74 -103
  81. package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.d.ts +58 -0
  82. package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.js +288 -0
  83. package/dist/es/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.d.ts +2 -43
  84. package/dist/es/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.js +187 -242
  85. package/dist/es/models/dataprotection/v4/config/CreationTimeRange.d.ts +58 -0
  86. package/dist/es/models/dataprotection/v4/config/CreationTimeRange.js +272 -0
  87. package/dist/es/models/dataprotection/v4/config/DataProtectionCapabilityName.d.ts +19 -0
  88. package/dist/es/models/dataprotection/v4/config/DataProtectionCapabilityName.js +77 -0
  89. package/dist/es/models/dataprotection/v4/config/DataProtectionClusterCapability.d.ts +34 -0
  90. package/dist/es/models/dataprotection/v4/config/DataProtectionClusterCapability.js +277 -0
  91. package/dist/es/models/dataprotection/v4/config/DataProtectionClusterCapabilityProjection.d.ts +10 -0
  92. package/dist/es/models/dataprotection/v4/config/DataProtectionClusterCapabilityProjection.js +124 -0
  93. package/dist/es/models/dataprotection/v4/config/DataProtectionSiteReference.d.ts +2 -8
  94. package/dist/es/models/dataprotection/v4/config/DataProtectionSiteReference.js +171 -212
  95. package/dist/es/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.d.ts +57 -0
  96. package/dist/es/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.js +290 -0
  97. package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPlanJobApiResponse.d.ts +58 -0
  98. package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPlanJobApiResponse.js +288 -0
  99. package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.d.ts +2 -43
  100. package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.js +187 -242
  101. package/dist/es/models/dataprotection/v4/config/DisasterRecoveryLocation.d.ts +72 -0
  102. package/dist/es/models/dataprotection/v4/config/DisasterRecoveryLocation.js +292 -0
  103. package/dist/es/models/dataprotection/v4/config/EntityRecoveryResult.d.ts +79 -0
  104. package/dist/es/models/dataprotection/v4/config/EntityRecoveryResult.js +352 -0
  105. package/dist/es/models/dataprotection/v4/config/EntityReference.d.ts +57 -0
  106. package/dist/es/models/dataprotection/v4/config/EntityReference.js +243 -0
  107. package/dist/es/models/dataprotection/v4/config/ErrorGroup.d.ts +19 -0
  108. package/dist/es/models/dataprotection/v4/config/ErrorGroup.js +113 -0
  109. package/dist/es/models/dataprotection/v4/config/ErrorMessage.d.ts +53 -0
  110. package/dist/es/models/dataprotection/v4/config/ErrorMessage.js +335 -0
  111. package/dist/es/models/dataprotection/v4/config/EsxiVmOverrideSpec.d.ts +2 -7
  112. package/dist/es/models/dataprotection/v4/config/EsxiVmOverrideSpec.js +143 -182
  113. package/dist/es/models/dataprotection/v4/config/ExecutionStepEntityReference.d.ts +68 -0
  114. package/dist/es/models/dataprotection/v4/config/ExecutionStepEntityReference.js +311 -0
  115. package/dist/es/models/dataprotection/v4/config/ExecutionStepEntityType.d.ts +19 -0
  116. package/dist/es/models/dataprotection/v4/config/ExecutionStepEntityType.js +143 -0
  117. package/dist/es/models/dataprotection/v4/config/ExecutionStepResult.d.ts +58 -0
  118. package/dist/es/models/dataprotection/v4/config/ExecutionStepResult.js +253 -0
  119. package/dist/es/models/dataprotection/v4/config/ExpirationTimeSpec.d.ts +7 -12
  120. package/dist/es/models/dataprotection/v4/config/ExpirationTimeSpec.js +143 -182
  121. package/dist/es/models/dataprotection/v4/config/FailoverDirection.d.ts +90 -0
  122. package/dist/es/models/dataprotection/v4/config/FailoverDirection.js +354 -0
  123. package/dist/es/models/dataprotection/v4/config/ForceDeleteAllRecoveryPointsSpec.d.ts +55 -0
  124. package/dist/es/models/dataprotection/v4/config/ForceDeleteAllRecoveryPointsSpec.js +274 -0
  125. package/dist/es/models/dataprotection/v4/config/GetConsistencyGroupApiResponse.d.ts +58 -0
  126. package/dist/es/models/dataprotection/v4/config/GetConsistencyGroupApiResponse.js +288 -0
  127. package/dist/es/models/dataprotection/v4/config/GetProtectedResourceApiResponse.d.ts +3 -44
  128. package/dist/es/models/dataprotection/v4/config/GetProtectedResourceApiResponse.js +187 -242
  129. package/dist/es/models/dataprotection/v4/config/GetRecoveryPlanJobApiResponse.d.ts +58 -0
  130. package/dist/es/models/dataprotection/v4/config/GetRecoveryPlanJobApiResponse.js +288 -0
  131. package/dist/es/models/dataprotection/v4/config/GetRecoveryPointApiResponse.d.ts +2 -43
  132. package/dist/es/models/dataprotection/v4/config/GetRecoveryPointApiResponse.js +187 -242
  133. package/dist/es/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.d.ts +2 -45
  134. package/dist/es/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.js +187 -242
  135. package/dist/es/models/dataprotection/v4/config/HostReference.d.ts +1 -17
  136. package/dist/es/models/dataprotection/v4/config/HostReference.js +153 -197
  137. package/dist/es/models/dataprotection/v4/config/HostType.js +7 -9
  138. package/dist/es/models/dataprotection/v4/config/HypervisorType.js +7 -9
  139. package/dist/es/models/dataprotection/v4/config/ListConsistencyGroupsApiResponse.d.ts +59 -0
  140. package/dist/es/models/dataprotection/v4/config/ListConsistencyGroupsApiResponse.js +315 -0
  141. package/dist/es/models/dataprotection/v4/config/ListDPClusterCapabilitiesApiResponse.d.ts +59 -0
  142. package/dist/es/models/dataprotection/v4/config/ListDPClusterCapabilitiesApiResponse.js +315 -0
  143. package/dist/es/models/dataprotection/v4/config/ListRecoveryPlanJobExecutionStepsApiResponse.d.ts +59 -0
  144. package/dist/es/models/dataprotection/v4/config/ListRecoveryPlanJobExecutionStepsApiResponse.js +315 -0
  145. package/dist/es/models/dataprotection/v4/config/ListRecoveryPlanJobValidationErrorsApiResponse.d.ts +59 -0
  146. package/dist/es/models/dataprotection/v4/config/ListRecoveryPlanJobValidationErrorsApiResponse.js +315 -0
  147. package/dist/es/models/dataprotection/v4/config/ListRecoveryPlanJobsApiResponse.d.ts +59 -0
  148. package/dist/es/models/dataprotection/v4/config/ListRecoveryPlanJobsApiResponse.js +315 -0
  149. package/dist/es/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.d.ts +2 -43
  150. package/dist/es/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.js +213 -268
  151. package/dist/es/models/dataprotection/v4/config/LocationReference.d.ts +2 -7
  152. package/dist/es/models/dataprotection/v4/config/LocationReference.js +142 -181
  153. package/dist/es/models/dataprotection/v4/config/NutanixObjectsBucket.d.ts +2 -7
  154. package/dist/es/models/dataprotection/v4/config/NutanixObjectsBucket.js +140 -179
  155. package/dist/es/models/dataprotection/v4/config/ObjectStorageType.js +7 -9
  156. package/dist/es/models/dataprotection/v4/config/OperationType.d.ts +19 -0
  157. package/dist/es/models/dataprotection/v4/config/OperationType.js +251 -0
  158. package/dist/es/models/dataprotection/v4/config/PhaseSummary.d.ts +33 -0
  159. package/dist/es/models/dataprotection/v4/config/PhaseSummary.js +274 -0
  160. package/dist/es/models/dataprotection/v4/config/ProtectedEntityType.js +7 -9
  161. package/dist/es/models/dataprotection/v4/config/ProtectedResource.d.ts +4 -72
  162. package/dist/es/models/dataprotection/v4/config/ProtectedResource.js +307 -369
  163. package/dist/es/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.d.ts +2 -43
  164. package/dist/es/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.js +187 -242
  165. package/dist/es/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.js +8 -10
  166. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.d.ts +2 -43
  167. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.js +187 -242
  168. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.d.ts +5 -11
  169. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.js +169 -210
  170. package/dist/es/models/dataprotection/v4/config/RecoveryInfo.d.ts +2 -13
  171. package/dist/es/models/dataprotection/v4/config/RecoveryInfo.js +149 -192
  172. package/dist/es/models/dataprotection/v4/config/RecoveryPlanActionType.d.ts +19 -0
  173. package/dist/es/models/dataprotection/v4/config/RecoveryPlanActionType.js +95 -0
  174. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJob.d.ts +166 -0
  175. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJob.js +738 -0
  176. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobExecutionStatus.d.ts +19 -0
  177. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobExecutionStatus.js +107 -0
  178. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobExecutionStep.d.ts +132 -0
  179. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobExecutionStep.js +624 -0
  180. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobExecutionStepProjection.d.ts +10 -0
  181. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobExecutionStepProjection.js +129 -0
  182. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobPhaseType.d.ts +19 -0
  183. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobPhaseType.js +89 -0
  184. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobProjection.d.ts +10 -0
  185. package/dist/es/models/dataprotection/v4/config/RecoveryPlanJobProjection.js +128 -0
  186. package/dist/es/models/dataprotection/v4/config/RecoveryPlanValidationError.d.ts +32 -0
  187. package/dist/es/models/dataprotection/v4/config/RecoveryPlanValidationError.js +322 -0
  188. package/dist/es/models/dataprotection/v4/config/RecoveryPlanValidationErrorProjection.d.ts +10 -0
  189. package/dist/es/models/dataprotection/v4/config/RecoveryPlanValidationErrorProjection.js +126 -0
  190. package/dist/es/models/dataprotection/v4/config/RecoveryPoint.d.ts +23 -101
  191. package/dist/es/models/dataprotection/v4/config/RecoveryPoint.js +337 -348
  192. package/dist/es/models/dataprotection/v4/config/RecoveryPointProjection.d.ts +1 -1
  193. package/dist/es/models/dataprotection/v4/config/RecoveryPointProjection.js +75 -103
  194. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.d.ts +2 -43
  195. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.js +187 -242
  196. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicationSpec.d.ts +5 -11
  197. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicationSpec.js +172 -213
  198. package/dist/es/models/dataprotection/v4/config/RecoveryPointRepository.d.ts +1 -18
  199. package/dist/es/models/dataprotection/v4/config/RecoveryPointRepository.js +196 -246
  200. package/dist/es/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.d.ts +1 -1
  201. package/dist/es/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.js +73 -102
  202. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestorationSpec.d.ts +8 -33
  203. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestorationSpec.js +222 -273
  204. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.d.ts +2 -43
  205. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.js +187 -242
  206. package/dist/es/models/dataprotection/v4/config/RecycleBinEntry.d.ts +77 -0
  207. package/dist/es/models/dataprotection/v4/config/RecycleBinEntry.js +405 -0
  208. package/dist/es/models/dataprotection/v4/config/RecycleBinVm.d.ts +44 -0
  209. package/dist/es/models/dataprotection/v4/config/RecycleBinVm.js +352 -0
  210. package/dist/es/models/dataprotection/v4/config/RecycleBinVmProjection.d.ts +10 -0
  211. package/dist/es/models/dataprotection/v4/config/RecycleBinVmProjection.js +124 -0
  212. package/dist/es/models/dataprotection/v4/config/RecycleBinVolumeGroup.d.ts +44 -0
  213. package/dist/es/models/dataprotection/v4/config/RecycleBinVolumeGroup.js +352 -0
  214. package/dist/es/models/dataprotection/v4/config/RecycleBinVolumeGroupProjection.d.ts +10 -0
  215. package/dist/es/models/dataprotection/v4/config/RecycleBinVolumeGroupProjection.js +124 -0
  216. package/dist/es/models/dataprotection/v4/config/ReplicationState.d.ts +2 -16
  217. package/dist/es/models/dataprotection/v4/config/ReplicationState.js +221 -266
  218. package/dist/es/models/dataprotection/v4/config/RestorableTimeRange.d.ts +2 -8
  219. package/dist/es/models/dataprotection/v4/config/RestorableTimeRange.js +166 -207
  220. package/dist/es/models/dataprotection/v4/config/RootCauseAnalysis.d.ts +69 -0
  221. package/dist/es/models/dataprotection/v4/config/RootCauseAnalysis.js +329 -0
  222. package/dist/es/models/dataprotection/v4/config/Severity.d.ts +19 -0
  223. package/dist/es/models/dataprotection/v4/config/Severity.js +83 -0
  224. package/dist/es/models/dataprotection/v4/config/SiteProtectionInfo.d.ts +2 -26
  225. package/dist/es/models/dataprotection/v4/config/SiteProtectionInfo.js +185 -228
  226. package/dist/es/models/dataprotection/v4/config/SiteReference.d.ts +2 -8
  227. package/dist/es/models/dataprotection/v4/config/SiteReference.js +171 -212
  228. package/dist/es/models/dataprotection/v4/config/StageSummary.d.ts +22 -0
  229. package/dist/es/models/dataprotection/v4/config/StageSummary.js +230 -0
  230. package/dist/es/models/dataprotection/v4/config/Summary.d.ts +59 -0
  231. package/dist/es/models/dataprotection/v4/config/Summary.js +277 -0
  232. package/dist/es/models/dataprotection/v4/config/SynchronousReplicationRole.js +8 -10
  233. package/dist/es/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.d.ts +58 -0
  234. package/dist/es/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.js +310 -0
  235. package/dist/es/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.d.ts +2 -43
  236. package/dist/es/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.js +187 -242
  237. package/dist/es/models/dataprotection/v4/config/VmRecoveryPoint.d.ts +1 -33
  238. package/dist/es/models/dataprotection/v4/config/VmRecoveryPoint.js +183 -206
  239. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.d.ts +8 -15
  240. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.js +211 -258
  241. package/dist/es/models/dataprotection/v4/config/VolumeGroupOverrideSpec.d.ts +2 -7
  242. package/dist/es/models/dataprotection/v4/config/VolumeGroupOverrideSpec.js +143 -182
  243. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.d.ts +18 -32
  244. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.js +283 -306
  245. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.d.ts +2 -13
  246. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.js +166 -207
  247. package/dist/es/models/dataprotection/v4/config/VolumeGroupSyncContext.d.ts +1 -29
  248. package/dist/es/models/dataprotection/v4/config/VolumeGroupSyncContext.js +148 -192
  249. package/dist/es/models/dataprotection/v4/config/Witness.d.ts +1 -34
  250. package/dist/es/models/dataprotection/v4/config/Witness.js +226 -278
  251. package/dist/es/models/dataprotection/v4/config/WitnessAvailabilityStatus.js +7 -9
  252. package/dist/es/models/dataprotection/v4/content/BaseRecoveryPointSpec.d.ts +2 -8
  253. package/dist/es/models/dataprotection/v4/content/BaseRecoveryPointSpec.js +171 -212
  254. package/dist/es/models/dataprotection/v4/content/ChangedRegion.d.ts +2 -9
  255. package/dist/es/models/dataprotection/v4/content/ChangedRegion.js +189 -232
  256. package/dist/es/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.d.ts +2 -43
  257. package/dist/es/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.js +209 -264
  258. package/dist/es/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.d.ts +2 -43
  259. package/dist/es/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.js +209 -264
  260. package/dist/es/models/dataprotection/v4/content/ClusterDiscoverOperation.js +9 -11
  261. package/dist/es/models/dataprotection/v4/content/ClusterDiscoverSpec.d.ts +2 -8
  262. package/dist/es/models/dataprotection/v4/content/ClusterDiscoverSpec.js +179 -224
  263. package/dist/es/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.d.ts +3 -9
  264. package/dist/es/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.js +197 -246
  265. package/dist/es/models/dataprotection/v4/content/DiskRecoveryPointReference.d.ts +2 -8
  266. package/dist/es/models/dataprotection/v4/content/DiskRecoveryPointReference.js +172 -213
  267. package/dist/es/models/dataprotection/v4/content/FileWrapper.d.ts +36 -0
  268. package/dist/es/models/dataprotection/v4/content/FileWrapper.js +200 -0
  269. package/dist/es/models/dataprotection/v4/content/GetVssMetadataApiResponse.d.ts +8 -48
  270. package/dist/es/models/dataprotection/v4/content/GetVssMetadataApiResponse.js +188 -242
  271. package/dist/es/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.d.ts +3 -8
  272. package/dist/es/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.js +143 -182
  273. package/dist/es/models/dataprotection/v4/content/RegionType.js +7 -9
  274. package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.d.ts +1 -9
  275. package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.js +130 -169
  276. package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointReference.d.ts +1 -9
  277. package/dist/es/models/dataprotection/v4/content/VmDiskRecoveryPointReference.js +130 -169
  278. package/dist/es/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.d.ts +4 -15
  279. package/dist/es/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.js +190 -231
  280. package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.d.ts +1 -9
  281. package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.js +130 -169
  282. package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.d.ts +1 -9
  283. package/dist/es/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.js +131 -170
  284. package/dist/es/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.d.ts +4 -15
  285. package/dist/es/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.js +190 -231
  286. package/dist/es/models/dataprotection/v4/error/AppMessage.d.ts +2 -12
  287. package/dist/es/models/dataprotection/v4/error/AppMessage.js +264 -313
  288. package/dist/es/models/dataprotection/v4/error/ErrorResponse.d.ts +2 -7
  289. package/dist/es/models/dataprotection/v4/error/ErrorResponse.js +195 -222
  290. package/dist/es/models/dataprotection/v4/error/SchemaValidationError.d.ts +2 -18
  291. package/dist/es/models/dataprotection/v4/error/SchemaValidationError.js +249 -300
  292. package/dist/es/models/dataprotection/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
  293. package/dist/es/models/dataprotection/v4/error/SchemaValidationErrorMessage.js +191 -234
  294. package/dist/es/models/dataprotection/v4/operations/BaseRecoveryPlanActionSpec.d.ts +73 -0
  295. package/dist/es/models/dataprotection/v4/operations/BaseRecoveryPlanActionSpec.js +297 -0
  296. package/dist/es/models/dataprotection/v4/operations/CleanupRecoveryPlanResourcesApiResponse.d.ts +58 -0
  297. package/dist/es/models/dataprotection/v4/operations/CleanupRecoveryPlanResourcesApiResponse.js +288 -0
  298. package/dist/es/models/dataprotection/v4/operations/PlannedFailoverRecoveryPlanApiResponse.d.ts +58 -0
  299. package/dist/es/models/dataprotection/v4/operations/PlannedFailoverRecoveryPlanApiResponse.js +288 -0
  300. package/dist/es/models/dataprotection/v4/operations/PlannedFailoverSpec.d.ts +37 -0
  301. package/dist/es/models/dataprotection/v4/operations/PlannedFailoverSpec.js +274 -0
  302. package/dist/es/models/dataprotection/v4/operations/TestFailoverRecoveryPlanApiResponse.d.ts +58 -0
  303. package/dist/es/models/dataprotection/v4/operations/TestFailoverRecoveryPlanApiResponse.js +288 -0
  304. package/dist/es/models/dataprotection/v4/operations/TestFailoverSpec.d.ts +26 -0
  305. package/dist/es/models/dataprotection/v4/operations/TestFailoverSpec.js +237 -0
  306. package/dist/es/models/dataprotection/v4/operations/UnplannedFailoverRecoveryPlanApiResponse.d.ts +58 -0
  307. package/dist/es/models/dataprotection/v4/operations/UnplannedFailoverRecoveryPlanApiResponse.js +288 -0
  308. package/dist/es/models/dataprotection/v4/operations/UnplannedFailoverSpec.d.ts +37 -0
  309. package/dist/es/models/dataprotection/v4/operations/UnplannedFailoverSpec.js +274 -0
  310. package/dist/es/models/dataprotection/v4/operations/ValidateRecoveryPlanApiResponse.d.ts +58 -0
  311. package/dist/es/models/dataprotection/v4/operations/ValidateRecoveryPlanApiResponse.js +288 -0
  312. package/dist/es/models/dataprotection/v4/operations/ValidateSpec.d.ts +24 -0
  313. package/dist/es/models/dataprotection/v4/operations/ValidateSpec.js +129 -0
  314. package/dist/es/models/prism/v4/config/TaskReference.d.ts +2 -7
  315. package/dist/es/models/prism/v4/config/TaskReference.js +150 -183
  316. package/dist/es/models/validation/ValidationError.js +26 -42
  317. package/dist/es/models/validation/ValidationScopes.js +3 -3
  318. package/dist/es/models/vmm/v4/ahv/config/CategoryReference.d.ts +2 -7
  319. package/dist/es/models/vmm/v4/ahv/config/CategoryReference.js +142 -181
  320. package/dist/es/models/vmm/v4/ahv/config/GuestStaticIpSpec.d.ts +57 -0
  321. package/dist/es/models/vmm/v4/ahv/config/GuestStaticIpSpec.js +277 -0
  322. package/dist/es/models/vmm/v4/ahv/config/OwnerReference.d.ts +2 -7
  323. package/dist/es/models/vmm/v4/ahv/config/OwnerReference.js +142 -181
  324. package/dist/es/models/vmm/v4/ahv/config/OwnershipInfo.d.ts +2 -12
  325. package/dist/es/models/vmm/v4/ahv/config/OwnershipInfo.js +138 -177
  326. package/dist/es/models/vmm/v4/ahv/config/SubnetReference.d.ts +2 -7
  327. package/dist/es/models/vmm/v4/ahv/config/SubnetReference.js +142 -181
  328. package/dist/es/models/vmm/v4/ahv/config/VmConfigOverrideSpecification.d.ts +12 -39
  329. package/dist/es/models/vmm/v4/ahv/config/VmConfigOverrideSpecification.js +283 -300
  330. package/dist/es/models/vmm/v4/ahv/config/VmRestoreGuestNicInfoOverrideSpec.d.ts +48 -0
  331. package/dist/es/models/vmm/v4/ahv/config/VmRestoreGuestNicInfoOverrideSpec.js +245 -0
  332. package/dist/es/models/vmm/v4/ahv/config/VmRestoreGuestToolsSpecification.d.ts +47 -0
  333. package/dist/es/models/vmm/v4/ahv/config/VmRestoreGuestToolsSpecification.js +236 -0
  334. package/dist/es/models/vmm/v4/ahv/config/VmRestoreIpv4ConfigOverrideSpec.d.ts +2 -20
  335. package/dist/es/models/vmm/v4/ahv/config/VmRestoreIpv4ConfigOverrideSpec.js +173 -218
  336. package/dist/es/models/vmm/v4/ahv/config/VmRestoreNicConfigOverrideParams.d.ts +12 -9
  337. package/dist/es/models/vmm/v4/ahv/config/VmRestoreNicConfigOverrideParams.js +252 -269
  338. package/dist/es/models/vmm/v4/ahv/config/VmRestoreNicConfigSpecification.d.ts +2 -15
  339. package/dist/es/models/vmm/v4/ahv/config/VmRestoreNicConfigSpecification.js +183 -228
  340. package/dist/es/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec.d.ts +2 -31
  341. package/dist/es/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec.js +162 -203
  342. package/dist/es/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicOverrideSpec.d.ts +2 -7
  343. package/dist/es/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicOverrideSpec.js +142 -181
  344. package/dist/es/utils/ValidationUtils.js +39 -69
  345. package/dist/lib/ApiClient.d.ts +29 -7
  346. package/dist/lib/ApiClient.js +854 -667
  347. package/dist/lib/Paginable.d.ts +1 -1
  348. package/dist/lib/Paginable.js +144 -183
  349. package/dist/lib/apis/consistencygroups-endpoints.d.ts +84 -0
  350. package/dist/lib/apis/consistencygroups-endpoints.js +267 -0
  351. package/dist/lib/apis/dataprotectionclustercapabilities-endpoints.d.ts +46 -0
  352. package/dist/lib/apis/dataprotectionclustercapabilities-endpoints.js +107 -0
  353. package/dist/lib/apis/protectedresources-endpoints.d.ts +1 -1
  354. package/dist/lib/apis/protectedresources-endpoints.js +128 -146
  355. package/dist/lib/apis/recoveryplanactions-endpoints.d.ts +76 -0
  356. package/dist/lib/apis/recoveryplanactions-endpoints.js +282 -0
  357. package/dist/lib/apis/recoveryplanjobs-endpoints.d.ts +108 -0
  358. package/dist/lib/apis/recoveryplanjobs-endpoints.js +291 -0
  359. package/dist/lib/apis/recoverypoints-endpoints.d.ts +2 -2
  360. package/dist/lib/apis/recoverypoints-endpoints.js +530 -552
  361. package/dist/lib/index.d.ts +133 -1
  362. package/dist/lib/index.js +849 -321
  363. package/dist/lib/models/common/v1/config/EntityReference.d.ts +79 -0
  364. package/dist/lib/models/common/v1/config/EntityReference.js +355 -0
  365. package/dist/lib/models/common/v1/config/EntityType.d.ts +19 -0
  366. package/dist/lib/models/common/v1/config/EntityType.js +239 -0
  367. package/dist/lib/models/common/v1/config/Flag.d.ts +2 -8
  368. package/dist/lib/models/common/v1/config/Flag.js +170 -211
  369. package/dist/lib/models/common/v1/config/IPAddress.d.ts +2 -20
  370. package/dist/lib/models/common/v1/config/IPAddress.js +170 -217
  371. package/dist/lib/models/common/v1/config/IPv4Address.d.ts +2 -8
  372. package/dist/lib/models/common/v1/config/IPv4Address.js +174 -215
  373. package/dist/lib/models/common/v1/config/IPv6Address.d.ts +2 -8
  374. package/dist/lib/models/common/v1/config/IPv6Address.js +174 -215
  375. package/dist/lib/models/common/v1/config/KVPair.d.ts +2 -8
  376. package/dist/lib/models/common/v1/config/KVPair.js +225 -270
  377. package/dist/lib/models/common/v1/config/MapOfStringWrapper.d.ts +2 -7
  378. package/dist/lib/models/common/v1/config/MapOfStringWrapper.js +139 -178
  379. package/dist/lib/models/common/v1/config/Message.d.ts +2 -10
  380. package/dist/lib/models/common/v1/config/Message.js +213 -258
  381. package/dist/lib/models/common/v1/config/MessageSeverity.js +7 -9
  382. package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +2 -7
  383. package/dist/lib/models/common/v1/config/TenantAwareModel.js +137 -177
  384. package/dist/lib/models/common/v1/response/ApiLink.d.ts +2 -8
  385. package/dist/lib/models/common/v1/response/ApiLink.js +165 -206
  386. package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +2 -40
  387. package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +281 -344
  388. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +1 -15
  389. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +154 -202
  390. package/dist/lib/models/dataprotection/v4/common/BackupType.js +7 -9
  391. package/dist/lib/models/dataprotection/v4/common/BaseRecoveryPoint.d.ts +12 -21
  392. package/dist/lib/models/dataprotection/v4/common/BaseRecoveryPoint.js +280 -301
  393. package/dist/lib/models/dataprotection/v4/common/BaseVmRecoveryPoint.d.ts +1 -32
  394. package/dist/lib/models/dataprotection/v4/common/BaseVmRecoveryPoint.js +294 -335
  395. package/dist/lib/models/dataprotection/v4/common/ClusterInfo.d.ts +5 -29
  396. package/dist/lib/models/dataprotection/v4/common/ClusterInfo.js +166 -207
  397. package/dist/lib/models/dataprotection/v4/common/DiskRecoveryPoint.d.ts +2 -8
  398. package/dist/lib/models/dataprotection/v4/common/DiskRecoveryPoint.js +163 -206
  399. package/dist/lib/models/dataprotection/v4/common/RecoveryPointStatus.js +7 -9
  400. package/dist/lib/models/dataprotection/v4/common/RecoveryPointType.js +7 -9
  401. package/dist/lib/models/dataprotection/v4/common/VssProperties.d.ts +2 -10
  402. package/dist/lib/models/dataprotection/v4/common/VssProperties.js +222 -267
  403. package/dist/lib/models/dataprotection/v4/config/AhvVmOverrideSpec.d.ts +1 -1
  404. package/dist/lib/models/dataprotection/v4/config/AhvVmOverrideSpec.js +75 -106
  405. package/dist/lib/models/dataprotection/v4/config/AmazonS3Bucket.d.ts +2 -8
  406. package/dist/lib/models/dataprotection/v4/config/AmazonS3Bucket.js +171 -212
  407. package/dist/lib/models/dataprotection/v4/config/AzureBlobStorageContainer.d.ts +2 -8
  408. package/dist/lib/models/dataprotection/v4/config/AzureBlobStorageContainer.js +171 -212
  409. package/dist/lib/models/dataprotection/v4/config/Capability.d.ts +71 -0
  410. package/dist/lib/models/dataprotection/v4/config/Capability.js +279 -0
  411. package/dist/lib/models/dataprotection/v4/config/ClusterInfoApiResponse.d.ts +2 -43
  412. package/dist/lib/models/dataprotection/v4/config/ClusterInfoApiResponse.js +187 -242
  413. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroup.d.ts +1 -26
  414. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroup.js +246 -301
  415. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMember.d.ts +2 -8
  416. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMember.js +166 -207
  417. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMemberType.js +7 -9
  418. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.d.ts +2 -8
  419. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.js +171 -212
  420. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupProjection.d.ts +1 -1
  421. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupProjection.js +74 -103
  422. package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.d.ts +58 -0
  423. package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupApiResponse.js +288 -0
  424. package/dist/lib/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.d.ts +2 -43
  425. package/dist/lib/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.js +187 -242
  426. package/dist/lib/models/dataprotection/v4/config/CreationTimeRange.d.ts +58 -0
  427. package/dist/lib/models/dataprotection/v4/config/CreationTimeRange.js +272 -0
  428. package/dist/lib/models/dataprotection/v4/config/DataProtectionCapabilityName.d.ts +19 -0
  429. package/dist/lib/models/dataprotection/v4/config/DataProtectionCapabilityName.js +77 -0
  430. package/dist/lib/models/dataprotection/v4/config/DataProtectionClusterCapability.d.ts +34 -0
  431. package/dist/lib/models/dataprotection/v4/config/DataProtectionClusterCapability.js +277 -0
  432. package/dist/lib/models/dataprotection/v4/config/DataProtectionClusterCapabilityProjection.d.ts +10 -0
  433. package/dist/lib/models/dataprotection/v4/config/DataProtectionClusterCapabilityProjection.js +124 -0
  434. package/dist/lib/models/dataprotection/v4/config/DataProtectionSiteReference.d.ts +2 -8
  435. package/dist/lib/models/dataprotection/v4/config/DataProtectionSiteReference.js +171 -212
  436. package/dist/lib/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.d.ts +57 -0
  437. package/dist/lib/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.js +290 -0
  438. package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPlanJobApiResponse.d.ts +58 -0
  439. package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPlanJobApiResponse.js +288 -0
  440. package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.d.ts +2 -43
  441. package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.js +187 -242
  442. package/dist/lib/models/dataprotection/v4/config/DisasterRecoveryLocation.d.ts +72 -0
  443. package/dist/lib/models/dataprotection/v4/config/DisasterRecoveryLocation.js +292 -0
  444. package/dist/lib/models/dataprotection/v4/config/EntityRecoveryResult.d.ts +79 -0
  445. package/dist/lib/models/dataprotection/v4/config/EntityRecoveryResult.js +352 -0
  446. package/dist/lib/models/dataprotection/v4/config/EntityReference.d.ts +57 -0
  447. package/dist/lib/models/dataprotection/v4/config/EntityReference.js +243 -0
  448. package/dist/lib/models/dataprotection/v4/config/ErrorGroup.d.ts +19 -0
  449. package/dist/lib/models/dataprotection/v4/config/ErrorGroup.js +113 -0
  450. package/dist/lib/models/dataprotection/v4/config/ErrorMessage.d.ts +53 -0
  451. package/dist/lib/models/dataprotection/v4/config/ErrorMessage.js +335 -0
  452. package/dist/lib/models/dataprotection/v4/config/EsxiVmOverrideSpec.d.ts +2 -7
  453. package/dist/lib/models/dataprotection/v4/config/EsxiVmOverrideSpec.js +143 -182
  454. package/dist/lib/models/dataprotection/v4/config/ExecutionStepEntityReference.d.ts +68 -0
  455. package/dist/lib/models/dataprotection/v4/config/ExecutionStepEntityReference.js +311 -0
  456. package/dist/lib/models/dataprotection/v4/config/ExecutionStepEntityType.d.ts +19 -0
  457. package/dist/lib/models/dataprotection/v4/config/ExecutionStepEntityType.js +143 -0
  458. package/dist/lib/models/dataprotection/v4/config/ExecutionStepResult.d.ts +58 -0
  459. package/dist/lib/models/dataprotection/v4/config/ExecutionStepResult.js +253 -0
  460. package/dist/lib/models/dataprotection/v4/config/ExpirationTimeSpec.d.ts +7 -12
  461. package/dist/lib/models/dataprotection/v4/config/ExpirationTimeSpec.js +143 -182
  462. package/dist/lib/models/dataprotection/v4/config/FailoverDirection.d.ts +90 -0
  463. package/dist/lib/models/dataprotection/v4/config/FailoverDirection.js +354 -0
  464. package/dist/lib/models/dataprotection/v4/config/ForceDeleteAllRecoveryPointsSpec.d.ts +55 -0
  465. package/dist/lib/models/dataprotection/v4/config/ForceDeleteAllRecoveryPointsSpec.js +274 -0
  466. package/dist/lib/models/dataprotection/v4/config/GetConsistencyGroupApiResponse.d.ts +58 -0
  467. package/dist/lib/models/dataprotection/v4/config/GetConsistencyGroupApiResponse.js +288 -0
  468. package/dist/lib/models/dataprotection/v4/config/GetProtectedResourceApiResponse.d.ts +3 -44
  469. package/dist/lib/models/dataprotection/v4/config/GetProtectedResourceApiResponse.js +187 -242
  470. package/dist/lib/models/dataprotection/v4/config/GetRecoveryPlanJobApiResponse.d.ts +58 -0
  471. package/dist/lib/models/dataprotection/v4/config/GetRecoveryPlanJobApiResponse.js +288 -0
  472. package/dist/lib/models/dataprotection/v4/config/GetRecoveryPointApiResponse.d.ts +2 -43
  473. package/dist/lib/models/dataprotection/v4/config/GetRecoveryPointApiResponse.js +187 -242
  474. package/dist/lib/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.d.ts +2 -45
  475. package/dist/lib/models/dataprotection/v4/config/GetVmRecoveryPointApiResponse.js +187 -242
  476. package/dist/lib/models/dataprotection/v4/config/HostReference.d.ts +1 -17
  477. package/dist/lib/models/dataprotection/v4/config/HostReference.js +153 -197
  478. package/dist/lib/models/dataprotection/v4/config/HostType.js +7 -9
  479. package/dist/lib/models/dataprotection/v4/config/HypervisorType.js +7 -9
  480. package/dist/lib/models/dataprotection/v4/config/ListConsistencyGroupsApiResponse.d.ts +59 -0
  481. package/dist/lib/models/dataprotection/v4/config/ListConsistencyGroupsApiResponse.js +315 -0
  482. package/dist/lib/models/dataprotection/v4/config/ListDPClusterCapabilitiesApiResponse.d.ts +59 -0
  483. package/dist/lib/models/dataprotection/v4/config/ListDPClusterCapabilitiesApiResponse.js +315 -0
  484. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPlanJobExecutionStepsApiResponse.d.ts +59 -0
  485. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPlanJobExecutionStepsApiResponse.js +315 -0
  486. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPlanJobValidationErrorsApiResponse.d.ts +59 -0
  487. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPlanJobValidationErrorsApiResponse.js +315 -0
  488. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPlanJobsApiResponse.d.ts +59 -0
  489. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPlanJobsApiResponse.js +315 -0
  490. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.d.ts +2 -43
  491. package/dist/lib/models/dataprotection/v4/config/ListRecoveryPointsApiResponse.js +213 -268
  492. package/dist/lib/models/dataprotection/v4/config/LocationReference.d.ts +2 -7
  493. package/dist/lib/models/dataprotection/v4/config/LocationReference.js +142 -181
  494. package/dist/lib/models/dataprotection/v4/config/NutanixObjectsBucket.d.ts +2 -7
  495. package/dist/lib/models/dataprotection/v4/config/NutanixObjectsBucket.js +140 -179
  496. package/dist/lib/models/dataprotection/v4/config/ObjectStorageType.js +7 -9
  497. package/dist/lib/models/dataprotection/v4/config/OperationType.d.ts +19 -0
  498. package/dist/lib/models/dataprotection/v4/config/OperationType.js +251 -0
  499. package/dist/lib/models/dataprotection/v4/config/PhaseSummary.d.ts +33 -0
  500. package/dist/lib/models/dataprotection/v4/config/PhaseSummary.js +274 -0
  501. package/dist/lib/models/dataprotection/v4/config/ProtectedEntityType.js +7 -9
  502. package/dist/lib/models/dataprotection/v4/config/ProtectedResource.d.ts +4 -72
  503. package/dist/lib/models/dataprotection/v4/config/ProtectedResource.js +307 -369
  504. package/dist/lib/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.d.ts +2 -43
  505. package/dist/lib/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.js +187 -242
  506. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.js +8 -10
  507. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.d.ts +2 -43
  508. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.js +187 -242
  509. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.d.ts +5 -11
  510. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.js +169 -210
  511. package/dist/lib/models/dataprotection/v4/config/RecoveryInfo.d.ts +2 -13
  512. package/dist/lib/models/dataprotection/v4/config/RecoveryInfo.js +149 -192
  513. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanActionType.d.ts +19 -0
  514. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanActionType.js +95 -0
  515. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJob.d.ts +166 -0
  516. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJob.js +738 -0
  517. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobExecutionStatus.d.ts +19 -0
  518. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobExecutionStatus.js +107 -0
  519. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobExecutionStep.d.ts +132 -0
  520. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobExecutionStep.js +624 -0
  521. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobExecutionStepProjection.d.ts +10 -0
  522. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobExecutionStepProjection.js +129 -0
  523. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobPhaseType.d.ts +19 -0
  524. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobPhaseType.js +89 -0
  525. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobProjection.d.ts +10 -0
  526. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanJobProjection.js +128 -0
  527. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanValidationError.d.ts +32 -0
  528. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanValidationError.js +322 -0
  529. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanValidationErrorProjection.d.ts +10 -0
  530. package/dist/lib/models/dataprotection/v4/config/RecoveryPlanValidationErrorProjection.js +126 -0
  531. package/dist/lib/models/dataprotection/v4/config/RecoveryPoint.d.ts +23 -101
  532. package/dist/lib/models/dataprotection/v4/config/RecoveryPoint.js +337 -348
  533. package/dist/lib/models/dataprotection/v4/config/RecoveryPointProjection.d.ts +1 -1
  534. package/dist/lib/models/dataprotection/v4/config/RecoveryPointProjection.js +75 -103
  535. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.d.ts +2 -43
  536. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.js +187 -242
  537. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicationSpec.d.ts +5 -11
  538. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicationSpec.js +172 -213
  539. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepository.d.ts +1 -18
  540. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepository.js +196 -246
  541. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.d.ts +1 -1
  542. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRepositoryProjection.js +73 -102
  543. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestorationSpec.d.ts +8 -33
  544. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestorationSpec.js +222 -273
  545. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.d.ts +2 -43
  546. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.js +187 -242
  547. package/dist/lib/models/dataprotection/v4/config/RecycleBinEntry.d.ts +77 -0
  548. package/dist/lib/models/dataprotection/v4/config/RecycleBinEntry.js +405 -0
  549. package/dist/lib/models/dataprotection/v4/config/RecycleBinVm.d.ts +44 -0
  550. package/dist/lib/models/dataprotection/v4/config/RecycleBinVm.js +352 -0
  551. package/dist/lib/models/dataprotection/v4/config/RecycleBinVmProjection.d.ts +10 -0
  552. package/dist/lib/models/dataprotection/v4/config/RecycleBinVmProjection.js +124 -0
  553. package/dist/lib/models/dataprotection/v4/config/RecycleBinVolumeGroup.d.ts +44 -0
  554. package/dist/lib/models/dataprotection/v4/config/RecycleBinVolumeGroup.js +352 -0
  555. package/dist/lib/models/dataprotection/v4/config/RecycleBinVolumeGroupProjection.d.ts +10 -0
  556. package/dist/lib/models/dataprotection/v4/config/RecycleBinVolumeGroupProjection.js +124 -0
  557. package/dist/lib/models/dataprotection/v4/config/ReplicationState.d.ts +2 -16
  558. package/dist/lib/models/dataprotection/v4/config/ReplicationState.js +221 -266
  559. package/dist/lib/models/dataprotection/v4/config/RestorableTimeRange.d.ts +2 -8
  560. package/dist/lib/models/dataprotection/v4/config/RestorableTimeRange.js +166 -207
  561. package/dist/lib/models/dataprotection/v4/config/RootCauseAnalysis.d.ts +69 -0
  562. package/dist/lib/models/dataprotection/v4/config/RootCauseAnalysis.js +329 -0
  563. package/dist/lib/models/dataprotection/v4/config/Severity.d.ts +19 -0
  564. package/dist/lib/models/dataprotection/v4/config/Severity.js +83 -0
  565. package/dist/lib/models/dataprotection/v4/config/SiteProtectionInfo.d.ts +2 -26
  566. package/dist/lib/models/dataprotection/v4/config/SiteProtectionInfo.js +185 -228
  567. package/dist/lib/models/dataprotection/v4/config/SiteReference.d.ts +2 -8
  568. package/dist/lib/models/dataprotection/v4/config/SiteReference.js +171 -212
  569. package/dist/lib/models/dataprotection/v4/config/StageSummary.d.ts +22 -0
  570. package/dist/lib/models/dataprotection/v4/config/StageSummary.js +230 -0
  571. package/dist/lib/models/dataprotection/v4/config/Summary.d.ts +59 -0
  572. package/dist/lib/models/dataprotection/v4/config/Summary.js +277 -0
  573. package/dist/lib/models/dataprotection/v4/config/SynchronousReplicationRole.js +8 -10
  574. package/dist/lib/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.d.ts +58 -0
  575. package/dist/lib/models/dataprotection/v4/config/UpdateConsistencyGroupApiResponse.js +310 -0
  576. package/dist/lib/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.d.ts +2 -43
  577. package/dist/lib/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.js +187 -242
  578. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPoint.d.ts +1 -33
  579. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPoint.js +183 -206
  580. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.d.ts +8 -15
  581. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.js +211 -258
  582. package/dist/lib/models/dataprotection/v4/config/VolumeGroupOverrideSpec.d.ts +2 -7
  583. package/dist/lib/models/dataprotection/v4/config/VolumeGroupOverrideSpec.js +143 -182
  584. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.d.ts +18 -32
  585. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.js +283 -306
  586. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.d.ts +2 -13
  587. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.js +166 -207
  588. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSyncContext.d.ts +1 -29
  589. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSyncContext.js +148 -192
  590. package/dist/lib/models/dataprotection/v4/config/Witness.d.ts +1 -34
  591. package/dist/lib/models/dataprotection/v4/config/Witness.js +226 -278
  592. package/dist/lib/models/dataprotection/v4/config/WitnessAvailabilityStatus.js +7 -9
  593. package/dist/lib/models/dataprotection/v4/content/BaseRecoveryPointSpec.d.ts +2 -8
  594. package/dist/lib/models/dataprotection/v4/content/BaseRecoveryPointSpec.js +171 -212
  595. package/dist/lib/models/dataprotection/v4/content/ChangedRegion.d.ts +2 -9
  596. package/dist/lib/models/dataprotection/v4/content/ChangedRegion.js +189 -232
  597. package/dist/lib/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.d.ts +2 -43
  598. package/dist/lib/models/dataprotection/v4/content/ChangedVmRegionsApiResponse.js +209 -264
  599. package/dist/lib/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.d.ts +2 -43
  600. package/dist/lib/models/dataprotection/v4/content/ChangedVolumeGroupRegionsApiResponse.js +209 -264
  601. package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverOperation.js +9 -11
  602. package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverSpec.d.ts +2 -8
  603. package/dist/lib/models/dataprotection/v4/content/ClusterDiscoverSpec.js +179 -224
  604. package/dist/lib/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.d.ts +3 -9
  605. package/dist/lib/models/dataprotection/v4/content/ComputeChangedRegionsClusterDiscoverSpec.js +197 -246
  606. package/dist/lib/models/dataprotection/v4/content/DiskRecoveryPointReference.d.ts +2 -8
  607. package/dist/lib/models/dataprotection/v4/content/DiskRecoveryPointReference.js +172 -213
  608. package/dist/lib/models/dataprotection/v4/content/FileWrapper.d.ts +36 -0
  609. package/dist/lib/models/dataprotection/v4/content/FileWrapper.js +200 -0
  610. package/dist/lib/models/dataprotection/v4/content/GetVssMetadataApiResponse.d.ts +8 -48
  611. package/dist/lib/models/dataprotection/v4/content/GetVssMetadataApiResponse.js +188 -242
  612. package/dist/lib/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.d.ts +3 -8
  613. package/dist/lib/models/dataprotection/v4/content/GetVssMetadataClusterDiscoverSpec.js +143 -182
  614. package/dist/lib/models/dataprotection/v4/content/RegionType.js +7 -9
  615. package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.d.ts +1 -9
  616. package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointClusterDiscoverSpec.js +130 -169
  617. package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointReference.d.ts +1 -9
  618. package/dist/lib/models/dataprotection/v4/content/VmDiskRecoveryPointReference.js +130 -169
  619. package/dist/lib/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.d.ts +4 -15
  620. package/dist/lib/models/dataprotection/v4/content/VmRecoveryPointChangedRegionsComputeSpec.js +190 -231
  621. package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.d.ts +1 -9
  622. package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointClusterDiscoverSpec.js +130 -169
  623. package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.d.ts +1 -9
  624. package/dist/lib/models/dataprotection/v4/content/VolumeGroupDiskRecoveryPointReference.js +131 -170
  625. package/dist/lib/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.d.ts +4 -15
  626. package/dist/lib/models/dataprotection/v4/content/VolumeGroupRecoveryPointChangedRegionsComputeSpec.js +190 -231
  627. package/dist/lib/models/dataprotection/v4/error/AppMessage.d.ts +2 -12
  628. package/dist/lib/models/dataprotection/v4/error/AppMessage.js +264 -313
  629. package/dist/lib/models/dataprotection/v4/error/ErrorResponse.d.ts +2 -7
  630. package/dist/lib/models/dataprotection/v4/error/ErrorResponse.js +195 -222
  631. package/dist/lib/models/dataprotection/v4/error/SchemaValidationError.d.ts +2 -18
  632. package/dist/lib/models/dataprotection/v4/error/SchemaValidationError.js +249 -300
  633. package/dist/lib/models/dataprotection/v4/error/SchemaValidationErrorMessage.d.ts +2 -9
  634. package/dist/lib/models/dataprotection/v4/error/SchemaValidationErrorMessage.js +191 -234
  635. package/dist/lib/models/dataprotection/v4/operations/BaseRecoveryPlanActionSpec.d.ts +73 -0
  636. package/dist/lib/models/dataprotection/v4/operations/BaseRecoveryPlanActionSpec.js +297 -0
  637. package/dist/lib/models/dataprotection/v4/operations/CleanupRecoveryPlanResourcesApiResponse.d.ts +58 -0
  638. package/dist/lib/models/dataprotection/v4/operations/CleanupRecoveryPlanResourcesApiResponse.js +288 -0
  639. package/dist/lib/models/dataprotection/v4/operations/PlannedFailoverRecoveryPlanApiResponse.d.ts +58 -0
  640. package/dist/lib/models/dataprotection/v4/operations/PlannedFailoverRecoveryPlanApiResponse.js +288 -0
  641. package/dist/lib/models/dataprotection/v4/operations/PlannedFailoverSpec.d.ts +37 -0
  642. package/dist/lib/models/dataprotection/v4/operations/PlannedFailoverSpec.js +274 -0
  643. package/dist/lib/models/dataprotection/v4/operations/TestFailoverRecoveryPlanApiResponse.d.ts +58 -0
  644. package/dist/lib/models/dataprotection/v4/operations/TestFailoverRecoveryPlanApiResponse.js +288 -0
  645. package/dist/lib/models/dataprotection/v4/operations/TestFailoverSpec.d.ts +26 -0
  646. package/dist/lib/models/dataprotection/v4/operations/TestFailoverSpec.js +237 -0
  647. package/dist/lib/models/dataprotection/v4/operations/UnplannedFailoverRecoveryPlanApiResponse.d.ts +58 -0
  648. package/dist/lib/models/dataprotection/v4/operations/UnplannedFailoverRecoveryPlanApiResponse.js +288 -0
  649. package/dist/lib/models/dataprotection/v4/operations/UnplannedFailoverSpec.d.ts +37 -0
  650. package/dist/lib/models/dataprotection/v4/operations/UnplannedFailoverSpec.js +274 -0
  651. package/dist/lib/models/dataprotection/v4/operations/ValidateRecoveryPlanApiResponse.d.ts +58 -0
  652. package/dist/lib/models/dataprotection/v4/operations/ValidateRecoveryPlanApiResponse.js +288 -0
  653. package/dist/lib/models/dataprotection/v4/operations/ValidateSpec.d.ts +24 -0
  654. package/dist/lib/models/dataprotection/v4/operations/ValidateSpec.js +129 -0
  655. package/dist/lib/models/prism/v4/config/TaskReference.d.ts +2 -7
  656. package/dist/lib/models/prism/v4/config/TaskReference.js +150 -183
  657. package/dist/lib/models/validation/ValidationError.js +26 -42
  658. package/dist/lib/models/validation/ValidationScopes.js +3 -3
  659. package/dist/lib/models/vmm/v4/ahv/config/CategoryReference.d.ts +2 -7
  660. package/dist/lib/models/vmm/v4/ahv/config/CategoryReference.js +142 -181
  661. package/dist/lib/models/vmm/v4/ahv/config/GuestStaticIpSpec.d.ts +57 -0
  662. package/dist/lib/models/vmm/v4/ahv/config/GuestStaticIpSpec.js +277 -0
  663. package/dist/lib/models/vmm/v4/ahv/config/OwnerReference.d.ts +2 -7
  664. package/dist/lib/models/vmm/v4/ahv/config/OwnerReference.js +142 -181
  665. package/dist/lib/models/vmm/v4/ahv/config/OwnershipInfo.d.ts +2 -12
  666. package/dist/lib/models/vmm/v4/ahv/config/OwnershipInfo.js +138 -177
  667. package/dist/lib/models/vmm/v4/ahv/config/SubnetReference.d.ts +2 -7
  668. package/dist/lib/models/vmm/v4/ahv/config/SubnetReference.js +142 -181
  669. package/dist/lib/models/vmm/v4/ahv/config/VmConfigOverrideSpecification.d.ts +12 -39
  670. package/dist/lib/models/vmm/v4/ahv/config/VmConfigOverrideSpecification.js +283 -300
  671. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreGuestNicInfoOverrideSpec.d.ts +48 -0
  672. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreGuestNicInfoOverrideSpec.js +245 -0
  673. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreGuestToolsSpecification.d.ts +47 -0
  674. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreGuestToolsSpecification.js +236 -0
  675. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreIpv4ConfigOverrideSpec.d.ts +2 -20
  676. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreIpv4ConfigOverrideSpec.js +173 -218
  677. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreNicConfigOverrideParams.d.ts +12 -9
  678. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreNicConfigOverrideParams.js +252 -269
  679. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreNicConfigSpecification.d.ts +2 -15
  680. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreNicConfigSpecification.js +183 -228
  681. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec.d.ts +2 -31
  682. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec.js +162 -203
  683. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicOverrideSpec.d.ts +2 -7
  684. package/dist/lib/models/vmm/v4/ahv/config/VmRestoreVirtualEthernetNicOverrideSpec.js +142 -181
  685. package/dist/lib/utils/ValidationUtils.js +39 -69
  686. package/package.json +1 -1
@@ -9,28 +9,13 @@ var _Paginable = _interopRequireDefault(require("./Paginable"));
9
9
  var _uuid = require("uuid");
10
10
  var _superagentRetryDelay = _interopRequireDefault(require("superagent-retry-delay"));
11
11
  var _https = _interopRequireDefault(require("https"));
12
- var _fs2 = _interopRequireDefault(require("fs"));
12
+ var _fs = _interopRequireDefault(require("fs"));
13
13
  var _path = _interopRequireDefault(require("path"));
14
14
  var _buffer = require("buffer");
15
15
  var _ApiResponseMetadata = _interopRequireDefault(require("./models/common/v1/response/ApiResponseMetadata"));
16
16
  var _Flag = _interopRequireDefault(require("./models/common/v1/config/Flag"));
17
17
  var _ApiClient;
18
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
- function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function (e, r, t) { if ("" === t) return e; var p = o[r]; return Array.isArray(p) ? "$" + p.join("$") : "number" == typeof p ? "$" + p : ""; })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
20
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
21
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
22
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
25
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
26
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
27
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
28
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
29
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
30
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
31
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
32
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
33
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
34
19
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
35
20
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
36
21
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
@@ -39,22 +24,22 @@ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a),
39
24
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } /*
40
25
  * Nutanix Data Protection APIs
41
26
  *
42
- * OpenAPI spec version: 4.1.1
27
+ * OpenAPI spec version: 4.2.1
43
28
  *
44
29
  * NOTE: This class is auto generated by the Open API Dev Platform.
45
30
  *
46
- * Open API Dev Platform Codegen version: 17.4.0.8851-RELEASE
31
+ * Open API Dev Platform Codegen version: 17.5.0.10128-RELEASE
47
32
  *
48
33
  * Do not edit the class manually.
49
34
  *
50
35
  */
51
- (0, _superagentRetryDelay["default"])(_superagent["default"]);
36
+ (0, _superagentRetryDelay.default)(_superagent.default);
52
37
  /**
53
38
  * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
54
39
  * application to use this class directly - the *Api and model classes provide the public API for the service. The
55
40
  * contents of this file should be regarded as internal but are documented for completeness.
56
41
  * @module ApiClient
57
- * @version 4.1.1
42
+ * @version 4.2.1
58
43
  */
59
44
  var _protocol = /*#__PURE__*/new WeakMap();
60
45
  var _cookie = /*#__PURE__*/new WeakMap();
@@ -63,15 +48,17 @@ var _verifySslFlag = /*#__PURE__*/new WeakMap();
63
48
  var _defaultConnectTimeout = /*#__PURE__*/new WeakMap();
64
49
  var _defaultReadTimeout = /*#__PURE__*/new WeakMap();
65
50
  var _defaultMaxTimeout = /*#__PURE__*/new WeakMap();
51
+ var _host = /*#__PURE__*/new WeakMap();
52
+ var _negotiationCompleted = /*#__PURE__*/new WeakMap();
53
+ var _negotiatedVersion = /*#__PURE__*/new WeakMap();
66
54
  var _LOG_LEVEL = /*#__PURE__*/new WeakMap();
67
55
  var _ApiClient_brand = /*#__PURE__*/new WeakSet();
68
- var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
56
+ class ApiClient {
69
57
  /**
70
58
  * @alias module:ApiClient
71
59
  * @class
72
60
  */
73
- function ApiClient() {
74
- _classCallCheck(this, ApiClient);
61
+ constructor() {
75
62
  /*
76
63
  * Checks whether the given content type represents JSON.<br>
77
64
  * JSON content type examples:<br>
@@ -92,6 +79,9 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
92
79
  _classPrivateFieldInitSpec(this, _defaultConnectTimeout, void 0);
93
80
  _classPrivateFieldInitSpec(this, _defaultReadTimeout, void 0);
94
81
  _classPrivateFieldInitSpec(this, _defaultMaxTimeout, void 0);
82
+ _classPrivateFieldInitSpec(this, _host, void 0);
83
+ _classPrivateFieldInitSpec(this, _negotiationCompleted, void 0);
84
+ _classPrivateFieldInitSpec(this, _negotiatedVersion, void 0);
95
85
  _classPrivateFieldInitSpec(this, _LOG_LEVEL, void 0);
96
86
  _classPrivateFieldSet(_LOG_LEVEL, this, Object.freeze({
97
87
  DEBUG: {
@@ -124,7 +114,7 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
124
114
  * @type {String}
125
115
  * @default localhost
126
116
  */
127
- this.host = typeof self === 'undefined' ? 'localhost' : self.location.hostname;
117
+ _classPrivateFieldSet(_host, this, typeof self === 'undefined' ? 'localhost' : self.location.hostname);
128
118
 
129
119
  /**
130
120
  * The port of the base URL.
@@ -215,13 +205,20 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
215
205
  */
216
206
  this.withCredentials = false;
217
207
  if (typeof self === 'undefined') {
218
- this.agent = new _superagent["default"].agent();
208
+ this.agent = new _superagent.default.agent();
219
209
  }
220
210
 
221
211
  /**
222
212
  * Allow user to override superagent agent
223
213
  */
224
214
  this.requestAgent = null;
215
+ _classPrivateFieldSet(_negotiatedVersion, this, null);
216
+
217
+ /**
218
+ * Allow SDK to fetch version info and negotiate version
219
+ */
220
+ this.allowVersionNegotiation = true;
221
+ _classPrivateFieldSet(_negotiationCompleted, this, false);
225
222
 
226
223
  /**
227
224
  * Allow SDK to print debug logs
@@ -256,642 +253,683 @@ var ApiClient = exports.ApiClient = /*#__PURE__*/function () {
256
253
  * Enable/Disable SSL Verification
257
254
  * @param verifySsl (boolean)
258
255
  */
259
- return _createClass(ApiClient, [{
260
- key: "verifySsl",
261
- get: function get() {
262
- return _classPrivateFieldGet(_verifySslFlag, this);
263
- }
256
+ set verifySsl(verifySsl) {
257
+ this.requestAgent = verifySsl ? null : new _https.default.Agent({
258
+ rejectUnauthorized: verifySsl
259
+ });
260
+ _classPrivateFieldSet(_verifySslFlag, this, verifySsl);
261
+ }
262
+ get verifySsl() {
263
+ return _classPrivateFieldGet(_verifySslFlag, this);
264
+ }
264
265
 
265
- /**
266
- * Configure log file to write activity logs
267
- * @param logfile The destination file (write stream / string)
268
- */,
269
- set: function set(verifySsl) {
270
- if (verifySsl) {
271
- this.requestAgent = null;
272
- } else {
273
- this.requestAgent = new _https["default"].Agent({
274
- rejectUnauthorized: false
266
+ /**
267
+ * Set the hostname for base URL
268
+ * @param {String} hostname the hostname
269
+ */
270
+ set host(hostname) {
271
+ _classPrivateFieldSet(_host, this, hostname);
272
+ // Reset negotiation flags when host changes
273
+ _classPrivateFieldSet(_negotiationCompleted, this, false);
274
+ _classPrivateFieldSet(_negotiatedVersion, this, null);
275
+ }
276
+
277
+ /**
278
+ * Get the hostname for base URL
279
+ * @returns {String} the hostname
280
+ */
281
+ get host() {
282
+ return _classPrivateFieldGet(_host, this);
283
+ }
284
+
285
+ /**
286
+ * Configure log file to write activity logs
287
+ * @param logfile The destination file (write stream / string)
288
+ */
289
+ set loggerFile(logfile) {
290
+ if (logfile !== null && typeof logfile !== 'undefined') {
291
+ if (typeof logfile === 'string' || logfile instanceof String) {
292
+ logfile = _fs.default.createWriteStream(logfile, {
293
+ flags: 'a'
275
294
  });
276
295
  }
277
- _classPrivateFieldSet(_verifySslFlag, this, verifySsl);
296
+ _classPrivateFieldSet(_logger, this, new console.Console({
297
+ stdout: logfile,
298
+ stderr: logfile
299
+ }));
278
300
  }
279
- }, {
280
- key: "loggerFile",
281
- set: function set(logfile) {
282
- if (logfile !== null && typeof logfile !== 'undefined') {
283
- if (typeof logfile === 'string' || logfile instanceof String) {
284
- logfile = _fs2["default"].createWriteStream(logfile, {
285
- flags: 'a'
286
- });
287
- }
288
- _classPrivateFieldSet(_logger, this, new console.Console({
289
- stdout: logfile,
290
- stderr: logfile
291
- }));
292
- }
301
+ }
302
+
303
+ /**
304
+ * Adds key value pair to default headers map, (to be added to every API call request)
305
+ * @param {String} key The key
306
+ * @param {String} value The corresponding value
307
+ */
308
+ addDefaultHeader(key, value) {
309
+ if (key === "Authorization") {
310
+ _classPrivateFieldSet(_cookie, this, null);
293
311
  }
312
+ this.defaultHeaders[key] = value;
313
+ }
294
314
 
295
- /**
296
- * Adds key value pair to default headers map, (to be added to every API call request)
297
- * @param {String} key The key
298
- * @param {String} value The corresponding value
299
- */
300
- }, {
301
- key: "addDefaultHeader",
302
- value: function addDefaultHeader(key, value) {
303
- if (key === "Authorization") {
304
- _classPrivateFieldSet(_cookie, this, null);
305
- }
306
- this.defaultHeaders[key] = value;
315
+ /*
316
+ * Returns a string representation for an actual parameter.
317
+ * @param param The actual parameter.
318
+ * @returns {String} The string representation of <code>param</code>.
319
+ */
320
+ paramToString(param) {
321
+ if (param == undefined || param == null) {
322
+ return '';
323
+ }
324
+ if (param instanceof Date) {
325
+ return param.toJSON();
326
+ }
327
+ return param.toString();
328
+ }
329
+ buildUrl(path, pathParams) {
330
+ if (!path.match(/^\//)) {
331
+ path = '/' + path;
332
+ }
333
+ if (typeof _classPrivateFieldGet(_negotiatedVersion, this) !== 'undefined' && _classPrivateFieldGet(_negotiatedVersion, this) !== null && _classPrivateFieldGet(_negotiatedVersion, this).match(/v\d+\.\d+(\.[a|b]\d+)?/) !== null && _classPrivateFieldGet(_negotiatedVersion, this) !== "v4.2") {
334
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Changing uri", path, "to negotiated version", _classPrivateFieldGet(_negotiatedVersion, this));
335
+ var uriRegExp = new RegExp("(?<=/[-\\w]+/)v\\d+\\.\\d+(\\.[a|b]\\d+)?(?=/.*)", "i");
336
+ path = path.replace(uriRegExp, _classPrivateFieldGet(_negotiatedVersion, this));
307
337
  }
308
338
 
309
- /*
310
- * Returns a string representation for an actual parameter.
311
- * @param param The actual parameter.
312
- * @returns {String} The string representation of <code>param</code>.
313
- */
314
- }, {
315
- key: "paramToString",
316
- value: function paramToString(param) {
317
- if (param == undefined || param == null) {
318
- return '';
319
- }
320
- if (param instanceof Date) {
321
- return param.toJSON();
322
- }
323
- return param.toString();
339
+ // The protocol of the base URL, including the colon (:).
340
+ _classPrivateFieldSet(_protocol, this, typeof self === 'undefined' ? this.scheme + ':' : self.location.protocol);
341
+ let basePath = ''; //default
342
+ if (_classPrivateFieldGet(_protocol, this) !== '' && this.host !== '' && this.port !== '') {
343
+ basePath = _classPrivateFieldGet(_protocol, this) + '\/\/' + this.host + ':' + this.port;
344
+ } else if (typeof self !== "undefined") {
345
+ basePath = self.origin;
324
346
  }
325
- }, {
326
- key: "buildUrl",
327
- value: function buildUrl(path, pathParams) {
328
- var _this = this;
329
- if (!path.match(/^\//)) {
330
- path = '/' + path;
347
+ var url = basePath + path;
348
+ url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
349
+ var value;
350
+ if (pathParams.hasOwnProperty(key)) {
351
+ value = this.paramToString(pathParams[key]);
352
+ } else {
353
+ value = fullMatch;
331
354
  }
355
+ return encodeURIComponent(value);
356
+ });
357
+ return url;
358
+ }
359
+ /*
360
+ * Builds a string representation of an array-type actual parameter, according to the given collection format.
361
+ * @param {Array} param An array parameter.
362
+ * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
363
+ * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
364
+ * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
365
+ */
366
+ buildCollectionParam(param, collectionFormat) {
367
+ if (param == null) {
368
+ return null;
369
+ }
370
+ switch (collectionFormat) {
371
+ case 'csv':
372
+ return param.map(this.paramToString).join(',');
373
+ case 'ssv':
374
+ return param.map(this.paramToString).join(' ');
375
+ case 'tsv':
376
+ return param.map(this.paramToString).join('\t');
377
+ case 'pipes':
378
+ return param.map(this.paramToString).join('|');
379
+ case 'multi':
380
+ //return the array directly as SuperAgent will handle it as expected
381
+ return param.map(this.paramToString);
382
+ default:
383
+ throw new Error('Unknown collection format: ' + collectionFormat);
384
+ }
385
+ }
332
386
 
333
- // The protocol of the base URL, including the colon (:).
334
- _classPrivateFieldSet(_protocol, this, typeof self === 'undefined' ? this.scheme + ':' : self.location.protocol);
335
- var basePath = ''; //default
336
- if (_classPrivateFieldGet(_protocol, this) !== '' && this.host !== '' && this.port !== '') {
337
- basePath = _classPrivateFieldGet(_protocol, this) + '\/\/' + this.host + ':' + this.port;
338
- } else if (typeof self !== "undefined") {
339
- basePath = self.origin;
340
- }
341
- var url = basePath + path;
342
- url = url.replace(/\{([\w-]+)\}/g, function (fullMatch, key) {
343
- var value;
344
- if (pathParams.hasOwnProperty(key)) {
345
- value = _this.paramToString(pathParams[key]);
346
- } else {
347
- value = fullMatch;
348
- }
349
- return encodeURIComponent(value);
350
- });
351
- return url;
387
+ /*
388
+ * Sets API key for authentication
389
+ *
390
+ * @param {String} key The API key for authentication
391
+ */
392
+ setApiKey(key) {
393
+ if (key == undefined || typeof key === 'string' || key instanceof String) {
394
+ this.authentications['apiKeyAuthScheme']['apiKey'] = key;
395
+ } else {
396
+ this.authentications['apiKeyAuthScheme']['apiKey'] = undefined;
352
397
  }
353
- }, {
354
- key: "buildCollectionParam",
355
- value:
356
- /*
357
- * Builds a string representation of an array-type actual parameter, according to the given collection format.
358
- * @param {Array} param An array parameter.
359
- * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
360
- * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
361
- * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
362
- */
363
- function buildCollectionParam(param, collectionFormat) {
364
- if (param == null) {
365
- return null;
366
- }
367
- switch (collectionFormat) {
368
- case 'csv':
369
- return param.map(this.paramToString).join(',');
370
- case 'ssv':
371
- return param.map(this.paramToString).join(' ');
372
- case 'tsv':
373
- return param.map(this.paramToString).join('\t');
374
- case 'pipes':
375
- return param.map(this.paramToString).join('|');
376
- case 'multi':
377
- //return the array directly as SuperAgent will handle it as expected
378
- return param.map(this.paramToString);
379
- default:
380
- throw new Error('Unknown collection format: ' + collectionFormat);
398
+ }
399
+
400
+ /*
401
+ * Applies authentication headers to the request.
402
+ * @param {Object} request The request object created by a <code>superagent()</code> call.
403
+ * @param {Array.<String>} authNames An array of authentication method names.
404
+ */
405
+
406
+ addEtagToReservedMap(response, data) {
407
+ if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("etag")) {
408
+ let etagRef = response.headers.etag;
409
+ if (data.getData() !== undefined) {
410
+ if (Array.isArray(data.getData()) && data.getData().length > 0) {
411
+ for (var item of data.getData()) {
412
+ if (item.hasOwnProperty("$reserved") && item.get$Reserved() !== undefined) {
413
+ item.get$Reserved()["ETag"] = etagRef;
414
+ }
415
+ }
416
+ } else if (data.getData().hasOwnProperty("$reserved") && data.getData().get$Reserved() !== undefined) {
417
+ data.getData().get$Reserved()["ETag"] = etagRef;
418
+ }
381
419
  }
382
420
  }
421
+ return data;
422
+ }
383
423
 
384
- /*
385
- * Sets API key for authentication
386
- *
387
- * @param {String} key The API key for authentication
388
- */
389
- }, {
390
- key: "setApiKey",
391
- value: function setApiKey(key) {
392
- if (key == undefined || typeof key === 'string' || key instanceof String) {
393
- this.authentications['apiKeyAuthScheme']['apiKey'] = key;
394
- } else {
395
- this.authentications['apiKeyAuthScheme']['apiKey'] = undefined;
424
+ /**
425
+ * Get ETag from an object if exists.
426
+ * The ETag is usually provided in the response of the GET API calls,
427
+ * which can further be used in other HTTP operations.
428
+ *
429
+ * @param object Object from which ETag needs to be retrieved
430
+ * @returns {(String|null)} returns ETag header in the object if it's an API response object, otherwise null
431
+ */
432
+ static getEtag(object) {
433
+ let etag = null;
434
+ if (object !== undefined) {
435
+ if (object.hasOwnProperty('$reserved') && object.get$Reserved() !== undefined) {
436
+ etag = this.getValueForCaseInsensitiveKeyMatch(object.get$Reserved(), 'ETag');
437
+ }
438
+ if (etag == null && object.hasOwnProperty("data") && object.getData().hasOwnProperty('$reserved') && object.getData().get$Reserved() !== undefined) {
439
+ etag = this.getValueForCaseInsensitiveKeyMatch(object.getData().get$Reserved(), 'ETag');
396
440
  }
397
441
  }
442
+ return etag;
443
+ }
444
+ static getValueForCaseInsensitiveKeyMatch(object, key) {
445
+ if (object && key) {
446
+ const searchKey = key.toLowerCase();
447
+ const matchedKey = Object.keys(object).find(key => key.toLowerCase() === searchKey);
448
+ return matchedKey ? object[matchedKey] : null;
449
+ }
450
+ return null;
451
+ }
398
452
 
399
- /*
400
- * Applies authentication headers to the request.
401
- * @param {Object} request The request object created by a <code>superagent()</code> call.
402
- * @param {Array.<String>} authNames An array of authentication method names.
403
- */
404
- }, {
405
- key: "addEtagToReservedMap",
406
- value: function addEtagToReservedMap(response, data) {
407
- if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("etag")) {
408
- var etagRef = response.headers.etag;
409
- if (data.getData() !== undefined) {
410
- if (Array.isArray(data.getData()) && data.getData().length > 0) {
411
- var _iterator = _createForOfIteratorHelper(data.getData()),
412
- _step;
413
- try {
414
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
415
- var item = _step.value;
416
- if (item.hasOwnProperty("$reserved") && item.get$Reserved() !== undefined) {
417
- item.get$Reserved()["ETag"] = etagRef;
418
- }
419
- }
420
- } catch (err) {
421
- _iterator.e(err);
422
- } finally {
423
- _iterator.f();
453
+ /**
454
+ * Get SDK's negotiated version.
455
+ * @returns {String} negotiated version.
456
+ */
457
+ getNegotiatedVersion() {
458
+ return _classPrivateFieldGet(_negotiatedVersion, this);
459
+ }
460
+ /**
461
+ * Call relevant options api and negotiate version
462
+ * Negotiated version available via getNegotiatedVersion()
463
+ * @param {ApiClient} selfInstance
464
+ * @param {Array.<String>} authNames An array of allowed authentication type names i.e. basicAuthScheme
465
+ * @returns {Promise<ApiClient>} a {@link https://www.promisejs.org/|Promise}
466
+ */
467
+ negotiateVersion(selfInstance, authNames) {
468
+ return new Promise(resolve => {
469
+ if (this.allowVersionNegotiation === true && _classPrivateFieldGet(_negotiationCompleted, this) === false) {
470
+ this.callApiInternal('/api/dataprotection/unversioned/info', 'OPTIONS', {}, {}, {}, {}, null, authNames, [], ['application/json'], Object).then(({
471
+ data,
472
+ response
473
+ }) => {
474
+ if (response.status === 200 && data.hasOwnProperty("data") && data.data !== null) {
475
+ const serverVersion = data.data;
476
+ const minimumSupportedVersion = "v4.2";
477
+
478
+ // Check if server version is below minimum supported version
479
+ if (_assertClassBrand(_ApiClient_brand, this, _isSmallerMinorVersion).call(this, _assertClassBrand(_ApiClient_brand, this, _getVersionDetails).call(this, serverVersion), _assertClassBrand(_ApiClient_brand, this, _getVersionDetails).call(this, minimumSupportedVersion))) {
480
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).WARN, null, "Server version", serverVersion, "is below minimum supported version", minimumSupportedVersion, ". Version negotiation will not be performed.");
481
+ _classPrivateFieldSet(_negotiatedVersion, this, null);
482
+ _classPrivateFieldSet(_negotiationCompleted, this, false);
483
+ resolve(selfInstance);
484
+ return;
424
485
  }
425
- } else if (data.getData().hasOwnProperty("$reserved") && data.getData().get$Reserved() !== undefined) {
426
- data.getData().get$Reserved()["ETag"] = etagRef;
486
+ _classPrivateFieldSet(_negotiatedVersion, this, _assertClassBrand(_ApiClient_brand, this, _performNegotiationBetweenVersions).call(this, "v4.2", serverVersion));
487
+ _classPrivateFieldSet(_negotiationCompleted, this, true);
488
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Negotiated Version with server :", _classPrivateFieldGet(_negotiatedVersion, this));
489
+ resolve(selfInstance);
490
+ } else {
491
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Could not fetch supported versions from server");
492
+ _classPrivateFieldSet(_negotiatedVersion, this, null);
493
+ _classPrivateFieldSet(_negotiationCompleted, this, false);
494
+ resolve(selfInstance);
427
495
  }
428
- }
496
+ }).catch(error => {
497
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Could not fetch supported versions from server");
498
+ _classPrivateFieldSet(_negotiatedVersion, this, null);
499
+ _classPrivateFieldSet(_negotiationCompleted, this, false);
500
+ resolve(selfInstance);
501
+ });
502
+ } else {
503
+ resolve(selfInstance);
429
504
  }
430
- return data;
431
- }
505
+ });
506
+ }
432
507
 
433
- /**
434
- * Get ETag from an object if exists.
435
- * The ETag is usually provided in the response of the GET API calls,
436
- * which can further be used in other HTTP operations.
437
- *
438
- * @param object Object from which ETag needs to be retrieved
439
- * @returns {(String|null)} returns ETag header in the object if it's an API response object, otherwise null
440
- */
441
- }, {
442
- key: "callApi",
443
- value:
444
- /**
445
- * Invokes the REST service using the supplied settings and parameters.
446
- * @param {String} path The base URL to invoke.
447
- * @param {String} httpMethod The HTTP method to use.
448
- * @param {Object.<String, String>} pathParams A map of path parameters and their values.
449
- * @param {Object.<String, Object>} queryParams A map of query parameters and their values.
450
- * @param {Object.<String, Object>} headerParams A map of header parameters and their values.
451
- * @param {Object.<String, Object>} formParams A map of form parameters and their values.
452
- * @param {Object} bodyParam The value to pass as the request body.
453
- * @param {Array.<String>} authNames An array of authentication type names.
454
- * @param {Array.<String>} contentTypes An array of request MIME types.
455
- * @param {Array.<String>} accepts An array of acceptable response MIME types.
456
- * @param {(String|Array|Object|Function)} returnType The required type to return; can be a string for simple types or the
457
- * constructor for a complex type.
458
- * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object.
459
- */
460
- function callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType) {
461
- var _this2 = this;
462
- var url = this.buildUrl(path, pathParams);
463
- var request = (0, _superagent["default"])(httpMethod, url);
508
+ // Gets a valid timeout
509
+ // 1. Sets to provided default timeout in case invalid value is passed
510
+ // 2. Sets to default max value of 30 minutes in case a value of more than 30 minutes is passed
464
511
 
465
- // override request callback to retry only required status codes
466
- request.oldCallback = request.callback;
467
- request.callback = function (err, res) {
468
- if (res && res.status) {
469
- var status = res.status;
470
- if (status >= 400 && !(status === 401 || status === 408 || status === 429 || status === 503 || status === 504)) {
471
- this._maxRetries = 0;
512
+ /**
513
+ * Invokes the REST service using the supplied settings and parameters.
514
+ * @param {String} path The base URL to invoke.
515
+ * @param {String} httpMethod The HTTP method to use.
516
+ * @param {Object.<String, String>} pathParams A map of path parameters and their values.
517
+ * @param {Object.<String, Object>} queryParams A map of query parameters and their values.
518
+ * @param {Object.<String, Object>} headerParams A map of header parameters and their values.
519
+ * @param {Object.<String, Object>} formParams A map of form parameters and their values.
520
+ * @param {Object} bodyParam The value to pass as the request body.
521
+ * @param {Array.<String>} authNames An array of authentication type names.
522
+ * @param {Array.<String>} contentTypes An array of request MIME types.
523
+ * @param {Array.<String>} accepts An array of acceptable response MIME types.
524
+ * @param {(String|Array|Object|Function)} returnType The required type to return; can be a string for simple types or the
525
+ * constructor for a complex type.
526
+ * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object.
527
+ */
528
+ callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType) {
529
+ return this.negotiateVersion(this, authNames).then(function (selfInstance) {
530
+ return selfInstance.callApiInternal(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType);
531
+ });
532
+ }
533
+ callApiInternal(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType) {
534
+ var url = this.buildUrl(path, pathParams);
535
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
536
+ let binaryMediaTypes = ['application/octet-stream', 'application/pdf', 'application/zip'];
537
+ if (accepts && accepts.length > 0 && accepts.some(accept => binaryMediaTypes.includes(accept)) && isBrowser && this.downloadDestination) {
538
+ return new Promise((resolve, reject) => {
539
+ // Prepare request for browser download
540
+ const fetchParams = _assertClassBrand(_ApiClient_brand, this, _prepareDownloadBrowserParams).call(this, url, httpMethod, queryParams, headerParams, bodyParam, authNames, contentTypes, accepts);
541
+ fetch(fetchParams.url, fetchParams.options).then(response => {
542
+ if (!response.ok) {
543
+ const err = new Error(`HTTP error ${response.status}`);
544
+ err.status = response.status;
545
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Error downloading file:", err);
546
+ reject(err);
472
547
  }
473
- if (res.status === 401) {
474
- this.unset("Cookie");
475
- this._maxRetries = 1;
548
+ if (!(this.downloadDestination instanceof WritableStream)) {
549
+ let errMsg = "Incompatible downloadDestination for Browser Environment, must be WritableStream";
550
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, errMsg);
551
+ reject(errMsg);
476
552
  }
477
- if (status === 429) {
478
- var retryAfter = res.headers['retry-after'];
479
- if (retryAfter) {
480
- var delay = parseInt(retryAfter, 10) * 1000;
481
- this._retryDelays[this._retries] = delay;
482
- }
553
+ const reader = response.body.getReader();
554
+ const writer = this.downloadDestination.getWriter();
555
+ const pump = () => {
556
+ return reader.read().then(({
557
+ done,
558
+ value
559
+ }) => {
560
+ if (done) {
561
+ writer.close();
562
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Finished streaming response");
563
+ resolve({
564
+ data: {},
565
+ response
566
+ });
567
+ }
568
+ return writer.write(value).then(pump);
569
+ });
570
+ };
571
+ return pump();
572
+ }).catch(error => {
573
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Caught the following error :", error);
574
+ reject(error);
575
+ });
576
+ });
577
+ }
578
+ var request = (0, _superagent.default)(httpMethod, url);
579
+
580
+ // override request callback to retry only required status codes
581
+ request.oldCallback = request.callback;
582
+ request.callback = function (err, res) {
583
+ if (res && res.status) {
584
+ const status = res.status;
585
+ if (status >= 400 && !(status === 408 || status === 429 || status === 503 || status === 504)) {
586
+ this._maxRetries = 0;
587
+ }
588
+ if (res.status === 401 && this.header["Cookie"]) {
589
+ this.unset("Cookie");
590
+ this._maxRetries = 1;
591
+ }
592
+ if (status === 429) {
593
+ let retryAfter = res.headers['retry-after'];
594
+ if (retryAfter) {
595
+ let delay = parseInt(retryAfter, 10) * 1000;
596
+ this._retryDelays[this._retries] = delay;
483
597
  }
484
598
  }
485
- this.oldCallback(err, res);
486
- };
599
+ }
600
+ this.oldCallback(err, res);
601
+ };
487
602
 
488
- // apply authentications
489
- _assertClassBrand(_ApiClient_brand, this, _applyAuthToRequest).call(this, request, authNames);
603
+ // apply authentications
604
+ _assertClassBrand(_ApiClient_brand, this, _applyAuthToRequest).call(this, request, authNames);
490
605
 
491
- // set query parameters
492
- if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
493
- queryParams['_'] = new Date().getTime();
494
- }
495
- request.query(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, queryParams));
606
+ // set query parameters
607
+ if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
608
+ queryParams['_'] = new Date().getTime();
609
+ }
610
+ request.query(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, queryParams));
496
611
 
497
- // set header parameters
498
- request.set(this.defaultHeaders).set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, headerParams));
499
- if ((this.defaultHeaders['NTNX-Request-Id'] === null || this.defaultHeaders['NTNX-Request-Id'] === undefined) && (headerParams['NTNX-Request-Id'] === null || headerParams['NTNX-Request-Id'] === undefined)) {
500
- var requestId = (0, _uuid.v4)();
501
- request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
502
- 'NTNX-Request-Id': requestId
503
- }));
504
- }
612
+ // set header parameters
613
+ request.set(this.defaultHeaders).set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, headerParams));
614
+ if ((this.defaultHeaders['NTNX-Request-Id'] === null || this.defaultHeaders['NTNX-Request-Id'] === undefined) && (headerParams['NTNX-Request-Id'] === null || headerParams['NTNX-Request-Id'] === undefined)) {
615
+ let requestId = (0, _uuid.v4)();
616
+ request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
617
+ 'NTNX-Request-Id': requestId
618
+ }));
619
+ }
505
620
 
506
- // Set User-Agent header only if it is not a browser environment
507
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
508
- if (!isBrowser) {
509
- this.downloadDestination = '.';
510
- request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
511
- 'User-Agent': 'Nutanix-dataprotection-js-client/4.1.1'
512
- }));
513
- }
621
+ // Set User-Agent header only if it is not a browser environment
622
+ if (!isBrowser) {
623
+ this.downloadDestination = '.';
624
+ request.set(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
625
+ 'User-Agent': 'Nutanix-dataprotection-js-client/4.2.1'
626
+ }));
627
+ }
514
628
 
515
- // set requestAgent if it is set by user
516
- if (this.requestAgent) {
517
- request.agent(this.requestAgent);
518
- }
629
+ // set requestAgent if it is set by user
630
+ if (this.requestAgent) {
631
+ request.agent(this.requestAgent);
632
+ }
519
633
 
520
- // set request timeouts
521
- var timeoutOptions = {};
522
- timeoutOptions["response"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.connectTimeout, _classPrivateFieldGet(_defaultConnectTimeout, this));
523
- timeoutOptions["deadline"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.readTimeout, _classPrivateFieldGet(_defaultReadTimeout, this));
524
- request.timeout(timeoutOptions);
525
- var contentType = headerParams.hasOwnProperty("Content-Type") ? headerParams["Content-Type"] : _assertClassBrand(_ApiClient_brand, this, _jsonPreferredMime).call(this, contentTypes);
526
- if (contentType) {
527
- // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
528
- if (contentType != 'multipart/form-data') {
529
- request.type(contentType);
530
- }
531
- } else if (!request.header['Content-Type']) {
532
- request.type('application/json');
634
+ // set request timeouts
635
+ var timeoutOptions = {};
636
+ timeoutOptions["response"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.connectTimeout, _classPrivateFieldGet(_defaultConnectTimeout, this));
637
+ timeoutOptions["deadline"] = _assertClassBrand(_ApiClient_brand, this, _getValidTimeout).call(this, this.readTimeout, _classPrivateFieldGet(_defaultReadTimeout, this));
638
+ request.timeout(timeoutOptions);
639
+ var contentType = headerParams.hasOwnProperty("Content-Type") ? headerParams["Content-Type"] : _assertClassBrand(_ApiClient_brand, this, _jsonPreferredMime).call(this, contentTypes);
640
+ if (contentType) {
641
+ // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
642
+ if (contentType != 'multipart/form-data') {
643
+ request.type(contentType);
533
644
  }
534
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Request URL :", httpMethod, url);
535
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Request Headers :", typeof request.header === "undefined" ? "" : request.header);
536
- if (contentType === 'application/x-www-form-urlencoded') {
537
- request.send(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams));
538
- } else if (contentType == 'multipart/form-data') {
539
- var _formParams = _assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams);
540
- for (var key in _formParams) {
541
- if (_formParams.hasOwnProperty(key)) {
542
- if (_assertClassBrand(_ApiClient_brand, this, _isFileParam).call(this, _formParams[key])) {
543
- // file field
544
- request.attach(key, _formParams[key]);
545
- } else {
546
- request.field(key, _formParams[key]);
547
- }
645
+ } else if (!request.header['Content-Type']) {
646
+ request.type('application/json');
647
+ }
648
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Request URL :", httpMethod, url);
649
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Request Headers :", typeof request.header === "undefined" ? "" : request.header);
650
+ if (contentType === 'application/x-www-form-urlencoded') {
651
+ request.send(_assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams));
652
+ } else if (contentType == 'multipart/form-data') {
653
+ var _formParams = _assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, formParams);
654
+ for (var key in _formParams) {
655
+ if (_formParams.hasOwnProperty(key)) {
656
+ if (_assertClassBrand(_ApiClient_brand, this, _isFileParam).call(this, _formParams[key])) {
657
+ // file field
658
+ request.attach(key, _formParams[key]);
659
+ } else {
660
+ request.field(key, _formParams[key]);
548
661
  }
549
662
  }
550
- } else if (contentType === 'application/octet-stream' && bodyParam !== null && typeof bodyParam !== 'undefined' && typeof bodyParam.pipe === 'function') {
551
- // FILE UPLOAD SUPPORT
663
+ }
664
+ } else if (contentType === 'application/octet-stream' && bodyParam !== null && typeof bodyParam !== 'undefined' && typeof bodyParam.pipe === 'function') {
665
+ // FILE UPLOAD SUPPORT
552
666
 
553
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Piping octet-stream request");
554
- if (typeof bodyParam.pipe === 'function') {
555
- bodyParam.pipe(request);
556
- } else if (typeof require === 'function') {
557
- var webstream;
558
- try {
559
- webstream = require('stream/web');
560
- } catch (err) {
561
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Error fetching steam/web");
562
- }
563
- if (bodyParam instanceof webstream.ReadableStream) {
564
- bodyParam.pipeTo(new webstream.WritableStream({
565
- write: function write(chunk) {
566
- request.write(chunk);
567
- },
568
- close: function close() {
569
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "READABLE STREAM CLOSED");
570
- },
571
- abort: function abort(err) {
572
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "READABLE STREAM ABORTED");
573
- }
574
- }));
575
- } else {
576
- request.send(bodyParam);
577
- }
667
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Piping octet-stream request");
668
+ if (typeof bodyParam.pipe === 'function') {
669
+ bodyParam.pipe(request);
670
+ } else if (typeof require === 'function') {
671
+ let webstream;
672
+ try {
673
+ webstream = require('stream/web');
674
+ } catch (err) {
675
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Error fetching steam/web");
676
+ }
677
+ if (bodyParam instanceof webstream.ReadableStream) {
678
+ bodyParam.pipeTo(new webstream.WritableStream({
679
+ write(chunk) {
680
+ request.write(chunk);
681
+ },
682
+ close() {
683
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "READABLE STREAM CLOSED");
684
+ },
685
+ abort(err) {
686
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "READABLE STREAM ABORTED");
687
+ }
688
+ }));
578
689
  } else {
579
690
  request.send(bodyParam);
580
691
  }
581
- return new Promise(function (resolve, reject) {
582
- request.on('error', function (err) {
583
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught the following error :", err);
584
- reject(err);
585
- }).on('response', function (response) {
586
- _assertClassBrand(_ApiClient_brand, _this2, _handleApiResponseForPromise).call(_this2, response, path, queryParams, returnType, resolve, reject);
587
- });
588
- });
589
- } else if (bodyParam) {
692
+ } else {
590
693
  request.send(bodyParam);
591
694
  }
592
- if (typeof returnType === 'Blob') {
593
- request.responseType('blob');
594
- } else if (returnType === 'String') {
595
- request.responseType('string');
596
- }
597
- _assertClassBrand(_ApiClient_brand, this, _attachCookies).call(this, request);
598
- _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Request Body :", typeof request._data === "undefined" ? "" : request._data);
599
- var accept = headerParams.hasOwnProperty("Accept") && headerParams["Accept"] != undefined ? headerParams["Accept"] : accepts.join(', ');
600
- var binaryMediaTypes = ['application/octet-stream', 'application/pdf', 'application/zip'];
601
- if (accept) {
602
- request.accept(accept);
603
- }
604
- return new Promise(function (resolve, reject) {
605
- request.buffer(false).redirects(0).retry(_this2.maxRetryAttempts, _this2.retryInterval, []).withCredentials(_this2.withCredentials).on('error', function (err) {
606
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught the following error :", err);
607
- }).end(function (error, response) {
608
- if (error) {
609
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, null, "Caught error during the request!");
610
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, error);
611
- if (error.response !== null && typeof error.response !== 'undefined') {
612
- error.data = _assertClassBrand(_ApiClient_brand, _this2, _deserialize).call(_this2, error.response, returnType);
613
- } else {
614
- error.data = _assertClassBrand(_ApiClient_brand, _this2, _wrapErrorInResponse).call(_this2, error);
615
- }
616
- reject(error);
695
+ return new Promise((resolve, reject) => {
696
+ request.on('error', err => {
697
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Caught the following error :", err);
698
+ reject(err);
699
+ }).on('response', response => {
700
+ _assertClassBrand(_ApiClient_brand, this, _handleApiResponseForPromise).call(this, response, path, queryParams, returnType, resolve, reject);
701
+ });
702
+ });
703
+ } else if (['POST', 'PUT', 'PATCH'].includes(httpMethod.toUpperCase()) && bodyParam) {
704
+ request.send(bodyParam);
705
+ }
706
+ if (typeof returnType === 'Blob') {
707
+ request.responseType('blob');
708
+ } else if (returnType === 'String') {
709
+ request.responseType('string');
710
+ }
711
+ _assertClassBrand(_ApiClient_brand, this, _attachCookies).call(this, request);
712
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Request Body :", typeof request._data === "undefined" ? "" : request._data);
713
+ var accept = headerParams.hasOwnProperty("Accept") && headerParams["Accept"] != undefined ? headerParams["Accept"] : accepts.join(', ');
714
+ if (accept) {
715
+ request.accept(accept);
716
+ }
717
+ return new Promise((resolve, reject) => {
718
+ request.buffer(false).redirects(0).retry(this.maxRetryAttempts, this.retryInterval, []).withCredentials(this.withCredentials).on('error', err => {
719
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Caught the following error :", err);
720
+ }).end((error, response) => {
721
+ if (error) {
722
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Caught error during the request!");
723
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, error);
724
+ // Reset negotiation flags on 404 to allow future negotiation attempts
725
+ if (error.status === 404) {
726
+ _classPrivateFieldSet(_negotiationCompleted, this, false);
727
+ _classPrivateFieldSet(_negotiatedVersion, this, null);
728
+ }
729
+ if (error.response !== null && typeof error.response !== 'undefined') {
730
+ error.data = _assertClassBrand(_ApiClient_brand, this, _deserialize).call(this, error.response, returnType);
617
731
  } else {
618
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Response Status :", response.status);
619
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).DEBUG, _assertClassBrand(_ApiClient_brand, _this2, _flatten), "Response Headers :", response.headers);
620
- var _contentType = '';
621
- if (response.headers.hasOwnProperty('content-type')) {
622
- _contentType = response.headers["content-type"];
623
- }
624
- var fetchStream = binaryMediaTypes.includes(_contentType);
625
- if (fetchStream) {
732
+ error.data = _assertClassBrand(_ApiClient_brand, this, _wrapErrorInResponse).call(this, error);
733
+ }
734
+ reject(error);
735
+ } else {
736
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Response Status :", response.status);
737
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Response Headers :", response.headers);
738
+ let contentType = '';
739
+ if (response.headers.hasOwnProperty('content-type')) {
740
+ contentType = response.headers["content-type"];
741
+ }
742
+ let fetchStream = binaryMediaTypes.includes(contentType);
743
+ if (fetchStream) {
744
+ /*
745
+ * Browser environment :
746
+ * Already handled
747
+ * Node.js environment :
748
+ * uses File System, downloadDestination expected to be a directory path, file is downloaded to this directory
749
+ */
750
+ if (!isBrowser) {
626
751
  /*
627
- * Browser environment :
628
- * uses Web Streams, downloadDestination expected to be a WritableStream (i.e. sink for response to be streamed to)
629
- * Node.js environment :
630
- * uses File System, downloadDestination expected to be a directory path, file is downloaded to this directory
752
+ * Non Browser environment :
753
+ * - stream data to file
754
+ * - fetch response headers and body (if exists)
755
+ * - return in case of error or after stream finish
756
+ *
757
+ * NOTE :
758
+ * superagent does not provide access to headers before pipe, therefore response is piped to
759
+ * file with temporary name, which is renamed to proper filename after Content-Disposition header is available
631
760
  */
632
- if (isBrowser) {
633
- /*
634
- * Browser environment :
635
- * - fetch webstream module
636
- * - write file to WritableStream downloadDestination
637
- * - if webstream if not available or downloadDestination is not instance of WritableStream
638
- * code flow goes to main request.then execution
639
- */
640
- if (typeof require === 'function') {
641
- var _webstream;
642
- try {
643
- _webstream = require('stream/web');
644
- } catch (err) {
645
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Error fetching steam/web");
646
- }
647
- if (_this2.downloadDestination instanceof _webstream.WritableStream) {
648
- // Piping Data
649
- var writer = _this2.downloadDestination.getWriter();
650
- try {
651
- response.on('data', function (chunk) {
652
- writer.write(chunk);
653
- });
654
- } catch (err) {
655
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Issue while downloading file", err);
656
- }
657
- response.on('end', function () {
658
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Finished streaming response");
659
- writer.close();
660
- var data = _assertClassBrand(_ApiClient_brand, _this2, _deserialize).call(_this2, response, returnType);
661
- resolve({
662
- data: data,
663
- response: response
664
- });
665
- }).on('error', function (err) {
666
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, "Caught the following error :", err);
667
- err.data = _assertClassBrand(_ApiClient_brand, _this2, _wrapErrorInResponse).call(_this2, err);
668
- reject(err);
669
- });
670
- } else {
671
- var errMsg = "Incompatible downloadDestination for Browser Environment, must be WritableStream";
672
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).ERROR, null, errMsg);
673
- reject(errMsg);
674
- }
675
- }
676
- } else {
677
- /*
678
- * Non Browser environment :
679
- * - stream data to file
680
- * - fetch response headers and body (if exists)
681
- * - return in case of error or after stream finish
682
- *
683
- * NOTE :
684
- * superagent does not provide access to headers before pipe, therefore response is piped to
685
- * file with temporary name, which is renamed to proper filename after Content-Disposition header is available
686
- */
687
761
 
688
- var tempFilename = _this2.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
689
- var stream = _fs2["default"].createWriteStream(tempFilename);
690
- _assertClassBrand(_ApiClient_brand, _this2, _processDownloadedFile).call(_this2, response, stream, tempFilename, resolve, reject, returnType);
691
- }
692
- } else if (response.status == 302) {
693
- /*
694
- * Handling 302 Redirects
695
- * - Reads X-Redirect-Token header from response and writes into Cookie header for redirected request
696
- */
697
- var _tempFilename = _this2.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
698
- var context = _this2;
699
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Redirecting to :", response.headers.location);
700
- var redirectRequest = (0, _superagent["default"])(httpMethod, response.headers.location);
701
- redirectRequest.set(request.header);
702
- if (response.headers.hasOwnProperty("x-redirect-token")) {
703
- _assertClassBrand(_ApiClient_brand, _this2, _log).call(_this2, _classPrivateFieldGet(_LOG_LEVEL, _this2).INFO, null, "Writing X-Redirect-Token into Cookie");
704
- redirectRequest.set("Cookie", response.headers["x-redirect-token"]);
705
- }
706
- redirectRequest.redirects(0);
707
- redirectRequest.withCredentials(_this2.withCredentials);
708
- redirectRequest.buffer(false);
709
- var redirectedStream = _fs2["default"].createWriteStream(_tempFilename);
710
- redirectRequest.pipe(redirectedStream);
711
- redirectRequest.on('response', function (redirectResponse) {
712
- _assertClassBrand(_ApiClient_brand, context, _log).call(context, _classPrivateFieldGet(_LOG_LEVEL, context).INFO, null, "Received response after redirection :", redirectResponse.status);
713
- _assertClassBrand(_ApiClient_brand, context, _processDownloadedFile).call(context, redirectResponse, redirectedStream, _tempFilename, resolve, reject, returnType);
714
- });
715
- } else {
716
- _assertClassBrand(_ApiClient_brand, _this2, _handleApiResponseForPromise).call(_this2, response, path, queryParams, returnType, resolve, reject);
762
+ let tempFilename = this.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
763
+ let stream = _fs.default.createWriteStream(tempFilename);
764
+ _assertClassBrand(_ApiClient_brand, this, _processDownloadedFile).call(this, response, stream, tempFilename, resolve, reject, returnType);
717
765
  }
766
+ } else if (response.status == 302) {
767
+ /*
768
+ * Handling 302 Redirects
769
+ * - Reads X-Redirect-Token header from response and writes into Cookie header for redirected request
770
+ */
771
+ let tempFilename = this.downloadDestination + '/downloaded_file_' + Date.now() + '.txt'; // temporary filename
772
+ let context = this;
773
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Redirecting to :", response.headers.location);
774
+ var redirectRequest = (0, _superagent.default)(httpMethod, response.headers.location);
775
+ redirectRequest.set(request.header);
776
+ if (response.headers.hasOwnProperty("x-redirect-token")) {
777
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Writing X-Redirect-Token into Cookie");
778
+ redirectRequest.set("Cookie", response.headers["x-redirect-token"]);
779
+ }
780
+ if (this.requestAgent) {
781
+ redirectRequest.agent(this.requestAgent);
782
+ }
783
+ redirectRequest.redirects(0);
784
+ redirectRequest.withCredentials(this.withCredentials);
785
+ redirectRequest.buffer(false);
786
+ let redirectedStream = _fs.default.createWriteStream(tempFilename);
787
+ redirectRequest.pipe(redirectedStream);
788
+ redirectRequest.on('response', function (redirectResponse) {
789
+ _assertClassBrand(_ApiClient_brand, context, _log).call(context, _classPrivateFieldGet(_LOG_LEVEL, context).INFO, null, "Received response after redirection :", redirectResponse.status);
790
+ _assertClassBrand(_ApiClient_brand, context, _processDownloadedFile).call(context, redirectResponse, redirectedStream, tempFilename, resolve, reject, returnType);
791
+ });
792
+ } else {
793
+ _assertClassBrand(_ApiClient_brand, this, _handleApiResponseForPromise).call(this, response, path, queryParams, returnType, resolve, reject);
718
794
  }
719
- });
720
- });
721
- }
722
- }], [{
723
- key: "getEtag",
724
- value: function getEtag(object) {
725
- var etag = null;
726
- if (object !== undefined) {
727
- if (object.hasOwnProperty('$reserved') && object.get$Reserved() !== undefined) {
728
- etag = this.getValueForCaseInsensitiveKeyMatch(object.get$Reserved(), 'ETag');
729
795
  }
730
- if (etag == null && object.hasOwnProperty("data") && object.getData().hasOwnProperty('$reserved') && object.getData().get$Reserved() !== undefined) {
731
- etag = this.getValueForCaseInsensitiveKeyMatch(object.getData().get$Reserved(), 'ETag');
796
+ });
797
+ });
798
+ }
799
+ static addEtagReferenceToHeader(bodyParam, headerParams) {
800
+ // set If-Match header from postBody $reserved map
801
+ if (typeof bodyParam !== 'undefined' && bodyParam !== null) {
802
+ if (bodyParam.hasOwnProperty('$reserved') && bodyParam.$reserved.hasOwnProperty('ETag')) {
803
+ let eTagReference = bodyParam.$reserved['ETag'];
804
+ if (typeof eTagReference !== 'undefined' && eTagReference !== null && eTagReference !== "") {
805
+ headerParams['If-Match'] = eTagReference;
732
806
  }
733
807
  }
734
- return etag;
735
- }
736
- }, {
737
- key: "getValueForCaseInsensitiveKeyMatch",
738
- value: function getValueForCaseInsensitiveKeyMatch(object, key) {
739
- if (object && key) {
740
- var searchKey = key.toLowerCase();
741
- var matchedKey = Object.keys(object).find(function (key) {
742
- return key.toLowerCase() === searchKey;
743
- });
744
- return matchedKey ? object[matchedKey] : null;
745
- }
746
- return null;
747
808
  }
809
+ }
748
810
 
749
- // Gets a valid timeout
750
- // 1. Sets to provided default timeout in case invalid value is passed
751
- // 2. Sets to default max value of 30 minutes in case a value of more than 30 minutes is passed
752
- }, {
753
- key: "addEtagReferenceToHeader",
754
- value: function addEtagReferenceToHeader(bodyParam, headerParams) {
755
- // set If-Match header from postBody $reserved map
756
- if (typeof bodyParam !== 'undefined' && bodyParam !== null) {
757
- if (bodyParam.hasOwnProperty('$reserved') && bodyParam.$reserved.hasOwnProperty('ETag')) {
758
- var eTagReference = bodyParam.$reserved['ETag'];
759
- if (typeof eTagReference !== 'undefined' && eTagReference !== null && eTagReference !== "") {
760
- headerParams['If-Match'] = eTagReference;
761
- }
762
- }
763
- }
764
- }
811
+ /*
812
+ * Parses an ISO-8601 string representation of a date value.
813
+ * @param {String} str The date value as a string.
814
+ * @returns {Date} The parsed date object.
815
+ */
816
+ static parseDate(str) {
817
+ return new Date(str);
818
+ }
765
819
 
766
- /*
767
- * Parses an ISO-8601 string representation of a date value.
768
- * @param {String} str The date value as a string.
769
- * @returns {Date} The parsed date object.
770
- */
771
- }, {
772
- key: "parseDate",
773
- value: function parseDate(str) {
774
- return new Date(str);
820
+ /*
821
+ * Parses queryParams and path to find a given query param value
822
+ * @param {String} path The path given to callApi method
823
+ * @param {Object.<String, Object>} queryParams The queryParams given to callApi method
824
+ * @param {String} param Parameter name to look for
825
+ * @param {String} defaultValue The default value for the missing param if not present
826
+ * @returns {String} The value of given parameter
827
+ */
828
+ static parseQueryParam(path, queryParams, param, defaultValue) {
829
+ let value = null;
830
+ if (typeof queryParams !== 'undefined' && queryParams.hasOwnProperty(param)) {
831
+ value = queryParams[param];
775
832
  }
776
-
777
- /*
778
- * Parses queryParams and path to find a given query param value
779
- * @param {String} path The path given to callApi method
780
- * @param {Object.<String, Object>} queryParams The queryParams given to callApi method
781
- * @param {String} param Parameter name to look for
782
- * @param {String} defaultValue The default value for the missing param if not present
783
- * @returns {String} The value of given parameter
784
- */
785
- }, {
786
- key: "parseQueryParam",
787
- value: function parseQueryParam(path, queryParams, param, defaultValue) {
788
- var value = null;
789
- if (typeof queryParams !== 'undefined' && queryParams.hasOwnProperty(param)) {
790
- value = queryParams[param];
791
- }
792
- if (value === null && (typeof path === 'string' || path instanceof String)) {
793
- var escapedParam = param.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
794
- var regexResult = path.match(new RegExp("".concat(escapedParam, "=([0-9]+)")));
795
- if (regexResult) {
796
- value = regexResult[1];
797
- }
798
- }
799
- if (value === null) {
800
- value = defaultValue;
833
+ if (value === null && (typeof path === 'string' || path instanceof String)) {
834
+ const escapedParam = param.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
835
+ const regexResult = path.match(new RegExp(`${escapedParam}=([0-9]+)`));
836
+ if (regexResult) {
837
+ value = regexResult[1];
801
838
  }
802
- return value;
803
839
  }
840
+ if (value === null) {
841
+ value = defaultValue;
842
+ }
843
+ return value;
844
+ }
804
845
 
805
- /**
806
- * Converts a value to the specified type.
807
- * @param {(String|Object)} data The data to convert, as a string or object.
808
- * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
809
- * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
810
- * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
811
- * all properties on <code>data<code> will be converted to this type.
812
- * @returns An instance of the specified type or null or undefined if data is null or undefined.
813
- */
814
- }, {
815
- key: "convertToType",
816
- value: function convertToType(data, type) {
817
- if (data === null || data === undefined) return data;
818
- switch (type) {
819
- case 'Boolean':
820
- return Boolean(data);
821
- case 'Integer':
822
- return parseInt(data, 10);
823
- case 'Number':
824
- return parseFloat(data);
825
- case 'String':
826
- return String(data);
827
- case 'Date':
828
- return ApiClient.parseDate(String(data));
829
- case 'Blob':
846
+ /**
847
+ * Converts a value to the specified type.
848
+ * @param {(String|Object)} data The data to convert, as a string or object.
849
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
850
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
851
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
852
+ * all properties on <code>data<code> will be converted to this type.
853
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
854
+ */
855
+ static convertToType(data, type) {
856
+ if (data === null || data === undefined) return data;
857
+ switch (type) {
858
+ case 'Boolean':
859
+ return Boolean(data);
860
+ case 'Integer':
861
+ return parseInt(data, 10);
862
+ case 'Number':
863
+ return parseFloat(data);
864
+ case 'String':
865
+ return String(data);
866
+ case 'Date':
867
+ return ApiClient.parseDate(String(data));
868
+ case 'Blob':
869
+ return data;
870
+ default:
871
+ if (type === Object) {
872
+ // generic object, return directly
830
873
  return data;
831
- default:
832
- if (type === Object) {
833
- // generic object, return directly
834
- return data;
835
- } else if (typeof type === 'function') {
836
- // for model type like: User
837
- return type.constructFromObject(data);
838
- } else if (Array.isArray(type)) {
839
- // for array type like: ['String']
840
- var itemType = type[0];
841
- return data.map(function (item) {
842
- return ApiClient.convertToType(item, itemType);
843
- });
844
- } else if (_typeof(type) === 'object') {
845
- // for plain object type like: {'String': 'Integer'}
846
- var keyType, valueType;
847
- for (var k in type) {
848
- if (type.hasOwnProperty(k)) {
849
- keyType = k;
850
- valueType = type[k];
851
- break;
852
- }
874
+ } else if (typeof type === 'function') {
875
+ // for model type like: User
876
+ return type.constructFromObject(data);
877
+ } else if (Array.isArray(type)) {
878
+ // for array type like: ['String']
879
+ var itemType = type[0];
880
+ return data.map(item => {
881
+ return ApiClient.convertToType(item, itemType);
882
+ });
883
+ } else if (typeof type === 'object') {
884
+ // for plain object type like: {'String': 'Integer'}
885
+ var keyType, valueType;
886
+ for (var k in type) {
887
+ if (type.hasOwnProperty(k)) {
888
+ keyType = k;
889
+ valueType = type[k];
890
+ break;
853
891
  }
854
- var result = {};
855
- for (var k in data) {
856
- if (data.hasOwnProperty(k)) {
857
- var key = ApiClient.convertToType(k, keyType);
858
- var value = ApiClient.convertToType(data[k], valueType);
859
- result[key] = value;
860
- }
892
+ }
893
+ var result = {};
894
+ for (var k in data) {
895
+ if (data.hasOwnProperty(k)) {
896
+ var key = ApiClient.convertToType(k, keyType);
897
+ var value = ApiClient.convertToType(data[k], valueType);
898
+ result[key] = value;
861
899
  }
862
- return result;
863
- } else {
864
- // for unknown type, return the data directly
865
- return data;
866
900
  }
867
- }
901
+ return result;
902
+ } else {
903
+ // for unknown type, return the data directly
904
+ return data;
905
+ }
868
906
  }
907
+ }
869
908
 
870
- /**
871
- * Constructs a new map or array model from REST data.
872
- * @param data {Object|Array} The REST data.
873
- * @param obj {Object|Array} The target object or array.
874
- */
875
- }, {
876
- key: "constructFromObject",
877
- value: function constructFromObject(data, obj, itemType) {
878
- if (Array.isArray(data)) {
879
- for (var i = 0; i < data.length; i++) {
880
- if (data.hasOwnProperty(i)) obj[i] = ApiClient.convertToType(data[i], itemType);
881
- }
882
- } else {
883
- for (var k in data) {
884
- if (data.hasOwnProperty(k)) obj[k] = ApiClient.convertToType(data[k], itemType);
885
- }
909
+ /**
910
+ * Constructs a new map or array model from REST data.
911
+ * @param data {Object|Array} The REST data.
912
+ * @param obj {Object|Array} The target object or array.
913
+ */
914
+ static constructFromObject(data, obj, itemType) {
915
+ if (Array.isArray(data)) {
916
+ for (var i = 0; i < data.length; i++) {
917
+ if (data.hasOwnProperty(i)) obj[i] = ApiClient.convertToType(data[i], itemType);
918
+ }
919
+ } else {
920
+ for (var k in data) {
921
+ if (data.hasOwnProperty(k)) obj[k] = ApiClient.convertToType(data[k], itemType);
886
922
  }
887
923
  }
888
- }]);
889
- }();
924
+ }
925
+ }
926
+
890
927
  /**
891
928
  * The default API client implementation.
892
929
  * @type {ApiClient}
893
930
  * @memberOf ApiClient
894
931
  */
932
+ exports.ApiClient = ApiClient;
895
933
  _ApiClient = ApiClient;
896
934
  function _isJsonMime(contentType) {
897
935
  return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
@@ -917,11 +955,11 @@ function _jsonPreferredMime(contentTypes) {
917
955
  function _isFileParam(param) {
918
956
  // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
919
957
  if (typeof require === 'function') {
920
- var _fs;
958
+ let fs;
921
959
  try {
922
- _fs = require('fs');
960
+ fs = require('fs');
923
961
  } catch (err) {}
924
- if (_fs && _fs.ReadStream && param instanceof _fs.ReadStream) {
962
+ if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
925
963
  return true;
926
964
  }
927
965
  }
@@ -967,17 +1005,16 @@ function _normalizeParams(params) {
967
1005
  return newParams;
968
1006
  }
969
1007
  function _applyAuthToRequest(request, authNames) {
970
- var _this3 = this;
971
- authNames.forEach(function (authName) {
972
- var auth = _this3.authentications[authName];
1008
+ authNames.forEach(authName => {
1009
+ var auth = this.authentications[authName];
973
1010
  switch (auth.type) {
974
1011
  case 'basic':
975
1012
  if (auth.username || auth.password) {
976
1013
  request.auth(auth.username || '', auth.password || '');
977
- } else if (_this3.username || _this3.password) {
978
- request.auth(_this3.username || '', _this3.password || '');
1014
+ } else if (this.username || this.password) {
1015
+ request.auth(this.username || '', this.password || '');
979
1016
  }
980
- _assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "Basic Auth applied to request");
1017
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Basic Auth applied to request");
981
1018
  break;
982
1019
  case 'apiKey':
983
1020
  if (auth.apiKey) {
@@ -993,7 +1030,7 @@ function _applyAuthToRequest(request, authNames) {
993
1030
  request.query(data);
994
1031
  }
995
1032
  }
996
- _assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "apiKey applied to request");
1033
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "apiKey applied to request");
997
1034
  break;
998
1035
  case 'oauth2':
999
1036
  if (auth.accessToken) {
@@ -1001,10 +1038,10 @@ function _applyAuthToRequest(request, authNames) {
1001
1038
  'Authorization': 'Bearer ' + auth.accessToken
1002
1039
  });
1003
1040
  }
1004
- _assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).DEBUG, null, "oauth2 applied to request");
1041
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "oauth2 applied to request");
1005
1042
  break;
1006
1043
  default:
1007
- _assertClassBrand(_ApiClient_brand, _this3, _log).call(_this3, _classPrivateFieldGet(_LOG_LEVEL, _this3).ERROR, null, "Unknown authentication type:", auth.type);
1044
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Unknown authentication type:", auth.type);
1008
1045
  throw new Error('Unknown authentication type: ' + auth.type);
1009
1046
  }
1010
1047
  });
@@ -1042,11 +1079,11 @@ function _deserialize(response, returnType) {
1042
1079
  data.data = new _buffer.Blob([response.text], {
1043
1080
  type: response.headers['content-type']
1044
1081
  });
1045
- var flag = new _Flag["default"]();
1082
+ let flag = new _Flag.default();
1046
1083
  flag.name = "hasError";
1047
1084
  flag.value = false;
1048
- var flags = [flag];
1049
- var metadata = new _ApiResponseMetadata["default"]();
1085
+ let flags = [flag];
1086
+ let metadata = new _ApiResponseMetadata.default();
1050
1087
  metadata.flags = flags;
1051
1088
  data.metadata = metadata;
1052
1089
  return data;
@@ -1055,7 +1092,7 @@ function _deserialize(response, returnType) {
1055
1092
  // Rely on SuperAgent for parsing response body.
1056
1093
  // See http://visionmedia.github.io/superagent/#parsing-response-bodies
1057
1094
  var data = response.body;
1058
- if (data == null || _typeof(data) === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) {
1095
+ if (data == null || typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) {
1059
1096
  // SuperAgent does not always produce a body; use the unparsed response as a fallback
1060
1097
  data = response.text;
1061
1098
  }
@@ -1069,19 +1106,79 @@ function _deserialize(response, returnType) {
1069
1106
  */
1070
1107
  function _paginateIfNeeded(data, path, queryParams) {
1071
1108
  // If response is not a Paginable instance, nothing to do
1072
- if (!(data instanceof _Paginable["default"])) {
1109
+ if (!(data instanceof _Paginable.default)) {
1073
1110
  return;
1074
1111
  }
1075
1112
  // Retrieve current page number, defaults to 0
1076
- var page = parseInt(this.constructor.parseQueryParam(path, queryParams, '$page', "0"), 10);
1113
+ const page = parseInt(this.constructor.parseQueryParam(path, queryParams, '$page', "0"), 10);
1077
1114
  // Retrieve current limit (results per page) number, defaults to 50
1078
- var resultsPerPage = parseInt(this.constructor.parseQueryParam(path, queryParams, '$limit', "50"), 10);
1115
+ const resultsPerPage = parseInt(this.constructor.parseQueryParam(path, queryParams, '$limit', "50"), 10);
1079
1116
 
1080
1117
  // Populate pagination data
1081
1118
  data.populatePaginationMetadata(this,
1082
1119
  // current ApiClient instance
1083
1120
  page, resultsPerPage);
1084
1121
  }
1122
+ function _performNegotiationBetweenVersions(sdk, server) {
1123
+ if (!sdk || !server) {
1124
+ return sdk;
1125
+ }
1126
+ let sdkProps = _assertClassBrand(_ApiClient_brand, this, _getVersionDetails).call(this, sdk);
1127
+ let serverProps = _assertClassBrand(_ApiClient_brand, this, _getVersionDetails).call(this, server);
1128
+ // if major version is different, then do not negotiate
1129
+ // maintain sdk version
1130
+ if (!sdkProps["family"] === serverProps["family"]) {
1131
+ return sdk;
1132
+ }
1133
+ // if sdk version is smaller than highest server version, then maintain sdk version
1134
+ if (_assertClassBrand(_ApiClient_brand, this, _isSmallerMinorVersion).call(this, sdkProps, serverProps)) {
1135
+ return sdk;
1136
+ }
1137
+ // since sdk version is higher than highest server version, use server version
1138
+ return server;
1139
+ }
1140
+ function _isSmallerMinorVersion(p1, p2) {
1141
+ // if revision different, then compare revision
1142
+ if (parseInt(p1["revision"]) != parseInt(p2["revision"])) {
1143
+ return parseInt(p1["revision"]) < parseInt(p2["revision"]);
1144
+ }
1145
+ // revision is same, so compare version_type (release_type + release_type_revision)
1146
+ if (p1["versionType"] === "released") {
1147
+ return false;
1148
+ }
1149
+ let p1ReleaseType = p1["versionType"].substring(0, 1);
1150
+ let p2ReleaseType = p2["versionType"].substring(0, 1);
1151
+ let p1ReleaseTypeRevision = parseInt(p1["versionType"].substring(1));
1152
+ let p2ReleaseTypeRevision = p2["versionType"] === "released" ? 0 : parseInt(p2["versionType"].substring(1));
1153
+ if (p1ReleaseType === p2ReleaseType) {
1154
+ // release type is same, so compare release type revision
1155
+ return p1ReleaseTypeRevision < p2ReleaseTypeRevision;
1156
+ }
1157
+ // release type is different, so alpha must be smallest and released must be largest
1158
+ return p1ReleaseType === "a" || p2["versionType"] === "released";
1159
+ }
1160
+ function _getVersionDetails(version) {
1161
+ let ret = {};
1162
+ if ("unversioned" === version) {
1163
+ ret["family"] = "unversioned";
1164
+ ret["versionType"] = "released";
1165
+ } else {
1166
+ let versionParts = version.toString().split('.');
1167
+ if ("unversioned" === versionParts[0]) {
1168
+ ret["family"] = "unversioned";
1169
+ ret["versionType"] = versionParts[1];
1170
+ } else {
1171
+ ret["family"] = versionParts[0].substring(1);
1172
+ ret["revision"] = versionParts[1];
1173
+ if (versionParts.length == 2) {
1174
+ ret["versionType"] = "released";
1175
+ } else {
1176
+ ret["versionType"] = versionParts[2];
1177
+ }
1178
+ }
1179
+ }
1180
+ return ret;
1181
+ }
1085
1182
  function _getValidTimeout(timeout, defaultTimeout) {
1086
1183
  if (timeout <= 0) {
1087
1184
  timeout = defaultTimeout;
@@ -1093,27 +1190,18 @@ function _getValidTimeout(timeout, defaultTimeout) {
1093
1190
  // If enabled, update cookie information to reuse in subsequent requests for a valid response
1094
1191
  function _updateCookies(response) {
1095
1192
  if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("set-cookie")) {
1096
- var finalCookie = "";
1097
- var cookieList = response.headers["set-cookie"];
1193
+ let finalCookie = "";
1194
+ let cookieList = response.headers["set-cookie"];
1098
1195
  if (cookieList.length > 0) {
1099
1196
  // add all cookies separated by ;
1100
- var _iterator2 = _createForOfIteratorHelper(cookieList),
1101
- _step2;
1102
- try {
1103
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1104
- var cookieItem = _step2.value;
1105
- cookieItem = cookieItem.split(";")[0];
1106
- if (cookieItem.includes("=")) {
1107
- cookieItem.trim();
1108
- finalCookie = finalCookie.concat(cookieItem).concat(";");
1109
- }
1197
+ for (let cookieItem of cookieList) {
1198
+ cookieItem = cookieItem.split(";")[0];
1199
+ if (cookieItem.includes("=")) {
1200
+ cookieItem.trim();
1201
+ finalCookie = finalCookie.concat(cookieItem).concat(";");
1110
1202
  }
1111
- // remove trailing ;
1112
- } catch (err) {
1113
- _iterator2.e(err);
1114
- } finally {
1115
- _iterator2.f();
1116
1203
  }
1204
+ // remove trailing ;
1117
1205
  if (finalCookie !== "") {
1118
1206
  finalCookie = finalCookie.substr(0, finalCookie.length - 1);
1119
1207
  }
@@ -1132,20 +1220,17 @@ function _attachCookies(request) {
1132
1220
  }));
1133
1221
  }
1134
1222
  }
1135
- function _log(level, mapper) {
1136
- for (var _len = arguments.length, messages = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1137
- messages[_key - 2] = arguments[_key];
1138
- }
1223
+ function _log(level, mapper, ...messages) {
1139
1224
  // Set default log level to INFO
1140
- if (_typeof(level) !== "object" || !("key" in level) || !("value" in level) || _typeof(level["value"]) !== "symbol") {
1225
+ if (typeof level !== "object" || !("key" in level) || !("value" in level) || typeof level["value"] !== "symbol") {
1141
1226
  level = _classPrivateFieldGet(_LOG_LEVEL, this).INFO;
1142
1227
  }
1143
1228
  if (!_assertClassBrand(_ApiClient_brand, this, _skipLogging).call(this, level)) {
1144
1229
  // Preprocess message to prefix with timestamp and log level
1145
- messages = messages.map(function (message) {
1230
+ messages = messages.map(message => {
1146
1231
  return typeof message === "string" ? message : mapper ? mapper(message) : JSON.stringify(message);
1147
1232
  });
1148
- var message = messages.join(' ');
1233
+ let message = messages.join(' ');
1149
1234
  message = new Date().toISOString() + ' ' + level.key + ' - ' + message;
1150
1235
  if (typeof _classPrivateFieldGet(_logger, this) !== "undefined" && _classPrivateFieldGet(_logger, this) !== null && typeof _classPrivateFieldGet(_logger, this).log === 'function') {
1151
1236
  _classPrivateFieldGet(_logger, this).log(message);
@@ -1160,12 +1245,12 @@ function _skipLogging(level) {
1160
1245
  }
1161
1246
  // A mapper function to flatten a simple non-nested (key:value) object to string
1162
1247
  function _flatten(obj) {
1163
- if (_typeof(obj) !== "object") {
1248
+ if (typeof obj !== "object") {
1164
1249
  return obj;
1165
1250
  }
1166
- var output = '\n';
1251
+ let output = '\n';
1167
1252
  if (obj) {
1168
- Object.keys(obj).forEach(function (e) {
1253
+ Object.keys(obj).forEach(e => {
1169
1254
  output += e + '=[' + obj[e] + ']\n';
1170
1255
  });
1171
1256
  }
@@ -1181,21 +1266,22 @@ function _handleApiResponseForPromise(response, path, queryParams, returnType, r
1181
1266
  _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Response Body :", data);
1182
1267
  if (response.status == 204 && data == null) {
1183
1268
  resolve({
1184
- data: data,
1185
- response: response
1269
+ data,
1270
+ response
1186
1271
  });
1187
1272
  } else if (response.ok && data != null) {
1188
1273
  this.addEtagToReservedMap(response, data);
1189
1274
  _assertClassBrand(_ApiClient_brand, this, _paginateIfNeeded).call(this, data, path, queryParams);
1190
1275
  resolve({
1191
- data: data,
1192
- response: response
1276
+ data,
1277
+ response
1193
1278
  });
1194
1279
  } else {
1195
1280
  _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, data);
1196
- reject(_objectSpread(_objectSpread({}, response.error), {}, {
1281
+ reject({
1282
+ ...response.error,
1197
1283
  data: data
1198
- }));
1284
+ });
1199
1285
  }
1200
1286
  } catch (err) {
1201
1287
  _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Caught error while processing response!");
@@ -1204,58 +1290,159 @@ function _handleApiResponseForPromise(response, path, queryParams, returnType, r
1204
1290
  reject(err);
1205
1291
  }
1206
1292
  }
1293
+ function _prepareDownloadBrowserParams(url, httpMethod, queryParams, headerParams, bodyParam, authNames, contentTypes, accepts) {
1294
+ let authHeaders = {};
1295
+
1296
+ // Apply authentication logic
1297
+ authNames.forEach(authName => {
1298
+ const auth = this.authentications[authName];
1299
+ switch (auth.type) {
1300
+ case 'basic':
1301
+ let username = '';
1302
+ let password = '';
1303
+ if (auth.username || auth.password) {
1304
+ username = auth.username || '';
1305
+ password = auth.password || '';
1306
+ } else if (this.username || this.password) {
1307
+ username = this.username || '';
1308
+ password = this.password || '';
1309
+ }
1310
+ if (username || password) {
1311
+ const credentials = btoa(`${username}:${password}`);
1312
+ authHeaders['Authorization'] = `Basic ${credentials}`;
1313
+ }
1314
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Basic Auth applied to request");
1315
+ break;
1316
+ case 'apiKey':
1317
+ if (auth.apiKey) {
1318
+ let apiKeyValue = '';
1319
+ if (auth.apiKeyPrefix) {
1320
+ apiKeyValue = auth.apiKeyPrefix + ' ' + auth.apiKey;
1321
+ } else {
1322
+ apiKeyValue = auth.apiKey;
1323
+ }
1324
+ if (auth['in'] === 'header') {
1325
+ authHeaders[auth.name] = 'Bearer ' + apiKeyValue;
1326
+ } else if (auth['in'] === 'query') {
1327
+ queryParams[auth.name] = apiKeyValue;
1328
+ }
1329
+ }
1330
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "apiKey applied to request");
1331
+ break;
1332
+ case 'oauth2':
1333
+ if (auth.accessToken) {
1334
+ authHeaders['Authorization'] = 'Bearer ' + auth.accessToken;
1335
+ }
1336
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "oauth2 applied to request");
1337
+ break;
1338
+ default:
1339
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Unknown authentication type:", auth.type);
1340
+ throw new Error('Unknown authentication type: ' + auth.type);
1341
+ }
1342
+ });
1343
+
1344
+ // set query parameters
1345
+ if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
1346
+ queryParams['cache'] = 'false';
1347
+ }
1348
+
1349
+ // Build URL with query parameters
1350
+ const normalizedParams = _assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, queryParams);
1351
+ const queryString = Object.keys(normalizedParams).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(normalizedParams[key])}`).join('&');
1352
+ let finalUrl = url;
1353
+ if (queryString) {
1354
+ finalUrl += (finalUrl.includes('?') ? '&' : '?') + queryString;
1355
+ }
1356
+ const finalHeaders = {
1357
+ ...this.defaultHeaders,
1358
+ ..._assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, headerParams),
1359
+ ...authHeaders
1360
+ };
1361
+
1362
+ // set header parameters
1363
+ if ((this.defaultHeaders['NTNX-Request-Id'] === null || this.defaultHeaders['NTNX-Request-Id'] === undefined) && (headerParams['NTNX-Request-Id'] === null || headerParams['NTNX-Request-Id'] === undefined)) {
1364
+ let requestId = (0, _uuid.v4)();
1365
+ finalHeaders['NTNX-Request-Id'] = requestId;
1366
+ }
1367
+
1368
+ //Add cookies if they exist
1369
+ if (_classPrivateFieldGet(_cookie, this) != null) {
1370
+ finalHeaders['Cookie'] = _assertClassBrand(_ApiClient_brand, this, _normalizeParams).call(this, {
1371
+ 'Cookie': _classPrivateFieldGet(_cookie, this)
1372
+ });
1373
+ }
1374
+
1375
+ // Set content type
1376
+ var contentType = headerParams.hasOwnProperty("Content-Type") ? headerParams["Content-Type"] : _assertClassBrand(_ApiClient_brand, this, _jsonPreferredMime).call(this, contentTypes);
1377
+ finalHeaders['Content-Type'] = contentType;
1378
+
1379
+ // Set Accept Header
1380
+ var accept = headerParams.hasOwnProperty("Accept") && headerParams["Accept"] != undefined ? headerParams["Accept"] : accepts.join(', ');
1381
+ if (accept) {
1382
+ finalHeaders['Accept'] = accept;
1383
+ }
1384
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Request URL :", httpMethod, url);
1385
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, _assertClassBrand(_ApiClient_brand, this, _flatten), "Request Headers :", finalHeaders);
1386
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).DEBUG, null, "Request Body :", bodyParam || "");
1387
+ return {
1388
+ url: finalUrl,
1389
+ options: {
1390
+ method: httpMethod,
1391
+ headers: finalHeaders,
1392
+ body: bodyParam,
1393
+ credentials: this.withCredentials ? 'include' : 'same-origin'
1394
+ }
1395
+ };
1396
+ }
1207
1397
  function _processDownloadedFile(response, stream, tempFilename, resolve, reject, returnType) {
1208
- var _this4 = this;
1209
1398
  _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Streaming response to : ", tempFilename);
1210
1399
  try {
1211
- response.on('data', function (chunk) {
1400
+ response.on('data', chunk => {
1212
1401
  stream.write(chunk);
1213
1402
  });
1214
1403
  } catch (err) {
1215
1404
  _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Issue while downloading file", err);
1216
1405
  }
1217
- var data = new returnType();
1406
+ let data = new returnType();
1218
1407
  // Fetch filename
1219
- var filename = "";
1408
+ let filename = "";
1220
1409
  if (typeof response.headers['content-disposition'] !== 'undefined' && response.headers['content-disposition'] !== null) {
1221
- var match = response.headers['content-disposition'].match(/*#__PURE__*/_wrapRegExp(/.*filename="(.*)".*/, {
1222
- filename: 1
1223
- }));
1224
- var filepath = _path["default"].parse(match.groups['filename']);
1410
+ let match = response.headers['content-disposition'].match(/.*filename=\"(?<filename>.*)\".*/);
1411
+ let filepath = _path.default.parse(match.groups['filename']);
1225
1412
  filename = this.downloadDestination + '/' + filepath.name + '_' + Date.now() + filepath.ext;
1226
1413
  data.data = {
1227
- "path": _path["default"].parse(filename),
1414
+ "path": _path.default.parse(filename),
1228
1415
  $objectType: "Path"
1229
1416
  };
1230
- var flag = new _Flag["default"]();
1417
+ let flag = new _Flag.default();
1231
1418
  flag.name = "hasError";
1232
1419
  flag.value = false;
1233
- var flags = [flag];
1234
- var metadata = new _ApiResponseMetadata["default"]();
1420
+ let flags = [flag];
1421
+ let metadata = new _ApiResponseMetadata.default();
1235
1422
  metadata.flags = flags;
1236
1423
  data.metadata = metadata;
1237
1424
  }
1238
- response.on('end', function () {
1239
- _assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).INFO, null, "Finished streaming response");
1425
+ response.on('end', () => {
1426
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Finished streaming response");
1240
1427
  if (filename.length !== 0) {
1241
- _assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).INFO, null, "Content-Disposition header found [", filename, "] is final filename");
1428
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).INFO, null, "Content-Disposition header found [", filename, "] is final filename");
1242
1429
  stream.close();
1243
- _fs2["default"].renameSync(tempFilename, filename);
1430
+ _fs.default.renameSync(tempFilename, filename);
1244
1431
  resolve({
1245
- data: data,
1246
- response: response
1432
+ data,
1433
+ response
1247
1434
  });
1248
1435
  } else {
1249
- _assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).ERROR, null, "Content-Disposition header not found [", tempFilename, "] is final filename");
1436
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Content-Disposition header not found [", tempFilename, "] is final filename");
1250
1437
  resolve({
1251
- data: data,
1252
- response: response
1438
+ data,
1439
+ response
1253
1440
  });
1254
1441
  }
1255
1442
  });
1256
- response.on('error', function (err) {
1257
- _assertClassBrand(_ApiClient_brand, _this4, _log).call(_this4, _classPrivateFieldGet(_LOG_LEVEL, _this4).ERROR, null, "Caught the following error :", err);
1258
- error.data = _assertClassBrand(_ApiClient_brand, _this4, _wrapErrorInResponse).call(_this4, error);
1443
+ response.on('error', err => {
1444
+ _assertClassBrand(_ApiClient_brand, this, _log).call(this, _classPrivateFieldGet(_LOG_LEVEL, this).ERROR, null, "Caught the following error :", err);
1445
+ error.data = _assertClassBrand(_ApiClient_brand, this, _wrapErrorInResponse).call(this, error);
1259
1446
  reject(err);
1260
1447
  });
1261
1448
  }