@nexgencloud/hyperstack-sdk-javascript 1.22.0-alpha

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 (392) hide show
  1. package/README.md +640 -0
  2. package/dist/ApiClient.js +710 -0
  3. package/dist/api/AliveApi.js +75 -0
  4. package/dist/api/ApiKeyApi.js +209 -0
  5. package/dist/api/AssigningMemberRoleApi.js +136 -0
  6. package/dist/api/AuthApi.js +79 -0
  7. package/dist/api/BillingApi.js +974 -0
  8. package/dist/api/CalculateApi.js +94 -0
  9. package/dist/api/CallbacksApi.js +318 -0
  10. package/dist/api/ClusterEventsApi.js +85 -0
  11. package/dist/api/ClustersApi.js +269 -0
  12. package/dist/api/ComplianceApi.js +202 -0
  13. package/dist/api/CreditApi.js +77 -0
  14. package/dist/api/CustomerContractApi.js +183 -0
  15. package/dist/api/DashboardApi.js +79 -0
  16. package/dist/api/DeploymentApi.js +195 -0
  17. package/dist/api/EnvironmentApi.js +264 -0
  18. package/dist/api/FirewallAttachmentApi.js +92 -0
  19. package/dist/api/FirewallsApi.js +317 -0
  20. package/dist/api/FlavorApi.js +86 -0
  21. package/dist/api/FloatingIpApi.js +128 -0
  22. package/dist/api/GpuApi.js +79 -0
  23. package/dist/api/ImageApi.js +231 -0
  24. package/dist/api/InviteApi.js +162 -0
  25. package/dist/api/KeypairApi.js +224 -0
  26. package/dist/api/OrganizationApi.js +161 -0
  27. package/dist/api/PaymentApi.js +116 -0
  28. package/dist/api/PermissionApi.js +79 -0
  29. package/dist/api/PolicyApi.js +79 -0
  30. package/dist/api/PricebookApi.js +75 -0
  31. package/dist/api/ProfileApi.js +203 -0
  32. package/dist/api/RbacRoleApi.js +251 -0
  33. package/dist/api/RegionApi.js +79 -0
  34. package/dist/api/SecurityRulesApi.js +79 -0
  35. package/dist/api/SnapshotEventsApi.js +85 -0
  36. package/dist/api/SnapshotsApi.js +316 -0
  37. package/dist/api/StockApi.js +79 -0
  38. package/dist/api/TemplateApi.js +280 -0
  39. package/dist/api/UserApi.js +153 -0
  40. package/dist/api/UserDetailChoiceApi.js +79 -0
  41. package/dist/api/UserPermissionApi.js +120 -0
  42. package/dist/api/VirtualMachineApi.js +861 -0
  43. package/dist/api/VirtualMachineEventsApi.js +87 -0
  44. package/dist/api/VncUrlApi.js +132 -0
  45. package/dist/api/VolumeApi.js +295 -0
  46. package/dist/api/VolumeAttachmentApi.js +143 -0
  47. package/dist/index.js +2729 -0
  48. package/dist/model/AddUpdateFlavorOrganizationPayload.js +242 -0
  49. package/dist/model/AddUserInfoSuccessResponseModel.js +111 -0
  50. package/dist/model/AllocatedGPUCountGraph.js +97 -0
  51. package/dist/model/ApiKeyFields.js +129 -0
  52. package/dist/model/ApiKeyVerifyFields.js +117 -0
  53. package/dist/model/AssignRbacRolePayload.js +108 -0
  54. package/dist/model/AttachCallbackPayload.js +112 -0
  55. package/dist/model/AttachCallbackResponse.js +109 -0
  56. package/dist/model/AttachFirewallWithVM.js +112 -0
  57. package/dist/model/AttachFirewallsToVMPayload.js +113 -0
  58. package/dist/model/AttachVolumeFields.js +121 -0
  59. package/dist/model/AttachVolumes.js +130 -0
  60. package/dist/model/AttachVolumesPayload.js +89 -0
  61. package/dist/model/AuthGetTokenResponseModel.js +119 -0
  62. package/dist/model/AuthRequestLoginFields.js +101 -0
  63. package/dist/model/AuthRequestLoginResponseModel.js +111 -0
  64. package/dist/model/AuthUserFields.js +121 -0
  65. package/dist/model/AuthUserInfoResponseModel.js +111 -0
  66. package/dist/model/BillingImmuneResourcesResponse.js +111 -0
  67. package/dist/model/BillingResponse.js +130 -0
  68. package/dist/model/Billingmetricesfields.js +173 -0
  69. package/dist/model/Billingmetricesresponse.js +130 -0
  70. package/dist/model/ClusterEvents.js +130 -0
  71. package/dist/model/ClusterEventsFields.js +165 -0
  72. package/dist/model/ClusterFields.js +211 -0
  73. package/dist/model/ClusterListResponse.js +130 -0
  74. package/dist/model/ClusterResponse.js +111 -0
  75. package/dist/model/ClusterVersions.js +109 -0
  76. package/dist/model/CommonResponseModel.js +97 -0
  77. package/dist/model/ComplianceFields.js +125 -0
  78. package/dist/model/ComplianceModelFields.js +141 -0
  79. package/dist/model/CompliancePayload.js +166 -0
  80. package/dist/model/ComplianceResponse.js +111 -0
  81. package/dist/model/ContainerOverviewFields.js +117 -0
  82. package/dist/model/Contract.js +158 -0
  83. package/dist/model/ContractBillingHistory.js +105 -0
  84. package/dist/model/ContractBillingHistoryResponseAttributes.js +149 -0
  85. package/dist/model/ContractBillingHistoryResponseModel.js +111 -0
  86. package/dist/model/ContractChangePayload.js +166 -0
  87. package/dist/model/ContractDiscountPlanFields.js +165 -0
  88. package/dist/model/ContractEligibleInstanceFields.js +153 -0
  89. package/dist/model/ContractEligibleInstancesResponse.js +138 -0
  90. package/dist/model/ContractEventCreateModel.js +143 -0
  91. package/dist/model/ContractGPUAllocationGraphResponse.js +111 -0
  92. package/dist/model/ContractInstanceFields.js +153 -0
  93. package/dist/model/ContractInstancesResponse.js +130 -0
  94. package/dist/model/ContractResourcePayload.js +146 -0
  95. package/dist/model/ContractlBillingHistoryResponseMetrics.js +85 -0
  96. package/dist/model/CreateClusterPayload.js +206 -0
  97. package/dist/model/CreateContractFields.js +170 -0
  98. package/dist/model/CreateContractPayload.js +178 -0
  99. package/dist/model/CreateDiscountResponse.js +111 -0
  100. package/dist/model/CreateDiscountsPayload.js +192 -0
  101. package/dist/model/CreateEnvironment.js +128 -0
  102. package/dist/model/CreateFirewallPayload.js +137 -0
  103. package/dist/model/CreateFirewallRulePayload.js +314 -0
  104. package/dist/model/CreateGPU.js +137 -0
  105. package/dist/model/CreateImage.js +105 -0
  106. package/dist/model/CreateImagePayload.js +126 -0
  107. package/dist/model/CreateInstancesPayload.js +320 -0
  108. package/dist/model/CreateInstancesResponse.js +130 -0
  109. package/dist/model/CreateProfilePayload.js +139 -0
  110. package/dist/model/CreateProfileResponse.js +111 -0
  111. package/dist/model/CreateSecurityRulePayload.js +312 -0
  112. package/dist/model/CreateSnapshotPayload.js +152 -0
  113. package/dist/model/CreateSnapshotResponse.js +111 -0
  114. package/dist/model/CreateUpdateComplianceResponse.js +111 -0
  115. package/dist/model/CreateUpdatePermissionPayload.js +154 -0
  116. package/dist/model/CreateUpdatePermissionResponseModel.js +111 -0
  117. package/dist/model/CreateUpdatePolicyPayload.js +150 -0
  118. package/dist/model/CreateUpdatePolicyResponseModel.js +111 -0
  119. package/dist/model/CreateUpdateRbacRolePayload.js +152 -0
  120. package/dist/model/CreateVolumePayload.js +189 -0
  121. package/dist/model/Creditrechargelimitfield.js +109 -0
  122. package/dist/model/Creditrechargelimitresponse.js +130 -0
  123. package/dist/model/Creditrequestresponse.js +130 -0
  124. package/dist/model/Creditrequests.js +125 -0
  125. package/dist/model/CustomerContractDetailResponseModel.js +111 -0
  126. package/dist/model/CustomerContractFields.js +182 -0
  127. package/dist/model/CustomerFields.js +97 -0
  128. package/dist/model/CustomerPayload.js +122 -0
  129. package/dist/model/DashboardInfoResponse.js +111 -0
  130. package/dist/model/Data.js +108 -0
  131. package/dist/model/DeploymentFields.js +141 -0
  132. package/dist/model/DeploymentFieldsforstartdeployments.js +153 -0
  133. package/dist/model/Deployments.js +130 -0
  134. package/dist/model/DetachVolumes.js +130 -0
  135. package/dist/model/DetachVolumesPayload.js +89 -0
  136. package/dist/model/DiscountEntityModel.js +122 -0
  137. package/dist/model/DiscountFields.js +149 -0
  138. package/dist/model/DiscountPlanFields.js +181 -0
  139. package/dist/model/DiscountResourceFields.js +113 -0
  140. package/dist/model/DiscountResourcePayload.js +142 -0
  141. package/dist/model/EditlabelofanexistingVMPayload.js +90 -0
  142. package/dist/model/Environment.js +111 -0
  143. package/dist/model/EnvironmentFeatures.js +85 -0
  144. package/dist/model/EnvironmentFields.js +131 -0
  145. package/dist/model/EnvironmentFieldsforVolume.js +89 -0
  146. package/dist/model/Environments.js +154 -0
  147. package/dist/model/ErrorResponseModel.js +112 -0
  148. package/dist/model/ExcludeBillingPostPayload.js +135 -0
  149. package/dist/model/ExcludeBillingPostResponse.js +91 -0
  150. package/dist/model/ExportBillingDataRequest.js +186 -0
  151. package/dist/model/ExportBillingDataResponse.js +101 -0
  152. package/dist/model/FieldChange.js +116 -0
  153. package/dist/model/FirewallAttachmentModel.js +119 -0
  154. package/dist/model/FirewallAttachmentVMModel.js +141 -0
  155. package/dist/model/FirewallDetailFields.js +206 -0
  156. package/dist/model/FirewallDetailResponse.js +111 -0
  157. package/dist/model/FirewallEnvironmentFields.js +109 -0
  158. package/dist/model/FirewallFields.js +143 -0
  159. package/dist/model/FirewallResponse.js +111 -0
  160. package/dist/model/FirewallRule.js +111 -0
  161. package/dist/model/FirewallsListResponse.js +154 -0
  162. package/dist/model/FlavorFields.js +222 -0
  163. package/dist/model/FlavorItemGetResponse.js +134 -0
  164. package/dist/model/FlavorListResponse.js +130 -0
  165. package/dist/model/FlavorObjectFields.js +121 -0
  166. package/dist/model/FlavorPayload.js +190 -0
  167. package/dist/model/FlavorResponse.js +111 -0
  168. package/dist/model/FlavorVMFields.js +149 -0
  169. package/dist/model/FlavorVMsResponse.js +130 -0
  170. package/dist/model/FutureNodeModel.js +171 -0
  171. package/dist/model/FutureNodeResponseModel.js +122 -0
  172. package/dist/model/FutureNodeStockModel.js +128 -0
  173. package/dist/model/FutureNodeUpdateModel.js +152 -0
  174. package/dist/model/FutureNodesStockModel.js +110 -0
  175. package/dist/model/GPU.js +111 -0
  176. package/dist/model/GPUFields.js +158 -0
  177. package/dist/model/GPUList.js +130 -0
  178. package/dist/model/GPURegionFields.js +97 -0
  179. package/dist/model/GenerateUpdateApiKeyPayload.js +124 -0
  180. package/dist/model/GenerateUpdateApiKeyResponseModel.js +111 -0
  181. package/dist/model/GetAllContractFields.js +137 -0
  182. package/dist/model/GetAllContractsResponseModel.js +130 -0
  183. package/dist/model/GetAllDiscountForAllOrganizationResponse.js +130 -0
  184. package/dist/model/GetAllDiscountsFields.js +158 -0
  185. package/dist/model/GetApiKeysResponseModel.js +130 -0
  186. package/dist/model/GetCustomerContractsListResponseModel.js +138 -0
  187. package/dist/model/GetDiscountDetailResponse.js +111 -0
  188. package/dist/model/GetDiscountResponse.js +130 -0
  189. package/dist/model/GetEntityDiscountDetailResponse.js +159 -0
  190. package/dist/model/GetInvitesResponseModel.js +130 -0
  191. package/dist/model/GetOrganizationResponseModel.js +111 -0
  192. package/dist/model/GetPermissionsResponseModel.js +130 -0
  193. package/dist/model/GetPoliciesResponseModel.js +130 -0
  194. package/dist/model/GetRbacRolesResponseModel.js +130 -0
  195. package/dist/model/GetTokenPayload.js +126 -0
  196. package/dist/model/GetUserPermissionsResponseModel.js +130 -0
  197. package/dist/model/GetVersionResponse.js +109 -0
  198. package/dist/model/Getcreditandthresholdinfo.js +101 -0
  199. package/dist/model/Getcreditandthresholdinfoinresponse.js +111 -0
  200. package/dist/model/GraphDatetimeValueModel.js +97 -0
  201. package/dist/model/HistoricalInstance.js +138 -0
  202. package/dist/model/HistoricalInstancesFields.js +201 -0
  203. package/dist/model/Image.js +91 -0
  204. package/dist/model/ImageFields.js +206 -0
  205. package/dist/model/ImageGetResponse.js +146 -0
  206. package/dist/model/ImageLogos.js +130 -0
  207. package/dist/model/Images.js +130 -0
  208. package/dist/model/ImportKeypairPayload.js +143 -0
  209. package/dist/model/ImportKeypairResponse.js +111 -0
  210. package/dist/model/InfrahubResourceObjectResponse.js +222 -0
  211. package/dist/model/InfrahubResourceObjectResponseForCustomer.js +182 -0
  212. package/dist/model/InsertDiscountPlanFields.js +168 -0
  213. package/dist/model/Instance.js +111 -0
  214. package/dist/model/InstanceEnvironmentFields.js +131 -0
  215. package/dist/model/InstanceEvents.js +130 -0
  216. package/dist/model/InstanceEventsFields.js +157 -0
  217. package/dist/model/InstanceFields.js +368 -0
  218. package/dist/model/InstanceFlavorFields.js +149 -0
  219. package/dist/model/InstanceImageFields.js +89 -0
  220. package/dist/model/InstanceKeypairFields.js +89 -0
  221. package/dist/model/InstanceOverviewFields.js +117 -0
  222. package/dist/model/InstanceResizePayload.js +103 -0
  223. package/dist/model/Instances.js +154 -0
  224. package/dist/model/InstancesSummaryFields.js +249 -0
  225. package/dist/model/InternalEnvironmentFields.js +117 -0
  226. package/dist/model/InternalInstanceFields.js +344 -0
  227. package/dist/model/InternalInstanceFlavorFields.js +161 -0
  228. package/dist/model/InternalInstanceImageFields.js +133 -0
  229. package/dist/model/InternalInstanceKeypairFields.js +141 -0
  230. package/dist/model/InternalInstancesResponse.js +130 -0
  231. package/dist/model/InternalSecurityRulesFieldsForInstance.js +169 -0
  232. package/dist/model/InternalVolumeAttachmentFields.js +123 -0
  233. package/dist/model/InternalVolumeFields.js +129 -0
  234. package/dist/model/InternalVolumesResponse.js +130 -0
  235. package/dist/model/InviteFields.js +117 -0
  236. package/dist/model/InviteUserPayload.js +113 -0
  237. package/dist/model/InviteUserResponseModel.js +111 -0
  238. package/dist/model/KeypairFields.js +141 -0
  239. package/dist/model/Keypairs.js +154 -0
  240. package/dist/model/LableResonse.js +97 -0
  241. package/dist/model/Lastdaycostfields.js +109 -0
  242. package/dist/model/Lastdaycostresponse.js +111 -0
  243. package/dist/model/LogoGetResponse.js +109 -0
  244. package/dist/model/LogoutPayload.js +112 -0
  245. package/dist/model/MetricItemFields.js +113 -0
  246. package/dist/model/MetricsFields.js +156 -0
  247. package/dist/model/NameAvailableModel.js +109 -0
  248. package/dist/model/NewConfigurationsResponse.js +117 -0
  249. package/dist/model/NewModelResponse.js +151 -0
  250. package/dist/model/NewStockResponse.js +134 -0
  251. package/dist/model/NewStockRetriveResponse.js +110 -0
  252. package/dist/model/NewStockUpdateResponseModel.js +97 -0
  253. package/dist/model/NodeModel.js +230 -0
  254. package/dist/model/NodePayloadModel.js +122 -0
  255. package/dist/model/NodePowerUsageModel.js +244 -0
  256. package/dist/model/NodeResponseModel.js +122 -0
  257. package/dist/model/NodeStockPayloadModel.js +110 -0
  258. package/dist/model/NodeStockResponseModel.js +110 -0
  259. package/dist/model/NodeStocksPayload.js +144 -0
  260. package/dist/model/OrganizationFields.js +208 -0
  261. package/dist/model/OrganizationLevelBillingHistory.js +126 -0
  262. package/dist/model/OrganizationLevelBillingHistoryResources.js +105 -0
  263. package/dist/model/OrganizationLevelBillingHistoryResponseAttributes.js +89 -0
  264. package/dist/model/OrganizationLevelBillingHistoryResponseMetrics.js +125 -0
  265. package/dist/model/OrganizationLevelBillingHistoryResponseModel.js +111 -0
  266. package/dist/model/OrganizationObjectResponse.js +118 -0
  267. package/dist/model/OrganizationThresholdfields.js +125 -0
  268. package/dist/model/OrganizationUserResponseModel.js +194 -0
  269. package/dist/model/Organizationcreditrechargelimitresponse.js +111 -0
  270. package/dist/model/Organizationthresholdsresponse.js +130 -0
  271. package/dist/model/Organizationthresholdupdateresponse.js +111 -0
  272. package/dist/model/OverviewInfo.js +119 -0
  273. package/dist/model/PaginationData.js +101 -0
  274. package/dist/model/PaymentDetailsFields.js +185 -0
  275. package/dist/model/PaymentDetailsResponse.js +111 -0
  276. package/dist/model/PaymentInitiateFields.js +89 -0
  277. package/dist/model/PaymentInitiatePayload.js +85 -0
  278. package/dist/model/PaymentInitiateResponse.js +111 -0
  279. package/dist/model/PermissionFields.js +141 -0
  280. package/dist/model/PolicyFields.js +150 -0
  281. package/dist/model/PolicyPermissionFields.js +109 -0
  282. package/dist/model/PowerUsageModel.js +122 -0
  283. package/dist/model/PricebookModel.js +137 -0
  284. package/dist/model/PricebookResourceObjectResponse.js +173 -0
  285. package/dist/model/PricebookResourceObjectResponseForCustomer.js +141 -0
  286. package/dist/model/ProfileFields.js +129 -0
  287. package/dist/model/ProfileListResponse.js +130 -0
  288. package/dist/model/ProfileObjectFields.js +124 -0
  289. package/dist/model/RbacRoleDetailResponseModel.js +111 -0
  290. package/dist/model/RbacRoleDetailResponseModelFixed.js +111 -0
  291. package/dist/model/RbacRoleField.js +89 -0
  292. package/dist/model/RbacRoleFields.js +180 -0
  293. package/dist/model/RefreshTokenPayload.js +126 -0
  294. package/dist/model/RegionFields.js +109 -0
  295. package/dist/model/RegionPayload.js +124 -0
  296. package/dist/model/RegionResponse.js +111 -0
  297. package/dist/model/Regions.js +130 -0
  298. package/dist/model/RemoveMemberFromOrganizationResponseModel.js +97 -0
  299. package/dist/model/RemoveMemberPayload.js +113 -0
  300. package/dist/model/RequestConsole.js +109 -0
  301. package/dist/model/ResourceBillingEventsHistoryMetrics.js +125 -0
  302. package/dist/model/ResourceBillingEventsHistoryResponse.js +130 -0
  303. package/dist/model/ResourceBillingResponseForCustomer.js +111 -0
  304. package/dist/model/ResourceLevelBillingDetailsAttributes.js +109 -0
  305. package/dist/model/ResourceLevelBillingDetailsMetrics.js +141 -0
  306. package/dist/model/ResourceLevelBillingDetailsVM.js +126 -0
  307. package/dist/model/ResourceLevelBillingDetailsVolume.js +126 -0
  308. package/dist/model/ResourceLevelBillingDetailsVolumeAttributes.js +129 -0
  309. package/dist/model/ResourceLevelBillingDetailsVolumeMetrics.js +117 -0
  310. package/dist/model/ResourceLevelBillingHistory.js +140 -0
  311. package/dist/model/ResourceLevelBillingHistoryResources.js +105 -0
  312. package/dist/model/ResourceLevelBillingHistoryResponseAttributes.js +121 -0
  313. package/dist/model/ResourceLevelBillingHistoryResponseMetrics.js +101 -0
  314. package/dist/model/ResourceLevelBillingVMDetailsResources.js +105 -0
  315. package/dist/model/ResourceLevelBillingVolumeDetailsResources.js +105 -0
  316. package/dist/model/ResourceLevelGraphBillingDetailVolume.js +134 -0
  317. package/dist/model/ResourceLevelGraphBillingDetailsAttributes.js +109 -0
  318. package/dist/model/ResourceLevelGraphBillingDetailsMetrics.js +118 -0
  319. package/dist/model/ResourceLevelGraphBillingDetailsVM.js +134 -0
  320. package/dist/model/ResourceLevelGraphBillingVMDetailsResources.js +105 -0
  321. package/dist/model/ResourceLevelGraphBillingVolumeDetailsResources.js +105 -0
  322. package/dist/model/ResourceLevelVMBillingDetailsResponseModel.js +111 -0
  323. package/dist/model/ResourceLevelVmBillingHistoryResponseModel.js +111 -0
  324. package/dist/model/ResourceLevelVmGraphBillingDetailsResponseModel.js +111 -0
  325. package/dist/model/ResourceLevelVolumeBillingDetailsResponseModel.js +111 -0
  326. package/dist/model/ResourceLevelVolumeBillingHistoryResponseModel.js +111 -0
  327. package/dist/model/ResourceLevelVolumeGraphBillingDetailsResponseModel.js +111 -0
  328. package/dist/model/ResourceObjectResponseForCustomer.js +99 -0
  329. package/dist/model/ResponseModel.js +97 -0
  330. package/dist/model/RolePermissionFields.js +109 -0
  331. package/dist/model/RolePolicyFields.js +109 -0
  332. package/dist/model/SecurityGroupRule.js +111 -0
  333. package/dist/model/SecurityGroupRuleFields.js +169 -0
  334. package/dist/model/SecurityRulesFieldsforInstance.js +169 -0
  335. package/dist/model/SecurityRulesProtocolFields.js +109 -0
  336. package/dist/model/SetDefaultsPayload.js +126 -0
  337. package/dist/model/SingleVisibilityUserResponse.js +128 -0
  338. package/dist/model/SnapshotFields.js +220 -0
  339. package/dist/model/SnapshotRestoreRequest.js +122 -0
  340. package/dist/model/SnapshotRetrieve.js +111 -0
  341. package/dist/model/SnapshotRetrieveFields.js +207 -0
  342. package/dist/model/Snapshots.js +154 -0
  343. package/dist/model/StartDeployment.js +111 -0
  344. package/dist/model/StartDeploymentPayload.js +146 -0
  345. package/dist/model/StockVisibilityUserListResponse.js +130 -0
  346. package/dist/model/StockVisibilityUserPayload.js +112 -0
  347. package/dist/model/SubResourceGraphBillingDetailsMetrics.js +303 -0
  348. package/dist/model/SubResourcesCostsResponseModel.js +134 -0
  349. package/dist/model/SubResourcesGraphBillingHistoryFields.js +105 -0
  350. package/dist/model/SubResourcesGraphResponseModel.js +111 -0
  351. package/dist/model/Subscribeorunsubscribeupdatepayload.js +109 -0
  352. package/dist/model/SuccessResponseModel.js +100 -0
  353. package/dist/model/Template.js +111 -0
  354. package/dist/model/TemplateFields.js +137 -0
  355. package/dist/model/Templates.js +130 -0
  356. package/dist/model/TokenFields.js +113 -0
  357. package/dist/model/UpdateContractPayload.js +168 -0
  358. package/dist/model/UpdateDiscountsPayload.js +160 -0
  359. package/dist/model/UpdateDiscountsStatusPayload.js +112 -0
  360. package/dist/model/UpdateEnvironment.js +113 -0
  361. package/dist/model/UpdateGPU.js +114 -0
  362. package/dist/model/UpdateKeypairName.js +113 -0
  363. package/dist/model/UpdateKeypairnameresponse.js +111 -0
  364. package/dist/model/UpdateOrganizationPayload.js +113 -0
  365. package/dist/model/UpdateOrganizationResponseModel.js +97 -0
  366. package/dist/model/UpdateTemplate.js +109 -0
  367. package/dist/model/UserDefaultChoiceForUserFields.js +101 -0
  368. package/dist/model/UserDefaultChoicesForUserResponse.js +130 -0
  369. package/dist/model/UserPermissionFields.js +109 -0
  370. package/dist/model/UserTransferPayload.js +122 -0
  371. package/dist/model/Userinfopostpayload.js +232 -0
  372. package/dist/model/UsersInfoFields.js +229 -0
  373. package/dist/model/UsersInfoListResponse.js +111 -0
  374. package/dist/model/VMUsageRequestPayload.js +113 -0
  375. package/dist/model/VMUsageResponse.js +138 -0
  376. package/dist/model/VNCURL.js +111 -0
  377. package/dist/model/VNCURLFields.js +97 -0
  378. package/dist/model/VerifyApiKeyPayload.js +113 -0
  379. package/dist/model/VerifyApiKeyResponseModel.js +111 -0
  380. package/dist/model/VirtualMachineUsage.js +117 -0
  381. package/dist/model/Volume.js +111 -0
  382. package/dist/model/VolumeAttachmentFields.js +123 -0
  383. package/dist/model/VolumeFields.js +211 -0
  384. package/dist/model/VolumeFieldsforInstance.js +137 -0
  385. package/dist/model/VolumeOverviewFields.js +101 -0
  386. package/dist/model/VolumeStatusChangeFields.js +125 -0
  387. package/dist/model/VolumeTypes.js +109 -0
  388. package/dist/model/Volumes.js +130 -0
  389. package/dist/model/VolumesLastStatusChangeResponse.js +130 -0
  390. package/dist/model/WarningMailLogFields.js +149 -0
  391. package/dist/model/WarningMailLogResponse.js +138 -0
  392. package/package.json +46 -0
