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,399 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ VRChat API Documentation
5
+
6
+
7
+ The version of the OpenAPI document: 1.20.8
8
+ Contact: vrchatapi.lpv0t@aries.fyi
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from collections.abc import Mapping as _Mapping
21
+ from datetime import datetime
22
+ from pydantic import AliasChoices, BaseModel, ConfigDict, Field, StrictBool, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional, cast as _cast
24
+ from vrchatapi.models.group_permissions import GroupPermissions
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+
30
+ _OPENAPI_GENERATOR_TO_DICT = "_openapi_generator_to_dict"
31
+
32
+
33
+ def _get_openapi_to_dict(value: Any) -> Any:
34
+ # Reciprocal function references preserve inherited generated methods
35
+ # without reserving model member names. Checking both directions also
36
+ # rejects overrides whose decorators copy function attributes.
37
+ to_dict = getattr(value, "to_dict", None)
38
+ type_to_dict = getattr(type(value), "to_dict", None)
39
+ if (
40
+ not callable(to_dict)
41
+ or getattr(to_dict, "__func__", None) is not type_to_dict
42
+ ):
43
+ return None
44
+
45
+ openapi_to_dict = getattr(
46
+ type_to_dict, _OPENAPI_GENERATOR_TO_DICT, None
47
+ )
48
+ if (
49
+ not callable(openapi_to_dict)
50
+ or getattr(
51
+ openapi_to_dict,
52
+ _OPENAPI_GENERATOR_TO_DICT,
53
+ None,
54
+ ) is not type_to_dict
55
+ ):
56
+ return None
57
+ return openapi_to_dict
58
+
59
+
60
+ def _to_legacy_item(value: Any, serialize: bool) -> Any:
61
+ to_dict = getattr(value, "to_dict", None)
62
+ if _get_openapi_to_dict(value) is not None and callable(to_dict):
63
+ return to_dict(serialize=serialize)
64
+ if callable(to_dict):
65
+ return to_dict()
66
+ return value
67
+
68
+
69
+ def _to_legacy_value(value: Any, serialize: bool) -> Any:
70
+ # python-legacy converted only immediate list elements or dictionary values:
71
+ # https://github.com/OpenAPITools/openapi-generator/blob/c84b949df1a9ec04ba75989cb49b45c940c2f694/modules/openapi-generator/src/main/resources/python-legacy/model.mustache#L203-L231
72
+ if isinstance(value, list):
73
+ return [_to_legacy_item(item, serialize) for item in value]
74
+ if isinstance(value, dict):
75
+ return {
76
+ key: _to_legacy_item(item, serialize)
77
+ for key, item in value.items()
78
+ }
79
+ return _to_legacy_item(value, serialize)
80
+
81
+
82
+ def _to_openapi_value(value: Any) -> Any:
83
+ if isinstance(value, list):
84
+ return [_to_openapi_value(item) for item in value]
85
+ if isinstance(value, dict):
86
+ return {key: _to_openapi_value(item) for key, item in value.items()}
87
+
88
+ to_openapi_dict = _get_openapi_to_dict(value)
89
+ if to_openapi_dict is not None:
90
+ return to_openapi_dict(value)
91
+
92
+ to_dict = getattr(value, "to_dict", None)
93
+ if callable(to_dict):
94
+ return to_dict()
95
+ return value
96
+
97
+
98
+ class GroupMyMember(BaseModel):
99
+ """
100
+ GroupMyMember
101
+
102
+ Attributes:
103
+ openapi_types (dict): The key is attribute name
104
+ and the value is attribute type.
105
+ attribute_map (dict): The key is attribute name
106
+ and the value is json key in definition.
107
+ """ # noqa: E501
108
+ accepted_by_display_name: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("acceptedByDisplayName", "accepted_by_display_name"), serialization_alias="acceptedByDisplayName")
109
+ accepted_by_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("acceptedById", "accepted_by_id"), serialization_alias="acceptedById")
110
+ banned_at: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("bannedAt", "banned_at"), serialization_alias="bannedAt")
111
+ created_at: Optional[datetime] = Field(default=None, validation_alias=AliasChoices("createdAt", "created_at"), serialization_alias="createdAt")
112
+ group_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("groupId", "group_id"), serialization_alias="groupId", json_schema_extra={"examples": ["grp_71a7ff59-112c-4e78-a990-c7cc650776e5"]})
113
+ has2_fa: Optional[StrictBool] = Field(default=False, validation_alias=AliasChoices("has2FA", "has2_fa"), serialization_alias="has2FA")
114
+ has_joined_from_purchase: Optional[StrictBool] = Field(default=False, validation_alias=AliasChoices("hasJoinedFromPurchase", "has_joined_from_purchase"), serialization_alias="hasJoinedFromPurchase")
115
+ id: Optional[StrictStr] = Field(default=None, json_schema_extra={"examples": ["gmem_95cdb3b4-4643-4eb6-bdab-46a4e1e5ce37"]})
116
+ is_representing: Optional[StrictBool] = Field(default=False, validation_alias=AliasChoices("isRepresenting", "is_representing"), serialization_alias="isRepresenting")
117
+ is_subscribed_to_announcements: Optional[StrictBool] = Field(default=True, validation_alias=AliasChoices("isSubscribedToAnnouncements", "is_subscribed_to_announcements"), serialization_alias="isSubscribedToAnnouncements")
118
+ is_subscribed_to_event_announcements: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("isSubscribedToEventAnnouncements", "is_subscribed_to_event_announcements"), serialization_alias="isSubscribedToEventAnnouncements")
119
+ joined_at: Optional[datetime] = Field(default=None, validation_alias=AliasChoices("joinedAt", "joined_at"), serialization_alias="joinedAt")
120
+ last_post_read_at: Optional[datetime] = Field(default=None, validation_alias=AliasChoices("lastPostReadAt", "last_post_read_at"), serialization_alias="lastPostReadAt")
121
+ m_role_ids: Optional[List[StrictStr]] = Field(default=None, validation_alias=AliasChoices("mRoleIds", "m_role_ids"), serialization_alias="mRoleIds")
122
+ manager_notes: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("managerNotes", "manager_notes"), serialization_alias="managerNotes")
123
+ membership_status: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("membershipStatus", "membership_status"), serialization_alias="membershipStatus", json_schema_extra={"examples": ["member"]})
124
+ permissions: Optional[List[GroupPermissions]] = None
125
+ role_ids: Optional[List[StrictStr]] = Field(default=None, validation_alias=AliasChoices("roleIds", "role_ids"), serialization_alias="roleIds")
126
+ user_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("userId", "user_id"), serialization_alias="userId", description="A users unique ID, usually in the form of `usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469`. Legacy players can have old IDs in the form of `8JoV9XEdpo`. The ID can never be changed.", json_schema_extra={"examples": ["usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469"]})
127
+ visibility: Optional[StrictStr] = Field(default=None, json_schema_extra={"examples": ["visible"]})
128
+ openapi_types: ClassVar[Dict[str, str]] = {
129
+ "accepted_by_display_name": "str",
130
+ "accepted_by_id": "str",
131
+ "banned_at": "str",
132
+ "created_at": "datetime",
133
+ "group_id": "str",
134
+ "has2_fa": "bool",
135
+ "has_joined_from_purchase": "bool",
136
+ "id": "str",
137
+ "is_representing": "bool",
138
+ "is_subscribed_to_announcements": "bool",
139
+ "is_subscribed_to_event_announcements": "bool",
140
+ "joined_at": "datetime",
141
+ "last_post_read_at": "datetime",
142
+ "m_role_ids": "List[str]",
143
+ "manager_notes": "str",
144
+ "membership_status": "str",
145
+ "permissions": "List[GroupPermissions]",
146
+ "role_ids": "List[str]",
147
+ "user_id": "str",
148
+ "visibility": "str"
149
+ }
150
+
151
+ attribute_map: ClassVar[Dict[str, str]] = {
152
+ "accepted_by_display_name": "acceptedByDisplayName",
153
+ "accepted_by_id": "acceptedById",
154
+ "banned_at": "bannedAt",
155
+ "created_at": "createdAt",
156
+ "group_id": "groupId",
157
+ "has2_fa": "has2FA",
158
+ "has_joined_from_purchase": "hasJoinedFromPurchase",
159
+ "id": "id",
160
+ "is_representing": "isRepresenting",
161
+ "is_subscribed_to_announcements": "isSubscribedToAnnouncements",
162
+ "is_subscribed_to_event_announcements": "isSubscribedToEventAnnouncements",
163
+ "joined_at": "joinedAt",
164
+ "last_post_read_at": "lastPostReadAt",
165
+ "m_role_ids": "mRoleIds",
166
+ "manager_notes": "managerNotes",
167
+ "membership_status": "membershipStatus",
168
+ "permissions": "permissions",
169
+ "role_ids": "roleIds",
170
+ "user_id": "userId",
171
+ "visibility": "visibility"
172
+ }
173
+ __properties: ClassVar[List[str]] = ["acceptedByDisplayName", "acceptedById", "bannedAt", "createdAt", "groupId", "has2FA", "hasJoinedFromPurchase", "id", "isRepresenting", "isSubscribedToAnnouncements", "isSubscribedToEventAnnouncements", "joinedAt", "lastPostReadAt", "mRoleIds", "managerNotes", "membershipStatus", "permissions", "roleIds", "userId", "visibility"]
174
+
175
+ @classmethod
176
+ def __preprocess_input_names(
177
+ cls,
178
+ obj: Any,
179
+ remove_hidden_storage_names: bool = True,
180
+ ) -> Any:
181
+ if not isinstance(obj, _Mapping):
182
+ return obj
183
+ obj = dict(obj)
184
+ if "acceptedByDisplayName" not in obj and "accepted_by_display_name" in obj:
185
+ obj["acceptedByDisplayName"] = obj["accepted_by_display_name"]
186
+ obj.pop("accepted_by_display_name", None)
187
+ if "acceptedById" not in obj and "accepted_by_id" in obj:
188
+ obj["acceptedById"] = obj["accepted_by_id"]
189
+ obj.pop("accepted_by_id", None)
190
+ if "bannedAt" not in obj and "banned_at" in obj:
191
+ obj["bannedAt"] = obj["banned_at"]
192
+ obj.pop("banned_at", None)
193
+ if "createdAt" not in obj and "created_at" in obj:
194
+ obj["createdAt"] = obj["created_at"]
195
+ obj.pop("created_at", None)
196
+ if "groupId" not in obj and "group_id" in obj:
197
+ obj["groupId"] = obj["group_id"]
198
+ obj.pop("group_id", None)
199
+ if "has2FA" not in obj and "has2_fa" in obj:
200
+ obj["has2FA"] = obj["has2_fa"]
201
+ obj.pop("has2_fa", None)
202
+ if "hasJoinedFromPurchase" not in obj and "has_joined_from_purchase" in obj:
203
+ obj["hasJoinedFromPurchase"] = obj["has_joined_from_purchase"]
204
+ obj.pop("has_joined_from_purchase", None)
205
+ if "isRepresenting" not in obj and "is_representing" in obj:
206
+ obj["isRepresenting"] = obj["is_representing"]
207
+ obj.pop("is_representing", None)
208
+ if "isSubscribedToAnnouncements" not in obj and "is_subscribed_to_announcements" in obj:
209
+ obj["isSubscribedToAnnouncements"] = obj["is_subscribed_to_announcements"]
210
+ obj.pop("is_subscribed_to_announcements", None)
211
+ if "isSubscribedToEventAnnouncements" not in obj and "is_subscribed_to_event_announcements" in obj:
212
+ obj["isSubscribedToEventAnnouncements"] = obj["is_subscribed_to_event_announcements"]
213
+ obj.pop("is_subscribed_to_event_announcements", None)
214
+ if "joinedAt" not in obj and "joined_at" in obj:
215
+ obj["joinedAt"] = obj["joined_at"]
216
+ obj.pop("joined_at", None)
217
+ if "lastPostReadAt" not in obj and "last_post_read_at" in obj:
218
+ obj["lastPostReadAt"] = obj["last_post_read_at"]
219
+ obj.pop("last_post_read_at", None)
220
+ if "mRoleIds" not in obj and "m_role_ids" in obj:
221
+ obj["mRoleIds"] = obj["m_role_ids"]
222
+ obj.pop("m_role_ids", None)
223
+ if "managerNotes" not in obj and "manager_notes" in obj:
224
+ obj["managerNotes"] = obj["manager_notes"]
225
+ obj.pop("manager_notes", None)
226
+ if "membershipStatus" not in obj and "membership_status" in obj:
227
+ obj["membershipStatus"] = obj["membership_status"]
228
+ obj.pop("membership_status", None)
229
+ if "roleIds" not in obj and "role_ids" in obj:
230
+ obj["roleIds"] = obj["role_ids"]
231
+ obj.pop("role_ids", None)
232
+ if "userId" not in obj and "user_id" in obj:
233
+ obj["userId"] = obj["user_id"]
234
+ obj.pop("user_id", None)
235
+ return obj
236
+
237
+ model_config = ConfigDict(
238
+ validate_by_name=True,
239
+ validate_by_alias=True,
240
+ validate_assignment=True,
241
+ extra="forbid",
242
+ protected_namespaces=(),
243
+ )
244
+
245
+
246
+ def to_str(self) -> str:
247
+ """Returns the string representation of the model"""
248
+ return pprint.pformat(self.to_dict())
249
+
250
+ def __repr__(self) -> str:
251
+ """For print and pprint"""
252
+ return self.to_str()
253
+
254
+ def __eq__(self, other: object) -> bool:
255
+ """Returns true if both objects are equal"""
256
+ if not isinstance(other, GroupMyMember):
257
+ return False
258
+
259
+ return self.to_dict() == other.to_dict()
260
+
261
+ def __ne__(self, other: object) -> bool:
262
+ """Returns true if both objects are not equal"""
263
+ if not isinstance(other, GroupMyMember):
264
+ return True
265
+
266
+ return not (self == other)
267
+
268
+
269
+ def to_json(self) -> str:
270
+ """Returns the JSON representation of the model using alias"""
271
+ to_openapi_dict = _get_openapi_to_dict(self)
272
+ if to_openapi_dict is not None:
273
+ return json.dumps(to_jsonable_python(to_openapi_dict(self)))
274
+ return json.dumps(to_jsonable_python(self.to_dict()))
275
+
276
+ @classmethod
277
+ def from_json(cls, json_str: str) -> Optional[Self]:
278
+ """Create an instance of GroupMyMember from a JSON string"""
279
+ return cls.from_dict(json.loads(json_str))
280
+
281
+ def to_dict(self, serialize: bool = False) -> Dict[str, Any]:
282
+ """Return all declared model fields using public or wire names."""
283
+ return {
284
+ ("acceptedByDisplayName" if serialize else "accepted_by_display_name"): _to_legacy_value(getattr(self, "accepted_by_display_name", None), serialize),
285
+ ("acceptedById" if serialize else "accepted_by_id"): _to_legacy_value(getattr(self, "accepted_by_id", None), serialize),
286
+ ("bannedAt" if serialize else "banned_at"): _to_legacy_value(getattr(self, "banned_at", None), serialize),
287
+ ("createdAt" if serialize else "created_at"): _to_legacy_value(getattr(self, "created_at", None), serialize),
288
+ ("groupId" if serialize else "group_id"): _to_legacy_value(getattr(self, "group_id", None), serialize),
289
+ ("has2FA" if serialize else "has2_fa"): _to_legacy_value(getattr(self, "has2_fa", None), serialize),
290
+ ("hasJoinedFromPurchase" if serialize else "has_joined_from_purchase"): _to_legacy_value(getattr(self, "has_joined_from_purchase", None), serialize),
291
+ ("id" if serialize else "id"): _to_legacy_value(getattr(self, "id", None), serialize),
292
+ ("isRepresenting" if serialize else "is_representing"): _to_legacy_value(getattr(self, "is_representing", None), serialize),
293
+ ("isSubscribedToAnnouncements" if serialize else "is_subscribed_to_announcements"): _to_legacy_value(getattr(self, "is_subscribed_to_announcements", None), serialize),
294
+ ("isSubscribedToEventAnnouncements" if serialize else "is_subscribed_to_event_announcements"): _to_legacy_value(getattr(self, "is_subscribed_to_event_announcements", None), serialize),
295
+ ("joinedAt" if serialize else "joined_at"): _to_legacy_value(getattr(self, "joined_at", None), serialize),
296
+ ("lastPostReadAt" if serialize else "last_post_read_at"): _to_legacy_value(getattr(self, "last_post_read_at", None), serialize),
297
+ ("mRoleIds" if serialize else "m_role_ids"): _to_legacy_value(getattr(self, "m_role_ids", None), serialize),
298
+ ("managerNotes" if serialize else "manager_notes"): _to_legacy_value(getattr(self, "manager_notes", None), serialize),
299
+ ("membershipStatus" if serialize else "membership_status"): _to_legacy_value(getattr(self, "membership_status", None), serialize),
300
+ ("permissions" if serialize else "permissions"): _to_legacy_value(getattr(self, "permissions", None), serialize),
301
+ ("roleIds" if serialize else "role_ids"): _to_legacy_value(getattr(self, "role_ids", None), serialize),
302
+ ("userId" if serialize else "user_id"): _to_legacy_value(getattr(self, "user_id", None), serialize),
303
+ ("visibility" if serialize else "visibility"): _to_legacy_value(getattr(self, "visibility", None), serialize),
304
+ }
305
+
306
+ def __openapi_generator_modern_projection(self) -> Dict[str, Any]:
307
+ """Return the dictionary representation of the model using alias.
308
+
309
+ This has the following differences from calling pydantic's
310
+ `self.model_dump(by_alias=True)`:
311
+
312
+ * `None` is only added to the output dict for nullable fields that
313
+ were set at model initialization. Other fields with value `None`
314
+ are ignored.
315
+ """
316
+ excluded_fields: Set[str] = set([
317
+ ])
318
+
319
+ _dict = self.model_dump(
320
+ by_alias=True,
321
+ exclude=excluded_fields,
322
+ exclude_none=True,
323
+ )
324
+ # set to None if accepted_by_display_name (nullable) is None
325
+ # and model_fields_set contains the field
326
+ if self.accepted_by_display_name is None and "accepted_by_display_name" in self.model_fields_set:
327
+ _dict['acceptedByDisplayName'] = None
328
+
329
+ # set to None if accepted_by_id (nullable) is None
330
+ # and model_fields_set contains the field
331
+ if self.accepted_by_id is None and "accepted_by_id" in self.model_fields_set:
332
+ _dict['acceptedById'] = None
333
+
334
+ # set to None if banned_at (nullable) is None
335
+ # and model_fields_set contains the field
336
+ if self.banned_at is None and "banned_at" in self.model_fields_set:
337
+ _dict['bannedAt'] = None
338
+
339
+ # set to None if last_post_read_at (nullable) is None
340
+ # and model_fields_set contains the field
341
+ if self.last_post_read_at is None and "last_post_read_at" in self.model_fields_set:
342
+ _dict['lastPostReadAt'] = None
343
+
344
+ return _dict
345
+
346
+ setattr(
347
+ to_dict,
348
+ _OPENAPI_GENERATOR_TO_DICT,
349
+ __openapi_generator_modern_projection,
350
+ )
351
+ setattr(
352
+ __openapi_generator_modern_projection,
353
+ _OPENAPI_GENERATOR_TO_DICT,
354
+ to_dict,
355
+ )
356
+ del __openapi_generator_modern_projection
357
+
358
+ @classmethod
359
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
360
+ """Create an instance of GroupMyMember from a dict"""
361
+ if obj is None:
362
+ return None
363
+
364
+ if not isinstance(obj, dict):
365
+ return cls.model_validate(obj)
366
+
367
+ obj = _cast(
368
+ Dict[str, Any],
369
+ cls.__preprocess_input_names(
370
+ obj,
371
+ remove_hidden_storage_names=True,
372
+ ),
373
+ )
374
+
375
+ _obj = cls.model_validate({
376
+ "acceptedByDisplayName": obj.get("acceptedByDisplayName"),
377
+ "acceptedById": obj.get("acceptedById"),
378
+ "bannedAt": obj.get("bannedAt"),
379
+ "createdAt": obj.get("createdAt"),
380
+ "groupId": obj.get("groupId"),
381
+ "has2FA": obj.get("has2FA") if obj.get("has2FA") is not None else False,
382
+ "hasJoinedFromPurchase": obj.get("hasJoinedFromPurchase") if obj.get("hasJoinedFromPurchase") is not None else False,
383
+ "id": obj.get("id"),
384
+ "isRepresenting": obj.get("isRepresenting") if obj.get("isRepresenting") is not None else False,
385
+ "isSubscribedToAnnouncements": obj.get("isSubscribedToAnnouncements") if obj.get("isSubscribedToAnnouncements") is not None else True,
386
+ "isSubscribedToEventAnnouncements": obj.get("isSubscribedToEventAnnouncements"),
387
+ "joinedAt": obj.get("joinedAt"),
388
+ "lastPostReadAt": obj.get("lastPostReadAt"),
389
+ "mRoleIds": obj.get("mRoleIds"),
390
+ "managerNotes": obj.get("managerNotes"),
391
+ "membershipStatus": obj.get("membershipStatus"),
392
+ "permissions": obj.get("permissions"),
393
+ "roleIds": obj.get("roleIds"),
394
+ "userId": obj.get("userId"),
395
+ "visibility": obj.get("visibility")
396
+ })
397
+ return _obj
398
+
399
+
@@ -0,0 +1,260 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ VRChat API Documentation
5
+
6
+
7
+ The version of the OpenAPI document: 1.20.8
8
+ Contact: vrchatapi.lpv0t@aries.fyi
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from collections.abc import Mapping as _Mapping
21
+ from pydantic import AliasChoices, BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional, cast as _cast
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+
28
+ _OPENAPI_GENERATOR_TO_DICT = "_openapi_generator_to_dict"
29
+
30
+
31
+ def _get_openapi_to_dict(value: Any) -> Any:
32
+ # Reciprocal function references preserve inherited generated methods
33
+ # without reserving model member names. Checking both directions also
34
+ # rejects overrides whose decorators copy function attributes.
35
+ to_dict = getattr(value, "to_dict", None)
36
+ type_to_dict = getattr(type(value), "to_dict", None)
37
+ if (
38
+ not callable(to_dict)
39
+ or getattr(to_dict, "__func__", None) is not type_to_dict
40
+ ):
41
+ return None
42
+
43
+ openapi_to_dict = getattr(
44
+ type_to_dict, _OPENAPI_GENERATOR_TO_DICT, None
45
+ )
46
+ if (
47
+ not callable(openapi_to_dict)
48
+ or getattr(
49
+ openapi_to_dict,
50
+ _OPENAPI_GENERATOR_TO_DICT,
51
+ None,
52
+ ) is not type_to_dict
53
+ ):
54
+ return None
55
+ return openapi_to_dict
56
+
57
+
58
+ def _to_legacy_item(value: Any, serialize: bool) -> Any:
59
+ to_dict = getattr(value, "to_dict", None)
60
+ if _get_openapi_to_dict(value) is not None and callable(to_dict):
61
+ return to_dict(serialize=serialize)
62
+ if callable(to_dict):
63
+ return to_dict()
64
+ return value
65
+
66
+
67
+ def _to_legacy_value(value: Any, serialize: bool) -> Any:
68
+ # python-legacy converted only immediate list elements or dictionary values:
69
+ # https://github.com/OpenAPITools/openapi-generator/blob/c84b949df1a9ec04ba75989cb49b45c940c2f694/modules/openapi-generator/src/main/resources/python-legacy/model.mustache#L203-L231
70
+ if isinstance(value, list):
71
+ return [_to_legacy_item(item, serialize) for item in value]
72
+ if isinstance(value, dict):
73
+ return {
74
+ key: _to_legacy_item(item, serialize)
75
+ for key, item in value.items()
76
+ }
77
+ return _to_legacy_item(value, serialize)
78
+
79
+
80
+ def _to_openapi_value(value: Any) -> Any:
81
+ if isinstance(value, list):
82
+ return [_to_openapi_value(item) for item in value]
83
+ if isinstance(value, dict):
84
+ return {key: _to_openapi_value(item) for key, item in value.items()}
85
+
86
+ to_openapi_dict = _get_openapi_to_dict(value)
87
+ if to_openapi_dict is not None:
88
+ return to_openapi_dict(value)
89
+
90
+ to_dict = getattr(value, "to_dict", None)
91
+ if callable(to_dict):
92
+ return to_dict()
93
+ return value
94
+
95
+
96
+ class GroupPermission(BaseModel):
97
+ """
98
+ A permission that can be granted to a role in a group.
99
+
100
+ Attributes:
101
+ openapi_types (dict): The key is attribute name
102
+ and the value is attribute type.
103
+ attribute_map (dict): The key is attribute name
104
+ and the value is json key in definition.
105
+ """ # noqa: E501
106
+ allowed_to_add: Optional[StrictBool] = Field(default=False, validation_alias=AliasChoices("allowedToAdd", "allowed_to_add"), serialization_alias="allowedToAdd", description="Whether the user is allowed to add this permission to a role.", json_schema_extra={"examples": [True]})
107
+ display_name: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("displayName", "display_name"), serialization_alias="displayName", description="The display name of the permission.", json_schema_extra={"examples": ["Manage Group Data"]})
108
+ help: Optional[StrictStr] = Field(default=None, description="Human-readable description of the permission.", json_schema_extra={"examples": ["Allows role to edit group details (name, description, joinState, initialRoles, etc)."]})
109
+ is_management_permission: Optional[StrictBool] = Field(default=False, validation_alias=AliasChoices("isManagementPermission", "is_management_permission"), serialization_alias="isManagementPermission", description="Whether this permission is a \"management\" permission.", json_schema_extra={"examples": [True]})
110
+ name: Optional[StrictStr] = Field(default=None, description="The name of the permission.", json_schema_extra={"examples": ["group-data-manage"]})
111
+ openapi_types: ClassVar[Dict[str, str]] = {
112
+ "allowed_to_add": "bool",
113
+ "display_name": "str",
114
+ "help": "str",
115
+ "is_management_permission": "bool",
116
+ "name": "str"
117
+ }
118
+
119
+ attribute_map: ClassVar[Dict[str, str]] = {
120
+ "allowed_to_add": "allowedToAdd",
121
+ "display_name": "displayName",
122
+ "help": "help",
123
+ "is_management_permission": "isManagementPermission",
124
+ "name": "name"
125
+ }
126
+ __properties: ClassVar[List[str]] = ["allowedToAdd", "displayName", "help", "isManagementPermission", "name"]
127
+
128
+ @classmethod
129
+ def __preprocess_input_names(
130
+ cls,
131
+ obj: Any,
132
+ remove_hidden_storage_names: bool = True,
133
+ ) -> Any:
134
+ if not isinstance(obj, _Mapping):
135
+ return obj
136
+ obj = dict(obj)
137
+ if "allowedToAdd" not in obj and "allowed_to_add" in obj:
138
+ obj["allowedToAdd"] = obj["allowed_to_add"]
139
+ obj.pop("allowed_to_add", None)
140
+ if "displayName" not in obj and "display_name" in obj:
141
+ obj["displayName"] = obj["display_name"]
142
+ obj.pop("display_name", None)
143
+ if "isManagementPermission" not in obj and "is_management_permission" in obj:
144
+ obj["isManagementPermission"] = obj["is_management_permission"]
145
+ obj.pop("is_management_permission", None)
146
+ return obj
147
+
148
+ model_config = ConfigDict(
149
+ validate_by_name=True,
150
+ validate_by_alias=True,
151
+ validate_assignment=True,
152
+ extra="forbid",
153
+ protected_namespaces=(),
154
+ )
155
+
156
+
157
+ def to_str(self) -> str:
158
+ """Returns the string representation of the model"""
159
+ return pprint.pformat(self.to_dict())
160
+
161
+ def __repr__(self) -> str:
162
+ """For print and pprint"""
163
+ return self.to_str()
164
+
165
+ def __eq__(self, other: object) -> bool:
166
+ """Returns true if both objects are equal"""
167
+ if not isinstance(other, GroupPermission):
168
+ return False
169
+
170
+ return self.to_dict() == other.to_dict()
171
+
172
+ def __ne__(self, other: object) -> bool:
173
+ """Returns true if both objects are not equal"""
174
+ if not isinstance(other, GroupPermission):
175
+ return True
176
+
177
+ return not (self == other)
178
+
179
+
180
+ def to_json(self) -> str:
181
+ """Returns the JSON representation of the model using alias"""
182
+ to_openapi_dict = _get_openapi_to_dict(self)
183
+ if to_openapi_dict is not None:
184
+ return json.dumps(to_jsonable_python(to_openapi_dict(self)))
185
+ return json.dumps(to_jsonable_python(self.to_dict()))
186
+
187
+ @classmethod
188
+ def from_json(cls, json_str: str) -> Optional[Self]:
189
+ """Create an instance of GroupPermission from a JSON string"""
190
+ return cls.from_dict(json.loads(json_str))
191
+
192
+ def to_dict(self, serialize: bool = False) -> Dict[str, Any]:
193
+ """Return all declared model fields using public or wire names."""
194
+ return {
195
+ ("allowedToAdd" if serialize else "allowed_to_add"): _to_legacy_value(getattr(self, "allowed_to_add", None), serialize),
196
+ ("displayName" if serialize else "display_name"): _to_legacy_value(getattr(self, "display_name", None), serialize),
197
+ ("help" if serialize else "help"): _to_legacy_value(getattr(self, "help", None), serialize),
198
+ ("isManagementPermission" if serialize else "is_management_permission"): _to_legacy_value(getattr(self, "is_management_permission", None), serialize),
199
+ ("name" if serialize else "name"): _to_legacy_value(getattr(self, "name", None), serialize),
200
+ }
201
+
202
+ def __openapi_generator_modern_projection(self) -> Dict[str, Any]:
203
+ """Return the dictionary representation of the model using alias.
204
+
205
+ This has the following differences from calling pydantic's
206
+ `self.model_dump(by_alias=True)`:
207
+
208
+ * `None` is only added to the output dict for nullable fields that
209
+ were set at model initialization. Other fields with value `None`
210
+ are ignored.
211
+ """
212
+ excluded_fields: Set[str] = set([
213
+ ])
214
+
215
+ _dict = self.model_dump(
216
+ by_alias=True,
217
+ exclude=excluded_fields,
218
+ exclude_none=True,
219
+ )
220
+ return _dict
221
+
222
+ setattr(
223
+ to_dict,
224
+ _OPENAPI_GENERATOR_TO_DICT,
225
+ __openapi_generator_modern_projection,
226
+ )
227
+ setattr(
228
+ __openapi_generator_modern_projection,
229
+ _OPENAPI_GENERATOR_TO_DICT,
230
+ to_dict,
231
+ )
232
+ del __openapi_generator_modern_projection
233
+
234
+ @classmethod
235
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
236
+ """Create an instance of GroupPermission from a dict"""
237
+ if obj is None:
238
+ return None
239
+
240
+ if not isinstance(obj, dict):
241
+ return cls.model_validate(obj)
242
+
243
+ obj = _cast(
244
+ Dict[str, Any],
245
+ cls.__preprocess_input_names(
246
+ obj,
247
+ remove_hidden_storage_names=True,
248
+ ),
249
+ )
250
+
251
+ _obj = cls.model_validate({
252
+ "allowedToAdd": obj.get("allowedToAdd") if obj.get("allowedToAdd") is not None else False,
253
+ "displayName": obj.get("displayName"),
254
+ "help": obj.get("help"),
255
+ "isManagementPermission": obj.get("isManagementPermission") if obj.get("isManagementPermission") is not None else False,
256
+ "name": obj.get("name")
257
+ })
258
+ return _obj
259
+
260
+