cloudsmith-api 2.0.31__py3-none-any.whl

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 (697) hide show
  1. cloudsmith_api/__init__.py +366 -0
  2. cloudsmith_api/api/__init__.py +28 -0
  3. cloudsmith_api/api/audit_log_api.py +264 -0
  4. cloudsmith_api/api/badges_api.py +217 -0
  5. cloudsmith_api/api/broadcasts_api.py +137 -0
  6. cloudsmith_api/api/bulk_action_api.py +137 -0
  7. cloudsmith_api/api/distros_api.py +224 -0
  8. cloudsmith_api/api/entitlements_api.py +1351 -0
  9. cloudsmith_api/api/files_api.py +621 -0
  10. cloudsmith_api/api/formats_api.py +224 -0
  11. cloudsmith_api/api/metrics_api.py +407 -0
  12. cloudsmith_api/api/namespaces_api.py +232 -0
  13. cloudsmith_api/api/openid_api.py +137 -0
  14. cloudsmith_api/api/orgs_api.py +8230 -0
  15. cloudsmith_api/api/packages_api.py +8253 -0
  16. cloudsmith_api/api/quota_api.py +430 -0
  17. cloudsmith_api/api/rates_api.py +125 -0
  18. cloudsmith_api/api/recycle_bin_api.py +248 -0
  19. cloudsmith_api/api/repos_api.py +18893 -0
  20. cloudsmith_api/api/status_api.py +125 -0
  21. cloudsmith_api/api/storage_regions_api.py +224 -0
  22. cloudsmith_api/api/user_api.py +509 -0
  23. cloudsmith_api/api/users_api.py +133 -0
  24. cloudsmith_api/api/vulnerabilities_api.py +502 -0
  25. cloudsmith_api/api/webhooks_api.py +609 -0
  26. cloudsmith_api/api_client.py +639 -0
  27. cloudsmith_api/configuration.py +253 -0
  28. cloudsmith_api/models/__init__.py +337 -0
  29. cloudsmith_api/models/allocated_limit.py +226 -0
  30. cloudsmith_api/models/allocated_limit_raw.py +202 -0
  31. cloudsmith_api/models/alpine_package_upload.py +2560 -0
  32. cloudsmith_api/models/alpine_package_upload_request.py +278 -0
  33. cloudsmith_api/models/alpine_upstream.py +1001 -0
  34. cloudsmith_api/models/alpine_upstream_request.py +595 -0
  35. cloudsmith_api/models/alpine_upstream_request_patch.py +593 -0
  36. cloudsmith_api/models/architecture.py +160 -0
  37. cloudsmith_api/models/broadcast_token.py +153 -0
  38. cloudsmith_api/models/broadcast_token_input.py +161 -0
  39. cloudsmith_api/models/cargo_package_upload.py +2560 -0
  40. cloudsmith_api/models/cargo_package_upload_request.py +246 -0
  41. cloudsmith_api/models/cargo_upstream.py +872 -0
  42. cloudsmith_api/models/cargo_upstream_request.py +529 -0
  43. cloudsmith_api/models/cargo_upstream_request_patch.py +527 -0
  44. cloudsmith_api/models/cocoapods_package_upload.py +2560 -0
  45. cloudsmith_api/models/cocoapods_package_upload_request.py +246 -0
  46. cloudsmith_api/models/common_bandwidth_metrics.py +206 -0
  47. cloudsmith_api/models/common_bandwidth_metrics_value.py +193 -0
  48. cloudsmith_api/models/common_downloads_metrics.py +206 -0
  49. cloudsmith_api/models/common_downloads_metrics_value.py +125 -0
  50. cloudsmith_api/models/common_metrics.py +236 -0
  51. cloudsmith_api/models/composer_package_upload.py +2563 -0
  52. cloudsmith_api/models/composer_package_upload_request.py +277 -0
  53. cloudsmith_api/models/composer_upstream.py +872 -0
  54. cloudsmith_api/models/composer_upstream_request.py +529 -0
  55. cloudsmith_api/models/composer_upstream_request_patch.py +527 -0
  56. cloudsmith_api/models/conan_package_upload.py +2634 -0
  57. cloudsmith_api/models/conan_package_upload_request.py +472 -0
  58. cloudsmith_api/models/conda_package_upload.py +2560 -0
  59. cloudsmith_api/models/conda_package_upload_request.py +246 -0
  60. cloudsmith_api/models/conda_upstream.py +872 -0
  61. cloudsmith_api/models/conda_upstream_request.py +529 -0
  62. cloudsmith_api/models/conda_upstream_request_patch.py +527 -0
  63. cloudsmith_api/models/connected_repository.py +311 -0
  64. cloudsmith_api/models/connected_repository_request.py +190 -0
  65. cloudsmith_api/models/connected_repository_request_patch.py +189 -0
  66. cloudsmith_api/models/cran_package_upload.py +2594 -0
  67. cloudsmith_api/models/cran_package_upload_request.py +311 -0
  68. cloudsmith_api/models/cran_upstream.py +872 -0
  69. cloudsmith_api/models/cran_upstream_request.py +529 -0
  70. cloudsmith_api/models/cran_upstream_request_patch.py +527 -0
  71. cloudsmith_api/models/dart_package_upload.py +2560 -0
  72. cloudsmith_api/models/dart_package_upload_request.py +246 -0
  73. cloudsmith_api/models/dart_upstream.py +872 -0
  74. cloudsmith_api/models/dart_upstream_request.py +529 -0
  75. cloudsmith_api/models/dart_upstream_request_patch.py +527 -0
  76. cloudsmith_api/models/deb_package_upload.py +2560 -0
  77. cloudsmith_api/models/deb_package_upload_request.py +377 -0
  78. cloudsmith_api/models/deb_upstream.py +1152 -0
  79. cloudsmith_api/models/deb_upstream_request.py +748 -0
  80. cloudsmith_api/models/deb_upstream_request_patch.py +745 -0
  81. cloudsmith_api/models/distribution.py +217 -0
  82. cloudsmith_api/models/distribution_full.py +300 -0
  83. cloudsmith_api/models/distribution_version.py +160 -0
  84. cloudsmith_api/models/docker_package_upload.py +2560 -0
  85. cloudsmith_api/models/docker_package_upload_request.py +246 -0
  86. cloudsmith_api/models/docker_upstream.py +760 -0
  87. cloudsmith_api/models/docker_upstream_request.py +591 -0
  88. cloudsmith_api/models/docker_upstream_request_patch.py +589 -0
  89. cloudsmith_api/models/dynamic_mapping.py +162 -0
  90. cloudsmith_api/models/entitlement_usage_metrics.py +125 -0
  91. cloudsmith_api/models/error_detail.py +158 -0
  92. cloudsmith_api/models/eula.py +166 -0
  93. cloudsmith_api/models/format.py +369 -0
  94. cloudsmith_api/models/format_support.py +299 -0
  95. cloudsmith_api/models/format_support_upstream.py +350 -0
  96. cloudsmith_api/models/generic_package_upload.py +2566 -0
  97. cloudsmith_api/models/generic_package_upload_request.py +343 -0
  98. cloudsmith_api/models/generic_upstream.py +906 -0
  99. cloudsmith_api/models/generic_upstream_request.py +563 -0
  100. cloudsmith_api/models/generic_upstream_request_patch.py +561 -0
  101. cloudsmith_api/models/geo_ip_location.py +296 -0
  102. cloudsmith_api/models/go_package_upload.py +2560 -0
  103. cloudsmith_api/models/go_package_upload_request.py +246 -0
  104. cloudsmith_api/models/go_upstream.py +872 -0
  105. cloudsmith_api/models/go_upstream_request.py +529 -0
  106. cloudsmith_api/models/go_upstream_request_patch.py +527 -0
  107. cloudsmith_api/models/helm_package_upload.py +2560 -0
  108. cloudsmith_api/models/helm_package_upload_request.py +277 -0
  109. cloudsmith_api/models/helm_upstream.py +872 -0
  110. cloudsmith_api/models/helm_upstream_request.py +529 -0
  111. cloudsmith_api/models/helm_upstream_request_patch.py +527 -0
  112. cloudsmith_api/models/hex_package_upload.py +2560 -0
  113. cloudsmith_api/models/hex_package_upload_request.py +246 -0
  114. cloudsmith_api/models/hex_upstream.py +872 -0
  115. cloudsmith_api/models/hex_upstream_request.py +529 -0
  116. cloudsmith_api/models/hex_upstream_request_patch.py +527 -0
  117. cloudsmith_api/models/history.py +265 -0
  118. cloudsmith_api/models/history_fieldset.py +179 -0
  119. cloudsmith_api/models/history_fieldset_raw.py +179 -0
  120. cloudsmith_api/models/huggingface_package_upload.py +2560 -0
  121. cloudsmith_api/models/huggingface_package_upload_request.py +246 -0
  122. cloudsmith_api/models/huggingface_upstream.py +872 -0
  123. cloudsmith_api/models/huggingface_upstream_request.py +529 -0
  124. cloudsmith_api/models/huggingface_upstream_request_patch.py +527 -0
  125. cloudsmith_api/models/inline_response200.py +238 -0
  126. cloudsmith_api/models/inline_response2001.py +182 -0
  127. cloudsmith_api/models/inline_response2002.py +125 -0
  128. cloudsmith_api/models/inline_response2003.py +125 -0
  129. cloudsmith_api/models/inline_response2004.py +125 -0
  130. cloudsmith_api/models/luarocks_package_upload.py +2560 -0
  131. cloudsmith_api/models/luarocks_package_upload_request.py +246 -0
  132. cloudsmith_api/models/maven_package_upload.py +2714 -0
  133. cloudsmith_api/models/maven_package_upload_request.py +611 -0
  134. cloudsmith_api/models/maven_upstream.py +1062 -0
  135. cloudsmith_api/models/maven_upstream_request.py +658 -0
  136. cloudsmith_api/models/maven_upstream_request_patch.py +656 -0
  137. cloudsmith_api/models/mcp_package_upload.py +2563 -0
  138. cloudsmith_api/models/mcp_package_upload_request.py +277 -0
  139. cloudsmith_api/models/member_teams.py +192 -0
  140. cloudsmith_api/models/namespace.py +211 -0
  141. cloudsmith_api/models/namespace_audit_log.py +562 -0
  142. cloudsmith_api/models/nested_license_policy.py +374 -0
  143. cloudsmith_api/models/nested_vulnerability_policy.py +382 -0
  144. cloudsmith_api/models/nested_vulnerability_scan_results.py +298 -0
  145. cloudsmith_api/models/nix_package_upload.py +2563 -0
  146. cloudsmith_api/models/nix_package_upload_request.py +308 -0
  147. cloudsmith_api/models/nix_upstream.py +872 -0
  148. cloudsmith_api/models/nix_upstream_request.py +529 -0
  149. cloudsmith_api/models/nix_upstream_request_patch.py +527 -0
  150. cloudsmith_api/models/npm_package_upload.py +2560 -0
  151. cloudsmith_api/models/npm_package_upload_request.py +277 -0
  152. cloudsmith_api/models/npm_upstream.py +907 -0
  153. cloudsmith_api/models/npm_upstream_request.py +564 -0
  154. cloudsmith_api/models/npm_upstream_request_patch.py +562 -0
  155. cloudsmith_api/models/nuget_package_upload.py +2560 -0
  156. cloudsmith_api/models/nuget_package_upload_request.py +277 -0
  157. cloudsmith_api/models/nuget_upstream.py +872 -0
  158. cloudsmith_api/models/nuget_upstream_request.py +529 -0
  159. cloudsmith_api/models/nuget_upstream_request_patch.py +527 -0
  160. cloudsmith_api/models/oidc.py +96 -0
  161. cloudsmith_api/models/oidc1.py +126 -0
  162. cloudsmith_api/models/oidc_request.py +162 -0
  163. cloudsmith_api/models/organization.py +294 -0
  164. cloudsmith_api/models/organization_custom_domain_nested_repo.py +160 -0
  165. cloudsmith_api/models/organization_custom_domains.py +598 -0
  166. cloudsmith_api/models/organization_group_sync.py +259 -0
  167. cloudsmith_api/models/organization_group_sync_request.py +254 -0
  168. cloudsmith_api/models/organization_group_sync_status.py +124 -0
  169. cloudsmith_api/models/organization_invite.py +386 -0
  170. cloudsmith_api/models/organization_invite_extend.py +388 -0
  171. cloudsmith_api/models/organization_invite_request.py +221 -0
  172. cloudsmith_api/models/organization_invite_update.py +133 -0
  173. cloudsmith_api/models/organization_invite_update_request_patch.py +133 -0
  174. cloudsmith_api/models/organization_membership.py +469 -0
  175. cloudsmith_api/models/organization_membership_request_patch.py +96 -0
  176. cloudsmith_api/models/organization_membership_role_update.py +417 -0
  177. cloudsmith_api/models/organization_membership_role_update_request_patch.py +131 -0
  178. cloudsmith_api/models/organization_membership_visibility_update.py +417 -0
  179. cloudsmith_api/models/organization_membership_visibility_update_request_patch.py +131 -0
  180. cloudsmith_api/models/organization_package_license_policy.py +355 -0
  181. cloudsmith_api/models/organization_package_license_policy_request.py +271 -0
  182. cloudsmith_api/models/organization_package_license_policy_request_patch.py +269 -0
  183. cloudsmith_api/models/organization_package_vulnerability_policy.py +363 -0
  184. cloudsmith_api/models/organization_package_vulnerability_policy_request.py +279 -0
  185. cloudsmith_api/models/organization_package_vulnerability_policy_request_patch.py +278 -0
  186. cloudsmith_api/models/organization_saml_auth.py +276 -0
  187. cloudsmith_api/models/organization_saml_auth_request_patch.py +274 -0
  188. cloudsmith_api/models/organization_team.py +264 -0
  189. cloudsmith_api/models/organization_team_invite.py +168 -0
  190. cloudsmith_api/models/organization_team_members.py +127 -0
  191. cloudsmith_api/models/organization_team_request.py +232 -0
  192. cloudsmith_api/models/organization_team_request_patch.py +231 -0
  193. cloudsmith_api/models/organization_team_service_member.py +195 -0
  194. cloudsmith_api/models/organization_usage.py +210 -0
  195. cloudsmith_api/models/organization_usage_update.py +182 -0
  196. cloudsmith_api/models/organization_usage_update_request_patch.py +182 -0
  197. cloudsmith_api/models/p2_package_upload.py +2560 -0
  198. cloudsmith_api/models/p2_package_upload_request.py +246 -0
  199. cloudsmith_api/models/package.py +2617 -0
  200. cloudsmith_api/models/package_bulk_action.py +228 -0
  201. cloudsmith_api/models/package_bulk_action_response.py +185 -0
  202. cloudsmith_api/models/package_copy.py +2619 -0
  203. cloudsmith_api/models/package_copy_request.py +212 -0
  204. cloudsmith_api/models/package_deny_policy.py +366 -0
  205. cloudsmith_api/models/package_deny_policy_request.py +216 -0
  206. cloudsmith_api/models/package_deny_policy_request_patch.py +215 -0
  207. cloudsmith_api/models/package_dependencies.py +125 -0
  208. cloudsmith_api/models/package_dependency.py +228 -0
  209. cloudsmith_api/models/package_detail.py +2645 -0
  210. cloudsmith_api/models/package_file.py +475 -0
  211. cloudsmith_api/models/package_file_parts_upload.py +191 -0
  212. cloudsmith_api/models/package_file_upload.py +247 -0
  213. cloudsmith_api/models/package_file_upload_request.py +236 -0
  214. cloudsmith_api/models/package_group.py +261 -0
  215. cloudsmith_api/models/package_license.py +276 -0
  216. cloudsmith_api/models/package_license_policy_evaluation_request.py +293 -0
  217. cloudsmith_api/models/package_license_policy_evaluation_request_request.py +96 -0
  218. cloudsmith_api/models/package_license_policy_violation_log.py +205 -0
  219. cloudsmith_api/models/package_license_policy_violation_log_cursor_page.py +177 -0
  220. cloudsmith_api/models/package_license_request_patch.py +309 -0
  221. cloudsmith_api/models/package_move.py +2619 -0
  222. cloudsmith_api/models/package_move_request.py +184 -0
  223. cloudsmith_api/models/package_quarantine.py +2589 -0
  224. cloudsmith_api/models/package_quarantine_request.py +208 -0
  225. cloudsmith_api/models/package_recycle_bin.py +197 -0
  226. cloudsmith_api/models/package_resync.py +2617 -0
  227. cloudsmith_api/models/package_status.py +762 -0
  228. cloudsmith_api/models/package_tag.py +2619 -0
  229. cloudsmith_api/models/package_tag_request.py +241 -0
  230. cloudsmith_api/models/package_usage_metrics.py +125 -0
  231. cloudsmith_api/models/package_version_badge.py +96 -0
  232. cloudsmith_api/models/package_vulnerability.py +264 -0
  233. cloudsmith_api/models/package_vulnerability_policy_evaluation_request.py +293 -0
  234. cloudsmith_api/models/package_vulnerability_policy_evaluation_request_request.py +96 -0
  235. cloudsmith_api/models/package_vulnerability_policy_violation_log.py +232 -0
  236. cloudsmith_api/models/package_vulnerability_policy_violation_log_cursor_page.py +177 -0
  237. cloudsmith_api/models/provider_settings.py +347 -0
  238. cloudsmith_api/models/provider_settings_write.py +375 -0
  239. cloudsmith_api/models/provider_settings_write_request.py +307 -0
  240. cloudsmith_api/models/provider_settings_write_request_patch.py +303 -0
  241. cloudsmith_api/models/python_package_upload.py +2560 -0
  242. cloudsmith_api/models/python_package_upload_request.py +246 -0
  243. cloudsmith_api/models/python_upstream.py +907 -0
  244. cloudsmith_api/models/python_upstream_request.py +564 -0
  245. cloudsmith_api/models/python_upstream_request_patch.py +562 -0
  246. cloudsmith_api/models/quota.py +125 -0
  247. cloudsmith_api/models/quota_history.py +125 -0
  248. cloudsmith_api/models/rate_check.py +269 -0
  249. cloudsmith_api/models/raw_package_upload.py +2572 -0
  250. cloudsmith_api/models/raw_package_upload_request.py +404 -0
  251. cloudsmith_api/models/recycle_bin_package.py +829 -0
  252. cloudsmith_api/models/repository.py +2221 -0
  253. cloudsmith_api/models/repository_audit_log.py +470 -0
  254. cloudsmith_api/models/repository_create.py +2221 -0
  255. cloudsmith_api/models/repository_create_request.py +1546 -0
  256. cloudsmith_api/models/repository_ecdsa_key.py +296 -0
  257. cloudsmith_api/models/repository_ecdsa_key_create.py +161 -0
  258. cloudsmith_api/models/repository_ed25519_key.py +299 -0
  259. cloudsmith_api/models/repository_ed25519_key_create.py +161 -0
  260. cloudsmith_api/models/repository_geo_ip_cidr.py +156 -0
  261. cloudsmith_api/models/repository_geo_ip_country_code.py +156 -0
  262. cloudsmith_api/models/repository_geo_ip_rules.py +152 -0
  263. cloudsmith_api/models/repository_geo_ip_rules_request.py +152 -0
  264. cloudsmith_api/models/repository_geo_ip_rules_request_patch.py +150 -0
  265. cloudsmith_api/models/repository_geo_ip_status.py +126 -0
  266. cloudsmith_api/models/repository_geo_ip_test_address.py +127 -0
  267. cloudsmith_api/models/repository_geo_ip_test_address_response.py +127 -0
  268. cloudsmith_api/models/repository_geo_ip_test_address_response_dict.py +223 -0
  269. cloudsmith_api/models/repository_gpg_key.py +298 -0
  270. cloudsmith_api/models/repository_gpg_key_create.py +161 -0
  271. cloudsmith_api/models/repository_privilege_dict.py +236 -0
  272. cloudsmith_api/models/repository_privilege_input.py +127 -0
  273. cloudsmith_api/models/repository_privilege_input_request.py +127 -0
  274. cloudsmith_api/models/repository_privilege_input_request_patch.py +126 -0
  275. cloudsmith_api/models/repository_request_patch.py +1517 -0
  276. cloudsmith_api/models/repository_retention_rules.py +340 -0
  277. cloudsmith_api/models/repository_retention_rules_request_patch.py +340 -0
  278. cloudsmith_api/models/repository_rsa_key.py +296 -0
  279. cloudsmith_api/models/repository_rsa_key_create.py +161 -0
  280. cloudsmith_api/models/repository_token.py +1236 -0
  281. cloudsmith_api/models/repository_token_action.py +96 -0
  282. cloudsmith_api/models/repository_token_private_broadcasts.py +127 -0
  283. cloudsmith_api/models/repository_token_private_broadcasts_request.py +127 -0
  284. cloudsmith_api/models/repository_token_refresh.py +1235 -0
  285. cloudsmith_api/models/repository_token_refresh_request.py +523 -0
  286. cloudsmith_api/models/repository_token_request.py +553 -0
  287. cloudsmith_api/models/repository_token_request_patch.py +552 -0
  288. cloudsmith_api/models/repository_token_sync.py +126 -0
  289. cloudsmith_api/models/repository_token_sync_request.py +130 -0
  290. cloudsmith_api/models/repository_transfer_region.py +126 -0
  291. cloudsmith_api/models/repository_transfer_region_request.py +126 -0
  292. cloudsmith_api/models/repository_webhook.py +871 -0
  293. cloudsmith_api/models/repository_webhook_request.py +471 -0
  294. cloudsmith_api/models/repository_webhook_request_patch.py +468 -0
  295. cloudsmith_api/models/repository_x509_ecdsa_certificate.py +375 -0
  296. cloudsmith_api/models/repository_x509_rsa_certificate.py +375 -0
  297. cloudsmith_api/models/resources_rate_check.py +126 -0
  298. cloudsmith_api/models/respository_geo_ip_enable_disable.py +96 -0
  299. cloudsmith_api/models/respository_geo_ip_enable_disable_request.py +96 -0
  300. cloudsmith_api/models/rpm_package_upload.py +2560 -0
  301. cloudsmith_api/models/rpm_package_upload_request.py +278 -0
  302. cloudsmith_api/models/rpm_upstream.py +1084 -0
  303. cloudsmith_api/models/rpm_upstream_request.py +680 -0
  304. cloudsmith_api/models/rpm_upstream_request_patch.py +677 -0
  305. cloudsmith_api/models/ruby_package_upload.py +2560 -0
  306. cloudsmith_api/models/ruby_package_upload_request.py +246 -0
  307. cloudsmith_api/models/ruby_upstream.py +872 -0
  308. cloudsmith_api/models/ruby_upstream_request.py +529 -0
  309. cloudsmith_api/models/ruby_upstream_request_patch.py +527 -0
  310. cloudsmith_api/models/service.py +399 -0
  311. cloudsmith_api/models/service_request.py +228 -0
  312. cloudsmith_api/models/service_request_patch.py +227 -0
  313. cloudsmith_api/models/service_teams.py +199 -0
  314. cloudsmith_api/models/status_basic.py +160 -0
  315. cloudsmith_api/models/storage_allocated_limit.py +290 -0
  316. cloudsmith_api/models/storage_allocated_limit_raw.py +254 -0
  317. cloudsmith_api/models/storage_region.py +162 -0
  318. cloudsmith_api/models/storage_usage.py +226 -0
  319. cloudsmith_api/models/storage_usage_raw.py +202 -0
  320. cloudsmith_api/models/swift_package_upload.py +2732 -0
  321. cloudsmith_api/models/swift_package_upload_request.py +500 -0
  322. cloudsmith_api/models/swift_upstream.py +872 -0
  323. cloudsmith_api/models/swift_upstream_request.py +529 -0
  324. cloudsmith_api/models/swift_upstream_request_patch.py +527 -0
  325. cloudsmith_api/models/tags.py +96 -0
  326. cloudsmith_api/models/terraform_package_upload.py +2560 -0
  327. cloudsmith_api/models/terraform_package_upload_request.py +246 -0
  328. cloudsmith_api/models/usage.py +194 -0
  329. cloudsmith_api/models/usage_fieldset.py +152 -0
  330. cloudsmith_api/models/usage_limits.py +152 -0
  331. cloudsmith_api/models/usage_limits_raw.py +152 -0
  332. cloudsmith_api/models/usage_raw.py +176 -0
  333. cloudsmith_api/models/user_auth_token.py +188 -0
  334. cloudsmith_api/models/user_auth_token_request.py +191 -0
  335. cloudsmith_api/models/user_authentication_token.py +182 -0
  336. cloudsmith_api/models/user_brief.py +297 -0
  337. cloudsmith_api/models/user_profile.py +386 -0
  338. cloudsmith_api/models/vagrant_package_upload.py +2600 -0
  339. cloudsmith_api/models/vagrant_package_upload_request.py +342 -0
  340. cloudsmith_api/models/vsx_package_upload.py +2560 -0
  341. cloudsmith_api/models/vsx_package_upload_request.py +246 -0
  342. cloudsmith_api/models/vulnerability.py +405 -0
  343. cloudsmith_api/models/vulnerability_scan.py +185 -0
  344. cloudsmith_api/models/vulnerability_scan_results.py +326 -0
  345. cloudsmith_api/models/vulnerability_scan_results_list.py +299 -0
  346. cloudsmith_api/models/vulnerability_scan_version.py +266 -0
  347. cloudsmith_api/models/web_osv_severity_counts.py +280 -0
  348. cloudsmith_api/models/webhook_template.py +160 -0
  349. cloudsmith_api/rest.py +323 -0
  350. cloudsmith_api-2.0.31.dist-info/METADATA +14 -0
  351. cloudsmith_api-2.0.31.dist-info/RECORD +697 -0
  352. cloudsmith_api-2.0.31.dist-info/WHEEL +6 -0
  353. cloudsmith_api-2.0.31.dist-info/top_level.txt +2 -0
  354. test/__init__.py +1 -0
  355. test/test_allocated_limit.py +40 -0
  356. test/test_allocated_limit_raw.py +40 -0
  357. test/test_alpine_package_upload.py +40 -0
  358. test/test_alpine_package_upload_request.py +40 -0
  359. test/test_alpine_upstream.py +40 -0
  360. test/test_alpine_upstream_request.py +40 -0
  361. test/test_alpine_upstream_request_patch.py +40 -0
  362. test/test_architecture.py +40 -0
  363. test/test_audit_log_api.py +48 -0
  364. test/test_badges_api.py +41 -0
  365. test/test_broadcast_token.py +40 -0
  366. test/test_broadcast_token_input.py +40 -0
  367. test/test_broadcasts_api.py +41 -0
  368. test/test_bulk_action_api.py +40 -0
  369. test/test_cargo_package_upload.py +40 -0
  370. test/test_cargo_package_upload_request.py +40 -0
  371. test/test_cargo_upstream.py +40 -0
  372. test/test_cargo_upstream_request.py +40 -0
  373. test/test_cargo_upstream_request_patch.py +40 -0
  374. test/test_cocoapods_package_upload.py +40 -0
  375. test/test_cocoapods_package_upload_request.py +40 -0
  376. test/test_common_bandwidth_metrics.py +40 -0
  377. test/test_common_bandwidth_metrics_value.py +40 -0
  378. test/test_common_downloads_metrics.py +40 -0
  379. test/test_common_downloads_metrics_value.py +40 -0
  380. test/test_common_metrics.py +40 -0
  381. test/test_composer_package_upload.py +40 -0
  382. test/test_composer_package_upload_request.py +40 -0
  383. test/test_composer_upstream.py +40 -0
  384. test/test_composer_upstream_request.py +40 -0
  385. test/test_composer_upstream_request_patch.py +40 -0
  386. test/test_conan_package_upload.py +40 -0
  387. test/test_conan_package_upload_request.py +40 -0
  388. test/test_conda_package_upload.py +40 -0
  389. test/test_conda_package_upload_request.py +40 -0
  390. test/test_conda_upstream.py +40 -0
  391. test/test_conda_upstream_request.py +40 -0
  392. test/test_conda_upstream_request_patch.py +40 -0
  393. test/test_connected_repository.py +40 -0
  394. test/test_connected_repository_request.py +40 -0
  395. test/test_connected_repository_request_patch.py +40 -0
  396. test/test_cran_package_upload.py +40 -0
  397. test/test_cran_package_upload_request.py +40 -0
  398. test/test_cran_upstream.py +40 -0
  399. test/test_cran_upstream_request.py +40 -0
  400. test/test_cran_upstream_request_patch.py +40 -0
  401. test/test_dart_package_upload.py +40 -0
  402. test/test_dart_package_upload_request.py +40 -0
  403. test/test_dart_upstream.py +40 -0
  404. test/test_dart_upstream_request.py +40 -0
  405. test/test_dart_upstream_request_patch.py +40 -0
  406. test/test_deb_package_upload.py +40 -0
  407. test/test_deb_package_upload_request.py +40 -0
  408. test/test_deb_upstream.py +40 -0
  409. test/test_deb_upstream_request.py +40 -0
  410. test/test_deb_upstream_request_patch.py +40 -0
  411. test/test_distribution.py +40 -0
  412. test/test_distribution_full.py +40 -0
  413. test/test_distribution_version.py +40 -0
  414. test/test_distros_api.py +48 -0
  415. test/test_docker_package_upload.py +40 -0
  416. test/test_docker_package_upload_request.py +40 -0
  417. test/test_docker_upstream.py +40 -0
  418. test/test_docker_upstream_request.py +40 -0
  419. test/test_docker_upstream_request_patch.py +40 -0
  420. test/test_dynamic_mapping.py +40 -0
  421. test/test_entitlement_usage_metrics.py +40 -0
  422. test/test_entitlements_api.py +111 -0
  423. test/test_error_detail.py +40 -0
  424. test/test_eula.py +40 -0
  425. test/test_files_api.py +69 -0
  426. test/test_format.py +40 -0
  427. test/test_format_support.py +40 -0
  428. test/test_format_support_upstream.py +40 -0
  429. test/test_formats_api.py +48 -0
  430. test/test_generic_package_upload.py +40 -0
  431. test/test_generic_package_upload_request.py +40 -0
  432. test/test_generic_upstream.py +40 -0
  433. test/test_generic_upstream_request.py +40 -0
  434. test/test_generic_upstream_request_patch.py +40 -0
  435. test/test_geo_ip_location.py +40 -0
  436. test/test_go_package_upload.py +40 -0
  437. test/test_go_package_upload_request.py +40 -0
  438. test/test_go_upstream.py +40 -0
  439. test/test_go_upstream_request.py +40 -0
  440. test/test_go_upstream_request_patch.py +40 -0
  441. test/test_helm_package_upload.py +40 -0
  442. test/test_helm_package_upload_request.py +40 -0
  443. test/test_helm_upstream.py +40 -0
  444. test/test_helm_upstream_request.py +40 -0
  445. test/test_helm_upstream_request_patch.py +40 -0
  446. test/test_hex_package_upload.py +40 -0
  447. test/test_hex_package_upload_request.py +40 -0
  448. test/test_hex_upstream.py +40 -0
  449. test/test_hex_upstream_request.py +40 -0
  450. test/test_hex_upstream_request_patch.py +40 -0
  451. test/test_history.py +40 -0
  452. test/test_history_fieldset.py +40 -0
  453. test/test_history_fieldset_raw.py +40 -0
  454. test/test_huggingface_package_upload.py +40 -0
  455. test/test_huggingface_package_upload_request.py +40 -0
  456. test/test_huggingface_upstream.py +40 -0
  457. test/test_huggingface_upstream_request.py +40 -0
  458. test/test_huggingface_upstream_request_patch.py +40 -0
  459. test/test_inline_response200.py +40 -0
  460. test/test_inline_response2001.py +40 -0
  461. test/test_inline_response2002.py +40 -0
  462. test/test_inline_response2003.py +40 -0
  463. test/test_inline_response2004.py +40 -0
  464. test/test_luarocks_package_upload.py +40 -0
  465. test/test_luarocks_package_upload_request.py +40 -0
  466. test/test_maven_package_upload.py +40 -0
  467. test/test_maven_package_upload_request.py +40 -0
  468. test/test_maven_upstream.py +40 -0
  469. test/test_maven_upstream_request.py +40 -0
  470. test/test_maven_upstream_request_patch.py +40 -0
  471. test/test_mcp_package_upload.py +40 -0
  472. test/test_mcp_package_upload_request.py +40 -0
  473. test/test_member_teams.py +40 -0
  474. test/test_metrics_api.py +55 -0
  475. test/test_namespace.py +40 -0
  476. test/test_namespace_audit_log.py +40 -0
  477. test/test_namespaces_api.py +48 -0
  478. test/test_nested_license_policy.py +40 -0
  479. test/test_nested_vulnerability_policy.py +40 -0
  480. test/test_nested_vulnerability_scan_results.py +40 -0
  481. test/test_nix_package_upload.py +40 -0
  482. test/test_nix_package_upload_request.py +40 -0
  483. test/test_nix_upstream.py +40 -0
  484. test/test_nix_upstream_request.py +40 -0
  485. test/test_nix_upstream_request_patch.py +40 -0
  486. test/test_npm_package_upload.py +40 -0
  487. test/test_npm_package_upload_request.py +40 -0
  488. test/test_npm_upstream.py +40 -0
  489. test/test_npm_upstream_request.py +40 -0
  490. test/test_npm_upstream_request_patch.py +40 -0
  491. test/test_nuget_package_upload.py +40 -0
  492. test/test_nuget_package_upload_request.py +40 -0
  493. test/test_nuget_upstream.py +40 -0
  494. test/test_nuget_upstream_request.py +40 -0
  495. test/test_nuget_upstream_request_patch.py +40 -0
  496. test/test_oidc.py +40 -0
  497. test/test_oidc1.py +40 -0
  498. test/test_oidc_request.py +40 -0
  499. test/test_openid_api.py +41 -0
  500. test/test_organization.py +40 -0
  501. test/test_organization_custom_domain_nested_repo.py +40 -0
  502. test/test_organization_custom_domains.py +40 -0
  503. test/test_organization_group_sync.py +40 -0
  504. test/test_organization_group_sync_request.py +40 -0
  505. test/test_organization_group_sync_status.py +40 -0
  506. test/test_organization_invite.py +40 -0
  507. test/test_organization_invite_extend.py +40 -0
  508. test/test_organization_invite_request.py +40 -0
  509. test/test_organization_invite_update.py +40 -0
  510. test/test_organization_invite_update_request_patch.py +40 -0
  511. test/test_organization_membership.py +40 -0
  512. test/test_organization_membership_request_patch.py +40 -0
  513. test/test_organization_membership_role_update.py +40 -0
  514. test/test_organization_membership_role_update_request_patch.py +40 -0
  515. test/test_organization_membership_visibility_update.py +40 -0
  516. test/test_organization_membership_visibility_update_request_patch.py +40 -0
  517. test/test_organization_package_license_policy.py +40 -0
  518. test/test_organization_package_license_policy_request.py +40 -0
  519. test/test_organization_package_license_policy_request_patch.py +40 -0
  520. test/test_organization_package_vulnerability_policy.py +40 -0
  521. test/test_organization_package_vulnerability_policy_request.py +40 -0
  522. test/test_organization_package_vulnerability_policy_request_patch.py +40 -0
  523. test/test_organization_saml_auth.py +40 -0
  524. test/test_organization_saml_auth_request_patch.py +40 -0
  525. test/test_organization_team.py +40 -0
  526. test/test_organization_team_invite.py +40 -0
  527. test/test_organization_team_members.py +40 -0
  528. test/test_organization_team_request.py +40 -0
  529. test/test_organization_team_request_patch.py +40 -0
  530. test/test_organization_team_service_member.py +40 -0
  531. test/test_organization_usage.py +40 -0
  532. test/test_organization_usage_update.py +40 -0
  533. test/test_organization_usage_update_request_patch.py +40 -0
  534. test/test_orgs_api.py +564 -0
  535. test/test_p2_package_upload.py +40 -0
  536. test/test_p2_package_upload_request.py +40 -0
  537. test/test_package.py +40 -0
  538. test/test_package_bulk_action.py +40 -0
  539. test/test_package_bulk_action_response.py +40 -0
  540. test/test_package_copy.py +40 -0
  541. test/test_package_copy_request.py +40 -0
  542. test/test_package_deny_policy.py +40 -0
  543. test/test_package_deny_policy_request.py +40 -0
  544. test/test_package_deny_policy_request_patch.py +40 -0
  545. test/test_package_dependencies.py +40 -0
  546. test/test_package_dependency.py +40 -0
  547. test/test_package_detail.py +40 -0
  548. test/test_package_file.py +40 -0
  549. test/test_package_file_parts_upload.py +40 -0
  550. test/test_package_file_upload.py +40 -0
  551. test/test_package_file_upload_request.py +40 -0
  552. test/test_package_group.py +40 -0
  553. test/test_package_license.py +40 -0
  554. test/test_package_license_policy_evaluation_request.py +40 -0
  555. test/test_package_license_policy_evaluation_request_request.py +40 -0
  556. test/test_package_license_policy_violation_log.py +40 -0
  557. test/test_package_license_policy_violation_log_cursor_page.py +40 -0
  558. test/test_package_license_request_patch.py +40 -0
  559. test/test_package_move.py +40 -0
  560. test/test_package_move_request.py +40 -0
  561. test/test_package_quarantine.py +40 -0
  562. test/test_package_quarantine_request.py +40 -0
  563. test/test_package_recycle_bin.py +40 -0
  564. test/test_package_resync.py +40 -0
  565. test/test_package_status.py +40 -0
  566. test/test_package_tag.py +40 -0
  567. test/test_package_tag_request.py +40 -0
  568. test/test_package_usage_metrics.py +40 -0
  569. test/test_package_version_badge.py +40 -0
  570. test/test_package_vulnerability.py +40 -0
  571. test/test_package_vulnerability_policy_evaluation_request.py +40 -0
  572. test/test_package_vulnerability_policy_evaluation_request_request.py +40 -0
  573. test/test_package_vulnerability_policy_violation_log.py +40 -0
  574. test/test_package_vulnerability_policy_violation_log_cursor_page.py +40 -0
  575. test/test_packages_api.py +545 -0
  576. test/test_provider_settings.py +40 -0
  577. test/test_provider_settings_write.py +40 -0
  578. test/test_provider_settings_write_request.py +40 -0
  579. test/test_provider_settings_write_request_patch.py +40 -0
  580. test/test_python_package_upload.py +40 -0
  581. test/test_python_package_upload_request.py +40 -0
  582. test/test_python_upstream.py +40 -0
  583. test/test_python_upstream_request.py +40 -0
  584. test/test_python_upstream_request_patch.py +40 -0
  585. test/test_quota.py +40 -0
  586. test/test_quota_api.py +62 -0
  587. test/test_quota_history.py +40 -0
  588. test/test_rate_check.py +40 -0
  589. test/test_rates_api.py +41 -0
  590. test/test_raw_package_upload.py +40 -0
  591. test/test_raw_package_upload_request.py +40 -0
  592. test/test_recycle_bin_api.py +47 -0
  593. test/test_recycle_bin_package.py +40 -0
  594. test/test_repos_api.py +1188 -0
  595. test/test_repository.py +40 -0
  596. test/test_repository_audit_log.py +40 -0
  597. test/test_repository_create.py +40 -0
  598. test/test_repository_create_request.py +40 -0
  599. test/test_repository_ecdsa_key.py +40 -0
  600. test/test_repository_ecdsa_key_create.py +40 -0
  601. test/test_repository_ed25519_key.py +40 -0
  602. test/test_repository_ed25519_key_create.py +40 -0
  603. test/test_repository_geo_ip_cidr.py +40 -0
  604. test/test_repository_geo_ip_country_code.py +40 -0
  605. test/test_repository_geo_ip_rules.py +40 -0
  606. test/test_repository_geo_ip_rules_request.py +40 -0
  607. test/test_repository_geo_ip_rules_request_patch.py +40 -0
  608. test/test_repository_geo_ip_status.py +40 -0
  609. test/test_repository_geo_ip_test_address.py +40 -0
  610. test/test_repository_geo_ip_test_address_response.py +40 -0
  611. test/test_repository_geo_ip_test_address_response_dict.py +40 -0
  612. test/test_repository_gpg_key.py +40 -0
  613. test/test_repository_gpg_key_create.py +40 -0
  614. test/test_repository_privilege_dict.py +40 -0
  615. test/test_repository_privilege_input.py +40 -0
  616. test/test_repository_privilege_input_request.py +40 -0
  617. test/test_repository_privilege_input_request_patch.py +40 -0
  618. test/test_repository_request_patch.py +40 -0
  619. test/test_repository_retention_rules.py +40 -0
  620. test/test_repository_retention_rules_request_patch.py +40 -0
  621. test/test_repository_rsa_key.py +40 -0
  622. test/test_repository_rsa_key_create.py +40 -0
  623. test/test_repository_token.py +40 -0
  624. test/test_repository_token_action.py +40 -0
  625. test/test_repository_token_private_broadcasts.py +40 -0
  626. test/test_repository_token_private_broadcasts_request.py +40 -0
  627. test/test_repository_token_refresh.py +40 -0
  628. test/test_repository_token_refresh_request.py +40 -0
  629. test/test_repository_token_request.py +40 -0
  630. test/test_repository_token_request_patch.py +40 -0
  631. test/test_repository_token_sync.py +40 -0
  632. test/test_repository_token_sync_request.py +40 -0
  633. test/test_repository_transfer_region.py +40 -0
  634. test/test_repository_transfer_region_request.py +40 -0
  635. test/test_repository_webhook.py +40 -0
  636. test/test_repository_webhook_request.py +40 -0
  637. test/test_repository_webhook_request_patch.py +40 -0
  638. test/test_repository_x509_ecdsa_certificate.py +40 -0
  639. test/test_repository_x509_rsa_certificate.py +40 -0
  640. test/test_resources_rate_check.py +40 -0
  641. test/test_respository_geo_ip_enable_disable.py +40 -0
  642. test/test_respository_geo_ip_enable_disable_request.py +40 -0
  643. test/test_rpm_package_upload.py +40 -0
  644. test/test_rpm_package_upload_request.py +40 -0
  645. test/test_rpm_upstream.py +40 -0
  646. test/test_rpm_upstream_request.py +40 -0
  647. test/test_rpm_upstream_request_patch.py +40 -0
  648. test/test_ruby_package_upload.py +40 -0
  649. test/test_ruby_package_upload_request.py +40 -0
  650. test/test_ruby_upstream.py +40 -0
  651. test/test_ruby_upstream_request.py +40 -0
  652. test/test_ruby_upstream_request_patch.py +40 -0
  653. test/test_service.py +40 -0
  654. test/test_service_request.py +40 -0
  655. test/test_service_request_patch.py +40 -0
  656. test/test_service_teams.py +40 -0
  657. test/test_status_api.py +41 -0
  658. test/test_status_basic.py +40 -0
  659. test/test_storage_allocated_limit.py +40 -0
  660. test/test_storage_allocated_limit_raw.py +40 -0
  661. test/test_storage_region.py +40 -0
  662. test/test_storage_regions_api.py +48 -0
  663. test/test_storage_usage.py +40 -0
  664. test/test_storage_usage_raw.py +40 -0
  665. test/test_swift_package_upload.py +40 -0
  666. test/test_swift_package_upload_request.py +40 -0
  667. test/test_swift_upstream.py +40 -0
  668. test/test_swift_upstream_request.py +40 -0
  669. test/test_swift_upstream_request_patch.py +40 -0
  670. test/test_tags.py +40 -0
  671. test/test_terraform_package_upload.py +40 -0
  672. test/test_terraform_package_upload_request.py +40 -0
  673. test/test_usage.py +40 -0
  674. test/test_usage_fieldset.py +40 -0
  675. test/test_usage_limits.py +40 -0
  676. test/test_usage_limits_raw.py +40 -0
  677. test/test_usage_raw.py +40 -0
  678. test/test_user_api.py +69 -0
  679. test/test_user_auth_token.py +40 -0
  680. test/test_user_auth_token_request.py +40 -0
  681. test/test_user_authentication_token.py +40 -0
  682. test/test_user_brief.py +40 -0
  683. test/test_user_profile.py +40 -0
  684. test/test_users_api.py +41 -0
  685. test/test_vagrant_package_upload.py +40 -0
  686. test/test_vagrant_package_upload_request.py +40 -0
  687. test/test_vsx_package_upload.py +40 -0
  688. test/test_vsx_package_upload_request.py +40 -0
  689. test/test_vulnerabilities_api.py +62 -0
  690. test/test_vulnerability.py +40 -0
  691. test/test_vulnerability_scan.py +40 -0
  692. test/test_vulnerability_scan_results.py +40 -0
  693. test/test_vulnerability_scan_results_list.py +40 -0
  694. test/test_vulnerability_scan_version.py +40 -0
  695. test/test_web_osv_severity_counts.py +40 -0
  696. test/test_webhook_template.py +40 -0
  697. test/test_webhooks_api.py +69 -0
