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.
- vrchatapi/__init__.py +742 -0
- vrchatapi/api/__init__.py +23 -0
- vrchatapi/api/authentication_api.py +6253 -0
- vrchatapi/api/avatars_api.py +4234 -0
- vrchatapi/api/calendar_api.py +4090 -0
- vrchatapi/api/economy_api.py +11547 -0
- vrchatapi/api/favorites_api.py +2368 -0
- vrchatapi/api/files_api.py +6109 -0
- vrchatapi/api/friends_api.py +1708 -0
- vrchatapi/api/groups_api.py +15085 -0
- vrchatapi/api/instances_api.py +1754 -0
- vrchatapi/api/inventory_api.py +4333 -0
- vrchatapi/api/invite_api.py +3337 -0
- vrchatapi/api/jams_api.py +1446 -0
- vrchatapi/api/miscellaneous_api.py +2384 -0
- vrchatapi/api/notifications_api.py +3624 -0
- vrchatapi/api/playermoderation_api.py +1127 -0
- vrchatapi/api/prints_api.py +1478 -0
- vrchatapi/api/props_api.py +2269 -0
- vrchatapi/api/users_api.py +7894 -0
- vrchatapi/api/worlds_api.py +6153 -0
- vrchatapi/api_client.py +865 -0
- vrchatapi/api_response.py +21 -0
- vrchatapi/configuration.py +686 -0
- vrchatapi/exceptions.py +218 -0
- vrchatapi/models/__init__.py +345 -0
- vrchatapi/models/account_deletion_log.py +253 -0
- vrchatapi/models/add_favorite_request.py +246 -0
- vrchatapi/models/add_group_gallery_image_request.py +234 -0
- vrchatapi/models/admin_asset_bundle.py +337 -0
- vrchatapi/models/admin_unity_package.py +261 -0
- vrchatapi/models/age_verification_status.py +38 -0
- vrchatapi/models/agreement.py +280 -0
- vrchatapi/models/agreement_code.py +36 -0
- vrchatapi/models/agreement_request.py +256 -0
- vrchatapi/models/agreement_status.py +261 -0
- vrchatapi/models/api_config.py +1299 -0
- vrchatapi/models/api_config_access_logs_urls.py +258 -0
- vrchatapi/models/api_config_announcement.py +217 -0
- vrchatapi/models/api_config_audio_config.py +311 -0
- vrchatapi/models/api_config_avatar_perf_limiter.py +293 -0
- vrchatapi/models/api_config_constants.py +262 -0
- vrchatapi/models/api_config_constants_groups.py +306 -0
- vrchatapi/models/api_config_constants_instance.py +238 -0
- vrchatapi/models/api_config_constants_instancepopulationbrackets.py +262 -0
- vrchatapi/models/api_config_constants_instancepopulationbracketscrowded.py +216 -0
- vrchatapi/models/api_config_constants_instancepopulationbracketsfew.py +216 -0
- vrchatapi/models/api_config_constants_instancepopulationbracketsmany.py +216 -0
- vrchatapi/models/api_config_constants_language.py +234 -0
- vrchatapi/models/api_config_download_url_list.py +258 -0
- vrchatapi/models/api_config_events.py +314 -0
- vrchatapi/models/api_config_ios_version.py +216 -0
- vrchatapi/models/api_config_min_supported_client_build_number.py +348 -0
- vrchatapi/models/api_config_offline_analysis.py +216 -0
- vrchatapi/models/api_health.py +248 -0
- vrchatapi/models/avatar.py +463 -0
- vrchatapi/models/avatar_moderation.py +249 -0
- vrchatapi/models/avatar_moderation_created.py +248 -0
- vrchatapi/models/avatar_moderation_type.py +36 -0
- vrchatapi/models/avatar_performance.py +265 -0
- vrchatapi/models/avatar_published_listings_inner.py +271 -0
- vrchatapi/models/avatar_style.py +239 -0
- vrchatapi/models/avatar_styles.py +231 -0
- vrchatapi/models/avatar_unity_package_url_object.py +234 -0
- vrchatapi/models/badge.py +308 -0
- vrchatapi/models/balance.py +247 -0
- vrchatapi/models/ban_group_member_request.py +234 -0
- vrchatapi/models/boop_request.py +250 -0
- vrchatapi/models/calendar_day_of_week.py +42 -0
- vrchatapi/models/calendar_event.py +475 -0
- vrchatapi/models/calendar_event_access.py +37 -0
- vrchatapi/models/calendar_event_category.py +48 -0
- vrchatapi/models/calendar_event_discovery.py +247 -0
- vrchatapi/models/calendar_event_discovery_inclusion.py +38 -0
- vrchatapi/models/calendar_event_discovery_scope.py +38 -0
- vrchatapi/models/calendar_event_frequency.py +39 -0
- vrchatapi/models/calendar_event_occurrence_kind.py +38 -0
- vrchatapi/models/calendar_event_platform.py +38 -0
- vrchatapi/models/calendar_event_recurrence.py +261 -0
- vrchatapi/models/calendar_event_recurrence_end.py +246 -0
- vrchatapi/models/calendar_event_recurrence_end_type.py +37 -0
- vrchatapi/models/calendar_event_user_interest.py +251 -0
- vrchatapi/models/change_user_tags_request.py +212 -0
- vrchatapi/models/change_world_tags_request.py +212 -0
- vrchatapi/models/content_filter.py +40 -0
- vrchatapi/models/create_avatar_moderation_request.py +243 -0
- vrchatapi/models/create_avatar_request.py +324 -0
- vrchatapi/models/create_calendar_event_request.py +385 -0
- vrchatapi/models/create_file_request.py +251 -0
- vrchatapi/models/create_file_version_request.py +259 -0
- vrchatapi/models/create_group_announcement_request.py +253 -0
- vrchatapi/models/create_group_gallery_request.py +297 -0
- vrchatapi/models/create_group_invite_request.py +242 -0
- vrchatapi/models/create_group_post_request.py +267 -0
- vrchatapi/models/create_group_request.py +295 -0
- vrchatapi/models/create_group_role_request.py +255 -0
- vrchatapi/models/create_instance_request.py +384 -0
- vrchatapi/models/create_jam_submission_request.py +239 -0
- vrchatapi/models/create_listing_request.py +285 -0
- vrchatapi/models/create_product_request.py +270 -0
- vrchatapi/models/create_prop_request.py +308 -0
- vrchatapi/models/create_world_request.py +322 -0
- vrchatapi/models/current_user.py +909 -0
- vrchatapi/models/current_user_platform_history_inner.py +245 -0
- vrchatapi/models/current_user_presence.py +379 -0
- vrchatapi/models/decline_group_invite_request.py +211 -0
- vrchatapi/models/developer_type.py +39 -0
- vrchatapi/models/disable2_fa_result.py +211 -0
- vrchatapi/models/discord_details.py +216 -0
- vrchatapi/models/dynamic_content_row.py +276 -0
- vrchatapi/models/earnings_metrics.py +248 -0
- vrchatapi/models/earnings_metrics_totals.py +267 -0
- vrchatapi/models/economy_account.py +360 -0
- vrchatapi/models/economy_balances.py +221 -0
- vrchatapi/models/economy_payout.py +385 -0
- vrchatapi/models/economy_payout_eligibility.py +263 -0
- vrchatapi/models/economy_payout_list.py +219 -0
- vrchatapi/models/economy_payout_status.py +295 -0
- vrchatapi/models/equip_inventory_item_request.py +235 -0
- vrchatapi/models/error.py +215 -0
- vrchatapi/models/favorite.py +251 -0
- vrchatapi/models/favorite_group.py +278 -0
- vrchatapi/models/favorite_group_limits.py +249 -0
- vrchatapi/models/favorite_group_visibility.py +38 -0
- vrchatapi/models/favorite_limits.py +265 -0
- vrchatapi/models/favorite_type.py +39 -0
- vrchatapi/models/favorited_world.py +441 -0
- vrchatapi/models/feedback.py +331 -0
- vrchatapi/models/file.py +325 -0
- vrchatapi/models/file_analysis.py +281 -0
- vrchatapi/models/file_analysis_avatar_stats.py +575 -0
- vrchatapi/models/file_data.py +279 -0
- vrchatapi/models/file_status.py +39 -0
- vrchatapi/models/file_upload_url.py +212 -0
- vrchatapi/models/file_version.py +254 -0
- vrchatapi/models/file_version_upload_status.py +269 -0
- vrchatapi/models/finish_file_data_upload_request.py +248 -0
- vrchatapi/models/follow_calendar_event_request.py +234 -0
- vrchatapi/models/friend_status.py +250 -0
- vrchatapi/models/get_group_posts200_response.py +219 -0
- vrchatapi/models/get_user_group_instances200_response.py +248 -0
- vrchatapi/models/group.py +514 -0
- vrchatapi/models/group_access_type.py +38 -0
- vrchatapi/models/group_announcement.py +315 -0
- vrchatapi/models/group_audit_log_entry.py +287 -0
- vrchatapi/models/group_gallery.py +319 -0
- vrchatapi/models/group_gallery_file_order.py +211 -0
- vrchatapi/models/group_gallery_file_order_request.py +239 -0
- vrchatapi/models/group_gallery_image.py +301 -0
- vrchatapi/models/group_instance.py +257 -0
- vrchatapi/models/group_join_request_action.py +37 -0
- vrchatapi/models/group_join_state.py +39 -0
- vrchatapi/models/group_member.py +415 -0
- vrchatapi/models/group_member_limited_user.py +290 -0
- vrchatapi/models/group_member_status.py +41 -0
- vrchatapi/models/group_my_member.py +399 -0
- vrchatapi/models/group_permission.py +260 -0
- vrchatapi/models/group_permissions.py +63 -0
- vrchatapi/models/group_post.py +317 -0
- vrchatapi/models/group_post_visibility.py +37 -0
- vrchatapi/models/group_privacy.py +37 -0
- vrchatapi/models/group_role.py +309 -0
- vrchatapi/models/group_role_template.py +39 -0
- vrchatapi/models/group_role_template_values.py +254 -0
- vrchatapi/models/group_role_template_values_roles.py +253 -0
- vrchatapi/models/group_search_sort.py +37 -0
- vrchatapi/models/group_transferable.py +215 -0
- vrchatapi/models/group_transferable_requirements.py +266 -0
- vrchatapi/models/group_user_visibility.py +38 -0
- vrchatapi/models/image_animation_style.py +62 -0
- vrchatapi/models/image_loop_style.py +37 -0
- vrchatapi/models/image_mask.py +41 -0
- vrchatapi/models/image_purpose.py +46 -0
- vrchatapi/models/info_push.py +306 -0
- vrchatapi/models/info_push_data.py +288 -0
- vrchatapi/models/info_push_data_article.py +215 -0
- vrchatapi/models/info_push_data_article_content.py +251 -0
- vrchatapi/models/info_push_data_clickable.py +224 -0
- vrchatapi/models/instance.py +597 -0
- vrchatapi/models/instance_content_settings.py +236 -0
- vrchatapi/models/instance_platforms.py +222 -0
- vrchatapi/models/instance_region.py +40 -0
- vrchatapi/models/instance_short_name_response.py +248 -0
- vrchatapi/models/instance_type.py +40 -0
- vrchatapi/models/inventory.py +247 -0
- vrchatapi/models/inventory_consumption_results.py +255 -0
- vrchatapi/models/inventory_default_attributes_value.py +243 -0
- vrchatapi/models/inventory_default_attributes_value_validator.py +211 -0
- vrchatapi/models/inventory_drop.py +331 -0
- vrchatapi/models/inventory_equip_slot.py +39 -0
- vrchatapi/models/inventory_flag.py +43 -0
- vrchatapi/models/inventory_item.py +420 -0
- vrchatapi/models/inventory_item_type.py +42 -0
- vrchatapi/models/inventory_metadata.py +287 -0
- vrchatapi/models/inventory_notification_details.py +244 -0
- vrchatapi/models/inventory_spawn.py +216 -0
- vrchatapi/models/inventory_template.py +351 -0
- vrchatapi/models/inventory_user_attributes.py +250 -0
- vrchatapi/models/invite_message.py +276 -0
- vrchatapi/models/invite_message_type.py +39 -0
- vrchatapi/models/invite_request.py +243 -0
- vrchatapi/models/invite_response.py +235 -0
- vrchatapi/models/jam.py +302 -0
- vrchatapi/models/jam_state_change_dates.py +276 -0
- vrchatapi/models/jam_submission.py +275 -0
- vrchatapi/models/join_group_request.py +234 -0
- vrchatapi/models/license.py +261 -0
- vrchatapi/models/license_action.py +37 -0
- vrchatapi/models/license_group.py +235 -0
- vrchatapi/models/license_type.py +39 -0
- vrchatapi/models/limited_group.py +377 -0
- vrchatapi/models/limited_unity_package.py +251 -0
- vrchatapi/models/limited_user_friend.py +399 -0
- vrchatapi/models/limited_user_groups.py +386 -0
- vrchatapi/models/limited_user_instance.py +430 -0
- vrchatapi/models/limited_user_search.py +395 -0
- vrchatapi/models/limited_world.py +410 -0
- vrchatapi/models/mime_type.py +50 -0
- vrchatapi/models/model_print.py +299 -0
- vrchatapi/models/moderate_user_request.py +217 -0
- vrchatapi/models/moderation_report.py +296 -0
- vrchatapi/models/mutual_friend.py +302 -0
- vrchatapi/models/mutuals.py +217 -0
- vrchatapi/models/notification.py +283 -0
- vrchatapi/models/notification_detail_invite.py +250 -0
- vrchatapi/models/notification_detail_invite_response.py +242 -0
- vrchatapi/models/notification_detail_request_invite.py +239 -0
- vrchatapi/models/notification_detail_request_invite_response.py +242 -0
- vrchatapi/models/notification_detail_vote_to_kick.py +242 -0
- vrchatapi/models/notification_type.py +43 -0
- vrchatapi/models/notification_v2.py +466 -0
- vrchatapi/models/notification_v2_details_boop.py +255 -0
- vrchatapi/models/notification_v2_response.py +259 -0
- vrchatapi/models/notification_v2_type.py +58 -0
- vrchatapi/models/ok_status.py +211 -0
- vrchatapi/models/ok_status2.py +234 -0
- vrchatapi/models/order_option.py +37 -0
- vrchatapi/models/order_option_short.py +37 -0
- vrchatapi/models/paginated_calendar_event_list.py +255 -0
- vrchatapi/models/paginated_group_audit_log_entry_list.py +255 -0
- vrchatapi/models/paginated_moderation_report_list.py +255 -0
- vrchatapi/models/past_display_name.py +241 -0
- vrchatapi/models/pending2_fa_result.py +239 -0
- vrchatapi/models/performance_limiter_info.py +234 -0
- vrchatapi/models/performance_ratings.py +41 -0
- vrchatapi/models/permission.py +280 -0
- vrchatapi/models/permission_data.py +258 -0
- vrchatapi/models/platform_build_info.py +242 -0
- vrchatapi/models/player_moderation.py +276 -0
- vrchatapi/models/player_moderation_type.py +44 -0
- vrchatapi/models/print_files.py +239 -0
- vrchatapi/models/private_profile.py +267 -0
- vrchatapi/models/private_profile_activity.py +292 -0
- vrchatapi/models/product.py +389 -0
- vrchatapi/models/product_listing.py +538 -0
- vrchatapi/models/product_listing_type.py +39 -0
- vrchatapi/models/product_listing_variant.py +272 -0
- vrchatapi/models/product_purchase.py +571 -0
- vrchatapi/models/product_purchase_history.py +256 -0
- vrchatapi/models/product_purchase_location_type.py +46 -0
- vrchatapi/models/product_purchase_product.py +269 -0
- vrchatapi/models/product_purchase_purchase_context.py +250 -0
- vrchatapi/models/product_purchase_record.py +312 -0
- vrchatapi/models/product_type.py +39 -0
- vrchatapi/models/profile_represented_group.py +262 -0
- vrchatapi/models/prop.py +358 -0
- vrchatapi/models/prop_publish_status.py +234 -0
- vrchatapi/models/prop_unity_package.py +269 -0
- vrchatapi/models/public_profile.py +398 -0
- vrchatapi/models/purchase_context_data.py +251 -0
- vrchatapi/models/purchase_product_listing_request.py +281 -0
- vrchatapi/models/region.py +42 -0
- vrchatapi/models/register_user_account_request.py +278 -0
- vrchatapi/models/release_status.py +39 -0
- vrchatapi/models/report_category.py +226 -0
- vrchatapi/models/report_reason.py +216 -0
- vrchatapi/models/represented_group.py +348 -0
- vrchatapi/models/request_invite_request.py +235 -0
- vrchatapi/models/respond_group_join_request.py +217 -0
- vrchatapi/models/respond_notification_v2_request.py +242 -0
- vrchatapi/models/response.py +217 -0
- vrchatapi/models/reward_badge.py +308 -0
- vrchatapi/models/reward_redemption.py +220 -0
- vrchatapi/models/reward_redemption_data.py +224 -0
- vrchatapi/models/reward_redemption_request.py +211 -0
- vrchatapi/models/reward_redemption_result.py +250 -0
- vrchatapi/models/search_group_members200_response.py +224 -0
- vrchatapi/models/seller_eligibility.py +211 -0
- vrchatapi/models/sent_notification.py +278 -0
- vrchatapi/models/service_queue_stats.py +234 -0
- vrchatapi/models/service_status.py +281 -0
- vrchatapi/models/share_inventory_item_direct_request.py +239 -0
- vrchatapi/models/sort_option.py +53 -0
- vrchatapi/models/sort_option_product_purchase.py +36 -0
- vrchatapi/models/store.py +372 -0
- vrchatapi/models/store_context.py +249 -0
- vrchatapi/models/store_shelf.py +304 -0
- vrchatapi/models/store_type.py +38 -0
- vrchatapi/models/store_view.py +40 -0
- vrchatapi/models/submit_moderation_report_request.py +263 -0
- vrchatapi/models/submit_moderation_report_request_details.py +283 -0
- vrchatapi/models/subscription.py +301 -0
- vrchatapi/models/subscription_period.py +40 -0
- vrchatapi/models/success.py +215 -0
- vrchatapi/models/success_flag.py +211 -0
- vrchatapi/models/tilia_kyc.py +246 -0
- vrchatapi/models/tilia_status.py +259 -0
- vrchatapi/models/tilia_tos.py +211 -0
- vrchatapi/models/token_bundle.py +286 -0
- vrchatapi/models/transaction.py +322 -0
- vrchatapi/models/transaction_agreement.py +353 -0
- vrchatapi/models/transaction_status.py +39 -0
- vrchatapi/models/transaction_steam_info.py +271 -0
- vrchatapi/models/transaction_steam_wallet_info.py +227 -0
- vrchatapi/models/transfer_group_request.py +234 -0
- vrchatapi/models/tutorial_status.py +255 -0
- vrchatapi/models/two_factor_auth_code.py +211 -0
- vrchatapi/models/two_factor_email_code.py +211 -0
- vrchatapi/models/two_factor_recovery_codes.py +247 -0
- vrchatapi/models/two_factor_recovery_codes_otp_inner.py +216 -0
- vrchatapi/models/unity_package.py +360 -0
- vrchatapi/models/update_asset_review_notes_request.py +234 -0
- vrchatapi/models/update_avatar_request.py +293 -0
- vrchatapi/models/update_calendar_event_request.py +365 -0
- vrchatapi/models/update_favorite_group_request.py +246 -0
- vrchatapi/models/update_group_gallery_request.py +297 -0
- vrchatapi/models/update_group_member_request.py +256 -0
- vrchatapi/models/update_group_representation_request.py +234 -0
- vrchatapi/models/update_group_request.py +300 -0
- vrchatapi/models/update_group_role_request.py +255 -0
- vrchatapi/models/update_inventory_item_request.py +254 -0
- vrchatapi/models/update_invite_message_request.py +211 -0
- vrchatapi/models/update_listing_request.py +211 -0
- vrchatapi/models/update_product_request.py +261 -0
- vrchatapi/models/update_prop_request.py +303 -0
- vrchatapi/models/update_tilia_tos_request.py +211 -0
- vrchatapi/models/update_user_badge_request.py +216 -0
- vrchatapi/models/update_user_note_request.py +239 -0
- vrchatapi/models/update_user_request.py +358 -0
- vrchatapi/models/update_world_request.py +317 -0
- vrchatapi/models/user.py +549 -0
- vrchatapi/models/user_credits_eligible.py +216 -0
- vrchatapi/models/user_exists.py +242 -0
- vrchatapi/models/user_note.py +273 -0
- vrchatapi/models/user_note_target_user.py +277 -0
- vrchatapi/models/user_state.py +38 -0
- vrchatapi/models/user_status.py +40 -0
- vrchatapi/models/user_subscription.py +330 -0
- vrchatapi/models/user_subscription_eligible.py +274 -0
- vrchatapi/models/verify2_fa_email_code_result.py +211 -0
- vrchatapi/models/verify2_fa_result.py +216 -0
- vrchatapi/models/verify_auth_token_result.py +217 -0
- vrchatapi/models/world.py +459 -0
- vrchatapi/models/world_metadata.py +216 -0
- vrchatapi/models/world_publish_status.py +234 -0
- vrchatapi/py.typed +0 -0
- vrchatapi/rest.py +303 -0
- vrchatapi_async-1.20.8.dev1.dist-info/METADATA +137 -0
- vrchatapi_async-1.20.8.dev1.dist-info/RECORD +362 -0
- vrchatapi_async-1.20.8.dev1.dist-info/WHEEL +5 -0
- vrchatapi_async-1.20.8.dev1.dist-info/licenses/LICENSE +21 -0
- vrchatapi_async-1.20.8.dev1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,571 @@
|
|
|
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, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, cast as _cast
|
|
24
|
+
from vrchatapi.models.product_listing_type import ProductListingType
|
|
25
|
+
from vrchatapi.models.product_purchase_product import ProductPurchaseProduct
|
|
26
|
+
from vrchatapi.models.product_purchase_purchase_context import ProductPurchasePurchaseContext
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
from pydantic_core import to_jsonable_python
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
_OPENAPI_GENERATOR_TO_DICT = "_openapi_generator_to_dict"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _get_openapi_to_dict(value: Any) -> Any:
|
|
36
|
+
# Reciprocal function references preserve inherited generated methods
|
|
37
|
+
# without reserving model member names. Checking both directions also
|
|
38
|
+
# rejects overrides whose decorators copy function attributes.
|
|
39
|
+
to_dict = getattr(value, "to_dict", None)
|
|
40
|
+
type_to_dict = getattr(type(value), "to_dict", None)
|
|
41
|
+
if (
|
|
42
|
+
not callable(to_dict)
|
|
43
|
+
or getattr(to_dict, "__func__", None) is not type_to_dict
|
|
44
|
+
):
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
openapi_to_dict = getattr(
|
|
48
|
+
type_to_dict, _OPENAPI_GENERATOR_TO_DICT, None
|
|
49
|
+
)
|
|
50
|
+
if (
|
|
51
|
+
not callable(openapi_to_dict)
|
|
52
|
+
or getattr(
|
|
53
|
+
openapi_to_dict,
|
|
54
|
+
_OPENAPI_GENERATOR_TO_DICT,
|
|
55
|
+
None,
|
|
56
|
+
) is not type_to_dict
|
|
57
|
+
):
|
|
58
|
+
return None
|
|
59
|
+
return openapi_to_dict
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _to_legacy_item(value: Any, serialize: bool) -> Any:
|
|
63
|
+
to_dict = getattr(value, "to_dict", None)
|
|
64
|
+
if _get_openapi_to_dict(value) is not None and callable(to_dict):
|
|
65
|
+
return to_dict(serialize=serialize)
|
|
66
|
+
if callable(to_dict):
|
|
67
|
+
return to_dict()
|
|
68
|
+
return value
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _to_legacy_value(value: Any, serialize: bool) -> Any:
|
|
72
|
+
# python-legacy converted only immediate list elements or dictionary values:
|
|
73
|
+
# https://github.com/OpenAPITools/openapi-generator/blob/c84b949df1a9ec04ba75989cb49b45c940c2f694/modules/openapi-generator/src/main/resources/python-legacy/model.mustache#L203-L231
|
|
74
|
+
if isinstance(value, list):
|
|
75
|
+
return [_to_legacy_item(item, serialize) for item in value]
|
|
76
|
+
if isinstance(value, dict):
|
|
77
|
+
return {
|
|
78
|
+
key: _to_legacy_item(item, serialize)
|
|
79
|
+
for key, item in value.items()
|
|
80
|
+
}
|
|
81
|
+
return _to_legacy_item(value, serialize)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _to_openapi_value(value: Any) -> Any:
|
|
85
|
+
if isinstance(value, list):
|
|
86
|
+
return [_to_openapi_value(item) for item in value]
|
|
87
|
+
if isinstance(value, dict):
|
|
88
|
+
return {key: _to_openapi_value(item) for key, item in value.items()}
|
|
89
|
+
|
|
90
|
+
to_openapi_dict = _get_openapi_to_dict(value)
|
|
91
|
+
if to_openapi_dict is not None:
|
|
92
|
+
return to_openapi_dict(value)
|
|
93
|
+
|
|
94
|
+
to_dict = getattr(value, "to_dict", None)
|
|
95
|
+
if callable(to_dict):
|
|
96
|
+
return to_dict()
|
|
97
|
+
return value
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class ProductPurchase(BaseModel):
|
|
101
|
+
"""
|
|
102
|
+
ProductPurchase
|
|
103
|
+
|
|
104
|
+
Attributes:
|
|
105
|
+
openapi_types (dict): The key is attribute name
|
|
106
|
+
and the value is attribute type.
|
|
107
|
+
attribute_map (dict): The key is attribute name
|
|
108
|
+
and the value is json key in definition.
|
|
109
|
+
""" # noqa: E501
|
|
110
|
+
buyer_display_name: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("buyerDisplayName", "buyer_display_name"), serialization_alias="buyerDisplayName")
|
|
111
|
+
buyer_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("buyerId", "buyer_id"), serialization_alias="buyerId", 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"]})
|
|
112
|
+
first_party: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("firstParty", "first_party"), serialization_alias="firstParty")
|
|
113
|
+
is_buyer: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("isBuyer", "is_buyer"), serialization_alias="isBuyer")
|
|
114
|
+
is_gift: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("isGift", "is_gift"), serialization_alias="isGift")
|
|
115
|
+
is_receiver: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("isReceiver", "is_receiver"), serialization_alias="isReceiver")
|
|
116
|
+
is_seller: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("isSeller", "is_seller"), serialization_alias="isSeller")
|
|
117
|
+
ledger_transaction_id: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("ledgerTransactionId", "ledger_transaction_id"), serialization_alias="ledgerTransactionId")
|
|
118
|
+
listing_currently_available: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("listingCurrentlyAvailable", "listing_currently_available"), serialization_alias="listingCurrentlyAvailable")
|
|
119
|
+
listing_description: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("listingDescription", "listing_description"), serialization_alias="listingDescription")
|
|
120
|
+
listing_display_name: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("listingDisplayName", "listing_display_name"), serialization_alias="listingDisplayName")
|
|
121
|
+
listing_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("listingId", "listing_id"), serialization_alias="listingId", json_schema_extra={"examples": ["prod_bfbc2315-247a-44d7-bfea-5237f8d56cb4"]})
|
|
122
|
+
listing_image_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("listingImageId", "listing_image_id"), serialization_alias="listingImageId", json_schema_extra={"examples": ["file_ce35d830-e20a-4df0-a6d4-5aaef4508044"]})
|
|
123
|
+
listing_subtitle: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("listingSubtitle", "listing_subtitle"), serialization_alias="listingSubtitle")
|
|
124
|
+
listing_type: Optional[ProductListingType] = Field(default=None, validation_alias=AliasChoices("listingType", "listing_type"), serialization_alias="listingType")
|
|
125
|
+
products: Optional[List[ProductPurchaseProduct]] = None
|
|
126
|
+
purchase_active: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("purchaseActive", "purchase_active"), serialization_alias="purchaseActive")
|
|
127
|
+
purchase_context: Optional[ProductPurchasePurchaseContext] = Field(default=None, validation_alias=AliasChoices("purchaseContext", "purchase_context"), serialization_alias="purchaseContext")
|
|
128
|
+
purchase_current_status: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("purchaseCurrentStatus", "purchase_current_status"), serialization_alias="purchaseCurrentStatus")
|
|
129
|
+
purchase_date: Optional[datetime] = Field(default=None, validation_alias=AliasChoices("purchaseDate", "purchase_date"), serialization_alias="purchaseDate")
|
|
130
|
+
purchase_duration: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("purchaseDuration", "purchase_duration"), serialization_alias="purchaseDuration")
|
|
131
|
+
purchase_duration_type: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("purchaseDurationType", "purchase_duration_type"), serialization_alias="purchaseDurationType")
|
|
132
|
+
purchase_end_date: Optional[datetime] = Field(default=None, validation_alias=AliasChoices("purchaseEndDate", "purchase_end_date"), serialization_alias="purchaseEndDate")
|
|
133
|
+
purchase_fee: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("purchaseFee", "purchase_fee"), serialization_alias="purchaseFee")
|
|
134
|
+
purchase_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("purchaseId", "purchase_id"), serialization_alias="purchaseId", json_schema_extra={"examples": ["pur_f0446b91-e0f7-403e-8932-609d5057898c"]})
|
|
135
|
+
purchase_latest: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("purchaseLatest", "purchase_latest"), serialization_alias="purchaseLatest")
|
|
136
|
+
purchase_price: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("purchasePrice", "purchase_price"), serialization_alias="purchasePrice")
|
|
137
|
+
purchase_quantity: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("purchaseQuantity", "purchase_quantity"), serialization_alias="purchaseQuantity")
|
|
138
|
+
purchase_start_date: Optional[datetime] = Field(default=None, validation_alias=AliasChoices("purchaseStartDate", "purchase_start_date"), serialization_alias="purchaseStartDate")
|
|
139
|
+
purchase_token: Optional[Dict[str, Any]] = Field(default=None, validation_alias=AliasChoices("purchaseToken", "purchase_token"), serialization_alias="purchaseToken")
|
|
140
|
+
purchase_type: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("purchaseType", "purchase_type"), serialization_alias="purchaseType")
|
|
141
|
+
purchase_unit_price: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("purchaseUnitPrice", "purchase_unit_price"), serialization_alias="purchaseUnitPrice")
|
|
142
|
+
purchase_value: Optional[StrictInt] = Field(default=None, validation_alias=AliasChoices("purchaseValue", "purchase_value"), serialization_alias="purchaseValue")
|
|
143
|
+
receiver_display_name: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("receiverDisplayName", "receiver_display_name"), serialization_alias="receiverDisplayName")
|
|
144
|
+
receiver_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("receiverId", "receiver_id"), serialization_alias="receiverId", 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"]})
|
|
145
|
+
recurrable: Optional[StrictBool] = None
|
|
146
|
+
refundable: Optional[StrictBool] = None
|
|
147
|
+
seller_display_name: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("sellerDisplayName", "seller_display_name"), serialization_alias="sellerDisplayName")
|
|
148
|
+
seller_id: Optional[StrictStr] = Field(default=None, validation_alias=AliasChoices("sellerId", "seller_id"), serialization_alias="sellerId", 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"]})
|
|
149
|
+
stackable: Optional[StrictBool] = None
|
|
150
|
+
will_recur: Optional[StrictBool] = Field(default=None, validation_alias=AliasChoices("willRecur", "will_recur"), serialization_alias="willRecur")
|
|
151
|
+
openapi_types: ClassVar[Dict[str, str]] = {
|
|
152
|
+
"buyer_display_name": "str",
|
|
153
|
+
"buyer_id": "str",
|
|
154
|
+
"first_party": "bool",
|
|
155
|
+
"is_buyer": "bool",
|
|
156
|
+
"is_gift": "bool",
|
|
157
|
+
"is_receiver": "bool",
|
|
158
|
+
"is_seller": "bool",
|
|
159
|
+
"ledger_transaction_id": "int",
|
|
160
|
+
"listing_currently_available": "bool",
|
|
161
|
+
"listing_description": "str",
|
|
162
|
+
"listing_display_name": "str",
|
|
163
|
+
"listing_id": "str",
|
|
164
|
+
"listing_image_id": "str",
|
|
165
|
+
"listing_subtitle": "str",
|
|
166
|
+
"listing_type": "ProductListingType",
|
|
167
|
+
"products": "List[ProductPurchaseProduct]",
|
|
168
|
+
"purchase_active": "bool",
|
|
169
|
+
"purchase_context": "ProductPurchasePurchaseContext",
|
|
170
|
+
"purchase_current_status": "str",
|
|
171
|
+
"purchase_date": "datetime",
|
|
172
|
+
"purchase_duration": "int",
|
|
173
|
+
"purchase_duration_type": "str",
|
|
174
|
+
"purchase_end_date": "datetime",
|
|
175
|
+
"purchase_fee": "int",
|
|
176
|
+
"purchase_id": "str",
|
|
177
|
+
"purchase_latest": "bool",
|
|
178
|
+
"purchase_price": "int",
|
|
179
|
+
"purchase_quantity": "int",
|
|
180
|
+
"purchase_start_date": "datetime",
|
|
181
|
+
"purchase_token": "object",
|
|
182
|
+
"purchase_type": "str",
|
|
183
|
+
"purchase_unit_price": "int",
|
|
184
|
+
"purchase_value": "int",
|
|
185
|
+
"receiver_display_name": "str",
|
|
186
|
+
"receiver_id": "str",
|
|
187
|
+
"recurrable": "bool",
|
|
188
|
+
"refundable": "bool",
|
|
189
|
+
"seller_display_name": "str",
|
|
190
|
+
"seller_id": "str",
|
|
191
|
+
"stackable": "bool",
|
|
192
|
+
"will_recur": "bool"
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
attribute_map: ClassVar[Dict[str, str]] = {
|
|
196
|
+
"buyer_display_name": "buyerDisplayName",
|
|
197
|
+
"buyer_id": "buyerId",
|
|
198
|
+
"first_party": "firstParty",
|
|
199
|
+
"is_buyer": "isBuyer",
|
|
200
|
+
"is_gift": "isGift",
|
|
201
|
+
"is_receiver": "isReceiver",
|
|
202
|
+
"is_seller": "isSeller",
|
|
203
|
+
"ledger_transaction_id": "ledgerTransactionId",
|
|
204
|
+
"listing_currently_available": "listingCurrentlyAvailable",
|
|
205
|
+
"listing_description": "listingDescription",
|
|
206
|
+
"listing_display_name": "listingDisplayName",
|
|
207
|
+
"listing_id": "listingId",
|
|
208
|
+
"listing_image_id": "listingImageId",
|
|
209
|
+
"listing_subtitle": "listingSubtitle",
|
|
210
|
+
"listing_type": "listingType",
|
|
211
|
+
"products": "products",
|
|
212
|
+
"purchase_active": "purchaseActive",
|
|
213
|
+
"purchase_context": "purchaseContext",
|
|
214
|
+
"purchase_current_status": "purchaseCurrentStatus",
|
|
215
|
+
"purchase_date": "purchaseDate",
|
|
216
|
+
"purchase_duration": "purchaseDuration",
|
|
217
|
+
"purchase_duration_type": "purchaseDurationType",
|
|
218
|
+
"purchase_end_date": "purchaseEndDate",
|
|
219
|
+
"purchase_fee": "purchaseFee",
|
|
220
|
+
"purchase_id": "purchaseId",
|
|
221
|
+
"purchase_latest": "purchaseLatest",
|
|
222
|
+
"purchase_price": "purchasePrice",
|
|
223
|
+
"purchase_quantity": "purchaseQuantity",
|
|
224
|
+
"purchase_start_date": "purchaseStartDate",
|
|
225
|
+
"purchase_token": "purchaseToken",
|
|
226
|
+
"purchase_type": "purchaseType",
|
|
227
|
+
"purchase_unit_price": "purchaseUnitPrice",
|
|
228
|
+
"purchase_value": "purchaseValue",
|
|
229
|
+
"receiver_display_name": "receiverDisplayName",
|
|
230
|
+
"receiver_id": "receiverId",
|
|
231
|
+
"recurrable": "recurrable",
|
|
232
|
+
"refundable": "refundable",
|
|
233
|
+
"seller_display_name": "sellerDisplayName",
|
|
234
|
+
"seller_id": "sellerId",
|
|
235
|
+
"stackable": "stackable",
|
|
236
|
+
"will_recur": "willRecur"
|
|
237
|
+
}
|
|
238
|
+
__properties: ClassVar[List[str]] = ["buyerDisplayName", "buyerId", "firstParty", "isBuyer", "isGift", "isReceiver", "isSeller", "ledgerTransactionId", "listingCurrentlyAvailable", "listingDescription", "listingDisplayName", "listingId", "listingImageId", "listingSubtitle", "listingType", "products", "purchaseActive", "purchaseContext", "purchaseCurrentStatus", "purchaseDate", "purchaseDuration", "purchaseDurationType", "purchaseEndDate", "purchaseFee", "purchaseId", "purchaseLatest", "purchasePrice", "purchaseQuantity", "purchaseStartDate", "purchaseToken", "purchaseType", "purchaseUnitPrice", "purchaseValue", "receiverDisplayName", "receiverId", "recurrable", "refundable", "sellerDisplayName", "sellerId", "stackable", "willRecur"]
|
|
239
|
+
|
|
240
|
+
@classmethod
|
|
241
|
+
def __preprocess_input_names(
|
|
242
|
+
cls,
|
|
243
|
+
obj: Any,
|
|
244
|
+
remove_hidden_storage_names: bool = True,
|
|
245
|
+
) -> Any:
|
|
246
|
+
if not isinstance(obj, _Mapping):
|
|
247
|
+
return obj
|
|
248
|
+
obj = dict(obj)
|
|
249
|
+
if "buyerDisplayName" not in obj and "buyer_display_name" in obj:
|
|
250
|
+
obj["buyerDisplayName"] = obj["buyer_display_name"]
|
|
251
|
+
obj.pop("buyer_display_name", None)
|
|
252
|
+
if "buyerId" not in obj and "buyer_id" in obj:
|
|
253
|
+
obj["buyerId"] = obj["buyer_id"]
|
|
254
|
+
obj.pop("buyer_id", None)
|
|
255
|
+
if "firstParty" not in obj and "first_party" in obj:
|
|
256
|
+
obj["firstParty"] = obj["first_party"]
|
|
257
|
+
obj.pop("first_party", None)
|
|
258
|
+
if "isBuyer" not in obj and "is_buyer" in obj:
|
|
259
|
+
obj["isBuyer"] = obj["is_buyer"]
|
|
260
|
+
obj.pop("is_buyer", None)
|
|
261
|
+
if "isGift" not in obj and "is_gift" in obj:
|
|
262
|
+
obj["isGift"] = obj["is_gift"]
|
|
263
|
+
obj.pop("is_gift", None)
|
|
264
|
+
if "isReceiver" not in obj and "is_receiver" in obj:
|
|
265
|
+
obj["isReceiver"] = obj["is_receiver"]
|
|
266
|
+
obj.pop("is_receiver", None)
|
|
267
|
+
if "isSeller" not in obj and "is_seller" in obj:
|
|
268
|
+
obj["isSeller"] = obj["is_seller"]
|
|
269
|
+
obj.pop("is_seller", None)
|
|
270
|
+
if "ledgerTransactionId" not in obj and "ledger_transaction_id" in obj:
|
|
271
|
+
obj["ledgerTransactionId"] = obj["ledger_transaction_id"]
|
|
272
|
+
obj.pop("ledger_transaction_id", None)
|
|
273
|
+
if "listingCurrentlyAvailable" not in obj and "listing_currently_available" in obj:
|
|
274
|
+
obj["listingCurrentlyAvailable"] = obj["listing_currently_available"]
|
|
275
|
+
obj.pop("listing_currently_available", None)
|
|
276
|
+
if "listingDescription" not in obj and "listing_description" in obj:
|
|
277
|
+
obj["listingDescription"] = obj["listing_description"]
|
|
278
|
+
obj.pop("listing_description", None)
|
|
279
|
+
if "listingDisplayName" not in obj and "listing_display_name" in obj:
|
|
280
|
+
obj["listingDisplayName"] = obj["listing_display_name"]
|
|
281
|
+
obj.pop("listing_display_name", None)
|
|
282
|
+
if "listingId" not in obj and "listing_id" in obj:
|
|
283
|
+
obj["listingId"] = obj["listing_id"]
|
|
284
|
+
obj.pop("listing_id", None)
|
|
285
|
+
if "listingImageId" not in obj and "listing_image_id" in obj:
|
|
286
|
+
obj["listingImageId"] = obj["listing_image_id"]
|
|
287
|
+
obj.pop("listing_image_id", None)
|
|
288
|
+
if "listingSubtitle" not in obj and "listing_subtitle" in obj:
|
|
289
|
+
obj["listingSubtitle"] = obj["listing_subtitle"]
|
|
290
|
+
obj.pop("listing_subtitle", None)
|
|
291
|
+
if "listingType" not in obj and "listing_type" in obj:
|
|
292
|
+
obj["listingType"] = obj["listing_type"]
|
|
293
|
+
obj.pop("listing_type", None)
|
|
294
|
+
if "purchaseActive" not in obj and "purchase_active" in obj:
|
|
295
|
+
obj["purchaseActive"] = obj["purchase_active"]
|
|
296
|
+
obj.pop("purchase_active", None)
|
|
297
|
+
if "purchaseContext" not in obj and "purchase_context" in obj:
|
|
298
|
+
obj["purchaseContext"] = obj["purchase_context"]
|
|
299
|
+
obj.pop("purchase_context", None)
|
|
300
|
+
if "purchaseCurrentStatus" not in obj and "purchase_current_status" in obj:
|
|
301
|
+
obj["purchaseCurrentStatus"] = obj["purchase_current_status"]
|
|
302
|
+
obj.pop("purchase_current_status", None)
|
|
303
|
+
if "purchaseDate" not in obj and "purchase_date" in obj:
|
|
304
|
+
obj["purchaseDate"] = obj["purchase_date"]
|
|
305
|
+
obj.pop("purchase_date", None)
|
|
306
|
+
if "purchaseDuration" not in obj and "purchase_duration" in obj:
|
|
307
|
+
obj["purchaseDuration"] = obj["purchase_duration"]
|
|
308
|
+
obj.pop("purchase_duration", None)
|
|
309
|
+
if "purchaseDurationType" not in obj and "purchase_duration_type" in obj:
|
|
310
|
+
obj["purchaseDurationType"] = obj["purchase_duration_type"]
|
|
311
|
+
obj.pop("purchase_duration_type", None)
|
|
312
|
+
if "purchaseEndDate" not in obj and "purchase_end_date" in obj:
|
|
313
|
+
obj["purchaseEndDate"] = obj["purchase_end_date"]
|
|
314
|
+
obj.pop("purchase_end_date", None)
|
|
315
|
+
if "purchaseFee" not in obj and "purchase_fee" in obj:
|
|
316
|
+
obj["purchaseFee"] = obj["purchase_fee"]
|
|
317
|
+
obj.pop("purchase_fee", None)
|
|
318
|
+
if "purchaseId" not in obj and "purchase_id" in obj:
|
|
319
|
+
obj["purchaseId"] = obj["purchase_id"]
|
|
320
|
+
obj.pop("purchase_id", None)
|
|
321
|
+
if "purchaseLatest" not in obj and "purchase_latest" in obj:
|
|
322
|
+
obj["purchaseLatest"] = obj["purchase_latest"]
|
|
323
|
+
obj.pop("purchase_latest", None)
|
|
324
|
+
if "purchasePrice" not in obj and "purchase_price" in obj:
|
|
325
|
+
obj["purchasePrice"] = obj["purchase_price"]
|
|
326
|
+
obj.pop("purchase_price", None)
|
|
327
|
+
if "purchaseQuantity" not in obj and "purchase_quantity" in obj:
|
|
328
|
+
obj["purchaseQuantity"] = obj["purchase_quantity"]
|
|
329
|
+
obj.pop("purchase_quantity", None)
|
|
330
|
+
if "purchaseStartDate" not in obj and "purchase_start_date" in obj:
|
|
331
|
+
obj["purchaseStartDate"] = obj["purchase_start_date"]
|
|
332
|
+
obj.pop("purchase_start_date", None)
|
|
333
|
+
if "purchaseToken" not in obj and "purchase_token" in obj:
|
|
334
|
+
obj["purchaseToken"] = obj["purchase_token"]
|
|
335
|
+
obj.pop("purchase_token", None)
|
|
336
|
+
if "purchaseType" not in obj and "purchase_type" in obj:
|
|
337
|
+
obj["purchaseType"] = obj["purchase_type"]
|
|
338
|
+
obj.pop("purchase_type", None)
|
|
339
|
+
if "purchaseUnitPrice" not in obj and "purchase_unit_price" in obj:
|
|
340
|
+
obj["purchaseUnitPrice"] = obj["purchase_unit_price"]
|
|
341
|
+
obj.pop("purchase_unit_price", None)
|
|
342
|
+
if "purchaseValue" not in obj and "purchase_value" in obj:
|
|
343
|
+
obj["purchaseValue"] = obj["purchase_value"]
|
|
344
|
+
obj.pop("purchase_value", None)
|
|
345
|
+
if "receiverDisplayName" not in obj and "receiver_display_name" in obj:
|
|
346
|
+
obj["receiverDisplayName"] = obj["receiver_display_name"]
|
|
347
|
+
obj.pop("receiver_display_name", None)
|
|
348
|
+
if "receiverId" not in obj and "receiver_id" in obj:
|
|
349
|
+
obj["receiverId"] = obj["receiver_id"]
|
|
350
|
+
obj.pop("receiver_id", None)
|
|
351
|
+
if "sellerDisplayName" not in obj and "seller_display_name" in obj:
|
|
352
|
+
obj["sellerDisplayName"] = obj["seller_display_name"]
|
|
353
|
+
obj.pop("seller_display_name", None)
|
|
354
|
+
if "sellerId" not in obj and "seller_id" in obj:
|
|
355
|
+
obj["sellerId"] = obj["seller_id"]
|
|
356
|
+
obj.pop("seller_id", None)
|
|
357
|
+
if "willRecur" not in obj and "will_recur" in obj:
|
|
358
|
+
obj["willRecur"] = obj["will_recur"]
|
|
359
|
+
obj.pop("will_recur", None)
|
|
360
|
+
return obj
|
|
361
|
+
|
|
362
|
+
model_config = ConfigDict(
|
|
363
|
+
validate_by_name=True,
|
|
364
|
+
validate_by_alias=True,
|
|
365
|
+
validate_assignment=True,
|
|
366
|
+
extra="forbid",
|
|
367
|
+
protected_namespaces=(),
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
def to_str(self) -> str:
|
|
372
|
+
"""Returns the string representation of the model"""
|
|
373
|
+
return pprint.pformat(self.to_dict())
|
|
374
|
+
|
|
375
|
+
def __repr__(self) -> str:
|
|
376
|
+
"""For print and pprint"""
|
|
377
|
+
return self.to_str()
|
|
378
|
+
|
|
379
|
+
def __eq__(self, other: object) -> bool:
|
|
380
|
+
"""Returns true if both objects are equal"""
|
|
381
|
+
if not isinstance(other, ProductPurchase):
|
|
382
|
+
return False
|
|
383
|
+
|
|
384
|
+
return self.to_dict() == other.to_dict()
|
|
385
|
+
|
|
386
|
+
def __ne__(self, other: object) -> bool:
|
|
387
|
+
"""Returns true if both objects are not equal"""
|
|
388
|
+
if not isinstance(other, ProductPurchase):
|
|
389
|
+
return True
|
|
390
|
+
|
|
391
|
+
return not (self == other)
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
def to_json(self) -> str:
|
|
395
|
+
"""Returns the JSON representation of the model using alias"""
|
|
396
|
+
to_openapi_dict = _get_openapi_to_dict(self)
|
|
397
|
+
if to_openapi_dict is not None:
|
|
398
|
+
return json.dumps(to_jsonable_python(to_openapi_dict(self)))
|
|
399
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
400
|
+
|
|
401
|
+
@classmethod
|
|
402
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
403
|
+
"""Create an instance of ProductPurchase from a JSON string"""
|
|
404
|
+
return cls.from_dict(json.loads(json_str))
|
|
405
|
+
|
|
406
|
+
def to_dict(self, serialize: bool = False) -> Dict[str, Any]:
|
|
407
|
+
"""Return all declared model fields using public or wire names."""
|
|
408
|
+
return {
|
|
409
|
+
("buyerDisplayName" if serialize else "buyer_display_name"): _to_legacy_value(getattr(self, "buyer_display_name", None), serialize),
|
|
410
|
+
("buyerId" if serialize else "buyer_id"): _to_legacy_value(getattr(self, "buyer_id", None), serialize),
|
|
411
|
+
("firstParty" if serialize else "first_party"): _to_legacy_value(getattr(self, "first_party", None), serialize),
|
|
412
|
+
("isBuyer" if serialize else "is_buyer"): _to_legacy_value(getattr(self, "is_buyer", None), serialize),
|
|
413
|
+
("isGift" if serialize else "is_gift"): _to_legacy_value(getattr(self, "is_gift", None), serialize),
|
|
414
|
+
("isReceiver" if serialize else "is_receiver"): _to_legacy_value(getattr(self, "is_receiver", None), serialize),
|
|
415
|
+
("isSeller" if serialize else "is_seller"): _to_legacy_value(getattr(self, "is_seller", None), serialize),
|
|
416
|
+
("ledgerTransactionId" if serialize else "ledger_transaction_id"): _to_legacy_value(getattr(self, "ledger_transaction_id", None), serialize),
|
|
417
|
+
("listingCurrentlyAvailable" if serialize else "listing_currently_available"): _to_legacy_value(getattr(self, "listing_currently_available", None), serialize),
|
|
418
|
+
("listingDescription" if serialize else "listing_description"): _to_legacy_value(getattr(self, "listing_description", None), serialize),
|
|
419
|
+
("listingDisplayName" if serialize else "listing_display_name"): _to_legacy_value(getattr(self, "listing_display_name", None), serialize),
|
|
420
|
+
("listingId" if serialize else "listing_id"): _to_legacy_value(getattr(self, "listing_id", None), serialize),
|
|
421
|
+
("listingImageId" if serialize else "listing_image_id"): _to_legacy_value(getattr(self, "listing_image_id", None), serialize),
|
|
422
|
+
("listingSubtitle" if serialize else "listing_subtitle"): _to_legacy_value(getattr(self, "listing_subtitle", None), serialize),
|
|
423
|
+
("listingType" if serialize else "listing_type"): _to_legacy_value(getattr(self, "listing_type", None), serialize),
|
|
424
|
+
("products" if serialize else "products"): _to_legacy_value(getattr(self, "products", None), serialize),
|
|
425
|
+
("purchaseActive" if serialize else "purchase_active"): _to_legacy_value(getattr(self, "purchase_active", None), serialize),
|
|
426
|
+
("purchaseContext" if serialize else "purchase_context"): _to_legacy_value(getattr(self, "purchase_context", None), serialize),
|
|
427
|
+
("purchaseCurrentStatus" if serialize else "purchase_current_status"): _to_legacy_value(getattr(self, "purchase_current_status", None), serialize),
|
|
428
|
+
("purchaseDate" if serialize else "purchase_date"): _to_legacy_value(getattr(self, "purchase_date", None), serialize),
|
|
429
|
+
("purchaseDuration" if serialize else "purchase_duration"): _to_legacy_value(getattr(self, "purchase_duration", None), serialize),
|
|
430
|
+
("purchaseDurationType" if serialize else "purchase_duration_type"): _to_legacy_value(getattr(self, "purchase_duration_type", None), serialize),
|
|
431
|
+
("purchaseEndDate" if serialize else "purchase_end_date"): _to_legacy_value(getattr(self, "purchase_end_date", None), serialize),
|
|
432
|
+
("purchaseFee" if serialize else "purchase_fee"): _to_legacy_value(getattr(self, "purchase_fee", None), serialize),
|
|
433
|
+
("purchaseId" if serialize else "purchase_id"): _to_legacy_value(getattr(self, "purchase_id", None), serialize),
|
|
434
|
+
("purchaseLatest" if serialize else "purchase_latest"): _to_legacy_value(getattr(self, "purchase_latest", None), serialize),
|
|
435
|
+
("purchasePrice" if serialize else "purchase_price"): _to_legacy_value(getattr(self, "purchase_price", None), serialize),
|
|
436
|
+
("purchaseQuantity" if serialize else "purchase_quantity"): _to_legacy_value(getattr(self, "purchase_quantity", None), serialize),
|
|
437
|
+
("purchaseStartDate" if serialize else "purchase_start_date"): _to_legacy_value(getattr(self, "purchase_start_date", None), serialize),
|
|
438
|
+
("purchaseToken" if serialize else "purchase_token"): _to_legacy_value(getattr(self, "purchase_token", None), serialize),
|
|
439
|
+
("purchaseType" if serialize else "purchase_type"): _to_legacy_value(getattr(self, "purchase_type", None), serialize),
|
|
440
|
+
("purchaseUnitPrice" if serialize else "purchase_unit_price"): _to_legacy_value(getattr(self, "purchase_unit_price", None), serialize),
|
|
441
|
+
("purchaseValue" if serialize else "purchase_value"): _to_legacy_value(getattr(self, "purchase_value", None), serialize),
|
|
442
|
+
("receiverDisplayName" if serialize else "receiver_display_name"): _to_legacy_value(getattr(self, "receiver_display_name", None), serialize),
|
|
443
|
+
("receiverId" if serialize else "receiver_id"): _to_legacy_value(getattr(self, "receiver_id", None), serialize),
|
|
444
|
+
("recurrable" if serialize else "recurrable"): _to_legacy_value(getattr(self, "recurrable", None), serialize),
|
|
445
|
+
("refundable" if serialize else "refundable"): _to_legacy_value(getattr(self, "refundable", None), serialize),
|
|
446
|
+
("sellerDisplayName" if serialize else "seller_display_name"): _to_legacy_value(getattr(self, "seller_display_name", None), serialize),
|
|
447
|
+
("sellerId" if serialize else "seller_id"): _to_legacy_value(getattr(self, "seller_id", None), serialize),
|
|
448
|
+
("stackable" if serialize else "stackable"): _to_legacy_value(getattr(self, "stackable", None), serialize),
|
|
449
|
+
("willRecur" if serialize else "will_recur"): _to_legacy_value(getattr(self, "will_recur", None), serialize),
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
def __openapi_generator_modern_projection(self) -> Dict[str, Any]:
|
|
453
|
+
"""Return the dictionary representation of the model using alias.
|
|
454
|
+
|
|
455
|
+
This has the following differences from calling pydantic's
|
|
456
|
+
`self.model_dump(by_alias=True)`:
|
|
457
|
+
|
|
458
|
+
* `None` is only added to the output dict for nullable fields that
|
|
459
|
+
were set at model initialization. Other fields with value `None`
|
|
460
|
+
are ignored.
|
|
461
|
+
"""
|
|
462
|
+
excluded_fields: Set[str] = set([
|
|
463
|
+
])
|
|
464
|
+
|
|
465
|
+
_dict = self.model_dump(
|
|
466
|
+
by_alias=True,
|
|
467
|
+
exclude=excluded_fields,
|
|
468
|
+
exclude_none=True,
|
|
469
|
+
)
|
|
470
|
+
# override the default output from pydantic by calling `to_dict()` of each item in products (list)
|
|
471
|
+
_items = []
|
|
472
|
+
if self.products:
|
|
473
|
+
for _item_products in self.products:
|
|
474
|
+
if _item_products:
|
|
475
|
+
_items.append(_to_openapi_value(_item_products))
|
|
476
|
+
_dict['products'] = _items
|
|
477
|
+
# override the default output from pydantic by calling `to_dict()` of purchase_context
|
|
478
|
+
if self.purchase_context:
|
|
479
|
+
_dict['purchaseContext'] = _to_openapi_value(self.purchase_context)
|
|
480
|
+
# set to None if purchase_end_date (nullable) is None
|
|
481
|
+
# and model_fields_set contains the field
|
|
482
|
+
if self.purchase_end_date is None and "purchase_end_date" in self.model_fields_set:
|
|
483
|
+
_dict['purchaseEndDate'] = None
|
|
484
|
+
|
|
485
|
+
# set to None if purchase_start_date (nullable) is None
|
|
486
|
+
# and model_fields_set contains the field
|
|
487
|
+
if self.purchase_start_date is None and "purchase_start_date" in self.model_fields_set:
|
|
488
|
+
_dict['purchaseStartDate'] = None
|
|
489
|
+
|
|
490
|
+
# set to None if purchase_token (nullable) is None
|
|
491
|
+
# and model_fields_set contains the field
|
|
492
|
+
if self.purchase_token is None and "purchase_token" in self.model_fields_set:
|
|
493
|
+
_dict['purchaseToken'] = None
|
|
494
|
+
|
|
495
|
+
return _dict
|
|
496
|
+
|
|
497
|
+
setattr(
|
|
498
|
+
to_dict,
|
|
499
|
+
_OPENAPI_GENERATOR_TO_DICT,
|
|
500
|
+
__openapi_generator_modern_projection,
|
|
501
|
+
)
|
|
502
|
+
setattr(
|
|
503
|
+
__openapi_generator_modern_projection,
|
|
504
|
+
_OPENAPI_GENERATOR_TO_DICT,
|
|
505
|
+
to_dict,
|
|
506
|
+
)
|
|
507
|
+
del __openapi_generator_modern_projection
|
|
508
|
+
|
|
509
|
+
@classmethod
|
|
510
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
511
|
+
"""Create an instance of ProductPurchase from a dict"""
|
|
512
|
+
if obj is None:
|
|
513
|
+
return None
|
|
514
|
+
|
|
515
|
+
if not isinstance(obj, dict):
|
|
516
|
+
return cls.model_validate(obj)
|
|
517
|
+
|
|
518
|
+
obj = _cast(
|
|
519
|
+
Dict[str, Any],
|
|
520
|
+
cls.__preprocess_input_names(
|
|
521
|
+
obj,
|
|
522
|
+
remove_hidden_storage_names=True,
|
|
523
|
+
),
|
|
524
|
+
)
|
|
525
|
+
|
|
526
|
+
_obj = cls.model_validate({
|
|
527
|
+
"buyerDisplayName": obj.get("buyerDisplayName"),
|
|
528
|
+
"buyerId": obj.get("buyerId"),
|
|
529
|
+
"firstParty": obj.get("firstParty"),
|
|
530
|
+
"isBuyer": obj.get("isBuyer"),
|
|
531
|
+
"isGift": obj.get("isGift"),
|
|
532
|
+
"isReceiver": obj.get("isReceiver"),
|
|
533
|
+
"isSeller": obj.get("isSeller"),
|
|
534
|
+
"ledgerTransactionId": obj.get("ledgerTransactionId"),
|
|
535
|
+
"listingCurrentlyAvailable": obj.get("listingCurrentlyAvailable"),
|
|
536
|
+
"listingDescription": obj.get("listingDescription"),
|
|
537
|
+
"listingDisplayName": obj.get("listingDisplayName"),
|
|
538
|
+
"listingId": obj.get("listingId"),
|
|
539
|
+
"listingImageId": obj.get("listingImageId"),
|
|
540
|
+
"listingSubtitle": obj.get("listingSubtitle"),
|
|
541
|
+
"listingType": obj.get("listingType") if obj.get("listingType") is not None else ProductListingType.SUBSCRIPTION,
|
|
542
|
+
"products": [ProductPurchaseProduct.from_dict(_item) for _item in obj["products"]] if obj.get("products") is not None else None,
|
|
543
|
+
"purchaseActive": obj.get("purchaseActive"),
|
|
544
|
+
"purchaseContext": ProductPurchasePurchaseContext.from_dict(obj["purchaseContext"]) if obj.get("purchaseContext") is not None else None,
|
|
545
|
+
"purchaseCurrentStatus": obj.get("purchaseCurrentStatus"),
|
|
546
|
+
"purchaseDate": obj.get("purchaseDate"),
|
|
547
|
+
"purchaseDuration": obj.get("purchaseDuration"),
|
|
548
|
+
"purchaseDurationType": obj.get("purchaseDurationType"),
|
|
549
|
+
"purchaseEndDate": obj.get("purchaseEndDate"),
|
|
550
|
+
"purchaseFee": obj.get("purchaseFee"),
|
|
551
|
+
"purchaseId": obj.get("purchaseId"),
|
|
552
|
+
"purchaseLatest": obj.get("purchaseLatest"),
|
|
553
|
+
"purchasePrice": obj.get("purchasePrice"),
|
|
554
|
+
"purchaseQuantity": obj.get("purchaseQuantity"),
|
|
555
|
+
"purchaseStartDate": obj.get("purchaseStartDate"),
|
|
556
|
+
"purchaseToken": obj.get("purchaseToken"),
|
|
557
|
+
"purchaseType": obj.get("purchaseType"),
|
|
558
|
+
"purchaseUnitPrice": obj.get("purchaseUnitPrice"),
|
|
559
|
+
"purchaseValue": obj.get("purchaseValue"),
|
|
560
|
+
"receiverDisplayName": obj.get("receiverDisplayName"),
|
|
561
|
+
"receiverId": obj.get("receiverId"),
|
|
562
|
+
"recurrable": obj.get("recurrable"),
|
|
563
|
+
"refundable": obj.get("refundable"),
|
|
564
|
+
"sellerDisplayName": obj.get("sellerDisplayName"),
|
|
565
|
+
"sellerId": obj.get("sellerId"),
|
|
566
|
+
"stackable": obj.get("stackable"),
|
|
567
|
+
"willRecur": obj.get("willRecur")
|
|
568
|
+
})
|
|
569
|
+
return _obj
|
|
570
|
+
|
|
571
|
+
|