@nutanix-scratch/dataprotection-js-client 4.0.1-alpha.4

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 (445) hide show
  1. package/LICENSE.txt +49 -0
  2. package/README.md +194 -0
  3. package/dist/Ntnx-Dataprotection-js-client-prod.js +11 -0
  4. package/dist/Ntnx-Dataprotection-js-client.js +2349 -0
  5. package/dist/es/ApiClient.d.ts +158 -0
  6. package/dist/es/ApiClient.js +1056 -0
  7. package/dist/es/Paginable.d.ts +95 -0
  8. package/dist/es/Paginable.js +289 -0
  9. package/dist/es/apis/consistencygroup-endpoints.d.ts +98 -0
  10. package/dist/es/apis/consistencygroup-endpoints.js +304 -0
  11. package/dist/es/index.d.ts +214 -0
  12. package/dist/es/index.js +853 -0
  13. package/dist/es/models/common/v1/config/Flag.d.ts +58 -0
  14. package/dist/es/models/common/v1/config/Flag.js +277 -0
  15. package/dist/es/models/common/v1/config/IPv4Address.d.ts +62 -0
  16. package/dist/es/models/common/v1/config/IPv4Address.js +290 -0
  17. package/dist/es/models/common/v1/config/KVPair.d.ts +62 -0
  18. package/dist/es/models/common/v1/config/KVPair.js +334 -0
  19. package/dist/es/models/common/v1/config/Message.d.ts +84 -0
  20. package/dist/es/models/common/v1/config/Message.js +356 -0
  21. package/dist/es/models/common/v1/config/MessageSeverity.d.ts +19 -0
  22. package/dist/es/models/common/v1/config/MessageSeverity.js +92 -0
  23. package/dist/es/models/common/v1/config/TenantAwareModel.d.ts +50 -0
  24. package/dist/es/models/common/v1/config/TenantAwareModel.js +245 -0
  25. package/dist/es/models/common/v1/response/ApiLink.d.ts +62 -0
  26. package/dist/es/models/common/v1/response/ApiLink.js +282 -0
  27. package/dist/es/models/common/v1/response/ApiResponseMetadata.d.ts +98 -0
  28. package/dist/es/models/common/v1/response/ApiResponseMetadata.js +440 -0
  29. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.d.ts +42 -0
  30. package/dist/es/models/common/v1/response/ExternalizableAbstractModel.js +273 -0
  31. package/dist/es/models/dataprotection/v4/common/BaseRecoveryPoint.d.ts +100 -0
  32. package/dist/es/models/dataprotection/v4/common/BaseRecoveryPoint.js +461 -0
  33. package/dist/es/models/dataprotection/v4/common/RecoveryPointStatus.d.ts +19 -0
  34. package/dist/es/models/dataprotection/v4/common/RecoveryPointStatus.js +92 -0
  35. package/dist/es/models/dataprotection/v4/common/RecoveryPointType.d.ts +19 -0
  36. package/dist/es/models/dataprotection/v4/common/RecoveryPointType.js +86 -0
  37. package/dist/es/models/dataprotection/v4/common/VendorSpecificProperty.d.ts +70 -0
  38. package/dist/es/models/dataprotection/v4/common/VendorSpecificProperty.js +286 -0
  39. package/dist/es/models/dataprotection/v4/config/AhvVmOverrideSpec.d.ts +50 -0
  40. package/dist/es/models/dataprotection/v4/config/AhvVmOverrideSpec.js +247 -0
  41. package/dist/es/models/dataprotection/v4/config/Category.d.ts +70 -0
  42. package/dist/es/models/dataprotection/v4/config/Category.js +286 -0
  43. package/dist/es/models/dataprotection/v4/config/ChangedRegions.d.ts +62 -0
  44. package/dist/es/models/dataprotection/v4/config/ChangedRegions.js +295 -0
  45. package/dist/es/models/dataprotection/v4/config/ChangedRegionsListApiResponse.d.ts +59 -0
  46. package/dist/es/models/dataprotection/v4/config/ChangedRegionsListApiResponse.js +314 -0
  47. package/dist/es/models/dataprotection/v4/config/ClusterReference.d.ts +69 -0
  48. package/dist/es/models/dataprotection/v4/config/ClusterReference.js +285 -0
  49. package/dist/es/models/dataprotection/v4/config/ConsistencyGroup.d.ts +62 -0
  50. package/dist/es/models/dataprotection/v4/config/ConsistencyGroup.js +328 -0
  51. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupApiResponse.d.ts +59 -0
  52. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupApiResponse.js +314 -0
  53. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.d.ts +59 -0
  54. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.js +341 -0
  55. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMember.d.ts +79 -0
  56. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMember.js +326 -0
  57. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMemberType.d.ts +19 -0
  58. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMemberType.js +86 -0
  59. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.d.ts +59 -0
  60. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.js +318 -0
  61. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.d.ts +69 -0
  62. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.js +290 -0
  63. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupProjection.d.ts +9 -0
  64. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupProjection.js +134 -0
  65. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.d.ts +67 -0
  66. package/dist/es/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.js +285 -0
  67. package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.d.ts +59 -0
  68. package/dist/es/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.js +318 -0
  69. package/dist/es/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.d.ts +59 -0
  70. package/dist/es/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.js +318 -0
  71. package/dist/es/models/dataprotection/v4/config/DataProtectionInfo.d.ts +58 -0
  72. package/dist/es/models/dataprotection/v4/config/DataProtectionInfo.js +278 -0
  73. package/dist/es/models/dataprotection/v4/config/DataProtectionSiteReference.d.ts +62 -0
  74. package/dist/es/models/dataprotection/v4/config/DataProtectionSiteReference.js +287 -0
  75. package/dist/es/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.d.ts +59 -0
  76. package/dist/es/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.js +316 -0
  77. package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.d.ts +59 -0
  78. package/dist/es/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.js +318 -0
  79. package/dist/es/models/dataprotection/v4/config/DisasterRecoveryLocation.d.ts +68 -0
  80. package/dist/es/models/dataprotection/v4/config/DisasterRecoveryLocation.js +297 -0
  81. package/dist/es/models/dataprotection/v4/config/Disk.d.ts +62 -0
  82. package/dist/es/models/dataprotection/v4/config/Disk.js +285 -0
  83. package/dist/es/models/dataprotection/v4/config/DiskRecoveryPoint.d.ts +37 -0
  84. package/dist/es/models/dataprotection/v4/config/DiskRecoveryPoint.js +254 -0
  85. package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.d.ts +59 -0
  86. package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.js +314 -0
  87. package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.d.ts +59 -0
  88. package/dist/es/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.js +336 -0
  89. package/dist/es/models/dataprotection/v4/config/EsxiVmOverrideSpec.d.ts +50 -0
  90. package/dist/es/models/dataprotection/v4/config/EsxiVmOverrideSpec.js +247 -0
  91. package/dist/es/models/dataprotection/v4/config/HardwareArchitecture.d.ts +19 -0
  92. package/dist/es/models/dataprotection/v4/config/HardwareArchitecture.js +86 -0
  93. package/dist/es/models/dataprotection/v4/config/HostReference.d.ts +42 -0
  94. package/dist/es/models/dataprotection/v4/config/HostReference.js +264 -0
  95. package/dist/es/models/dataprotection/v4/config/HostType.d.ts +19 -0
  96. package/dist/es/models/dataprotection/v4/config/HostType.js +80 -0
  97. package/dist/es/models/dataprotection/v4/config/HypervisorType.d.ts +19 -0
  98. package/dist/es/models/dataprotection/v4/config/HypervisorType.js +92 -0
  99. package/dist/es/models/dataprotection/v4/config/IpAddress.d.ts +57 -0
  100. package/dist/es/models/dataprotection/v4/config/IpAddress.js +249 -0
  101. package/dist/es/models/dataprotection/v4/config/LocationReference.d.ts +50 -0
  102. package/dist/es/models/dataprotection/v4/config/LocationReference.js +247 -0
  103. package/dist/es/models/dataprotection/v4/config/PowerState.d.ts +19 -0
  104. package/dist/es/models/dataprotection/v4/config/PowerState.js +86 -0
  105. package/dist/es/models/dataprotection/v4/config/ProtectedResource.d.ts +74 -0
  106. package/dist/es/models/dataprotection/v4/config/ProtectedResource.js +400 -0
  107. package/dist/es/models/dataprotection/v4/config/ProtectedResourceApiResponse.d.ts +59 -0
  108. package/dist/es/models/dataprotection/v4/config/ProtectedResourceApiResponse.js +314 -0
  109. package/dist/es/models/dataprotection/v4/config/ProtectedResourceEntityType.d.ts +19 -0
  110. package/dist/es/models/dataprotection/v4/config/ProtectedResourceEntityType.js +86 -0
  111. package/dist/es/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.d.ts +59 -0
  112. package/dist/es/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.js +314 -0
  113. package/dist/es/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.d.ts +19 -0
  114. package/dist/es/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.js +104 -0
  115. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.d.ts +59 -0
  116. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.js +314 -0
  117. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.d.ts +69 -0
  118. package/dist/es/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.js +287 -0
  119. package/dist/es/models/dataprotection/v4/config/RecoveryInfo.d.ts +50 -0
  120. package/dist/es/models/dataprotection/v4/config/RecoveryInfo.js +255 -0
  121. package/dist/es/models/dataprotection/v4/config/RecoveryPoint.d.ts +104 -0
  122. package/dist/es/models/dataprotection/v4/config/RecoveryPoint.js +512 -0
  123. package/dist/es/models/dataprotection/v4/config/RecoveryPointApiResponse.d.ts +59 -0
  124. package/dist/es/models/dataprotection/v4/config/RecoveryPointApiResponse.js +314 -0
  125. package/dist/es/models/dataprotection/v4/config/RecoveryPointListApiResponse.d.ts +59 -0
  126. package/dist/es/models/dataprotection/v4/config/RecoveryPointListApiResponse.js +336 -0
  127. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.d.ts +59 -0
  128. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.js +318 -0
  129. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicationSpec.d.ts +43 -0
  130. package/dist/es/models/dataprotection/v4/config/RecoveryPointReplicationSpec.js +263 -0
  131. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestorationSpec.d.ts +74 -0
  132. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestorationSpec.js +357 -0
  133. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.d.ts +59 -0
  134. package/dist/es/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.js +318 -0
  135. package/dist/es/models/dataprotection/v4/config/Regions.d.ts +62 -0
  136. package/dist/es/models/dataprotection/v4/config/Regions.js +282 -0
  137. package/dist/es/models/dataprotection/v4/config/ReplicationState.d.ts +82 -0
  138. package/dist/es/models/dataprotection/v4/config/ReplicationState.js +357 -0
  139. package/dist/es/models/dataprotection/v4/config/RestorableTimeRange.d.ts +62 -0
  140. package/dist/es/models/dataprotection/v4/config/RestorableTimeRange.js +282 -0
  141. package/dist/es/models/dataprotection/v4/config/SetExpirationTimeSpec.d.ts +57 -0
  142. package/dist/es/models/dataprotection/v4/config/SetExpirationTimeSpec.js +246 -0
  143. package/dist/es/models/dataprotection/v4/config/SiteReference.d.ts +62 -0
  144. package/dist/es/models/dataprotection/v4/config/SiteReference.js +288 -0
  145. package/dist/es/models/dataprotection/v4/config/Subnet.d.ts +48 -0
  146. package/dist/es/models/dataprotection/v4/config/Subnet.js +242 -0
  147. package/dist/es/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.d.ts +59 -0
  148. package/dist/es/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.js +314 -0
  149. package/dist/es/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.d.ts +59 -0
  150. package/dist/es/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.js +314 -0
  151. package/dist/es/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.d.ts +59 -0
  152. package/dist/es/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.js +314 -0
  153. package/dist/es/models/dataprotection/v4/config/VMRecoveryPoint.d.ts +49 -0
  154. package/dist/es/models/dataprotection/v4/config/VMRecoveryPoint.js +295 -0
  155. package/dist/es/models/dataprotection/v4/config/VMRecoveryPointApiResponse.d.ts +59 -0
  156. package/dist/es/models/dataprotection/v4/config/VMRecoveryPointApiResponse.js +314 -0
  157. package/dist/es/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.d.ts +59 -0
  158. package/dist/es/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.js +336 -0
  159. package/dist/es/models/dataprotection/v4/config/ValidateRecoveryPointResult.d.ts +79 -0
  160. package/dist/es/models/dataprotection/v4/config/ValidateRecoveryPointResult.js +320 -0
  161. package/dist/es/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.d.ts +59 -0
  162. package/dist/es/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.js +336 -0
  163. package/dist/es/models/dataprotection/v4/config/ValidationSeverity.d.ts +19 -0
  164. package/dist/es/models/dataprotection/v4/config/ValidationSeverity.js +86 -0
  165. package/dist/es/models/dataprotection/v4/config/Vm.d.ts +140 -0
  166. package/dist/es/models/dataprotection/v4/config/Vm.js +545 -0
  167. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.d.ts +70 -0
  168. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.js +319 -0
  169. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.d.ts +59 -0
  170. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.js +318 -0
  171. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.d.ts +76 -0
  172. package/dist/es/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.js +320 -0
  173. package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPoint.d.ts +98 -0
  174. package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPoint.js +405 -0
  175. package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPointProjection.d.ts +9 -0
  176. package/dist/es/models/dataprotection/v4/config/VmSubRecoveryPointProjection.js +132 -0
  177. package/dist/es/models/dataprotection/v4/config/VolumeGroup.d.ts +62 -0
  178. package/dist/es/models/dataprotection/v4/config/VolumeGroup.js +285 -0
  179. package/dist/es/models/dataprotection/v4/config/VolumeGroupOverrideSpec.d.ts +50 -0
  180. package/dist/es/models/dataprotection/v4/config/VolumeGroupOverrideSpec.js +247 -0
  181. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.d.ts +49 -0
  182. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.js +295 -0
  183. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.d.ts +59 -0
  184. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.js +314 -0
  185. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.d.ts +59 -0
  186. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.js +336 -0
  187. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.d.ts +62 -0
  188. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.js +288 -0
  189. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.d.ts +59 -0
  190. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.js +318 -0
  191. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.d.ts +66 -0
  192. package/dist/es/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.js +284 -0
  193. package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.d.ts +98 -0
  194. package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.js +407 -0
  195. package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.d.ts +9 -0
  196. package/dist/es/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.js +132 -0
  197. package/dist/es/models/dataprotection/v4/config/VolumeGroupSyncContext.d.ts +58 -0
  198. package/dist/es/models/dataprotection/v4/config/VolumeGroupSyncContext.js +279 -0
  199. package/dist/es/models/dataprotection/v4/config/VpcReference.d.ts +69 -0
  200. package/dist/es/models/dataprotection/v4/config/VpcReference.js +285 -0
  201. package/dist/es/models/dataprotection/v4/config/Witness.d.ts +66 -0
  202. package/dist/es/models/dataprotection/v4/config/Witness.js +358 -0
  203. package/dist/es/models/dataprotection/v4/config/WitnessApiResponse.d.ts +59 -0
  204. package/dist/es/models/dataprotection/v4/config/WitnessApiResponse.js +314 -0
  205. package/dist/es/models/dataprotection/v4/config/WitnessAvailabilityStatus.d.ts +19 -0
  206. package/dist/es/models/dataprotection/v4/config/WitnessAvailabilityStatus.js +86 -0
  207. package/dist/es/models/dataprotection/v4/error/AppMessage.d.ts +100 -0
  208. package/dist/es/models/dataprotection/v4/error/AppMessage.js +422 -0
  209. package/dist/es/models/dataprotection/v4/error/ErrorResponse.d.ts +48 -0
  210. package/dist/es/models/dataprotection/v4/error/ErrorResponse.js +313 -0
  211. package/dist/es/models/dataprotection/v4/error/SchemaValidationError.d.ts +88 -0
  212. package/dist/es/models/dataprotection/v4/error/SchemaValidationError.js +394 -0
  213. package/dist/es/models/dataprotection/v4/error/SchemaValidationErrorMessage.d.ts +68 -0
  214. package/dist/es/models/dataprotection/v4/error/SchemaValidationErrorMessage.js +311 -0
  215. package/dist/es/models/prism/v4/config/TaskReference.d.ts +50 -0
  216. package/dist/es/models/prism/v4/config/TaskReference.js +260 -0
  217. package/dist/es/models/storage/v4/config/Task.d.ts +50 -0
  218. package/dist/es/models/storage/v4/config/Task.js +254 -0
  219. package/dist/es/models/validation/ValidationError.d.ts +13 -0
  220. package/dist/es/models/validation/ValidationError.js +62 -0
  221. package/dist/es/models/validation/ValidationScopes.d.ts +9 -0
  222. package/dist/es/models/validation/ValidationScopes.js +39 -0
  223. package/dist/es/utils/ValidationUtils.d.ts +13 -0
  224. package/dist/es/utils/ValidationUtils.js +87 -0
  225. package/dist/lib/ApiClient.d.ts +158 -0
  226. package/dist/lib/ApiClient.js +1056 -0
  227. package/dist/lib/Paginable.d.ts +95 -0
  228. package/dist/lib/Paginable.js +289 -0
  229. package/dist/lib/apis/consistencygroup-endpoints.d.ts +98 -0
  230. package/dist/lib/apis/consistencygroup-endpoints.js +304 -0
  231. package/dist/lib/index.d.ts +214 -0
  232. package/dist/lib/index.js +853 -0
  233. package/dist/lib/models/common/v1/config/Flag.d.ts +58 -0
  234. package/dist/lib/models/common/v1/config/Flag.js +277 -0
  235. package/dist/lib/models/common/v1/config/IPv4Address.d.ts +62 -0
  236. package/dist/lib/models/common/v1/config/IPv4Address.js +290 -0
  237. package/dist/lib/models/common/v1/config/KVPair.d.ts +62 -0
  238. package/dist/lib/models/common/v1/config/KVPair.js +334 -0
  239. package/dist/lib/models/common/v1/config/Message.d.ts +84 -0
  240. package/dist/lib/models/common/v1/config/Message.js +356 -0
  241. package/dist/lib/models/common/v1/config/MessageSeverity.d.ts +19 -0
  242. package/dist/lib/models/common/v1/config/MessageSeverity.js +92 -0
  243. package/dist/lib/models/common/v1/config/TenantAwareModel.d.ts +50 -0
  244. package/dist/lib/models/common/v1/config/TenantAwareModel.js +245 -0
  245. package/dist/lib/models/common/v1/response/ApiLink.d.ts +62 -0
  246. package/dist/lib/models/common/v1/response/ApiLink.js +282 -0
  247. package/dist/lib/models/common/v1/response/ApiResponseMetadata.d.ts +98 -0
  248. package/dist/lib/models/common/v1/response/ApiResponseMetadata.js +440 -0
  249. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.d.ts +42 -0
  250. package/dist/lib/models/common/v1/response/ExternalizableAbstractModel.js +273 -0
  251. package/dist/lib/models/dataprotection/v4/common/BaseRecoveryPoint.d.ts +100 -0
  252. package/dist/lib/models/dataprotection/v4/common/BaseRecoveryPoint.js +461 -0
  253. package/dist/lib/models/dataprotection/v4/common/RecoveryPointStatus.d.ts +19 -0
  254. package/dist/lib/models/dataprotection/v4/common/RecoveryPointStatus.js +92 -0
  255. package/dist/lib/models/dataprotection/v4/common/RecoveryPointType.d.ts +19 -0
  256. package/dist/lib/models/dataprotection/v4/common/RecoveryPointType.js +86 -0
  257. package/dist/lib/models/dataprotection/v4/common/VendorSpecificProperty.d.ts +70 -0
  258. package/dist/lib/models/dataprotection/v4/common/VendorSpecificProperty.js +286 -0
  259. package/dist/lib/models/dataprotection/v4/config/AhvVmOverrideSpec.d.ts +50 -0
  260. package/dist/lib/models/dataprotection/v4/config/AhvVmOverrideSpec.js +247 -0
  261. package/dist/lib/models/dataprotection/v4/config/Category.d.ts +70 -0
  262. package/dist/lib/models/dataprotection/v4/config/Category.js +286 -0
  263. package/dist/lib/models/dataprotection/v4/config/ChangedRegions.d.ts +62 -0
  264. package/dist/lib/models/dataprotection/v4/config/ChangedRegions.js +295 -0
  265. package/dist/lib/models/dataprotection/v4/config/ChangedRegionsListApiResponse.d.ts +59 -0
  266. package/dist/lib/models/dataprotection/v4/config/ChangedRegionsListApiResponse.js +314 -0
  267. package/dist/lib/models/dataprotection/v4/config/ClusterReference.d.ts +69 -0
  268. package/dist/lib/models/dataprotection/v4/config/ClusterReference.js +285 -0
  269. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroup.d.ts +62 -0
  270. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroup.js +328 -0
  271. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupApiResponse.d.ts +59 -0
  272. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupApiResponse.js +314 -0
  273. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.d.ts +59 -0
  274. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupListApiResponse.js +341 -0
  275. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMember.d.ts +79 -0
  276. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMember.js +326 -0
  277. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMemberType.d.ts +19 -0
  278. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMemberType.js +86 -0
  279. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.d.ts +59 -0
  280. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrateApiResponse.js +318 -0
  281. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.d.ts +69 -0
  282. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupMigrationSpec.js +290 -0
  283. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupProjection.d.ts +9 -0
  284. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupProjection.js +134 -0
  285. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.d.ts +67 -0
  286. package/dist/lib/models/dataprotection/v4/config/ConsistencyGroupRecoveryPointSpec.js +285 -0
  287. package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.d.ts +59 -0
  288. package/dist/lib/models/dataprotection/v4/config/CreateConsistencyGroupRecoveryPointApiResponse.js +318 -0
  289. package/dist/lib/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.d.ts +59 -0
  290. package/dist/lib/models/dataprotection/v4/config/CreateRecoveryPointApiResponse.js +318 -0
  291. package/dist/lib/models/dataprotection/v4/config/DataProtectionInfo.d.ts +58 -0
  292. package/dist/lib/models/dataprotection/v4/config/DataProtectionInfo.js +278 -0
  293. package/dist/lib/models/dataprotection/v4/config/DataProtectionSiteReference.d.ts +62 -0
  294. package/dist/lib/models/dataprotection/v4/config/DataProtectionSiteReference.js +287 -0
  295. package/dist/lib/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.d.ts +59 -0
  296. package/dist/lib/models/dataprotection/v4/config/DeleteConsistencyGroupApiResponse.js +316 -0
  297. package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.d.ts +59 -0
  298. package/dist/lib/models/dataprotection/v4/config/DeleteRecoveryPointApiResponse.js +318 -0
  299. package/dist/lib/models/dataprotection/v4/config/DisasterRecoveryLocation.d.ts +68 -0
  300. package/dist/lib/models/dataprotection/v4/config/DisasterRecoveryLocation.js +297 -0
  301. package/dist/lib/models/dataprotection/v4/config/Disk.d.ts +62 -0
  302. package/dist/lib/models/dataprotection/v4/config/Disk.js +285 -0
  303. package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPoint.d.ts +37 -0
  304. package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPoint.js +254 -0
  305. package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.d.ts +59 -0
  306. package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointApiResponse.js +314 -0
  307. package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.d.ts +59 -0
  308. package/dist/lib/models/dataprotection/v4/config/DiskRecoveryPointListApiResponse.js +336 -0
  309. package/dist/lib/models/dataprotection/v4/config/EsxiVmOverrideSpec.d.ts +50 -0
  310. package/dist/lib/models/dataprotection/v4/config/EsxiVmOverrideSpec.js +247 -0
  311. package/dist/lib/models/dataprotection/v4/config/HardwareArchitecture.d.ts +19 -0
  312. package/dist/lib/models/dataprotection/v4/config/HardwareArchitecture.js +86 -0
  313. package/dist/lib/models/dataprotection/v4/config/HostReference.d.ts +42 -0
  314. package/dist/lib/models/dataprotection/v4/config/HostReference.js +264 -0
  315. package/dist/lib/models/dataprotection/v4/config/HostType.d.ts +19 -0
  316. package/dist/lib/models/dataprotection/v4/config/HostType.js +80 -0
  317. package/dist/lib/models/dataprotection/v4/config/HypervisorType.d.ts +19 -0
  318. package/dist/lib/models/dataprotection/v4/config/HypervisorType.js +92 -0
  319. package/dist/lib/models/dataprotection/v4/config/IpAddress.d.ts +57 -0
  320. package/dist/lib/models/dataprotection/v4/config/IpAddress.js +249 -0
  321. package/dist/lib/models/dataprotection/v4/config/LocationReference.d.ts +50 -0
  322. package/dist/lib/models/dataprotection/v4/config/LocationReference.js +247 -0
  323. package/dist/lib/models/dataprotection/v4/config/PowerState.d.ts +19 -0
  324. package/dist/lib/models/dataprotection/v4/config/PowerState.js +86 -0
  325. package/dist/lib/models/dataprotection/v4/config/ProtectedResource.d.ts +74 -0
  326. package/dist/lib/models/dataprotection/v4/config/ProtectedResource.js +400 -0
  327. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceApiResponse.d.ts +59 -0
  328. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceApiResponse.js +314 -0
  329. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceEntityType.d.ts +19 -0
  330. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceEntityType.js +86 -0
  331. package/dist/lib/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.d.ts +59 -0
  332. package/dist/lib/models/dataprotection/v4/config/ProtectedResourcePromoteApiResponse.js +314 -0
  333. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.d.ts +19 -0
  334. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceReplicationStatus.js +104 -0
  335. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.d.ts +59 -0
  336. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreApiResponse.js +314 -0
  337. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.d.ts +69 -0
  338. package/dist/lib/models/dataprotection/v4/config/ProtectedResourceRestoreSpec.js +287 -0
  339. package/dist/lib/models/dataprotection/v4/config/RecoveryInfo.d.ts +50 -0
  340. package/dist/lib/models/dataprotection/v4/config/RecoveryInfo.js +255 -0
  341. package/dist/lib/models/dataprotection/v4/config/RecoveryPoint.d.ts +104 -0
  342. package/dist/lib/models/dataprotection/v4/config/RecoveryPoint.js +512 -0
  343. package/dist/lib/models/dataprotection/v4/config/RecoveryPointApiResponse.d.ts +59 -0
  344. package/dist/lib/models/dataprotection/v4/config/RecoveryPointApiResponse.js +314 -0
  345. package/dist/lib/models/dataprotection/v4/config/RecoveryPointListApiResponse.d.ts +59 -0
  346. package/dist/lib/models/dataprotection/v4/config/RecoveryPointListApiResponse.js +336 -0
  347. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.d.ts +59 -0
  348. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicateApiResponse.js +318 -0
  349. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicationSpec.d.ts +43 -0
  350. package/dist/lib/models/dataprotection/v4/config/RecoveryPointReplicationSpec.js +263 -0
  351. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestorationSpec.d.ts +74 -0
  352. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestorationSpec.js +357 -0
  353. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.d.ts +59 -0
  354. package/dist/lib/models/dataprotection/v4/config/RecoveryPointRestoreApiResponse.js +318 -0
  355. package/dist/lib/models/dataprotection/v4/config/Regions.d.ts +62 -0
  356. package/dist/lib/models/dataprotection/v4/config/Regions.js +282 -0
  357. package/dist/lib/models/dataprotection/v4/config/ReplicationState.d.ts +82 -0
  358. package/dist/lib/models/dataprotection/v4/config/ReplicationState.js +357 -0
  359. package/dist/lib/models/dataprotection/v4/config/RestorableTimeRange.d.ts +62 -0
  360. package/dist/lib/models/dataprotection/v4/config/RestorableTimeRange.js +282 -0
  361. package/dist/lib/models/dataprotection/v4/config/SetExpirationTimeSpec.d.ts +57 -0
  362. package/dist/lib/models/dataprotection/v4/config/SetExpirationTimeSpec.js +246 -0
  363. package/dist/lib/models/dataprotection/v4/config/SiteReference.d.ts +62 -0
  364. package/dist/lib/models/dataprotection/v4/config/SiteReference.js +288 -0
  365. package/dist/lib/models/dataprotection/v4/config/Subnet.d.ts +48 -0
  366. package/dist/lib/models/dataprotection/v4/config/Subnet.js +242 -0
  367. package/dist/lib/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.d.ts +59 -0
  368. package/dist/lib/models/dataprotection/v4/config/SyncedVolumeGroupByIdApiResponse.js +314 -0
  369. package/dist/lib/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.d.ts +59 -0
  370. package/dist/lib/models/dataprotection/v4/config/SynchronousReplicaPromoteApiResponse.js +314 -0
  371. package/dist/lib/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.d.ts +59 -0
  372. package/dist/lib/models/dataprotection/v4/config/UpdateRecoveryPointExpirationTimeApiResponse.js +314 -0
  373. package/dist/lib/models/dataprotection/v4/config/VMRecoveryPoint.d.ts +49 -0
  374. package/dist/lib/models/dataprotection/v4/config/VMRecoveryPoint.js +295 -0
  375. package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointApiResponse.d.ts +59 -0
  376. package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointApiResponse.js +314 -0
  377. package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.d.ts +59 -0
  378. package/dist/lib/models/dataprotection/v4/config/VMRecoveryPointListApiResponse.js +336 -0
  379. package/dist/lib/models/dataprotection/v4/config/ValidateRecoveryPointResult.d.ts +79 -0
  380. package/dist/lib/models/dataprotection/v4/config/ValidateRecoveryPointResult.js +320 -0
  381. package/dist/lib/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.d.ts +59 -0
  382. package/dist/lib/models/dataprotection/v4/config/ValidateRestoreVmRecoveryPointApiResponse.js +336 -0
  383. package/dist/lib/models/dataprotection/v4/config/ValidationSeverity.d.ts +19 -0
  384. package/dist/lib/models/dataprotection/v4/config/ValidationSeverity.js +86 -0
  385. package/dist/lib/models/dataprotection/v4/config/Vm.d.ts +140 -0
  386. package/dist/lib/models/dataprotection/v4/config/Vm.js +545 -0
  387. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.d.ts +70 -0
  388. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestorationSpec.js +319 -0
  389. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.d.ts +59 -0
  390. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreApiResponse.js +318 -0
  391. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.d.ts +76 -0
  392. package/dist/lib/models/dataprotection/v4/config/VmRecoveryPointRestoreOverride.js +320 -0
  393. package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPoint.d.ts +98 -0
  394. package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPoint.js +405 -0
  395. package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPointProjection.d.ts +9 -0
  396. package/dist/lib/models/dataprotection/v4/config/VmSubRecoveryPointProjection.js +132 -0
  397. package/dist/lib/models/dataprotection/v4/config/VolumeGroup.d.ts +62 -0
  398. package/dist/lib/models/dataprotection/v4/config/VolumeGroup.js +285 -0
  399. package/dist/lib/models/dataprotection/v4/config/VolumeGroupOverrideSpec.d.ts +50 -0
  400. package/dist/lib/models/dataprotection/v4/config/VolumeGroupOverrideSpec.js +247 -0
  401. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.d.ts +49 -0
  402. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPoint.js +295 -0
  403. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.d.ts +59 -0
  404. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointApiResponse.js +314 -0
  405. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.d.ts +59 -0
  406. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointListApiResponse.js +336 -0
  407. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.d.ts +62 -0
  408. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestorationSpec.js +288 -0
  409. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.d.ts +59 -0
  410. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreApiResponse.js +318 -0
  411. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.d.ts +66 -0
  412. package/dist/lib/models/dataprotection/v4/config/VolumeGroupRecoveryPointRestoreOverride.js +284 -0
  413. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.d.ts +98 -0
  414. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPoint.js +407 -0
  415. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.d.ts +9 -0
  416. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSubRecoveryPointProjection.js +132 -0
  417. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSyncContext.d.ts +58 -0
  418. package/dist/lib/models/dataprotection/v4/config/VolumeGroupSyncContext.js +279 -0
  419. package/dist/lib/models/dataprotection/v4/config/VpcReference.d.ts +69 -0
  420. package/dist/lib/models/dataprotection/v4/config/VpcReference.js +285 -0
  421. package/dist/lib/models/dataprotection/v4/config/Witness.d.ts +66 -0
  422. package/dist/lib/models/dataprotection/v4/config/Witness.js +358 -0
  423. package/dist/lib/models/dataprotection/v4/config/WitnessApiResponse.d.ts +59 -0
  424. package/dist/lib/models/dataprotection/v4/config/WitnessApiResponse.js +314 -0
  425. package/dist/lib/models/dataprotection/v4/config/WitnessAvailabilityStatus.d.ts +19 -0
  426. package/dist/lib/models/dataprotection/v4/config/WitnessAvailabilityStatus.js +86 -0
  427. package/dist/lib/models/dataprotection/v4/error/AppMessage.d.ts +100 -0
  428. package/dist/lib/models/dataprotection/v4/error/AppMessage.js +422 -0
  429. package/dist/lib/models/dataprotection/v4/error/ErrorResponse.d.ts +48 -0
  430. package/dist/lib/models/dataprotection/v4/error/ErrorResponse.js +313 -0
  431. package/dist/lib/models/dataprotection/v4/error/SchemaValidationError.d.ts +88 -0
  432. package/dist/lib/models/dataprotection/v4/error/SchemaValidationError.js +394 -0
  433. package/dist/lib/models/dataprotection/v4/error/SchemaValidationErrorMessage.d.ts +68 -0
  434. package/dist/lib/models/dataprotection/v4/error/SchemaValidationErrorMessage.js +311 -0
  435. package/dist/lib/models/prism/v4/config/TaskReference.d.ts +50 -0
  436. package/dist/lib/models/prism/v4/config/TaskReference.js +260 -0
  437. package/dist/lib/models/storage/v4/config/Task.d.ts +50 -0
  438. package/dist/lib/models/storage/v4/config/Task.js +254 -0
  439. package/dist/lib/models/validation/ValidationError.d.ts +13 -0
  440. package/dist/lib/models/validation/ValidationError.js +62 -0
  441. package/dist/lib/models/validation/ValidationScopes.d.ts +9 -0
  442. package/dist/lib/models/validation/ValidationScopes.js +39 -0
  443. package/dist/lib/utils/ValidationUtils.d.ts +13 -0
  444. package/dist/lib/utils/ValidationUtils.js +87 -0
  445. package/package.json +52 -0