@@ -0,0 +1,639 @@
1
+ # coding: utf-8
2
+ """
3
+ Cloudsmith API (v1)
4
+
5
+ The API to the Cloudsmith Service # noqa: E501
6
+
7
+ OpenAPI spec version: v1
8
+ Contact: support@cloudsmith.io
9
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
10
+ """
11
+
12
+ from __future__ import absolute_import
13
+
14
+ import datetime
15
+ import json
16
+ import mimetypes
17
+ from multiprocessing.pool import ThreadPool
18
+ import os
19
+ import re
20
+ import tempfile
21
+
22
+ # python 2 and python 3 compatibility library
23
+ import six
24
+ from six.moves.urllib.parse import quote
25
+
26
+ from cloudsmith_api.configuration import Configuration
27
+ import cloudsmith_api.models
28
+ from cloudsmith_api import rest
29
+
30
+
31
+ class ApiClient(object):
32
+ """Generic API client for Swagger client library builds.
33
+
34
+ Swagger generic API client. This client handles the client-
35
+ server communication, and is invariant across implementations. Specifics of
36
+ the methods and models for each application are generated from the Swagger
37
+ templates.
38
+
39
+ NOTE: This class is auto generated by the swagger code generator program.
40
+ Ref: https://github.com/swagger-api/swagger-codegen
41
+ Do not edit the class manually.
42
+
43
+ :param configuration: .Configuration object for this client
44
+ :param header_name: a header to pass when making calls to the API.
45
+ :param header_value: a header value to pass when making calls to
46
+ the API.
47
+ :param cookie: a cookie to include in the header when making calls
48
+ to the API
49
+ """
50
+
51
+ PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
52
+ NATIVE_TYPES_MAPPING = {
53
+ 'int': int,
54
+ 'long': int if six.PY3 else long, # noqa: F821
55
+ 'float': float,
56
+ 'str': str,
57
+ 'bool': bool,
58
+ 'date': datetime.date,
59
+ 'datetime': datetime.datetime,
60
+ 'object': object,
61
+ }
62
+
63
+ def __init__(self, configuration=None, header_name=None, header_value=None,
64
+ cookie=None):
65
+ if configuration is None:
66
+ configuration = Configuration()
67
+ self.configuration = configuration
68
+
69
+ # Use the pool property to lazily initialize the ThreadPool.
70
+ self._pool = None
71
+ self.rest_client = rest.RESTClientObject(configuration)
72
+ self.default_headers = {}
73
+ if header_name is not None:
74
+ self.default_headers[header_name] = header_value
75
+ self.cookie = cookie
76
+ # Set default User-Agent.
77
+ self.user_agent = 'Swagger-Codegen/2.0.31/python'
78
+ self.client_side_validation = configuration.client_side_validation
79
+
80
+ def __del__(self):
81
+ if self._pool is not None:
82
+ self._pool.close()
83
+ self._pool.join()
84
+
85
+ @property
86
+ def pool(self):
87
+ if self._pool is None:
88
+ self._pool = ThreadPool()
89
+ return self._pool
90
+
91
+ @property
92
+ def user_agent(self):
93
+ """User agent for this API client"""
94
+ return self.default_headers['User-Agent']
95
+
96
+ @user_agent.setter
97
+ def user_agent(self, value):
98
+ self.default_headers['User-Agent'] = value
99
+
100
+ def set_default_header(self, header_name, header_value):
101
+ self.default_headers[header_name] = header_value
102
+
103
+ def __call_api(
104
+ self, resource_path, method, path_params=None,
105
+ query_params=None, header_params=None, body=None, post_params=None,
106
+ files=None, response_type=None, auth_settings=None,
107
+ _return_http_data_only=None, collection_formats=None,
108
+ _preload_content=True, _request_timeout=None):
109
+
110
+ config = self.configuration
111
+
112
+ # header parameters
113
+ header_params = header_params or {}
114
+ header_params.update(self.default_headers)
115
+ if self.cookie:
116
+ header_params['Cookie'] = self.cookie
117
+ if header_params:
118
+ header_params = self.sanitize_for_serialization(header_params)
119
+ header_params = dict(self.parameters_to_tuples(header_params,
120
+ collection_formats))
121
+
122
+ # path parameters
123
+ if path_params:
124
+ path_params = self.sanitize_for_serialization(path_params)
125
+ path_params = self.parameters_to_tuples(path_params,
126
+ collection_formats)
127
+ for k, v in path_params:
128
+ # specified safe chars, encode everything
129
+ resource_path = resource_path.replace(
130
+ '{%s}' % k,
131
+ quote(str(v), safe=config.safe_chars_for_path_param)
132
+ )
133
+
134
+ # query parameters
135
+ if query_params:
136
+ query_params = self.sanitize_for_serialization(query_params)
137
+ query_params = self.parameters_to_tuples(query_params,
138
+ collection_formats)
139
+
140
+ # post parameters
141
+ if post_params or files:
142
+ post_params = self.prepare_post_parameters(post_params, files)
143
+ post_params = self.sanitize_for_serialization(post_params)
144
+ post_params = self.parameters_to_tuples(post_params,
145
+ collection_formats)
146
+
147
+ # auth setting
148
+ self.update_params_for_auth(header_params, query_params, auth_settings)
149
+
150
+ # body
151
+ if body:
152
+ body = self.sanitize_for_serialization(body)
153
+
154
+ # request url
155
+ url = self.configuration.host + resource_path
156
+
157
+ # perform request and return response
158
+ response_data = self.request(
159
+ method, url, query_params=query_params, headers=header_params,
160
+ post_params=post_params, body=body,
161
+ _preload_content=_preload_content,
162
+ _request_timeout=_request_timeout)
163
+
164
+ self.last_response = response_data
165
+
166
+ return_data = response_data
167
+ if _preload_content:
168
+ # deserialize response data
169
+ if response_type:
170
+ return_data = self.deserialize(response_data, response_type)
171
+ else:
172
+ return_data = None
173
+
174
+ if _return_http_data_only:
175
+ return (return_data)
176
+ else:
177
+ return (return_data, response_data.status,
178
+ response_data.getheaders())
179
+
180
+ def sanitize_for_serialization(self, obj):
181
+ """Builds a JSON POST object.
182
+
183
+ If obj is None, return None.
184
+ If obj is str, int, long, float, bool, return directly.
185
+ If obj is datetime.datetime, datetime.date
186
+ convert to string in iso8601 format.
187
+ If obj is list, sanitize each element in the list.
188
+ If obj is dict, return the dict.
189
+ If obj is swagger model, return the properties dict.
190
+
191
+ :param obj: The data to serialize.
192
+ :return: The serialized form of data.
193
+ """
194
+ if obj is None:
195
+ return None
196
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
197
+ return obj
198
+ elif isinstance(obj, list):
199
+ return [self.sanitize_for_serialization(sub_obj)
200
+ for sub_obj in obj]
201
+ elif isinstance(obj, tuple):
202
+ return tuple(self.sanitize_for_serialization(sub_obj)
203
+ for sub_obj in obj)
204
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
205
+ return obj.isoformat()
206
+
207
+ if isinstance(obj, dict):
208
+ obj_dict = obj
209
+ else:
210
+ # Convert model obj to dict except
211
+ # attributes `swagger_types`, `attribute_map`
212
+ # and attributes which value is not None.
213
+ # Convert attribute name to json key in
214
+ # model definition for request.
215
+ obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
216
+ for attr, _ in six.iteritems(obj.swagger_types)
217
+ if getattr(obj, attr) is not None}
218
+
219
+ return {key: self.sanitize_for_serialization(val)
220
+ for key, val in six.iteritems(obj_dict)}
221
+
222
+ def deserialize(self, response, response_type):
223
+ """Deserializes response into an object.
224
+
225
+ :param response: RESTResponse object to be deserialized.
226
+ :param response_type: class literal for
227
+ deserialized object, or string of class name.
228
+
229
+ :return: deserialized object.
230
+ """
231
+ # handle file downloading
232
+ # save response body into a tmp file and return the instance
233
+ if response_type == "file":
234
+ return self.__deserialize_file(response)
235
+
236
+ # fetch data from response object
237
+ try:
238
+ data = json.loads(response.data)
239
+ except ValueError:
240
+ data = response.data
241
+
242
+ return self.__deserialize(data, response_type)
243
+
244
+ def __deserialize(self, data, klass):
245
+ """Deserializes dict, list, str into an object.
246
+
247
+ :param data: dict, list or str.
248
+ :param klass: class literal, or string of class name.
249
+
250
+ :return: object.
251
+ """
252
+ if data is None:
253
+ return None
254
+
255
+ if type(klass) == str:
256
+ if klass.startswith('list['):
257
+ sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
258
+ return [self.__deserialize(sub_data, sub_kls)
259
+ for sub_data in data]
260
+
261
+ if klass.startswith('dict('):
262
+ sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
263
+ return {k: self.__deserialize(v, sub_kls)
264
+ for k, v in six.iteritems(data)}
265
+
266
+ # convert str to class
267
+ if klass in self.NATIVE_TYPES_MAPPING:
268
+ klass = self.NATIVE_TYPES_MAPPING[klass]
269
+ else:
270
+ klass = getattr(cloudsmith_api.models, klass)
271
+
272
+ if klass in self.PRIMITIVE_TYPES:
273
+ return self.__deserialize_primitive(data, klass)
274
+ elif klass == object:
275
+ return self.__deserialize_object(data)
276
+ elif klass == datetime.date:
277
+ return self.__deserialize_date(data)
278
+ elif klass == datetime.datetime:
279
+ return self.__deserialize_datatime(data)
280
+ else:
281
+ return self.__deserialize_model(data, klass)
282
+
283
+ def call_api(self, resource_path, method,
284
+ path_params=None, query_params=None, header_params=None,
285
+ body=None, post_params=None, files=None,
286
+ response_type=None, auth_settings=None, async_req=None,
287
+ _return_http_data_only=None, collection_formats=None,
288
+ _preload_content=True, _request_timeout=None):
289
+ """Makes the HTTP request (synchronous) and returns deserialized data.
290
+
291
+ To make an async request, set the async_req parameter.
292
+
293
+ :param resource_path: Path to method endpoint.
294
+ :param method: Method to call.
295
+ :param path_params: Path parameters in the url.
296
+ :param query_params: Query parameters in the url.
297
+ :param header_params: Header parameters to be
298
+ placed in the request header.
299
+ :param body: Request body.
300
+ :param post_params dict: Request post form parameters,
301
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
302
+ :param auth_settings list: Auth Settings names for the request.
303
+ :param response: Response data type.
304
+ :param files dict: key -> filename, value -> filepath,
305
+ for `multipart/form-data`.
306
+ :param async_req bool: execute request asynchronously
307
+ :param _return_http_data_only: response data without head status code
308
+ and headers
309
+ :param collection_formats: dict of collection formats for path, query,
310
+ header, and post parameters.
311
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
312
+ be returned without reading/decoding response
313
+ data. Default is True.
314
+ :param _request_timeout: timeout setting for this request. If one
315
+ number provided, it will be total request
316
+ timeout. It can also be a pair (tuple) of
317
+ (connection, read) timeouts.
318
+ :return:
319
+ If async_req parameter is True,
320
+ the request will be called asynchronously.
321
+ The method will return the request thread.
322
+ If parameter async_req is False or missing,
323
+ then the method will return the response directly.
324
+ """
325
+ if not async_req:
326
+ return self.__call_api(resource_path, method,
327
+ path_params, query_params, header_params,
328
+ body, post_params, files,
329
+ response_type, auth_settings,
330
+ _return_http_data_only, collection_formats,
331
+ _preload_content, _request_timeout)
332
+ else:
333
+ thread = self.pool.apply_async(self.__call_api, (resource_path,
334
+ method, path_params, query_params,
335
+ header_params, body,
336
+ post_params, files,
337
+ response_type, auth_settings,
338
+ _return_http_data_only,
339
+ collection_formats,
340
+ _preload_content, _request_timeout))
341
+ return thread
342
+
343
+ def request(self, method, url, query_params=None, headers=None,
344
+ post_params=None, body=None, _preload_content=True,
345
+ _request_timeout=None):
346
+ """Makes the HTTP request using RESTClient."""
347
+ if method == "GET":
348
+ return self.rest_client.GET(url,
349
+ query_params=query_params,
350
+ _preload_content=_preload_content,
351
+ _request_timeout=_request_timeout,
352
+ headers=headers)
353
+ elif method == "HEAD":
354
+ return self.rest_client.HEAD(url,
355
+ query_params=query_params,
356
+ _preload_content=_preload_content,
357
+ _request_timeout=_request_timeout,
358
+ headers=headers)
359
+ elif method == "OPTIONS":
360
+ return self.rest_client.OPTIONS(url,
361
+ query_params=query_params,
362
+ headers=headers,
363
+ post_params=post_params,
364
+ _preload_content=_preload_content,
365
+ _request_timeout=_request_timeout,
366
+ body=body)
367
+ elif method == "POST":
368
+ return self.rest_client.POST(url,
369
+ query_params=query_params,
370
+ headers=headers,
371
+ post_params=post_params,
372
+ _preload_content=_preload_content,
373
+ _request_timeout=_request_timeout,
374
+ body=body)
375
+ elif method == "PUT":
376
+ return self.rest_client.PUT(url,
377
+ query_params=query_params,
378
+ headers=headers,
379
+ post_params=post_params,
380
+ _preload_content=_preload_content,
381
+ _request_timeout=_request_timeout,
382
+ body=body)
383
+ elif method == "PATCH":
384
+ return self.rest_client.PATCH(url,
385
+ query_params=query_params,
386
+ headers=headers,
387
+ post_params=post_params,
388
+ _preload_content=_preload_content,
389
+ _request_timeout=_request_timeout,
390
+ body=body)
391
+ elif method == "DELETE":
392
+ return self.rest_client.DELETE(url,
393
+ query_params=query_params,
394
+ headers=headers,
395
+ _preload_content=_preload_content,
396
+ _request_timeout=_request_timeout,
397
+ body=body)
398
+ else:
399
+ raise ValueError(
400
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
401
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
402
+ )
403
+
404
+ def parameters_to_tuples(self, params, collection_formats):
405
+ """Get parameters as list of tuples, formatting collections.
406
+
407
+ :param params: Parameters as dict or list of two-tuples
408
+ :param dict collection_formats: Parameter collection formats
409
+ :return: Parameters as list of tuples, collections formatted
410
+ """
411
+ new_params = []
412
+ if collection_formats is None:
413
+ collection_formats = {}
414
+ for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
415
+ if k in collection_formats:
416
+ collection_format = collection_formats[k]
417
+ if collection_format == 'multi':
418
+ new_params.extend((k, value) for value in v)
419
+ else:
420
+ if collection_format == 'ssv':
421
+ delimiter = ' '
422
+ elif collection_format == 'tsv':
423
+ delimiter = '\t'
424
+ elif collection_format == 'pipes':
425
+ delimiter = '|'
426
+ else: # csv is the default
427
+ delimiter = ','
428
+ new_params.append(
429
+ (k, delimiter.join(str(value) for value in v)))
430
+ else:
431
+ new_params.append((k, v))
432
+ return new_params
433
+
434
+ def prepare_post_parameters(self, post_params=None, files=None):
435
+ """Builds form parameters.
436
+
437
+ :param post_params: Normal form parameters.
438
+ :param files: File parameters.
439
+ :return: Form parameters with files.
440
+ """
441
+ params = []
442
+
443
+ if post_params:
444
+ params = post_params
445
+
446
+ if files:
447
+ for k, v in six.iteritems(files):
448
+ if not v:
449
+ continue
450
+ file_names = v if type(v) is list else [v]
451
+ for n in file_names:
452
+ with open(n, 'rb') as f:
453
+ filename = os.path.basename(f.name)
454
+ filedata = f.read()
455
+ mimetype = (mimetypes.guess_type(filename)[0] or
456
+ 'application/octet-stream')
457
+ params.append(
458
+ tuple([k, tuple([filename, filedata, mimetype])]))
459
+
460
+ return params
461
+
462
+ def select_header_accept(self, accepts):
463
+ """Returns `Accept` based on an array of accepts provided.
464
+
465
+ :param accepts: List of headers.
466
+ :return: Accept (e.g. application/json).
467
+ """
468
+ if not accepts:
469
+ return
470
+
471
+ accepts = [x.lower() for x in accepts]
472
+
473
+ if 'application/json' in accepts:
474
+ return 'application/json'
475
+ else:
476
+ return ', '.join(accepts)
477
+
478
+ def select_header_content_type(self, content_types):
479
+ """Returns `Content-Type` based on an array of content_types provided.
480
+
481
+ :param content_types: List of content-types.
482
+ :return: Content-Type (e.g. application/json).
483
+ """
484
+ if not content_types:
485
+ return 'application/json'
486
+
487
+ content_types = [x.lower() for x in content_types]
488
+
489
+ if 'application/json' in content_types or '*/*' in content_types:
490
+ return 'application/json'
491
+ else:
492
+ return content_types[0]
493
+
494
+ def update_params_for_auth(self, headers, querys, auth_settings):
495
+ """Updates header and query params based on authentication setting.
496
+
497
+ :param headers: Header parameters dict to be updated.
498
+ :param querys: Query parameters tuple list to be updated.
499
+ :param auth_settings: Authentication setting identifiers list.
500
+ """
501
+ if not auth_settings:
502
+ return
503
+
504
+ for auth in auth_settings:
505
+ auth_setting = self.configuration.auth_settings().get(auth)
506
+ if auth_setting:
507
+ if not auth_setting['value']:
508
+ continue
509
+ elif auth_setting['in'] == 'header':
510
+ headers[auth_setting['key']] = auth_setting['value']
511
+ elif auth_setting['in'] == 'query':
512
+ querys.append((auth_setting['key'], auth_setting['value']))
513
+ else:
514
+ raise ValueError(
515
+ 'Authentication token must be in `query` or `header`'
516
+ )
517
+
518
+ def __deserialize_file(self, response):
519
+ """Deserializes body to file
520
+
521
+ Saves response body into a file in a temporary folder,
522
+ using the filename from the `Content-Disposition` header if provided.
523
+
524
+ :param response: RESTResponse.
525
+ :return: file path.
526
+ """
527
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
528
+ os.close(fd)
529
+ os.remove(path)
530
+
531
+ content_disposition = response.getheader("Content-Disposition")
532
+ if content_disposition:
533
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
534
+ content_disposition).group(1)
535
+ path = os.path.join(os.path.dirname(path), filename)
536
+
537
+ with open(path, "w") as f:
538
+ f.write(response.data)
539
+
540
+ return path
541
+
542
+ def __deserialize_primitive(self, data, klass):
543
+ """Deserializes string to primitive type.
544
+
545
+ :param data: str.
546
+ :param klass: class literal.
547
+
548
+ :return: int, long, float, str, bool.
549
+ """
550
+ try:
551
+ return klass(data)
552
+ except UnicodeEncodeError:
553
+ return six.text_type(data)
554
+ except TypeError:
555
+ return data
556
+
557
+ def __deserialize_object(self, value):
558
+ """Return a original value.
559
+
560
+ :return: object.
561
+ """
562
+ return value
563
+
564
+ def __deserialize_date(self, string):
565
+ """Deserializes string to date.
566
+
567
+ :param string: str.
568
+ :return: date.
569
+ """
570
+ try:
571
+ from dateutil.parser import parse
572
+ return parse(string).date()
573
+ except ImportError:
574
+ return string
575
+ except ValueError:
576
+ raise rest.ApiException(
577
+ status=0,
578
+ reason="Failed to parse `{0}` as date object".format(string)
579
+ )
580
+
581
+ def __deserialize_datatime(self, string):
582
+ """Deserializes string to datetime.
583
+
584
+ The string should be in iso8601 datetime format.
585
+
586
+ :param string: str.
587
+ :return: datetime.
588
+ """
589
+ try:
590
+ from dateutil.parser import parse
591
+ return parse(string)
592
+ except ImportError:
593
+ return string
594
+ except ValueError:
595
+ raise rest.ApiException(
596
+ status=0,
597
+ reason=(
598
+ "Failed to parse `{0}` as datetime object"
599
+ .format(string)
600
+ )
601
+ )
602
+
603
+ def __hasattr(self, object, name):
604
+ return name in object.__class__.__dict__
605
+
606
+ def __deserialize_model(self, data, klass):
607
+ """Deserializes list or dict to model.
608
+
609
+ :param data: dict, list.
610
+ :param klass: class literal.
611
+ :return: model object.
612
+ """
613
+
614
+ if (not klass.swagger_types and
615
+ not self.__hasattr(klass, 'get_real_child_model')):
616
+ return data
617
+
618
+ kwargs = {}
619
+ if klass.swagger_types is not None:
620
+ for attr, attr_type in six.iteritems(klass.swagger_types):
621
+ if (data is not None and
622
+ klass.attribute_map[attr] in data and
623
+ isinstance(data, (list, dict))):
624
+ value = data[klass.attribute_map[attr]]
625
+ kwargs[attr] = self.__deserialize(value, attr_type)
626
+
627
+ instance = klass(**kwargs)
628
+
629
+ if (isinstance(instance, dict) and
630
+ klass.swagger_types is not None and
631
+ isinstance(data, dict)):
632
+ for key, value in data.items():
633
+ if key not in klass.swagger_types:
634
+ instance[key] = value
635
+ if self.__hasattr(instance, 'get_real_child_model'):
636
+ klass_name = instance.get_real_child_model(data)
637
+ if klass_name:
638
+ instance = self.__deserialize(data, klass_name)
639
+ return instance