@@ -0,0 +1,710 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _superagent = _interopRequireDefault(require("superagent"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ 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); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); } /**
15
+ * Infrahub-API
16
+ * Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
17
+ *
18
+ * The version of the OpenAPI document: 1.0
19
+ *
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * @module ApiClient
28
+ * @version v1.22.0-alpha
29
+ */
30
+ /**
31
+ * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
32
+ * application to use this class directly - the *Api and model classes provide the public API for the service. The
33
+ * contents of this file should be regarded as internal but are documented for completeness.
34
+ * @alias module:ApiClient
35
+ * @class
36
+ */
37
+ var ApiClient = /*#__PURE__*/function () {
38
+ /**
39
+ * The base URL against which to resolve every API call's (relative) path.
40
+ * Overrides the default value set in spec file if present
41
+ * @param {String} basePath
42
+ */
43
+ function ApiClient() {
44
+ var basePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'https://infrahub-api.nexgencloud.com/v1';
45
+ _classCallCheck(this, ApiClient);
46
+ /**
47
+ * The base URL against which to resolve every API call's (relative) path.
48
+ * @type {String}
49
+ * @default https://infrahub-api.nexgencloud.com/v1
50
+ */
51
+ this.basePath = basePath.replace(/\/+$/, '');
52
+
53
+ /**
54
+ * The authentication methods to be included for all API calls.
55
+ * @type {Array.<String>}
56
+ */
57
+ this.authentications = {
58
+ 'accessToken': {
59
+ type: 'apiKey',
60
+ 'in': 'header',
61
+ name: 'Authorization'
62
+ },
63
+ 'apiKey': {
64
+ type: 'apiKey',
65
+ 'in': 'header',
66
+ name: 'api_key'
67
+ }
68
+ };
69
+
70
+ /**
71
+ * The default HTTP headers to be included for all API calls.
72
+ * @type {Array.<String>}
73
+ * @default {}
74
+ */
75
+ this.defaultHeaders = {
76
+ 'User-Agent': 'OpenAPI-Generator/v1.22.0-alpha/Javascript'
77
+ };
78
+
79
+ /**
80
+ * The default HTTP timeout for all API calls.
81
+ * @type {Number}
82
+ * @default 60000
83
+ */
84
+ this.timeout = 60000;
85
+
86
+ /**
87
+ * If set to false an additional timestamp parameter is added to all API GET calls to
88
+ * prevent browser caching
89
+ * @type {Boolean}
90
+ * @default true
91
+ */
92
+ this.cache = true;
93
+
94
+ /**
95
+ * If set to true, the client will save the cookies from each server
96
+ * response, and return them in the next request.
97
+ * @default false
98
+ */
99
+ this.enableCookies = false;
100
+
101
+ /*
102
+ * Used to save and return cookies in a node.js (non-browser) setting,
103
+ * if this.enableCookies is set to true.
104
+ */
105
+ if (typeof window === 'undefined') {
106
+ this.agent = new _superagent["default"].agent();
107
+ }
108
+
109
+ /*
110
+ * Allow user to override superagent agent
111
+ */
112
+ this.requestAgent = null;
113
+
114
+ /*
115
+ * Allow user to add superagent plugins
116
+ */
117
+ this.plugins = null;
118
+ }
119
+
120
+ /**
121
+ * Returns a string representation for an actual parameter.
122
+ * @param param The actual parameter.
123
+ * @returns {String} The string representation of <code>param</code>.
124
+ */
125
+ return _createClass(ApiClient, [{
126
+ key: "paramToString",
127
+ value: function paramToString(param) {
128
+ if (param == undefined || param == null) {
129
+ return '';
130
+ }
131
+ if (param instanceof Date) {
132
+ return param.toJSON();
133
+ }
134
+ if (ApiClient.canBeJsonified(param)) {
135
+ return JSON.stringify(param);
136
+ }
137
+ return param.toString();
138
+ }
139
+
140
+ /**
141
+ * Returns a boolean indicating if the parameter could be JSON.stringified
142
+ * @param param The actual parameter
143
+ * @returns {Boolean} Flag indicating if <code>param</code> can be JSON.stringified
144
+ */
145
+ }, {
146
+ key: "buildUrl",
147
+ value:
148
+ /**
149
+ * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
150
+ * NOTE: query parameters are not handled here.
151
+ * @param {String} path The path to append to the base URL.
152
+ * @param {Object} pathParams The parameter values to append.
153
+ * @param {String} apiBasePath Base path defined in the path, operation level to override the default one
154
+ * @returns {String} The encoded path with parameter values substituted.
155
+ */
156
+ function buildUrl(path, pathParams, apiBasePath) {
157
+ var _this = this;
158
+ if (!path.match(/^\//)) {
159
+ path = '/' + path;
160
+ }
161
+ var url = this.basePath + path;
162
+
163
+ // use API (operation, path) base path if defined
164
+ if (apiBasePath !== null && apiBasePath !== undefined) {
165
+ url = apiBasePath + path;
166
+ }
167
+ url = url.replace(/\{([\w-\.#]+)\}/g, function (fullMatch, key) {
168
+ var value;
169
+ if (pathParams.hasOwnProperty(key)) {
170
+ value = _this.paramToString(pathParams[key]);
171
+ } else {
172
+ value = fullMatch;
173
+ }
174
+ return encodeURIComponent(value);
175
+ });
176
+ return url;
177
+ }
178
+
179
+ /**
180
+ * Checks whether the given content type represents JSON.<br>
181
+ * JSON content type examples:<br>
182
+ * <ul>
183
+ * <li>application/json</li>
184
+ * <li>application/json; charset=UTF8</li>
185
+ * <li>APPLICATION/JSON</li>
186
+ * </ul>
187
+ * @param {String} contentType The MIME content type to check.
188
+ * @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
189
+ */
190
+ }, {
191
+ key: "isJsonMime",
192
+ value: function isJsonMime(contentType) {
193
+ return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
194
+ }
195
+
196
+ /**
197
+ * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
198
+ * @param {Array.<String>} contentTypes
199
+ * @returns {String} The chosen content type, preferring JSON.
200
+ */
201
+ }, {
202
+ key: "jsonPreferredMime",
203
+ value: function jsonPreferredMime(contentTypes) {
204
+ for (var i = 0; i < contentTypes.length; i++) {
205
+ if (this.isJsonMime(contentTypes[i])) {
206
+ return contentTypes[i];
207
+ }
208
+ }
209
+ return contentTypes[0];
210
+ }
211
+
212
+ /**
213
+ * Checks whether the given parameter value represents file-like content.
214
+ * @param param The parameter to check.
215
+ * @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
216
+ */
217
+ }, {
218
+ key: "isFileParam",
219
+ value: function isFileParam(param) {
220
+ // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
221
+ if (typeof require === 'function') {
222
+ var fs;
223
+ try {
224
+ fs = require('fs');
225
+ } catch (err) {}
226
+ if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
227
+ return true;
228
+ }
229
+ }
230
+
231
+ // Buffer in Node.js
232
+ if (typeof Buffer === 'function' && param instanceof Buffer) {
233
+ return true;
234
+ }
235
+
236
+ // Blob in browser
237
+ if (typeof Blob === 'function' && param instanceof Blob) {
238
+ return true;
239
+ }
240
+
241
+ // File in browser (it seems File object is also instance of Blob, but keep this for safe)
242
+ if (typeof File === 'function' && param instanceof File) {
243
+ return true;
244
+ }
245
+ return false;
246
+ }
247
+
248
+ /**
249
+ * Normalizes parameter values:
250
+ * <ul>
251
+ * <li>remove nils</li>
252
+ * <li>keep files and arrays</li>
253
+ * <li>format to string with `paramToString` for other cases</li>
254
+ * </ul>
255
+ * @param {Object.<String, Object>} params The parameters as object properties.
256
+ * @returns {Object.<String, Object>} normalized parameters.
257
+ */
258
+ }, {
259
+ key: "normalizeParams",
260
+ value: function normalizeParams(params) {
261
+ var newParams = {};
262
+ for (var key in params) {
263
+ if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
264
+ var value = params[key];
265
+ if (this.isFileParam(value) || Array.isArray(value)) {
266
+ newParams[key] = value;
267
+ } else {
268
+ newParams[key] = this.paramToString(value);
269
+ }
270
+ }
271
+ }
272
+ return newParams;
273
+ }
274
+
275
+ /**
276
+ * Builds a string representation of an array-type actual parameter, according to the given collection format.
277
+ * @param {Array} param An array parameter.
278
+ * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
279
+ * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
280
+ * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
281
+ */
282
+ }, {
283
+ key: "buildCollectionParam",
284
+ value: function buildCollectionParam(param, collectionFormat) {
285
+ if (param == null) {
286
+ return null;
287
+ }
288
+ switch (collectionFormat) {
289
+ case 'csv':
290
+ return param.map(this.paramToString, this).join(',');
291
+ case 'ssv':
292
+ return param.map(this.paramToString, this).join(' ');
293
+ case 'tsv':
294
+ return param.map(this.paramToString, this).join('\t');
295
+ case 'pipes':
296
+ return param.map(this.paramToString, this).join('|');
297
+ case 'multi':
298
+ //return the array directly as SuperAgent will handle it as expected
299
+ return param.map(this.paramToString, this);
300
+ case 'passthrough':
301
+ return param;
302
+ default:
303
+ throw new Error('Unknown collection format: ' + collectionFormat);
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Applies authentication headers to the request.
309
+ * @param {Object} request The request object created by a <code>superagent()</code> call.
310
+ * @param {Array.<String>} authNames An array of authentication method names.
311
+ */
312
+ }, {
313
+ key: "applyAuthToRequest",
314
+ value: function applyAuthToRequest(request, authNames) {
315
+ var _this2 = this;
316
+ authNames.forEach(function (authName) {
317
+ var auth = _this2.authentications[authName];
318
+ switch (auth.type) {
319
+ case 'basic':
320
+ if (auth.username || auth.password) {
321
+ request.auth(auth.username || '', auth.password || '');
322
+ }
323
+ break;
324
+ case 'bearer':
325
+ if (auth.accessToken) {
326
+ var localVarBearerToken = typeof auth.accessToken === 'function' ? auth.accessToken() : auth.accessToken;
327
+ request.set({
328
+ 'Authorization': 'Bearer ' + localVarBearerToken
329
+ });
330
+ }
331
+ break;
332
+ case 'apiKey':
333
+ if (auth.apiKey) {
334
+ var data = {};
335
+ if (auth.apiKeyPrefix) {
336
+ data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey;
337
+ } else {
338
+ data[auth.name] = auth.apiKey;
339
+ }
340
+ if (auth['in'] === 'header') {
341
+ request.set(data);
342
+ } else {
343
+ request.query(data);
344
+ }
345
+ }
346
+ break;
347
+ case 'oauth2':
348
+ if (auth.accessToken) {
349
+ request.set({
350
+ 'Authorization': 'Bearer ' + auth.accessToken
351
+ });
352
+ }
353
+ break;
354
+ default:
355
+ throw new Error('Unknown authentication type: ' + auth.type);
356
+ }
357
+ });
358
+ }
359
+
360
+ /**
361
+ * Deserializes an HTTP response body into a value of the specified type.
362
+ * @param {Object} response A SuperAgent response object.
363
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
364
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
365
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
366
+ * all properties on <code>data<code> will be converted to this type.
367
+ * @returns A value of the specified type.
368
+ */
369
+ }, {
370
+ key: "deserialize",
371
+ value: function deserialize(response, returnType) {
372
+ if (response == null || returnType == null || response.status == 204) {
373
+ return null;
374
+ }
375
+
376
+ // Rely on SuperAgent for parsing response body.
377
+ // See http://visionmedia.github.io/superagent/#parsing-response-bodies
378
+ var data = response.body;
379
+ if (data == null || _typeof(data) === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length) {
380
+ // SuperAgent does not always produce a body; use the unparsed response as a fallback
381
+ data = response.text;
382
+ }
383
+ return ApiClient.convertToType(data, returnType);
384
+ }
385
+
386
+ /**
387
+ * Invokes the REST service using the supplied settings and parameters.
388
+ * @param {String} path The base URL to invoke.
389
+ * @param {String} httpMethod The HTTP method to use.
390
+ * @param {Object.<String, String>} pathParams A map of path parameters and their values.
391
+ * @param {Object.<String, Object>} queryParams A map of query parameters and their values.
392
+ * @param {Object.<String, Object>} headerParams A map of header parameters and their values.
393
+ * @param {Object.<String, Object>} formParams A map of form parameters and their values.
394
+ * @param {Object} bodyParam The value to pass as the request body.
395
+ * @param {Array.<String>} authNames An array of authentication type names.
396
+ * @param {Array.<String>} contentTypes An array of request MIME types.
397
+ * @param {Array.<String>} accepts An array of acceptable response MIME types.
398
+ * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
399
+ * constructor for a complex type.
400
+ * @param {String} apiBasePath base path defined in the operation/path level to override the default one
401
+ * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object.
402
+ */
403
+ }, {
404
+ key: "callApi",
405
+ value: function callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, apiBasePath) {
406
+ var _this3 = this;
407
+ var url = this.buildUrl(path, pathParams, apiBasePath);
408
+ var request = (0, _superagent["default"])(httpMethod, url);
409
+ if (this.plugins !== null) {
410
+ for (var index in this.plugins) {
411
+ if (this.plugins.hasOwnProperty(index)) {
412
+ request.use(this.plugins[index]);
413
+ }
414
+ }
415
+ }
416
+
417
+ // apply authentications
418
+ this.applyAuthToRequest(request, authNames);
419
+
420
+ // set query parameters
421
+ if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
422
+ queryParams['_'] = new Date().getTime();
423
+ }
424
+ request.query(this.normalizeParams(queryParams));
425
+
426
+ // set header parameters
427
+ request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));
428
+
429
+ // set requestAgent if it is set by user
430
+ if (this.requestAgent) {
431
+ request.agent(this.requestAgent);
432
+ }
433
+
434
+ // set request timeout
435
+ request.timeout(this.timeout);
436
+ var contentType = this.jsonPreferredMime(contentTypes);
437
+ if (contentType) {
438
+ // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
439
+ if (contentType != 'multipart/form-data') {
440
+ request.type(contentType);
441
+ }
442
+ }
443
+ if (contentType === 'application/x-www-form-urlencoded') {
444
+ var normalizedParams = this.normalizeParams(formParams);
445
+ var urlSearchParams = new URLSearchParams(normalizedParams);
446
+ var queryString = urlSearchParams.toString();
447
+ request.send(queryString);
448
+ } else if (contentType == 'multipart/form-data') {
449
+ var _formParams = this.normalizeParams(formParams);
450
+ for (var key in _formParams) {
451
+ if (_formParams.hasOwnProperty(key)) {
452
+ var _formParamsValue = _formParams[key];
453
+ if (this.isFileParam(_formParamsValue)) {
454
+ // file field
455
+ request.attach(key, _formParamsValue);
456
+ } else if (Array.isArray(_formParamsValue) && _formParamsValue.length && this.isFileParam(_formParamsValue[0])) {
457
+ // multiple files
458
+ _formParamsValue.forEach(function (file) {
459
+ return request.attach(key, file);
460
+ });
461
+ } else {
462
+ request.field(key, _formParamsValue);
463
+ }
464
+ }
465
+ }
466
+ } else if (bodyParam !== null && bodyParam !== undefined) {
467
+ if (!request.header['Content-Type']) {
468
+ request.type('application/json');
469
+ }
470
+ request.send(bodyParam);
471
+ }
472
+ var accept = this.jsonPreferredMime(accepts);
473
+ if (accept) {
474
+ request.accept(accept);
475
+ }
476
+ if (returnType === 'Blob') {
477
+ request.responseType('blob');
478
+ } else if (returnType === 'String') {
479
+ request.responseType('text');
480
+ }
481
+
482
+ // Attach previously saved cookies, if enabled
483
+ if (this.enableCookies) {
484
+ if (typeof window === 'undefined') {
485
+ this.agent._attachCookies(request);
486
+ } else {
487
+ request.withCredentials();
488
+ }
489
+ }
490
+ return new Promise(function (resolve, reject) {
491
+ request.end(function (error, response) {
492
+ if (error) {
493
+ var err = {};
494
+ if (response) {
495
+ err.status = response.status;
496
+ err.statusText = response.statusText;
497
+ err.body = response.body;
498
+ err.response = response;
499
+ }
500
+ err.error = error;
501
+ reject(err);
502
+ } else {
503
+ try {
504
+ var data = _this3.deserialize(response, returnType);
505
+ if (_this3.enableCookies && typeof window === 'undefined') {
506
+ _this3.agent._saveCookies(response);
507
+ }
508
+ resolve({
509
+ data: data,
510
+ response: response
511
+ });
512
+ } catch (err) {
513
+ reject(err);
514
+ }
515
+ }
516
+ });
517
+ });
518
+ }
519
+
520
+ /**
521
+ * Parses an ISO-8601 string representation or epoch representation of a date value.
522
+ * @param {String} str The date value as a string.
523
+ * @returns {Date} The parsed date object.
524
+ */
525
+ }, {
526
+ key: "hostSettings",
527
+ value:
528
+ /**
529
+ * Gets an array of host settings
530
+ * @returns An array of host settings
531
+ */
532
+ function hostSettings() {
533
+ return [{
534
+ 'url': "https://infrahub-api.nexgencloud.com/v1",
535
+ 'description': "No description provided"
536
+ }];
537
+ }
538
+ }, {
539
+ key: "getBasePathFromSettings",
540
+ value: function getBasePathFromSettings(index) {
541
+ var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
542
+ var servers = this.hostSettings();
543
+
544
+ // check array index out of bound
545
+ if (index < 0 || index >= servers.length) {
546
+ throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
547
+ }
548
+ var server = servers[index];
549
+ var url = server['url'];
550
+
551
+ // go through variable and assign a value
552
+ for (var variable_name in server['variables']) {
553
+ if (variable_name in variables) {
554
+ var variable = server['variables'][variable_name];
555
+ if (!('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name])) {
556
+ url = url.replace("{" + variable_name + "}", variables[variable_name]);
557
+ } else {
558
+ throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
559
+ }
560
+ } else {
561
+ // use default value
562
+ url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']);
563
+ }
564
+ }
565
+ return url;
566
+ }
567
+
568
+ /**
569
+ * Constructs a new map or array model from REST data.
570
+ * @param data {Object|Array} The REST data.
571
+ * @param obj {Object|Array} The target object or array.
572
+ */
573
+ }], [{
574
+ key: "canBeJsonified",
575
+ value: function canBeJsonified(str) {
576
+ if (typeof str !== 'string' && _typeof(str) !== 'object') return false;
577
+ try {
578
+ var type = str.toString();
579
+ return type === '[object Object]' || type === '[object Array]';
580
+ } catch (err) {
581
+ return false;
582
+ }
583
+ }
584
+ }, {
585
+ key: "parseDate",
586
+ value: function parseDate(str) {
587
+ if (isNaN(str)) {
588
+ return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
589
+ }
590
+ return new Date(+str);
591
+ }
592
+
593
+ /**
594
+ * Converts a value to the specified type.
595
+ * @param {(String|Object)} data The data to convert, as a string or object.
596
+ * @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
597
+ * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
598
+ * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
599
+ * all properties on <code>data<code> will be converted to this type.
600
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
601
+ */
602
+ }, {
603
+ key: "convertToType",
604
+ value: function convertToType(data, type) {
605
+ if (data === null || data === undefined) return data;
606
+ switch (type) {
607
+ case 'Boolean':
608
+ return Boolean(data);
609
+ case 'Integer':
610
+ return parseInt(data, 10);
611
+ case 'Number':
612
+ return parseFloat(data);
613
+ case 'String':
614
+ return String(data);
615
+ case 'Date':
616
+ return ApiClient.parseDate(String(data));
617
+ case 'Blob':
618
+ return data;
619
+ default:
620
+ if (type === Object) {
621
+ // generic object, return directly
622
+ return data;
623
+ } else if (typeof type.constructFromObject === 'function') {
624
+ // for model type like User and enum class
625
+ return type.constructFromObject(data);
626
+ } else if (Array.isArray(type)) {
627
+ // for array type like: ['String']
628
+ var itemType = type[0];
629
+ return data.map(function (item) {
630
+ return ApiClient.convertToType(item, itemType);
631
+ });
632
+ } else if (_typeof(type) === 'object') {
633
+ // for plain object type like: {'String': 'Integer'}
634
+ var keyType, valueType;
635
+ for (var k in type) {
636
+ if (type.hasOwnProperty(k)) {
637
+ keyType = k;
638
+ valueType = type[k];
639
+ break;
640
+ }
641
+ }
642
+ var result = {};
643
+ for (var k in data) {
644
+ if (data.hasOwnProperty(k)) {
645
+ var key = ApiClient.convertToType(k, keyType);
646
+ var value = ApiClient.convertToType(data[k], valueType);
647
+ result[key] = value;
648
+ }
649
+ }
650
+ return result;
651
+ } else {
652
+ // for unknown type, return the data directly
653
+ return data;
654
+ }
655
+ }
656
+ }
657
+ }, {
658
+ key: "constructFromObject",
659
+ value: function constructFromObject(data, obj, itemType) {
660
+ if (Array.isArray(data)) {
661
+ for (var i = 0; i < data.length; i++) {
662
+ if (data.hasOwnProperty(i)) obj[i] = ApiClient.convertToType(data[i], itemType);
663
+ }
664
+ } else {
665
+ for (var k in data) {
666
+ if (data.hasOwnProperty(k)) obj[k] = ApiClient.convertToType(data[k], itemType);
667
+ }
668
+ }
669
+ }
670
+ }]);
671
+ }();
672
+ /**
673
+ * Enumeration of collection format separator strategies.
674
+ * @enum {String}
675
+ * @readonly
676
+ */
677
+ ApiClient.CollectionFormatEnum = {
678
+ /**
679
+ * Comma-separated values. Value: <code>csv</code>
680
+ * @const
681
+ */
682
+ CSV: ',',
683
+ /**
684
+ * Space-separated values. Value: <code>ssv</code>
685
+ * @const
686
+ */
687
+ SSV: ' ',
688
+ /**
689
+ * Tab-separated values. Value: <code>tsv</code>
690
+ * @const
691
+ */
692
+ TSV: '\t',
693
+ /**
694
+ * Pipe(|)-separated values. Value: <code>pipes</code>
695
+ * @const
696
+ */
697
+ PIPES: '|',
698
+ /**
699
+ * Native array. Value: <code>multi</code>
700
+ * @const
701
+ */
702
+ MULTI: 'multi'
703
+ };
704
+
705
+ /**
706
+ * The default API client implementation.
707
+ * @type {module:ApiClient}
708
+ */
709
+ ApiClient.instance = new ApiClient();
710
+ var _default = exports["default"] = ApiClient;