@@ -0,0 +1,1056 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ApiClient = void 0;
7
+ var _superagent = _interopRequireDefault(require("superagent"));
8
+ var _Paginable = _interopRequireDefault(require("./Paginable"));
9
+ var _uuid = require("uuid");
10
+ var _superagentRetryDelay = _interopRequireDefault(require("superagent-retry-delay"));
11
+ var _https = _interopRequireDefault(require("https"));
12
+ var _fs2 = _interopRequireDefault(require("fs"));
13
+ var _class;
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
20
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
22
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
26
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
27
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
28
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
29
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
30
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
31
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
32
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
33
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
34
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
35
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } /*
36
+ * Nutanix Dataprotection Versioned APIs
37
+ *
38
+ * OpenAPI spec version: 4.0.1-alpha-4
39
+ *
40
+ * NOTE: This class is auto generated by the Open API Dev Platform.
41
+ *
42
+ * Open API Dev Platform Codegen version: 16.8.0.6343-RELEASE
43
+ *
44
+ * Do not edit the class manually.
45
+ *
46
+ */
47
+ (0, _superagentRetryDelay["default"])(_superagent["default"]);
48
+ /**
49
+ * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
50
+ * application to use this class directly - the *Api and model classes provide the public API for the service. The
51
+ * contents of this file should be regarded as internal but are documented for completeness.
52
+ * @module ApiClient
53
+ * @version 4.0.1-alpha-4
54
+ */
55
+ var _protocol = /*#__PURE__*/new WeakMap();
56
+ var _cookie = /*#__PURE__*/new WeakMap();
57
+ var _logger = /*#__PURE__*/new WeakMap();
58
+ var _verifySslFlag = /*#__PURE__*/new WeakMap();
59
+ var _defaultConnectTimeout = /*#__PURE__*/new WeakMap();
60
+ var _defaultReadTimeout = /*#__PURE__*/new WeakMap();
61
+ var _defaultMaxTimeout = /*#__PURE__*/new WeakMap();
62
+ var _LOG_LEVEL = /*#__PURE__*/new WeakMap();
63
+ var _isJsonMime = /*#__PURE__*/new WeakSet();
64
+ var _jsonPreferredMime = /*#__PURE__*/new WeakSet();
65
+ var _isFileParam = /*#__PURE__*/new WeakSet();
66
+ var _normalizeParams = /*#__PURE__*/new WeakSet();
67
+ var _applyAuthToRequest = /*#__PURE__*/new WeakSet();
68
+ var _wrapErrorInResponse = /*#__PURE__*/new WeakSet();
69
+ var _deserialize = /*#__PURE__*/new WeakSet();
70
+ var _paginateIfNeeded = /*#__PURE__*/new WeakSet();
71
+ var _getValidTimeout = /*#__PURE__*/new WeakSet();
72
+ var _updateCookies = /*#__PURE__*/new WeakSet();
73
+ var _attachCookies = /*#__PURE__*/new WeakSet();
74
+ var _log = /*#__PURE__*/new WeakSet();
75
+ var _skipLogging = /*#__PURE__*/new WeakSet();
76
+ var _getLocalDateTime = /*#__PURE__*/new WeakSet();
77
+ var _flatten = /*#__PURE__*/new WeakSet();
78
+ var ApiClient = /*#__PURE__*/function () {
79
+ /**
80
+ * @alias module:ApiClient
81
+ * @class
82
+ */
83
+ function ApiClient() {
84
+ _classCallCheck(this, ApiClient);
85
+ // A mapper function to flatten a simple non-nested (key:value) object to string
86
+ _classPrivateMethodInitSpec(this, _flatten);
87
+ _classPrivateMethodInitSpec(this, _getLocalDateTime);
88
+ _classPrivateMethodInitSpec(this, _skipLogging);
89
+ _classPrivateMethodInitSpec(this, _log);
90
+ // If enabled, attach saved cookies to request
91
+ _classPrivateMethodInitSpec(this, _attachCookies);
92
+ // If enabled, update cookie information to reuse in subsequent requests for a valid response
93
+ _classPrivateMethodInitSpec(this, _updateCookies);
94
+ // Gets a valid timeout
95
+ // 1. Sets to provided default timeout in case invalid value is passed
96
+ // 2. Sets to default max value of 30 minutes in case a value of more than 30 minutes is passed
97
+ _classPrivateMethodInitSpec(this, _getValidTimeout);
98
+ /**
99
+ * Set pagination data if response is a Paginable object
100
+ * @param {Object} data The response data already passed through deserialize
101
+ * @param {String} path The path given to callApi method
102
+ * @param {Object.<String, Object>} queryParams The queryParams given to callApi method
103
+ */
104
+ _classPrivateMethodInitSpec(this, _paginateIfNeeded);
105
+ /**
106
+ * Deserializes an HTTP response body into a value of the specified type.
107
+ * @param {Object} response A SuperAgent response object.
108
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
109
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
110
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
111
+ * all properties on <code>data<code> will be converted to this type.
112
+ * @returns A value of the specified type.
113
+ */
114
+ _classPrivateMethodInitSpec(this, _deserialize);
115
+ /**
116
+ * Wraps errors in generic response format.
117
+ * @param {Object} error object encountered during request.
118
+ * @returns an error object with wrapped response within error.data .
119
+ */
120
+ _classPrivateMethodInitSpec(this, _wrapErrorInResponse);
121
+ /*
122
+ * Applies authentication headers to the request.
123
+ * @param {Object} request The request object created by a <code>superagent()</code> call.
124
+ * @param {Array.<String>} authNames An array of authentication method names.
125
+ */
126
+ _classPrivateMethodInitSpec(this, _applyAuthToRequest);
127
+ /*
128
+ * Normalizes parameter values:
129
+ * <ul>
130
+ * <li>remove nils</li>
131
+ * <li>keep files and arrays</li>
132
+ * <li>format to string with `paramToString` for other cases</li>
133
+ * </ul>
134
+ * @param {Object.<String, Object>} params The parameters as object properties.
135
+ * @returns {Object.<String, Object>} normalized parameters.
136
+ */
137
+ _classPrivateMethodInitSpec(this, _normalizeParams);
138
+ /*
139
+ * Checks whether the given parameter value represents file-like content.
140
+ * @param param The parameter to check.
141
+ * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
142
+ */
143
+ _classPrivateMethodInitSpec(this, _isFileParam);
144
+ /*
145
+ * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
146
+ * @param {Array.<String>} contentTypes
147
+ * @returns {String} The chosen content type, preferring JSON.
148
+ */
149
+ _classPrivateMethodInitSpec(this, _jsonPreferredMime);
150
+ /*
151
+ * Checks whether the given content type represents JSON.<br>
152
+ * JSON content type examples:<br>
153
+ * <ul>
154
+ * <li>application/json</li>
155
+ * <li>application/json; charset=UTF8</li>
156
+ * <li>APPLICATION/JSON</li>
157
+ * </ul>
158
+ * @param {String} contentType The MIME content type to check.
159
+ * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
160
+ */
161
+ _classPrivateMethodInitSpec(this, _isJsonMime);
162
+ // PRIVATE VARIABLES
163
+ _classPrivateFieldInitSpec(this, _protocol, {
164
+ writable: true,
165
+ value: void 0
166
+ });
167
+ _classPrivateFieldInitSpec(this, _cookie, {
168
+ writable: true,
169
+ value: void 0
170
+ });
171
+ _classPrivateFieldInitSpec(this, _logger, {
172
+ writable: true,
173
+ value: void 0
174
+ });
175
+ _classPrivateFieldInitSpec(this, _verifySslFlag, {
176
+ writable: true,
177
+ value: void 0
178
+ });
179
+ _classPrivateFieldInitSpec(this, _defaultConnectTimeout, {
180
+ writable: true,
181
+ value: void 0
182
+ });
183
+ _classPrivateFieldInitSpec(this, _defaultReadTimeout, {
184
+ writable: true,
185
+ value: void 0
186
+ });
187
+ _classPrivateFieldInitSpec(this, _defaultMaxTimeout, {
188
+ writable: true,
189
+ value: void 0
190
+ });
191
+ _classPrivateFieldInitSpec(this, _LOG_LEVEL, {
192
+ writable: true,
193
+ value: void 0
194
+ });
195
+ _classPrivateFieldSet(this, _LOG_LEVEL, Object.freeze({
196
+ DEBUG: {
197
+ key: "DEBUG",
198
+ value: Symbol(0)
199
+ },
200
+ INFO: {
201
+ key: "INFO",
202
+ value: Symbol(1)
203
+ },
204
+ WARN: {
205
+ key: "WARN",
206
+ value: Symbol(2)
207
+ },
208
+ ERROR: {
209
+ key: "ERROR",
210
+ value: Symbol(3)
211
+ }
212
+ }));
213
+
214
+ /**
215
+ * URI scheme for connecting to the cluster (HTTP or HTTPS using SSL/TLS)
216
+ * @type {String}
217
+ * @default https
218
+ */
219
+ this.scheme = 'https';
220
+
221
+ /**
222
+ * The hostname of the URL against which to resolve every API call's (relative) path.
223
+ * @type {String}
224
+ * @default localhost
225
+ */
226
+ this.host = typeof self === 'undefined' ? 'localhost' : self.location.hostname;
227
+
228
+ /**
229
+ * The port of the base URL.
230
+ * @type {String}
231
+ * @default 9440
232
+ */
233
+ this.port = typeof self === 'undefined' ? '9440' : self.location.port;
234
+
235
+ /**
236
+ * The authentication methods to be included for all API calls.
237
+ * @type {Array.<String>}
238
+ */
239
+ this.authentications = {
240
+ 'basicAuthScheme': {
241
+ type: 'basic'
242
+ }
243
+ };
244
+
245
+ /**
246
+ * The default HTTP headers to be included for all API calls.
247
+ * @type {Array.<String>}
248
+ * @default {}
249
+ */
250
+ this.defaultHeaders = {};
251
+ _classPrivateFieldSet(this, _defaultConnectTimeout, 30000);
252
+ _classPrivateFieldSet(this, _defaultReadTimeout, 30000);
253
+ _classPrivateFieldSet(this, _defaultMaxTimeout, 1800000);
254
+
255
+ /**
256
+ * The default HTTP read timeout in milliseconds for all API calls.
257
+ * @type {Number}
258
+ * @default 30000
259
+ */
260
+ this.readTimeout = _classPrivateFieldGet(this, _defaultReadTimeout);
261
+
262
+ /**
263
+ * The default HTTP connection timeout in milliseconds for all API calls.
264
+ * @type {Number}
265
+ * @default 30000
266
+ */
267
+ this.connectTimeout = _classPrivateFieldGet(this, _defaultConnectTimeout);
268
+
269
+ /**
270
+ * If set to false an additional timestamp parameter is added to all API GET calls to
271
+ * prevent browser caching
272
+ * @type {Boolean}
273
+ * @default true
274
+ */
275
+ this.cache = true;
276
+
277
+ /**
278
+ * Saved Cookies
279
+ * @default null
280
+ */
281
+ _classPrivateFieldSet(this, _cookie, null);
282
+
283
+ /**
284
+ * The maximum number of retry attempts to be made by the client
285
+ * in case of server error.
286
+ * @type {Number}
287
+ * @default 5
288
+ */
289
+ this.maxRetryAttempts = 5;
290
+
291
+ /**
292
+ * The delay period (in milliseconds) between two consecutive retry attempts
293
+ * @type {Number}
294
+ * @default 3000
295
+ */
296
+ this.retryInterval = 3000;
297
+ if (typeof self === 'undefined') {
298
+ this.agent = new _superagent["default"].agent();
299
+ }
300
+
301
+ /**
302
+ * Allow user to override superagent agent
303
+ */
304
+ this.requestAgent = null;
305
+
306
+ /**
307
+ * Allow SDK to print debug logs
308
+ */
309
+ this.debug = false;
310
+ _classPrivateFieldSet(this, _logger, null);
311
+
312
+ /**
313
+ * Username for basic auth
314
+ */
315
+ this.username = null;
316
+
317
+ /**
318
+ * Password for basic auth
319
+ */
320
+ this.password = null;
321
+ _classPrivateFieldSet(this, _verifySslFlag, true);
322
+
323
+ /*
324
+ * Log file to write activity logs
325
+ */
326
+ this.loggerFile = null;
327
+ }
328
+
329
+ /**
330
+ * Enable/Disable SSL Verification
331
+ * @param verifySsl (boolean)
332
+ */
333
+ _createClass(ApiClient, [{
334
+ key: "verifySsl",
335
+ get: function get() {
336
+ return _classPrivateFieldGet(this, _verifySslFlag);
337
+ }
338
+
339
+ /**
340
+ * Configure log file to write activity logs
341
+ * @param logfile The destination file (write stream / string)
342
+ */,
343
+ set: function set(verifySsl) {
344
+ if (verifySsl) {
345
+ this.requestAgent = null;
346
+ } else {
347
+ this.requestAgent = new _https["default"].Agent({
348
+ rejectUnauthorized: false
349
+ });
350
+ }
351
+ _classPrivateFieldSet(this, _verifySslFlag, verifySsl);
352
+ }
353
+ }, {
354
+ key: "loggerFile",
355
+ set: function set(logfile) {
356
+ if (logfile !== null && typeof logfile !== 'undefined') {
357
+ if (typeof logfile === 'string' || logfile instanceof String) {
358
+ logfile = _fs2["default"].createWriteStream(logfile, {
359
+ flags: 'a'
360
+ });
361
+ }
362
+ _classPrivateFieldSet(this, _logger, new console.Console({
363
+ stdout: logfile,
364
+ stderr: logfile
365
+ }));
366
+ }
367
+ }
368
+
369
+ /**
370
+ * Adds key value pair to default headers map, (to be added to every API call request)
371
+ * @param {String} key The key
372
+ * @param {String} value The corresponding value
373
+ */
374
+ }, {
375
+ key: "addDefaultHeader",
376
+ value: function addDefaultHeader(key, value) {
377
+ if (key === "Authorization") {
378
+ _classPrivateFieldSet(this, _cookie, null);
379
+ }
380
+ this.defaultHeaders[key] = value;
381
+ }
382
+
383
+ /*
384
+ * Returns a string representation for an actual parameter.
385
+ * @param param The actual parameter.
386
+ * @returns {String} The string representation of <code>param</code>.
387
+ */
388
+ }, {
389
+ key: "paramToString",
390
+ value: function paramToString(param) {
391
+ if (param == undefined || param == null) {
392
+ return '';
393
+ }
394
+ if (param instanceof Date) {
395
+ return param.toJSON();
396
+ }
397
+ return param.toString();
398
+ }
399
+ }, {
400
+ key: "buildUrl",
401
+ value: function buildUrl(path, pathParams) {
402
+ var _this = this;
403
+ if (!path.match(/^\//)) {
404
+ path = '/' + path;
405
+ }
406
+
407
+ // The protocol of the base URL, including the colon (:).
408
+ _classPrivateFieldSet(this, _protocol, typeof self === 'undefined' ? this.scheme + ':' : self.location.protocol);
409
+ var basePath = ''; //default
410
+ if (_classPrivateFieldGet(this, _protocol) !== '' && this.host !== '' && this.port !== '') {
411
+ basePath = _classPrivateFieldGet(this, _protocol) + '\/\/' + this.host + ':' + this.port;
412
+ } else if (typeof self !== "undefined") {
413
+ basePath = self.origin;
414
+ }
415
+ var url = basePath + path;
416
+ url = url.replace(/\{([\w-]+)\}/g, function (fullMatch, key) {
417
+ var value;
418
+ if (pathParams.hasOwnProperty(key)) {
419
+ value = _this.paramToString(pathParams[key]);
420
+ } else {
421
+ value = fullMatch;
422
+ }
423
+ return encodeURIComponent(value);
424
+ });
425
+ return url;
426
+ }
427
+ }, {
428
+ key: "buildCollectionParam",
429
+ value:
430
+ /*
431
+ * Builds a string representation of an array-type actual parameter, according to the given collection format.
432
+ * @param {Array} param An array parameter.
433
+ * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
434
+ * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
435
+ * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
436
+ */
437
+ function buildCollectionParam(param, collectionFormat) {
438
+ if (param == null) {
439
+ return null;
440
+ }
441
+ switch (collectionFormat) {
442
+ case 'csv':
443
+ return param.map(this.paramToString).join(',');
444
+ case 'ssv':
445
+ return param.map(this.paramToString).join(' ');
446
+ case 'tsv':
447
+ return param.map(this.paramToString).join('\t');
448
+ case 'pipes':
449
+ return param.map(this.paramToString).join('|');
450
+ case 'multi':
451
+ //return the array directly as SuperAgent will handle it as expected
452
+ return param.map(this.paramToString);
453
+ default:
454
+ throw new Error('Unknown collection format: ' + collectionFormat);
455
+ }
456
+ }
457
+ }, {
458
+ key: "addEtagToReservedMap",
459
+ value: function addEtagToReservedMap(response, data) {
460
+ if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("etag")) {
461
+ var etagRef = response.headers.etag;
462
+ if (data.getData() !== undefined) {
463
+ if (Array.isArray(data.getData()) && data.getData().length > 0) {
464
+ var _iterator = _createForOfIteratorHelper(data.getData()),
465
+ _step;
466
+ try {
467
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
468
+ var item = _step.value;
469
+ if (item.hasOwnProperty("$reserved") && item.get$Reserved() !== undefined) {
470
+ item.get$Reserved()["ETag"] = etagRef;
471
+ }
472
+ }
473
+ } catch (err) {
474
+ _iterator.e(err);
475
+ } finally {
476
+ _iterator.f();
477
+ }
478
+ } else if (data.getData().hasOwnProperty("$reserved") && data.getData().get$Reserved() !== undefined) {
479
+ data.getData().get$Reserved()["ETag"] = etagRef;
480
+ }
481
+ }
482
+ }
483
+ return data;
484
+ }
485
+
486
+ /**
487
+ * Get ETag from an object if exists.
488
+ * The ETag is usually provided in the response of the GET API calls,
489
+ * which can further be used in other HTTP operations.
490
+ *
491
+ * @param object Object from which ETag needs to be retrieved
492
+ * @returns {(String|null)} returns ETag header in the object if it's an API response object, otherwise null
493
+ */
494
+ }, {
495
+ key: "callApi",
496
+ value:
497
+ /**
498
+ * Invokes the REST service using the supplied settings and parameters.
499
+ * @param {String} path The base URL to invoke.
500
+ * @param {String} httpMethod The HTTP method to use.
501
+ * @param {Object.<String, String>} pathParams A map of path parameters and their values.
502
+ * @param {Object.<String, Object>} queryParams A map of query parameters and their values.
503
+ * @param {Object.<String, Object>} headerParams A map of header parameters and their values.
504
+ * @param {Object.<String, Object>} formParams A map of form parameters and their values.
505
+ * @param {Object} bodyParam The value to pass as the request body.
506
+ * @param {Array.<String>} authNames An array of authentication type names.
507
+ * @param {Array.<String>} contentTypes An array of request MIME types.
508
+ * @param {Array.<String>} accepts An array of acceptable response MIME types.
509
+ * @param {(String|Array|Object|Function)} returnType The required type to return; can be a string for simple types or the
510
+ * constructor for a complex type.
511
+ * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object.
512
+ */
513
+ function callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType) {
514
+ var _this2 = this;
515
+ var url = this.buildUrl(path, pathParams);
516
+ var request = (0, _superagent["default"])(httpMethod, url);
517
+
518
+ // override request callback to retry only required status codes
519
+ request.oldCallback = request.callback;
520
+ request.callback = function (err, res) {
521
+ if (res && res.status) {
522
+ var status = res.status;
523
+ if (status >= 400 && !(status === 401 || status === 408 || status === 503 || status === 504)) {
524
+ this._maxRetries = 0;
525
+ }
526
+ if (res.status === 401) {
527
+ this.unset("Cookie");
528
+ this._maxRetries = 1;
529
+ }
530
+ }
531
+ this.oldCallback(err, res);
532
+ };
533
+
534
+ // apply authentications
535
+ _classPrivateMethodGet(this, _applyAuthToRequest, _applyAuthToRequest2).call(this, request, authNames);
536
+
537
+ // set query parameters
538
+ if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
539
+ queryParams['_'] = new Date().getTime();
540
+ }
541
+ request.query(_classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, queryParams));
542
+
543
+ // set header parameters
544
+ request.set(this.defaultHeaders).set(_classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, headerParams));
545
+ if ((this.defaultHeaders['NTNX-Request-Id'] === null || this.defaultHeaders['NTNX-Request-Id'] === undefined) && (headerParams['NTNX-Request-Id'] === null || headerParams['NTNX-Request-Id'] === undefined)) {
546
+ var requestId = (0, _uuid.v4)();
547
+ request.set(_classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, {
548
+ 'NTNX-Request-Id': requestId
549
+ }));
550
+ }
551
+
552
+ // Set User-Agent header only if it is not a browser environment
553
+ var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
554
+ if (!isBrowser) {
555
+ request.set(_classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, {
556
+ 'User-Agent': 'Nutanix-dataprotection-js-client/4.0.1-alpha.4'
557
+ }));
558
+ }
559
+
560
+ // set requestAgent if it is set by user
561
+ if (this.requestAgent) {
562
+ request.agent(this.requestAgent);
563
+ }
564
+
565
+ // set request timeouts
566
+ var timeoutOptions = {};
567
+ timeoutOptions["response"] = _classPrivateMethodGet(this, _getValidTimeout, _getValidTimeout2).call(this, this.connectTimeout, _classPrivateFieldGet(this, _defaultConnectTimeout));
568
+ timeoutOptions["deadline"] = _classPrivateMethodGet(this, _getValidTimeout, _getValidTimeout2).call(this, this.readTimeout, _classPrivateFieldGet(this, _defaultReadTimeout));
569
+ request.timeout(timeoutOptions);
570
+ var contentType = _classPrivateMethodGet(this, _jsonPreferredMime, _jsonPreferredMime2).call(this, contentTypes);
571
+ if (contentType) {
572
+ // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
573
+ if (contentType != 'multipart/form-data') {
574
+ request.type(contentType);
575
+ }
576
+ } else if (!request.header['Content-Type']) {
577
+ request.type('application/json');
578
+ }
579
+ if (contentType === 'application/x-www-form-urlencoded') {
580
+ request.send(_classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, formParams));
581
+ } else if (contentType == 'multipart/form-data') {
582
+ var _formParams = _classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, formParams);
583
+ for (var key in _formParams) {
584
+ if (_formParams.hasOwnProperty(key)) {
585
+ if (_classPrivateMethodGet(this, _isFileParam, _isFileParam2).call(this, _formParams[key])) {
586
+ // file field
587
+ request.attach(key, _formParams[key]);
588
+ } else {
589
+ request.field(key, _formParams[key]);
590
+ }
591
+ }
592
+ }
593
+ } else if (bodyParam) {
594
+ request.send(bodyParam);
595
+ }
596
+ var accept = _classPrivateMethodGet(this, _jsonPreferredMime, _jsonPreferredMime2).call(this, accepts);
597
+ if (accept) {
598
+ request.accept(accept);
599
+ }
600
+ if (returnType === 'Blob') {
601
+ request.responseType('blob');
602
+ } else if (returnType === 'String') {
603
+ request.responseType('string');
604
+ }
605
+ _classPrivateMethodGet(this, _attachCookies, _attachCookies2).call(this, request);
606
+ _classPrivateMethodGet(this, _log, _log2).call(this, _classPrivateFieldGet(this, _LOG_LEVEL).INFO, null, "Request URL :", httpMethod, url);
607
+ _classPrivateMethodGet(this, _log, _log2).call(this, _classPrivateFieldGet(this, _LOG_LEVEL).DEBUG, _classPrivateMethodGet(this, _flatten, _flatten2), "Request Headers :", typeof request.header === "undefined" ? "" : request.header);
608
+ _classPrivateMethodGet(this, _log, _log2).call(this, _classPrivateFieldGet(this, _LOG_LEVEL).DEBUG, null, "Request Body :", typeof request._data === "undefined" ? "" : request._data);
609
+ return new Promise(function (resolve, reject) {
610
+ request.on('error', function (err) {
611
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Caught the following error :", err);
612
+ }).retry(_this2.maxRetryAttempts, _this2.retryInterval, []).then(function (response) {
613
+ try {
614
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).INFO, null, "Response Status :", response.status);
615
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, _classPrivateMethodGet(_this2, _flatten, _flatten2), "Response Headers :", response.headers);
616
+ _classPrivateMethodGet(_this2, _updateCookies, _updateCookies2).call(_this2, response || {});
617
+ var data = _classPrivateMethodGet(_this2, _deserialize, _deserialize2).call(_this2, response, returnType);
618
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Response Body :", data);
619
+ if (response.ok) {
620
+ _this2.addEtagToReservedMap(response, data);
621
+ _classPrivateMethodGet(_this2, _paginateIfNeeded, _paginateIfNeeded2).call(_this2, data, path, queryParams);
622
+ resolve({
623
+ data: data,
624
+ response: response
625
+ });
626
+ } else {
627
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).ERROR, null, data);
628
+ reject(_objectSpread(_objectSpread({}, response.error), {}, {
629
+ data: data
630
+ }));
631
+ }
632
+ } catch (err) {
633
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Caught error while processing response!");
634
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).ERROR, null, err);
635
+ err.data = _classPrivateMethodGet(_this2, _wrapErrorInResponse, _wrapErrorInResponse2).call(_this2, err);
636
+ reject(err);
637
+ }
638
+ })["catch"](function (error) {
639
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).DEBUG, null, "Caught error during the request!");
640
+ _classPrivateMethodGet(_this2, _log, _log2).call(_this2, _classPrivateFieldGet(_this2, _LOG_LEVEL).ERROR, null, error);
641
+ if (error.response !== null && typeof error.response !== 'undefined') {
642
+ error.data = _classPrivateMethodGet(_this2, _deserialize, _deserialize2).call(_this2, error.response, returnType);
643
+ } else {
644
+ error.data = _classPrivateMethodGet(_this2, _wrapErrorInResponse, _wrapErrorInResponse2).call(_this2, error);
645
+ }
646
+ reject(error);
647
+ });
648
+ });
649
+ }
650
+ }], [{
651
+ key: "getEtag",
652
+ value: function getEtag(object) {
653
+ var etag = null;
654
+ if (object !== undefined) {
655
+ if (object.hasOwnProperty('$reserved') && object.get$Reserved() !== undefined) {
656
+ etag = this.getValueForCaseInsensitiveKeyMatch(object.get$Reserved(), 'ETag');
657
+ }
658
+ if (etag == null && object.hasOwnProperty("data") && object.getData().hasOwnProperty('$reserved') && object.getData().get$Reserved() !== undefined) {
659
+ etag = this.getValueForCaseInsensitiveKeyMatch(object.getData().get$Reserved(), 'ETag');
660
+ }
661
+ }
662
+ return etag;
663
+ }
664
+ }, {
665
+ key: "getValueForCaseInsensitiveKeyMatch",
666
+ value: function getValueForCaseInsensitiveKeyMatch(object, key) {
667
+ if (object && key) {
668
+ var searchKey = key.toLowerCase();
669
+ var matchedKey = Object.keys(object).find(function (key) {
670
+ return key.toLowerCase() === searchKey;
671
+ });
672
+ return matchedKey ? object[matchedKey] : null;
673
+ }
674
+ return null;
675
+ }
676
+ }, {
677
+ key: "addEtagReferenceToHeader",
678
+ value: function addEtagReferenceToHeader(bodyParam, headerParams) {
679
+ // set If-Match header from postBody $reserved map
680
+ if (typeof bodyParam !== 'undefined' && bodyParam !== null) {
681
+ if (bodyParam.hasOwnProperty('$reserved') && bodyParam.$reserved.hasOwnProperty('ETag')) {
682
+ var eTagReference = bodyParam.$reserved['ETag'];
683
+ if (typeof eTagReference !== 'undefined' && eTagReference !== null && eTagReference !== "") {
684
+ headerParams['If-Match'] = eTagReference;
685
+ }
686
+ }
687
+ }
688
+ }
689
+
690
+ /*
691
+ * Parses an ISO-8601 string representation of a date value.
692
+ * @param {String} str The date value as a string.
693
+ * @returns {Date} The parsed date object.
694
+ */
695
+ }, {
696
+ key: "parseDate",
697
+ value: function parseDate(str) {
698
+ return new Date(str);
699
+ }
700
+
701
+ /*
702
+ * Parses queryParams and path to find a given query param value
703
+ * @param {String} path The path given to callApi method
704
+ * @param {Object.<String, Object>} queryParams The queryParams given to callApi method
705
+ * @param {String} param Parameter name to look for
706
+ * @param {String} defaultValue The default value for the missing param if not present
707
+ * @returns {String} The value of given parameter
708
+ */
709
+ }, {
710
+ key: "parseQueryParam",
711
+ value: function parseQueryParam(path, queryParams, param, defaultValue) {
712
+ var value = null;
713
+ if (typeof queryParams !== 'undefined' && queryParams.hasOwnProperty(param)) {
714
+ value = queryParams[param];
715
+ }
716
+ if (value === null && (typeof path === 'string' || path instanceof String)) {
717
+ var escapedParam = param.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
718
+ var regexResult = path.match(new RegExp("".concat(escapedParam, "=([0-9]+)")));
719
+ if (regexResult) {
720
+ value = regexResult[1];
721
+ }
722
+ }
723
+ if (value === null) {
724
+ value = defaultValue;
725
+ }
726
+ return value;
727
+ }
728
+
729
+ /**
730
+ * Converts a value to the specified type.
731
+ * @param {(String|Object)} data The data to convert, as a string or object.
732
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
733
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
734
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
735
+ * all properties on <code>data<code> will be converted to this type.
736
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
737
+ */
738
+ }, {
739
+ key: "convertToType",
740
+ value: function convertToType(data, type) {
741
+ if (data === null || data === undefined) return data;
742
+ switch (type) {
743
+ case 'Boolean':
744
+ return Boolean(data);
745
+ case 'Integer':
746
+ return parseInt(data, 10);
747
+ case 'Number':
748
+ return parseFloat(data);
749
+ case 'String':
750
+ return String(data);
751
+ case 'Date':
752
+ return ApiClient.parseDate(String(data));
753
+ case 'Blob':
754
+ return data;
755
+ default:
756
+ if (type === Object) {
757
+ // generic object, return directly
758
+ return data;
759
+ } else if (typeof type === 'function') {
760
+ // for model type like: User
761
+ return type.constructFromObject(data);
762
+ } else if (Array.isArray(type)) {
763
+ // for array type like: ['String']
764
+ var itemType = type[0];
765
+ return data.map(function (item) {
766
+ return ApiClient.convertToType(item, itemType);
767
+ });
768
+ } else if (_typeof(type) === 'object') {
769
+ // for plain object type like: {'String': 'Integer'}
770
+ var keyType, valueType;
771
+ for (var k in type) {
772
+ if (type.hasOwnProperty(k)) {
773
+ keyType = k;
774
+ valueType = type[k];
775
+ break;
776
+ }
777
+ }
778
+ var result = {};
779
+ for (var k in data) {
780
+ if (data.hasOwnProperty(k)) {
781
+ var key = ApiClient.convertToType(k, keyType);
782
+ var value = ApiClient.convertToType(data[k], valueType);
783
+ result[key] = value;
784
+ }
785
+ }
786
+ return result;
787
+ } else {
788
+ // for unknown type, return the data directly
789
+ return data;
790
+ }
791
+ }
792
+ }
793
+
794
+ /**
795
+ * Constructs a new map or array model from REST data.
796
+ * @param data {Object|Array} The REST data.
797
+ * @param obj {Object|Array} The target object or array.
798
+ */
799
+ }, {
800
+ key: "constructFromObject",
801
+ value: function constructFromObject(data, obj, itemType) {
802
+ if (Array.isArray(data)) {
803
+ for (var i = 0; i < data.length; i++) {
804
+ if (data.hasOwnProperty(i)) obj[i] = ApiClient.convertToType(data[i], itemType);
805
+ }
806
+ } else {
807
+ for (var k in data) {
808
+ if (data.hasOwnProperty(k)) obj[k] = ApiClient.convertToType(data[k], itemType);
809
+ }
810
+ }
811
+ }
812
+ }]);
813
+ return ApiClient;
814
+ }();
815
+ /**
816
+ * The default API client implementation.
817
+ * @type {ApiClient}
818
+ * @memberOf ApiClient
819
+ */
820
+ exports.ApiClient = ApiClient;
821
+ _class = ApiClient;
822
+ function _isJsonMime2(contentType) {
823
+ return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
824
+ }
825
+ function _jsonPreferredMime2(contentTypes) {
826
+ for (var i = 0; i < contentTypes.length; i++) {
827
+ if (_classPrivateMethodGet(this, _isJsonMime, _isJsonMime2).call(this, contentTypes[i])) {
828
+ return contentTypes[i];
829
+ }
830
+ }
831
+ return contentTypes[0];
832
+ }
833
+ function _isFileParam2(param) {
834
+ // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
835
+ if (typeof require === 'function') {
836
+ var _fs;
837
+ try {
838
+ _fs = require('fs');
839
+ } catch (err) {}
840
+ if (_fs && _fs.ReadStream && param instanceof _fs.ReadStream) {
841
+ return true;
842
+ }
843
+ }
844
+
845
+ // Buffer in Node.js
846
+ if (typeof Buffer === 'function' && param instanceof Buffer) {
847
+ return true;
848
+ }
849
+
850
+ // Blob in browser
851
+ if (typeof Blob === 'function' && param instanceof Blob) {
852
+ return true;
853
+ }
854
+
855
+ // File in browser (it seems File object is also instance of Blob, but keep this for safe)
856
+ if (typeof File === 'function' && param instanceof File) {
857
+ return true;
858
+ }
859
+ return false;
860
+ }
861
+ function _normalizeParams2(params) {
862
+ var newParams = {};
863
+ for (var key in params) {
864
+ if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
865
+ var value = params[key];
866
+ if (_classPrivateMethodGet(this, _isFileParam, _isFileParam2).call(this, value) || Array.isArray(value)) {
867
+ newParams[key] = value;
868
+ } else {
869
+ newParams[key] = this.paramToString(value);
870
+ }
871
+ }
872
+ }
873
+ return newParams;
874
+ }
875
+ function _applyAuthToRequest2(request, authNames) {
876
+ var _this3 = this;
877
+ authNames.forEach(function (authName) {
878
+ var auth = _this3.authentications[authName];
879
+ switch (auth.type) {
880
+ case 'basic':
881
+ if (auth.username || auth.password) {
882
+ request.auth(auth.username || '', auth.password || '');
883
+ } else if (_this3.username || _this3.password) {
884
+ request.auth(_this3.username || '', _this3.password || '');
885
+ }
886
+ _classPrivateMethodGet(_this3, _log, _log2).call(_this3, _classPrivateFieldGet(_this3, _LOG_LEVEL).DEBUG, null, "Basic Auth applied to request");
887
+ break;
888
+ case 'apiKey':
889
+ if (auth.apiKey) {
890
+ var data = {};
891
+ if (auth.apiKeyPrefix) {
892
+ data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey;
893
+ } else {
894
+ data[auth.name] = auth.apiKey;
895
+ }
896
+ if (auth['in'] === 'header') {
897
+ request.set(data);
898
+ } else {
899
+ request.query(data);
900
+ }
901
+ }
902
+ _classPrivateMethodGet(_this3, _log, _log2).call(_this3, _classPrivateFieldGet(_this3, _LOG_LEVEL).DEBUG, null, "apiKey applied to request");
903
+ break;
904
+ case 'oauth2':
905
+ if (auth.accessToken) {
906
+ request.set({
907
+ 'Authorization': 'Bearer ' + auth.accessToken
908
+ });
909
+ }
910
+ _classPrivateMethodGet(_this3, _log, _log2).call(_this3, _classPrivateFieldGet(_this3, _LOG_LEVEL).DEBUG, null, "oauth2 applied to request");
911
+ break;
912
+ default:
913
+ _classPrivateMethodGet(_this3, _log, _log2).call(_this3, _classPrivateFieldGet(_this3, _LOG_LEVEL).ERROR, null, "Unknown authentication type:", auth.type);
914
+ throw new Error('Unknown authentication type: ' + auth.type);
915
+ }
916
+ });
917
+ }
918
+ function _wrapErrorInResponse2(error) {
919
+ var response = {
920
+ data: {},
921
+ metadata: {}
922
+ };
923
+ response.data.status = error.status;
924
+ response.data.message = error.message;
925
+ }
926
+ function _deserialize2(response, returnType) {
927
+ if (response == null || returnType == null || response.status == 204) {
928
+ return null;
929
+ }
930
+
931
+ // Rely on SuperAgent for parsing response body.
932
+ // See http://visionmedia.github.io/superagent/#parsing-response-bodies
933
+ var data = response.body;
934
+ if (data == null || _typeof(data) === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) {
935
+ // SuperAgent does not always produce a body; use the unparsed response as a fallback
936
+ data = response.text;
937
+ }
938
+ return _class.convertToType(data, returnType);
939
+ }
940
+ function _paginateIfNeeded2(data, path, queryParams) {
941
+ // If response is not a Paginable instance, nothing to do
942
+ if (!(data instanceof _Paginable["default"])) {
943
+ return;
944
+ }
945
+ // Retrieve current page number, defaults to 0
946
+ var page = parseInt(this.constructor.parseQueryParam(path, queryParams, '$page', "0"), 10);
947
+ // Retrieve current limit (results per page) number, defaults to 50
948
+ var resultsPerPage = parseInt(this.constructor.parseQueryParam(path, queryParams, '$limit', "50"), 10);
949
+
950
+ // Populate pagination data
951
+ data.populatePaginationMetadata(this,
952
+ // current ApiClient instance
953
+ page, resultsPerPage);
954
+ }
955
+ function _getValidTimeout2(timeout, defaultTimeout) {
956
+ if (timeout <= 0) {
957
+ timeout = defaultTimeout;
958
+ } else if (timeout > _classPrivateFieldGet(this, _defaultMaxTimeout)) {
959
+ timeout = _classPrivateFieldGet(this, _defaultMaxTimeout);
960
+ }
961
+ return timeout;
962
+ }
963
+ function _updateCookies2(response) {
964
+ if (response.hasOwnProperty("headers") && response.headers.hasOwnProperty("set-cookie")) {
965
+ var finalCookie = "";
966
+ var cookieList = response.headers["set-cookie"];
967
+ if (cookieList.length > 0) {
968
+ // add all cookies separated by ;
969
+ var _iterator2 = _createForOfIteratorHelper(cookieList),
970
+ _step2;
971
+ try {
972
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
973
+ var cookieItem = _step2.value;
974
+ cookieItem = cookieItem.split(";")[0];
975
+ if (cookieItem.includes("=")) {
976
+ cookieItem.trim();
977
+ finalCookie = finalCookie.concat(cookieItem).concat(";");
978
+ }
979
+ }
980
+ // remove trailing ;
981
+ } catch (err) {
982
+ _iterator2.e(err);
983
+ } finally {
984
+ _iterator2.f();
985
+ }
986
+ if (finalCookie !== "") {
987
+ finalCookie = finalCookie.substr(0, finalCookie.length - 1);
988
+ }
989
+ }
990
+ _classPrivateFieldSet(this, _cookie, finalCookie);
991
+ _classPrivateMethodGet(this, _log, _log2).call(this, _classPrivateFieldGet(this, _LOG_LEVEL).DEBUG, null, "Retained cookie :", finalCookie);
992
+ } else {
993
+ _classPrivateFieldSet(this, _cookie, null);
994
+ }
995
+ }
996
+ function _attachCookies2(request) {
997
+ if (_classPrivateFieldGet(this, _cookie) != null) {
998
+ request.set(_classPrivateMethodGet(this, _normalizeParams, _normalizeParams2).call(this, {
999
+ 'Cookie': _classPrivateFieldGet(this, _cookie)
1000
+ }));
1001
+ }
1002
+ }
1003
+ function _log2(level, mapper) {
1004
+ for (var _len = arguments.length, messages = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1005
+ messages[_key - 2] = arguments[_key];
1006
+ }
1007
+ // Set default log level to INFO
1008
+ if (_typeof(level) !== "object" || !("key" in level) || !("value" in level) || _typeof(level["value"]) !== "symbol") {
1009
+ level = _classPrivateFieldGet(this, _LOG_LEVEL).INFO;
1010
+ }
1011
+ if (!_classPrivateMethodGet(this, _skipLogging, _skipLogging2).call(this, level)) {
1012
+ // Preprocess message to prefix with timestamp and log level
1013
+ messages = messages.map(function (message) {
1014
+ return typeof message === "string" ? message : mapper ? mapper(message) : JSON.stringify(message);
1015
+ });
1016
+ var message = messages.join(' ');
1017
+ message = _classPrivateMethodGet(this, _getLocalDateTime, _getLocalDateTime2).call(this) + ' ' + level.key + ' - ' + message;
1018
+ if (typeof _classPrivateFieldGet(this, _logger) !== "undefined" && _classPrivateFieldGet(this, _logger) !== null && typeof _classPrivateFieldGet(this, _logger).log === 'function') {
1019
+ _classPrivateFieldGet(this, _logger).log(message);
1020
+ } else {
1021
+ console.log(message);
1022
+ }
1023
+ }
1024
+ }
1025
+ function _skipLogging2(level) {
1026
+ // Skip logging if log level is DEBUG but debug is not enabled.
1027
+ return !this.debug && level === _classPrivateFieldGet(this, _LOG_LEVEL).DEBUG;
1028
+ }
1029
+ function _getLocalDateTime2() {
1030
+ // Current epoch UTC time in milliseconds
1031
+ var epochTime = Date.now();
1032
+
1033
+ // "getTimezoneOffset" returns the difference, in minutes, between a date as evaluated in the UTC time zone,
1034
+ // and the same date as evaluated in the local time zone.
1035
+ // if you are in timezone UTC-1, outputs 60
1036
+ // if you are in timezone UTC+3, outputs -180
1037
+ var timezoneOffsetInMinutes = new Date().getTimezoneOffset();
1038
+ var timezoneOffsetInMilliseconds = timezoneOffsetInMinutes * 60 * 1000;
1039
+
1040
+ // Create a new date with adjusted epoch time based on timezone offset
1041
+ var date = new Date(epochTime - timezoneOffsetInMilliseconds);
1042
+ return date.toISOString().slice(0, 23);
1043
+ }
1044
+ function _flatten2(obj) {
1045
+ if (_typeof(obj) !== "object") {
1046
+ return obj;
1047
+ }
1048
+ var output = '\n';
1049
+ if (obj) {
1050
+ Object.keys(obj).forEach(function (e) {
1051
+ output += e + '=[' + obj[e] + ']\n';
1052
+ });
1053
+ }
1054
+ return output === '\n' ? obj : output;
1055
+ }
1056
+ ApiClient.instance = new ApiClient();