vrchatapi-async 1.20.8.dev1__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 (362) hide show
  1. vrchatapi/__init__.py +742 -0
  2. vrchatapi/api/__init__.py +23 -0
  3. vrchatapi/api/authentication_api.py +6253 -0
  4. vrchatapi/api/avatars_api.py +4234 -0
  5. vrchatapi/api/calendar_api.py +4090 -0
  6. vrchatapi/api/economy_api.py +11547 -0
  7. vrchatapi/api/favorites_api.py +2368 -0
  8. vrchatapi/api/files_api.py +6109 -0
  9. vrchatapi/api/friends_api.py +1708 -0
  10. vrchatapi/api/groups_api.py +15085 -0
  11. vrchatapi/api/instances_api.py +1754 -0
  12. vrchatapi/api/inventory_api.py +4333 -0
  13. vrchatapi/api/invite_api.py +3337 -0
  14. vrchatapi/api/jams_api.py +1446 -0
  15. vrchatapi/api/miscellaneous_api.py +2384 -0
  16. vrchatapi/api/notifications_api.py +3624 -0
  17. vrchatapi/api/playermoderation_api.py +1127 -0
  18. vrchatapi/api/prints_api.py +1478 -0
  19. vrchatapi/api/props_api.py +2269 -0
  20. vrchatapi/api/users_api.py +7894 -0
  21. vrchatapi/api/worlds_api.py +6153 -0
  22. vrchatapi/api_client.py +865 -0
  23. vrchatapi/api_response.py +21 -0
  24. vrchatapi/configuration.py +686 -0
  25. vrchatapi/exceptions.py +218 -0
  26. vrchatapi/models/__init__.py +345 -0
  27. vrchatapi/models/account_deletion_log.py +253 -0
  28. vrchatapi/models/add_favorite_request.py +246 -0
  29. vrchatapi/models/add_group_gallery_image_request.py +234 -0
  30. vrchatapi/models/admin_asset_bundle.py +337 -0
  31. vrchatapi/models/admin_unity_package.py +261 -0
  32. vrchatapi/models/age_verification_status.py +38 -0
  33. vrchatapi/models/agreement.py +280 -0
  34. vrchatapi/models/agreement_code.py +36 -0
  35. vrchatapi/models/agreement_request.py +256 -0
  36. vrchatapi/models/agreement_status.py +261 -0
  37. vrchatapi/models/api_config.py +1299 -0
  38. vrchatapi/models/api_config_access_logs_urls.py +258 -0
  39. vrchatapi/models/api_config_announcement.py +217 -0
  40. vrchatapi/models/api_config_audio_config.py +311 -0
  41. vrchatapi/models/api_config_avatar_perf_limiter.py +293 -0
  42. vrchatapi/models/api_config_constants.py +262 -0
  43. vrchatapi/models/api_config_constants_groups.py +306 -0
  44. vrchatapi/models/api_config_constants_instance.py +238 -0
  45. vrchatapi/models/api_config_constants_instancepopulationbrackets.py +262 -0
  46. vrchatapi/models/api_config_constants_instancepopulationbracketscrowded.py +216 -0
  47. vrchatapi/models/api_config_constants_instancepopulationbracketsfew.py +216 -0
  48. vrchatapi/models/api_config_constants_instancepopulationbracketsmany.py +216 -0
  49. vrchatapi/models/api_config_constants_language.py +234 -0
  50. vrchatapi/models/api_config_download_url_list.py +258 -0
  51. vrchatapi/models/api_config_events.py +314 -0
  52. vrchatapi/models/api_config_ios_version.py +216 -0
  53. vrchatapi/models/api_config_min_supported_client_build_number.py +348 -0
  54. vrchatapi/models/api_config_offline_analysis.py +216 -0
  55. vrchatapi/models/api_health.py +248 -0
  56. vrchatapi/models/avatar.py +463 -0
  57. vrchatapi/models/avatar_moderation.py +249 -0
  58. vrchatapi/models/avatar_moderation_created.py +248 -0
  59. vrchatapi/models/avatar_moderation_type.py +36 -0
  60. vrchatapi/models/avatar_performance.py +265 -0
  61. vrchatapi/models/avatar_published_listings_inner.py +271 -0
  62. vrchatapi/models/avatar_style.py +239 -0
  63. vrchatapi/models/avatar_styles.py +231 -0
  64. vrchatapi/models/avatar_unity_package_url_object.py +234 -0
  65. vrchatapi/models/badge.py +308 -0
  66. vrchatapi/models/balance.py +247 -0
  67. vrchatapi/models/ban_group_member_request.py +234 -0
  68. vrchatapi/models/boop_request.py +250 -0
  69. vrchatapi/models/calendar_day_of_week.py +42 -0
  70. vrchatapi/models/calendar_event.py +475 -0
  71. vrchatapi/models/calendar_event_access.py +37 -0
  72. vrchatapi/models/calendar_event_category.py +48 -0
  73. vrchatapi/models/calendar_event_discovery.py +247 -0
  74. vrchatapi/models/calendar_event_discovery_inclusion.py +38 -0
  75. vrchatapi/models/calendar_event_discovery_scope.py +38 -0
  76. vrchatapi/models/calendar_event_frequency.py +39 -0
  77. vrchatapi/models/calendar_event_occurrence_kind.py +38 -0
  78. vrchatapi/models/calendar_event_platform.py +38 -0
  79. vrchatapi/models/calendar_event_recurrence.py +261 -0
  80. vrchatapi/models/calendar_event_recurrence_end.py +246 -0
  81. vrchatapi/models/calendar_event_recurrence_end_type.py +37 -0
  82. vrchatapi/models/calendar_event_user_interest.py +251 -0
  83. vrchatapi/models/change_user_tags_request.py +212 -0
  84. vrchatapi/models/change_world_tags_request.py +212 -0
  85. vrchatapi/models/content_filter.py +40 -0
  86. vrchatapi/models/create_avatar_moderation_request.py +243 -0
  87. vrchatapi/models/create_avatar_request.py +324 -0
  88. vrchatapi/models/create_calendar_event_request.py +385 -0
  89. vrchatapi/models/create_file_request.py +251 -0
  90. vrchatapi/models/create_file_version_request.py +259 -0
  91. vrchatapi/models/create_group_announcement_request.py +253 -0
  92. vrchatapi/models/create_group_gallery_request.py +297 -0
  93. vrchatapi/models/create_group_invite_request.py +242 -0
  94. vrchatapi/models/create_group_post_request.py +267 -0
  95. vrchatapi/models/create_group_request.py +295 -0
  96. vrchatapi/models/create_group_role_request.py +255 -0
  97. vrchatapi/models/create_instance_request.py +384 -0
  98. vrchatapi/models/create_jam_submission_request.py +239 -0
  99. vrchatapi/models/create_listing_request.py +285 -0
  100. vrchatapi/models/create_product_request.py +270 -0
  101. vrchatapi/models/create_prop_request.py +308 -0
  102. vrchatapi/models/create_world_request.py +322 -0
  103. vrchatapi/models/current_user.py +909 -0
  104. vrchatapi/models/current_user_platform_history_inner.py +245 -0
  105. vrchatapi/models/current_user_presence.py +379 -0
  106. vrchatapi/models/decline_group_invite_request.py +211 -0
  107. vrchatapi/models/developer_type.py +39 -0
  108. vrchatapi/models/disable2_fa_result.py +211 -0
  109. vrchatapi/models/discord_details.py +216 -0
  110. vrchatapi/models/dynamic_content_row.py +276 -0
  111. vrchatapi/models/earnings_metrics.py +248 -0
  112. vrchatapi/models/earnings_metrics_totals.py +267 -0
  113. vrchatapi/models/economy_account.py +360 -0
  114. vrchatapi/models/economy_balances.py +221 -0
  115. vrchatapi/models/economy_payout.py +385 -0
  116. vrchatapi/models/economy_payout_eligibility.py +263 -0
  117. vrchatapi/models/economy_payout_list.py +219 -0
  118. vrchatapi/models/economy_payout_status.py +295 -0
  119. vrchatapi/models/equip_inventory_item_request.py +235 -0
  120. vrchatapi/models/error.py +215 -0
  121. vrchatapi/models/favorite.py +251 -0
  122. vrchatapi/models/favorite_group.py +278 -0
  123. vrchatapi/models/favorite_group_limits.py +249 -0
  124. vrchatapi/models/favorite_group_visibility.py +38 -0
  125. vrchatapi/models/favorite_limits.py +265 -0
  126. vrchatapi/models/favorite_type.py +39 -0
  127. vrchatapi/models/favorited_world.py +441 -0
  128. vrchatapi/models/feedback.py +331 -0
  129. vrchatapi/models/file.py +325 -0
  130. vrchatapi/models/file_analysis.py +281 -0
  131. vrchatapi/models/file_analysis_avatar_stats.py +575 -0
  132. vrchatapi/models/file_data.py +279 -0
  133. vrchatapi/models/file_status.py +39 -0
  134. vrchatapi/models/file_upload_url.py +212 -0
  135. vrchatapi/models/file_version.py +254 -0
  136. vrchatapi/models/file_version_upload_status.py +269 -0
  137. vrchatapi/models/finish_file_data_upload_request.py +248 -0
  138. vrchatapi/models/follow_calendar_event_request.py +234 -0
  139. vrchatapi/models/friend_status.py +250 -0
  140. vrchatapi/models/get_group_posts200_response.py +219 -0
  141. vrchatapi/models/get_user_group_instances200_response.py +248 -0
  142. vrchatapi/models/group.py +514 -0
  143. vrchatapi/models/group_access_type.py +38 -0
  144. vrchatapi/models/group_announcement.py +315 -0
  145. vrchatapi/models/group_audit_log_entry.py +287 -0
  146. vrchatapi/models/group_gallery.py +319 -0
  147. vrchatapi/models/group_gallery_file_order.py +211 -0
  148. vrchatapi/models/group_gallery_file_order_request.py +239 -0
  149. vrchatapi/models/group_gallery_image.py +301 -0
  150. vrchatapi/models/group_instance.py +257 -0
  151. vrchatapi/models/group_join_request_action.py +37 -0
  152. vrchatapi/models/group_join_state.py +39 -0
  153. vrchatapi/models/group_member.py +415 -0
  154. vrchatapi/models/group_member_limited_user.py +290 -0
  155. vrchatapi/models/group_member_status.py +41 -0
  156. vrchatapi/models/group_my_member.py +399 -0
  157. vrchatapi/models/group_permission.py +260 -0
  158. vrchatapi/models/group_permissions.py +63 -0
  159. vrchatapi/models/group_post.py +317 -0
  160. vrchatapi/models/group_post_visibility.py +37 -0
  161. vrchatapi/models/group_privacy.py +37 -0
  162. vrchatapi/models/group_role.py +309 -0
  163. vrchatapi/models/group_role_template.py +39 -0
  164. vrchatapi/models/group_role_template_values.py +254 -0
  165. vrchatapi/models/group_role_template_values_roles.py +253 -0
  166. vrchatapi/models/group_search_sort.py +37 -0
  167. vrchatapi/models/group_transferable.py +215 -0
  168. vrchatapi/models/group_transferable_requirements.py +266 -0
  169. vrchatapi/models/group_user_visibility.py +38 -0
  170. vrchatapi/models/image_animation_style.py +62 -0
  171. vrchatapi/models/image_loop_style.py +37 -0
  172. vrchatapi/models/image_mask.py +41 -0
  173. vrchatapi/models/image_purpose.py +46 -0
  174. vrchatapi/models/info_push.py +306 -0
  175. vrchatapi/models/info_push_data.py +288 -0
  176. vrchatapi/models/info_push_data_article.py +215 -0
  177. vrchatapi/models/info_push_data_article_content.py +251 -0
  178. vrchatapi/models/info_push_data_clickable.py +224 -0
  179. vrchatapi/models/instance.py +597 -0
  180. vrchatapi/models/instance_content_settings.py +236 -0
  181. vrchatapi/models/instance_platforms.py +222 -0
  182. vrchatapi/models/instance_region.py +40 -0
  183. vrchatapi/models/instance_short_name_response.py +248 -0
  184. vrchatapi/models/instance_type.py +40 -0
  185. vrchatapi/models/inventory.py +247 -0
  186. vrchatapi/models/inventory_consumption_results.py +255 -0
  187. vrchatapi/models/inventory_default_attributes_value.py +243 -0
  188. vrchatapi/models/inventory_default_attributes_value_validator.py +211 -0
  189. vrchatapi/models/inventory_drop.py +331 -0
  190. vrchatapi/models/inventory_equip_slot.py +39 -0
  191. vrchatapi/models/inventory_flag.py +43 -0
  192. vrchatapi/models/inventory_item.py +420 -0
  193. vrchatapi/models/inventory_item_type.py +42 -0
  194. vrchatapi/models/inventory_metadata.py +287 -0
  195. vrchatapi/models/inventory_notification_details.py +244 -0
  196. vrchatapi/models/inventory_spawn.py +216 -0
  197. vrchatapi/models/inventory_template.py +351 -0
  198. vrchatapi/models/inventory_user_attributes.py +250 -0
  199. vrchatapi/models/invite_message.py +276 -0
  200. vrchatapi/models/invite_message_type.py +39 -0
  201. vrchatapi/models/invite_request.py +243 -0
  202. vrchatapi/models/invite_response.py +235 -0
  203. vrchatapi/models/jam.py +302 -0
  204. vrchatapi/models/jam_state_change_dates.py +276 -0
  205. vrchatapi/models/jam_submission.py +275 -0
  206. vrchatapi/models/join_group_request.py +234 -0
  207. vrchatapi/models/license.py +261 -0
  208. vrchatapi/models/license_action.py +37 -0
  209. vrchatapi/models/license_group.py +235 -0
  210. vrchatapi/models/license_type.py +39 -0
  211. vrchatapi/models/limited_group.py +377 -0
  212. vrchatapi/models/limited_unity_package.py +251 -0
  213. vrchatapi/models/limited_user_friend.py +399 -0
  214. vrchatapi/models/limited_user_groups.py +386 -0
  215. vrchatapi/models/limited_user_instance.py +430 -0
  216. vrchatapi/models/limited_user_search.py +395 -0
  217. vrchatapi/models/limited_world.py +410 -0
  218. vrchatapi/models/mime_type.py +50 -0
  219. vrchatapi/models/model_print.py +299 -0
  220. vrchatapi/models/moderate_user_request.py +217 -0
  221. vrchatapi/models/moderation_report.py +296 -0
  222. vrchatapi/models/mutual_friend.py +302 -0
  223. vrchatapi/models/mutuals.py +217 -0
  224. vrchatapi/models/notification.py +283 -0
  225. vrchatapi/models/notification_detail_invite.py +250 -0
  226. vrchatapi/models/notification_detail_invite_response.py +242 -0
  227. vrchatapi/models/notification_detail_request_invite.py +239 -0
  228. vrchatapi/models/notification_detail_request_invite_response.py +242 -0
  229. vrchatapi/models/notification_detail_vote_to_kick.py +242 -0
  230. vrchatapi/models/notification_type.py +43 -0
  231. vrchatapi/models/notification_v2.py +466 -0
  232. vrchatapi/models/notification_v2_details_boop.py +255 -0
  233. vrchatapi/models/notification_v2_response.py +259 -0
  234. vrchatapi/models/notification_v2_type.py +58 -0
  235. vrchatapi/models/ok_status.py +211 -0
  236. vrchatapi/models/ok_status2.py +234 -0
  237. vrchatapi/models/order_option.py +37 -0
  238. vrchatapi/models/order_option_short.py +37 -0
  239. vrchatapi/models/paginated_calendar_event_list.py +255 -0
  240. vrchatapi/models/paginated_group_audit_log_entry_list.py +255 -0
  241. vrchatapi/models/paginated_moderation_report_list.py +255 -0
  242. vrchatapi/models/past_display_name.py +241 -0
  243. vrchatapi/models/pending2_fa_result.py +239 -0
  244. vrchatapi/models/performance_limiter_info.py +234 -0
  245. vrchatapi/models/performance_ratings.py +41 -0
  246. vrchatapi/models/permission.py +280 -0
  247. vrchatapi/models/permission_data.py +258 -0
  248. vrchatapi/models/platform_build_info.py +242 -0
  249. vrchatapi/models/player_moderation.py +276 -0
  250. vrchatapi/models/player_moderation_type.py +44 -0
  251. vrchatapi/models/print_files.py +239 -0
  252. vrchatapi/models/private_profile.py +267 -0
  253. vrchatapi/models/private_profile_activity.py +292 -0
  254. vrchatapi/models/product.py +389 -0
  255. vrchatapi/models/product_listing.py +538 -0
  256. vrchatapi/models/product_listing_type.py +39 -0
  257. vrchatapi/models/product_listing_variant.py +272 -0
  258. vrchatapi/models/product_purchase.py +571 -0
  259. vrchatapi/models/product_purchase_history.py +256 -0
  260. vrchatapi/models/product_purchase_location_type.py +46 -0
  261. vrchatapi/models/product_purchase_product.py +269 -0
  262. vrchatapi/models/product_purchase_purchase_context.py +250 -0
  263. vrchatapi/models/product_purchase_record.py +312 -0
  264. vrchatapi/models/product_type.py +39 -0
  265. vrchatapi/models/profile_represented_group.py +262 -0
  266. vrchatapi/models/prop.py +358 -0
  267. vrchatapi/models/prop_publish_status.py +234 -0
  268. vrchatapi/models/prop_unity_package.py +269 -0
  269. vrchatapi/models/public_profile.py +398 -0
  270. vrchatapi/models/purchase_context_data.py +251 -0
  271. vrchatapi/models/purchase_product_listing_request.py +281 -0
  272. vrchatapi/models/region.py +42 -0
  273. vrchatapi/models/register_user_account_request.py +278 -0
  274. vrchatapi/models/release_status.py +39 -0
  275. vrchatapi/models/report_category.py +226 -0
  276. vrchatapi/models/report_reason.py +216 -0
  277. vrchatapi/models/represented_group.py +348 -0
  278. vrchatapi/models/request_invite_request.py +235 -0
  279. vrchatapi/models/respond_group_join_request.py +217 -0
  280. vrchatapi/models/respond_notification_v2_request.py +242 -0
  281. vrchatapi/models/response.py +217 -0
  282. vrchatapi/models/reward_badge.py +308 -0
  283. vrchatapi/models/reward_redemption.py +220 -0
  284. vrchatapi/models/reward_redemption_data.py +224 -0
  285. vrchatapi/models/reward_redemption_request.py +211 -0
  286. vrchatapi/models/reward_redemption_result.py +250 -0
  287. vrchatapi/models/search_group_members200_response.py +224 -0
  288. vrchatapi/models/seller_eligibility.py +211 -0
  289. vrchatapi/models/sent_notification.py +278 -0
  290. vrchatapi/models/service_queue_stats.py +234 -0
  291. vrchatapi/models/service_status.py +281 -0
  292. vrchatapi/models/share_inventory_item_direct_request.py +239 -0
  293. vrchatapi/models/sort_option.py +53 -0
  294. vrchatapi/models/sort_option_product_purchase.py +36 -0
  295. vrchatapi/models/store.py +372 -0
  296. vrchatapi/models/store_context.py +249 -0
  297. vrchatapi/models/store_shelf.py +304 -0
  298. vrchatapi/models/store_type.py +38 -0
  299. vrchatapi/models/store_view.py +40 -0
  300. vrchatapi/models/submit_moderation_report_request.py +263 -0
  301. vrchatapi/models/submit_moderation_report_request_details.py +283 -0
  302. vrchatapi/models/subscription.py +301 -0
  303. vrchatapi/models/subscription_period.py +40 -0
  304. vrchatapi/models/success.py +215 -0
  305. vrchatapi/models/success_flag.py +211 -0
  306. vrchatapi/models/tilia_kyc.py +246 -0
  307. vrchatapi/models/tilia_status.py +259 -0
  308. vrchatapi/models/tilia_tos.py +211 -0
  309. vrchatapi/models/token_bundle.py +286 -0
  310. vrchatapi/models/transaction.py +322 -0
  311. vrchatapi/models/transaction_agreement.py +353 -0
  312. vrchatapi/models/transaction_status.py +39 -0
  313. vrchatapi/models/transaction_steam_info.py +271 -0
  314. vrchatapi/models/transaction_steam_wallet_info.py +227 -0
  315. vrchatapi/models/transfer_group_request.py +234 -0
  316. vrchatapi/models/tutorial_status.py +255 -0
  317. vrchatapi/models/two_factor_auth_code.py +211 -0
  318. vrchatapi/models/two_factor_email_code.py +211 -0
  319. vrchatapi/models/two_factor_recovery_codes.py +247 -0
  320. vrchatapi/models/two_factor_recovery_codes_otp_inner.py +216 -0
  321. vrchatapi/models/unity_package.py +360 -0
  322. vrchatapi/models/update_asset_review_notes_request.py +234 -0
  323. vrchatapi/models/update_avatar_request.py +293 -0
  324. vrchatapi/models/update_calendar_event_request.py +365 -0
  325. vrchatapi/models/update_favorite_group_request.py +246 -0
  326. vrchatapi/models/update_group_gallery_request.py +297 -0
  327. vrchatapi/models/update_group_member_request.py +256 -0
  328. vrchatapi/models/update_group_representation_request.py +234 -0
  329. vrchatapi/models/update_group_request.py +300 -0
  330. vrchatapi/models/update_group_role_request.py +255 -0
  331. vrchatapi/models/update_inventory_item_request.py +254 -0
  332. vrchatapi/models/update_invite_message_request.py +211 -0
  333. vrchatapi/models/update_listing_request.py +211 -0
  334. vrchatapi/models/update_product_request.py +261 -0
  335. vrchatapi/models/update_prop_request.py +303 -0
  336. vrchatapi/models/update_tilia_tos_request.py +211 -0
  337. vrchatapi/models/update_user_badge_request.py +216 -0
  338. vrchatapi/models/update_user_note_request.py +239 -0
  339. vrchatapi/models/update_user_request.py +358 -0
  340. vrchatapi/models/update_world_request.py +317 -0
  341. vrchatapi/models/user.py +549 -0
  342. vrchatapi/models/user_credits_eligible.py +216 -0
  343. vrchatapi/models/user_exists.py +242 -0
  344. vrchatapi/models/user_note.py +273 -0
  345. vrchatapi/models/user_note_target_user.py +277 -0
  346. vrchatapi/models/user_state.py +38 -0
  347. vrchatapi/models/user_status.py +40 -0
  348. vrchatapi/models/user_subscription.py +330 -0
  349. vrchatapi/models/user_subscription_eligible.py +274 -0
  350. vrchatapi/models/verify2_fa_email_code_result.py +211 -0
  351. vrchatapi/models/verify2_fa_result.py +216 -0
  352. vrchatapi/models/verify_auth_token_result.py +217 -0
  353. vrchatapi/models/world.py +459 -0
  354. vrchatapi/models/world_metadata.py +216 -0
  355. vrchatapi/models/world_publish_status.py +234 -0
  356. vrchatapi/py.typed +0 -0
  357. vrchatapi/rest.py +303 -0
  358. vrchatapi_async-1.20.8.dev1.dist-info/METADATA +137 -0
  359. vrchatapi_async-1.20.8.dev1.dist-info/RECORD +362 -0
  360. vrchatapi_async-1.20.8.dev1.dist-info/WHEEL +5 -0
  361. vrchatapi_async-1.20.8.dev1.dist-info/licenses/LICENSE +21 -0
  362. vrchatapi_async-1.20.8.dev1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ """API response object."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Optional, Generic, Mapping, TypeVar
5
+ from pydantic import Field, StrictInt, StrictBytes, BaseModel
6
+
7
+ T = TypeVar("T")
8
+
9
+ class ApiResponse(BaseModel, Generic[T]):
10
+ """
11
+ API response object
12
+ """
13
+
14
+ status_code: StrictInt = Field(description="HTTP status code")
15
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
16
+ data: T = Field(description="Deserialized data given the data type")
17
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
18
+
19
+ model_config = {
20
+ "arbitrary_types_allowed": True
21
+ }
@@ -0,0 +1,686 @@
1
+ """
2
+ VRChat API Documentation
3
+
4
+
5
+ The version of the OpenAPI document: 1.20.8
6
+ Contact: vrchatapi.lpv0t@aries.fyi
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import aiohttp
14
+ import aiohttp_retry
15
+ import base64
16
+ import copy
17
+ import http.client as httplib
18
+ import logging
19
+ from logging import FileHandler
20
+ import sys
21
+ import urllib.parse
22
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
23
+ from typing_extensions import NotRequired, Self
24
+
25
+
26
+
27
+ JSON_SCHEMA_VALIDATION_KEYWORDS = {
28
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
29
+ 'minimum', 'exclusiveMinimum', 'maxLength',
30
+ 'minLength', 'pattern', 'maxItems', 'minItems'
31
+ }
32
+
33
+ ServerVariablesT = Dict[str, str]
34
+
35
+ GenericAuthSetting = TypedDict(
36
+ "GenericAuthSetting",
37
+ {
38
+ "type": str,
39
+ "in": str,
40
+ "key": str,
41
+ "value": str,
42
+ },
43
+ )
44
+
45
+
46
+ OAuth2AuthSetting = TypedDict(
47
+ "OAuth2AuthSetting",
48
+ {
49
+ "type": Literal["oauth2"],
50
+ "in": Literal["header"],
51
+ "key": Literal["Authorization"],
52
+ "value": str,
53
+ },
54
+ )
55
+
56
+
57
+ APIKeyAuthSetting = TypedDict(
58
+ "APIKeyAuthSetting",
59
+ {
60
+ "type": Literal["api_key"],
61
+ "in": str,
62
+ "key": str,
63
+ "value": Optional[str],
64
+ },
65
+ )
66
+
67
+
68
+ BasicAuthSetting = TypedDict(
69
+ "BasicAuthSetting",
70
+ {
71
+ "type": Literal["basic"],
72
+ "in": Literal["header"],
73
+ "key": Literal["Authorization"],
74
+ "value": Optional[str],
75
+ },
76
+ )
77
+
78
+
79
+ BearerFormatAuthSetting = TypedDict(
80
+ "BearerFormatAuthSetting",
81
+ {
82
+ "type": Literal["bearer"],
83
+ "in": Literal["header"],
84
+ "format": Literal["JWT"],
85
+ "key": Literal["Authorization"],
86
+ "value": str,
87
+ },
88
+ )
89
+
90
+
91
+ BearerAuthSetting = TypedDict(
92
+ "BearerAuthSetting",
93
+ {
94
+ "type": Literal["bearer"],
95
+ "in": Literal["header"],
96
+ "key": Literal["Authorization"],
97
+ "value": str,
98
+ },
99
+ )
100
+
101
+
102
+ HTTPSignatureAuthSetting = TypedDict(
103
+ "HTTPSignatureAuthSetting",
104
+ {
105
+ "type": Literal["http-signature"],
106
+ "in": Literal["header"],
107
+ "key": Literal["Authorization"],
108
+ "value": None,
109
+ },
110
+ )
111
+
112
+
113
+ AuthSettings = TypedDict(
114
+ "AuthSettings",
115
+ {
116
+ "authCookie": APIKeyAuthSetting,
117
+ "authHeader": BasicAuthSetting,
118
+ "twoFactorAuthCookie": APIKeyAuthSetting,
119
+ },
120
+ total=False,
121
+ )
122
+
123
+
124
+ class HostSettingVariable(TypedDict):
125
+ description: str
126
+ default_value: str
127
+ enum_values: List[str]
128
+
129
+
130
+ class HostSetting(TypedDict):
131
+ url: str
132
+ description: str
133
+ variables: NotRequired[Dict[str, HostSettingVariable]]
134
+
135
+
136
+ class Configuration:
137
+ """This class contains various settings of the API client.
138
+
139
+ :param host: Base url.
140
+ :param ignore_operation_servers
141
+ Boolean to ignore operation servers for the API client.
142
+ Config will use `host` as the base url regardless of the operation servers.
143
+ :param api_key: Dict to store API key(s).
144
+ Each entry in the dict specifies an API key.
145
+ The dict key is the name of the security scheme in the OAS specification.
146
+ The dict value is the API key secret.
147
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
148
+ The dict key is the name of the security scheme in the OAS specification.
149
+ The dict value is an API key prefix when generating the auth data.
150
+ :param username: Username for HTTP basic authentication.
151
+ :param password: Password for HTTP basic authentication.
152
+ :param access_token: Access token.
153
+ :param server_index: Index to servers configuration.
154
+ :param server_variables: Mapping with string values to replace variables in
155
+ templated server configuration. The validation of enums is performed for
156
+ variables with defined enum values before.
157
+ :param server_operation_index: Mapping from operation ID to an index to server
158
+ configuration.
159
+ :param server_operation_variables: Mapping from operation ID to a mapping with
160
+ string values to replace variables in templated server configuration.
161
+ The validation of enums is performed for variables with defined enum
162
+ values before.
163
+ :param verify_ssl: bool - Set this to false to skip verifying SSL certificate
164
+ when calling API from https server.
165
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
166
+ in PEM format.
167
+ :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration.
168
+ :param trace_configs: list of aiohttp.TraceConfig instances forwarded to
169
+ aiohttp.ClientSession for tracing/instrumentation (e.g. OpenTelemetry).
170
+ :param tcp_connector_limit_per_host: Per-host concurrency cap forwarded to
171
+ aiohttp.TCPConnector(limit_per_host=...). None leaves aiohttp's default (0 = unlimited).
172
+ :param client_session_kwargs: Extra keyword arguments merged into
173
+ aiohttp.ClientSession(**kwargs) (e.g. json_serialize=orjson.dumps,
174
+ cookie_jar=aiohttp.DummyCookieJar()).
175
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
176
+ in PEM (str) or DER (bytes) format.
177
+ :param cert_file: the path to a client certificate file, for mTLS.
178
+ :param key_file: the path to a client key file, for mTLS.
179
+ :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification.
180
+ :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server.
181
+ :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync.
182
+ :param proxy: Proxy URL.
183
+ :param proxy_headers: Proxy headers.
184
+ :param safe_chars_for_path_param: Safe characters for path parameter encoding.
185
+ :param client_side_validation: Enable client-side validation. Default True.
186
+ :param socket_options: Options to pass down to the underlying urllib3 socket.
187
+ :param datetime_format: Datetime format string for serialization.
188
+ :param date_format: Date format string for serialization.
189
+
190
+ :Example:
191
+
192
+ API Key Authentication Example.
193
+ Given the following security scheme in the OpenAPI specification:
194
+ components:
195
+ securitySchemes:
196
+ cookieAuth: # name for the security scheme
197
+ type: apiKey
198
+ in: cookie
199
+ name: JSESSIONID # cookie name
200
+
201
+ You can programmatically set the cookie:
202
+
203
+ conf = vrchatapi.Configuration(
204
+ api_key={'cookieAuth': 'abc123'}
205
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
206
+ )
207
+
208
+ The following cookie will be added to the HTTP request:
209
+ Cookie: JSESSIONID abc123
210
+
211
+ HTTP Basic Authentication Example.
212
+ Given the following security scheme in the OpenAPI specification:
213
+ components:
214
+ securitySchemes:
215
+ http_basic_auth:
216
+ type: http
217
+ scheme: basic
218
+
219
+ Configure API client with HTTP basic authentication:
220
+
221
+ conf = vrchatapi.Configuration(
222
+ username='the-user',
223
+ password='the-password',
224
+ )
225
+
226
+ """
227
+
228
+ _default: ClassVar[Optional[Self]] = None
229
+
230
+ def __init__(
231
+ self,
232
+ host: Optional[str]=None,
233
+ api_key: Optional[Dict[str, str]]=None,
234
+ api_key_prefix: Optional[Dict[str, str]]=None,
235
+ username: Optional[str]=None,
236
+ password: Optional[str]=None,
237
+ access_token: Optional[str]=None,
238
+ server_index: Optional[int]=None,
239
+ server_variables: Optional[ServerVariablesT]=None,
240
+ server_operation_index: Optional[Dict[int, int]]=None,
241
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
242
+ ignore_operation_servers: bool=False,
243
+ ssl_ca_cert: Optional[str]=None,
244
+ retries: Optional[Union[int, aiohttp_retry.RetryOptionsBase]] = None,
245
+ trace_configs: Optional[List[aiohttp.TraceConfig]] = None,
246
+ tcp_connector_limit_per_host: Optional[int] = None,
247
+ client_session_kwargs: Optional[Dict[str, Any]] = None,
248
+ ca_cert_data: Optional[Union[str, bytes]] = None,
249
+ cert_file: Optional[str]=None,
250
+ key_file: Optional[str]=None,
251
+ verify_ssl: bool=True,
252
+ assert_hostname: Optional[bool]=None,
253
+ tls_server_name: Optional[str]=None,
254
+ connection_pool_maxsize: Optional[int]=None,
255
+ proxy: Optional[str]=None,
256
+ proxy_headers: Optional[Any]=None,
257
+ safe_chars_for_path_param: str='~()',
258
+ client_side_validation: bool=True,
259
+ socket_options: Optional[Any]=None,
260
+ datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z",
261
+ date_format: str="%Y-%m-%d",
262
+ *,
263
+ debug: Optional[bool] = None,
264
+ ) -> None:
265
+ """Constructor
266
+ """
267
+ self._base_path = "https://api.vrchat.cloud/api/1" if host is None else host
268
+ """Default Base url
269
+ """
270
+ self.server_index = 0 if server_index is None and host is None else server_index
271
+ self.server_operation_index = server_operation_index or {}
272
+ """Default server index
273
+ """
274
+ self.server_variables = server_variables or {}
275
+ self.server_operation_variables = server_operation_variables or {}
276
+ """Default server variables
277
+ """
278
+ self.ignore_operation_servers = ignore_operation_servers
279
+ """Ignore operation servers
280
+ """
281
+ self.temp_folder_path = None
282
+ """Temp file folder for downloading files
283
+ """
284
+ # Authentication Settings
285
+ self.api_key = {}
286
+ if api_key:
287
+ self.api_key = api_key
288
+ """dict to store API key(s)
289
+ """
290
+ self.api_key_prefix = {}
291
+ if api_key_prefix:
292
+ self.api_key_prefix = api_key_prefix
293
+ """dict to store API prefix (e.g. Bearer)
294
+ """
295
+ self.refresh_api_key_hook = None
296
+ """function hook to refresh API key if expired
297
+ """
298
+ self.username = username
299
+ """Username for HTTP basic authentication
300
+ """
301
+ self.password = password
302
+ """Password for HTTP basic authentication
303
+ """
304
+ self.access_token = access_token
305
+ """Access token
306
+ """
307
+ self.logger = {}
308
+ """Logging Settings
309
+ """
310
+ self.logger["package_logger"] = logging.getLogger("vrchatapi")
311
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
312
+ """Log format
313
+ """
314
+ self.logger_stream_handler = None
315
+ """Log stream handler
316
+ """
317
+ self.logger_file_handler: Optional[FileHandler] = None
318
+ """Log file handler
319
+ """
320
+ self.logger_file = None
321
+ """Debug file location
322
+ """
323
+ if debug is not None:
324
+ self.debug = debug
325
+ else:
326
+ self.__debug = False
327
+ """Debug switch
328
+ """
329
+
330
+ self.verify_ssl = verify_ssl
331
+ """SSL/TLS verification
332
+ Set this to false to skip verifying SSL certificate when calling API
333
+ from https server.
334
+ """
335
+ self.ssl_ca_cert = ssl_ca_cert
336
+ """Set this to customize the certificate file to verify the peer.
337
+ """
338
+ self.ca_cert_data = ca_cert_data
339
+ """Set this to verify the peer using PEM (str) or DER (bytes)
340
+ certificate data.
341
+ """
342
+ self.cert_file = cert_file
343
+ """client certificate file
344
+ """
345
+ self.key_file = key_file
346
+ """client key file
347
+ """
348
+ self.assert_hostname = assert_hostname
349
+ """Set this to True/False to enable/disable SSL hostname verification.
350
+ """
351
+ self.tls_server_name = tls_server_name
352
+ """SSL/TLS Server Name Indication (SNI)
353
+ Set this to the SNI value expected by the server.
354
+ """
355
+
356
+ self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100
357
+ """This value is passed to the aiohttp to limit simultaneous connections.
358
+ None in the constructor is coerced to default 100.
359
+ """
360
+
361
+ self.proxy = proxy
362
+ """Proxy URL
363
+ """
364
+ self.proxy_headers = proxy_headers
365
+ """Proxy headers
366
+ """
367
+ self.safe_chars_for_path_param = safe_chars_for_path_param
368
+ """Safe chars for path_param
369
+ """
370
+ self.retries = retries
371
+ """Retry configuration
372
+ """
373
+ self.trace_configs = trace_configs
374
+ """aiohttp.TraceConfig list forwarded to ClientSession for tracing.
375
+ """
376
+ self.tcp_connector_limit_per_host = tcp_connector_limit_per_host
377
+ """Per-host concurrency cap forwarded to TCPConnector.
378
+ """
379
+ self.client_session_kwargs = client_session_kwargs
380
+ """Extra kwargs merged into aiohttp.ClientSession(**kwargs).
381
+
382
+ """
383
+ # Enable client side validation
384
+ self.client_side_validation = client_side_validation
385
+
386
+ self.socket_options = socket_options
387
+ """Options to pass down to the underlying urllib3 socket
388
+ """
389
+
390
+ self.datetime_format = datetime_format
391
+ """datetime format
392
+ """
393
+
394
+ self.date_format = date_format
395
+ """date format
396
+ """
397
+
398
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
399
+ cls = self.__class__
400
+ result = cls.__new__(cls)
401
+ memo[id(self)] = result
402
+ for k, v in self.__dict__.items():
403
+ if k not in ('logger', 'logger_file_handler'):
404
+ setattr(result, k, copy.deepcopy(v, memo))
405
+ # shallow copy of loggers
406
+ result.logger = copy.copy(self.logger)
407
+ # use setter to re-create the file handler (excluded from __dict__ copy)
408
+ result.logger_file = self.logger_file
409
+
410
+ return result
411
+
412
+ def __setattr__(self, name: str, value: Any) -> None:
413
+ object.__setattr__(self, name, value)
414
+
415
+ @classmethod
416
+ def set_default(cls, default: Optional[Self]) -> None:
417
+ """Set default instance of configuration.
418
+
419
+ It stores default configuration, which can be
420
+ returned by get_default_copy method.
421
+
422
+ :param default: object of Configuration
423
+ """
424
+ cls._default = default
425
+
426
+ @classmethod
427
+ def get_default_copy(cls) -> Self:
428
+ """Deprecated. Please use `get_default` instead.
429
+
430
+ Deprecated. Please use `get_default` instead.
431
+
432
+ :return: The configuration object.
433
+ """
434
+ return cls.get_default()
435
+
436
+ @classmethod
437
+ def get_default(cls) -> Self:
438
+ """Return the default configuration.
439
+
440
+ This method returns newly created, based on default constructor,
441
+ object of Configuration class or returns a copy of default
442
+ configuration.
443
+
444
+ :return: The configuration object.
445
+ """
446
+ if cls._default is None:
447
+ cls._default = cls()
448
+ return cls._default
449
+
450
+ @property
451
+ def logger_file(self) -> Optional[str]:
452
+ """The logger file.
453
+
454
+ If the logger_file is None, then add stream handler and remove file
455
+ handler. Otherwise, add file handler and remove stream handler.
456
+
457
+ :param value: The logger_file path.
458
+ :type: str
459
+ """
460
+ return self.__logger_file
461
+
462
+ @logger_file.setter
463
+ def logger_file(self, value: Optional[str]) -> None:
464
+ """The logger file.
465
+
466
+ If the logger_file is None, then add stream handler and remove file
467
+ handler. Otherwise, add file handler and remove stream handler.
468
+
469
+ :param value: The logger_file path.
470
+ :type: str
471
+ """
472
+ self.__logger_file = value
473
+ if self.__logger_file:
474
+ # If set logging file,
475
+ # then add file handler and remove stream handler.
476
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
477
+ self.logger_file_handler.setFormatter(self.logger_formatter)
478
+ for _, logger in self.logger.items():
479
+ logger.addHandler(self.logger_file_handler)
480
+
481
+ @property
482
+ def debug(self) -> bool:
483
+ """Debug status
484
+
485
+ :param value: The debug status, True or False.
486
+ :type: bool
487
+ """
488
+ return self.__debug
489
+
490
+ @debug.setter
491
+ def debug(self, value: bool) -> None:
492
+ """Debug status
493
+
494
+ :param value: The debug status, True or False.
495
+ :type: bool
496
+ """
497
+ self.__debug = value
498
+ if self.__debug:
499
+ # if debug status is True, turn on debug logging
500
+ for _, logger in self.logger.items():
501
+ logger.setLevel(logging.DEBUG)
502
+ # turn on httplib debug
503
+ httplib.HTTPConnection.debuglevel = 1
504
+ else:
505
+ # if debug status is False, turn off debug logging,
506
+ # setting log level to default `logging.WARNING`
507
+ for _, logger in self.logger.items():
508
+ logger.setLevel(logging.WARNING)
509
+ # turn off httplib debug
510
+ httplib.HTTPConnection.debuglevel = 0
511
+
512
+ @property
513
+ def logger_format(self) -> str:
514
+ """The logger format.
515
+
516
+ The logger_formatter will be updated when sets logger_format.
517
+
518
+ :param value: The format string.
519
+ :type: str
520
+ """
521
+ return self.__logger_format
522
+
523
+ @logger_format.setter
524
+ def logger_format(self, value: str) -> None:
525
+ """The logger format.
526
+
527
+ The logger_formatter will be updated when sets logger_format.
528
+
529
+ :param value: The format string.
530
+ :type: str
531
+ """
532
+ self.__logger_format = value
533
+ self.logger_formatter = logging.Formatter(self.__logger_format)
534
+
535
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
536
+ """Gets API key (with prefix if set).
537
+
538
+ :param identifier: The identifier of apiKey.
539
+ :param alias: The alternative identifier of apiKey.
540
+ :return: The token for api key authentication.
541
+ """
542
+ if self.refresh_api_key_hook is not None:
543
+ self.refresh_api_key_hook(self)
544
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
545
+ if key:
546
+ prefix = self.api_key_prefix.get(
547
+ identifier, self.api_key_prefix.get(alias) if alias is not None else None)
548
+ if prefix:
549
+ return "%s %s" % (prefix, key)
550
+ else:
551
+ return key
552
+
553
+ return None
554
+
555
+ def get_basic_auth_token(self) -> Optional[str]:
556
+ """Gets HTTP basic authentication header (string).
557
+
558
+ :return: The token for basic HTTP authentication.
559
+ """
560
+ username = ""
561
+ if self.username is not None:
562
+ username = self.username
563
+ password = ""
564
+ if self.password is not None:
565
+ password = self.password
566
+
567
+ # URL-encode username/password to avoid issues with special characters
568
+ encoded_username = urllib.parse.quote(username)
569
+ encoded_password = urllib.parse.quote(password)
570
+
571
+ return "Basic " + base64.b64encode(
572
+ (encoded_username + ":" + encoded_password).encode('utf-8')
573
+ ).decode('utf-8')
574
+
575
+ def auth_settings(self)-> AuthSettings:
576
+ """Gets Auth Settings dict for api client.
577
+
578
+ :return: The Auth Settings information dict.
579
+ """
580
+ auth: AuthSettings = {}
581
+ if 'authCookie' in self.api_key:
582
+ auth['authCookie'] = {
583
+ 'type': 'api_key',
584
+ 'in': 'cookie',
585
+ 'key': 'auth',
586
+ 'value': self.get_api_key_with_prefix(
587
+ 'authCookie',
588
+ ),
589
+ }
590
+ if self.username is not None and self.password is not None:
591
+ auth['authHeader'] = {
592
+ 'type': 'basic',
593
+ 'in': 'header',
594
+ 'key': 'Authorization',
595
+ 'value': self.get_basic_auth_token()
596
+ }
597
+ if 'twoFactorAuthCookie' in self.api_key:
598
+ auth['twoFactorAuthCookie'] = {
599
+ 'type': 'api_key',
600
+ 'in': 'cookie',
601
+ 'key': 'twoFactorAuth',
602
+ 'value': self.get_api_key_with_prefix(
603
+ 'twoFactorAuthCookie',
604
+ ),
605
+ }
606
+ return auth
607
+
608
+ def to_debug_report(self) -> str:
609
+ """Gets the essential information for debugging.
610
+
611
+ :return: The report for debugging.
612
+ """
613
+ return "Python SDK Debug Report:\n"\
614
+ "OS: {env}\n"\
615
+ "Python Version: {pyversion}\n"\
616
+ "Version of the API: 1.20.8\n"\
617
+ "SDK Package Version: 1.0.0".\
618
+ format(env=sys.platform, pyversion=sys.version)
619
+
620
+ def get_host_settings(self) -> List[HostSetting]:
621
+ """Gets an array of host settings
622
+
623
+ :return: An array of host settings
624
+ """
625
+ return [
626
+ {
627
+ 'url': "https://api.vrchat.cloud/api/1",
628
+ 'description': "No description provided",
629
+ }
630
+ ]
631
+
632
+ def get_host_from_settings(
633
+ self,
634
+ index: Optional[int],
635
+ variables: Optional[ServerVariablesT]=None,
636
+ servers: Optional[List[HostSetting]]=None,
637
+ ) -> str:
638
+ """Gets host URL based on the index and variables
639
+ :param index: array index of the host settings
640
+ :param variables: hash of variable and the corresponding value
641
+ :param servers: an array of host settings or None
642
+ :return: URL based on host settings
643
+ """
644
+ if index is None:
645
+ return self._base_path
646
+
647
+ variables = {} if variables is None else variables
648
+ servers = self.get_host_settings() if servers is None else servers
649
+
650
+ try:
651
+ server = servers[index]
652
+ except IndexError:
653
+ raise ValueError(
654
+ "Invalid index {0} when selecting the host settings. "
655
+ "Must be less than {1}".format(index, len(servers)))
656
+
657
+ url = server['url']
658
+
659
+ # go through variables and replace placeholders
660
+ for variable_name, variable in server.get('variables', {}).items():
661
+ used_value = variables.get(
662
+ variable_name, variable['default_value'])
663
+
664
+ if 'enum_values' in variable \
665
+ and variable['enum_values'] \
666
+ and used_value not in variable['enum_values']:
667
+ raise ValueError(
668
+ "The variable `{0}` in the host URL has invalid value "
669
+ "{1}. Must be {2}.".format(
670
+ variable_name, variables[variable_name],
671
+ variable['enum_values']))
672
+
673
+ url = url.replace("{" + variable_name + "}", used_value)
674
+
675
+ return url
676
+
677
+ @property
678
+ def host(self) -> str:
679
+ """Return generated host."""
680
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
681
+
682
+ @host.setter
683
+ def host(self, value: str) -> None:
684
+ """Fix base path."""
685
+ self._base_path = value
686
+ self.server_index = None