twitter-openapi-python-generated 0.0.33__py3-none-any.whl → 0.0.34__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.
- twitter_openapi_python_generated/__init__.py +742 -330
- twitter_openapi_python_generated/api/default_api.py +1 -2
- twitter_openapi_python_generated/api/other_api.py +1 -2
- twitter_openapi_python_generated/api/post_api.py +1 -2
- twitter_openapi_python_generated/api/tweet_api.py +1 -2
- twitter_openapi_python_generated/api/user_api.py +1 -2
- twitter_openapi_python_generated/api/user_list_api.py +318 -2
- twitter_openapi_python_generated/api/users_api.py +1 -2
- twitter_openapi_python_generated/api/v11_get_api.py +1 -2
- twitter_openapi_python_generated/api/v11_post_api.py +1 -2
- twitter_openapi_python_generated/api/v20_get_api.py +1 -2
- twitter_openapi_python_generated/api_client.py +35 -28
- twitter_openapi_python_generated/configuration.py +47 -23
- twitter_openapi_python_generated/exceptions.py +7 -5
- twitter_openapi_python_generated/models/__init__.py +41 -2
- twitter_openapi_python_generated/models/about_community_result.py +4 -3
- twitter_openapi_python_generated/models/about_community_results.py +4 -3
- twitter_openapi_python_generated/models/about_community_tweet_data.py +4 -3
- twitter_openapi_python_generated/models/additional_media_info.py +4 -3
- twitter_openapi_python_generated/models/additional_media_info_call_to_actions.py +4 -3
- twitter_openapi_python_generated/models/additional_media_info_call_to_actions_url.py +4 -3
- twitter_openapi_python_generated/models/allow_download_status.py +4 -3
- twitter_openapi_python_generated/models/analysis_results.py +4 -3
- twitter_openapi_python_generated/models/article.py +4 -3
- twitter_openapi_python_generated/models/article_cover_media.py +7 -3
- twitter_openapi_python_generated/models/article_cover_media_color_info.py +4 -3
- twitter_openapi_python_generated/models/article_cover_media_color_info_palette.py +4 -3
- twitter_openapi_python_generated/models/article_cover_media_color_info_palette_rgb.py +4 -3
- twitter_openapi_python_generated/models/article_cover_media_info.py +4 -3
- twitter_openapi_python_generated/models/article_lifecycle_state.py +4 -3
- twitter_openapi_python_generated/models/article_metadata.py +4 -3
- twitter_openapi_python_generated/models/article_preview.py +99 -0
- twitter_openapi_python_generated/models/article_result.py +23 -6
- twitter_openapi_python_generated/models/article_results.py +4 -3
- twitter_openapi_python_generated/models/author_community_relationship.py +9 -8
- twitter_openapi_python_generated/models/birdwatch_entity.py +4 -3
- twitter_openapi_python_generated/models/birdwatch_entity_ref.py +4 -3
- twitter_openapi_python_generated/models/birdwatch_pivot.py +19 -6
- twitter_openapi_python_generated/models/birdwatch_pivot_call_to_action.py +4 -3
- twitter_openapi_python_generated/models/birdwatch_pivot_footer.py +4 -3
- twitter_openapi_python_generated/models/birdwatch_pivot_note.py +20 -6
- twitter_openapi_python_generated/models/birdwatch_pivot_subtitle.py +4 -3
- twitter_openapi_python_generated/models/bookmarks_response.py +4 -3
- twitter_openapi_python_generated/models/bookmarks_response_data.py +4 -3
- twitter_openapi_python_generated/models/bookmarks_timeline.py +4 -3
- twitter_openapi_python_generated/models/callback.py +4 -3
- twitter_openapi_python_generated/models/client_event_info.py +4 -3
- twitter_openapi_python_generated/models/communities_actions.py +4 -3
- twitter_openapi_python_generated/models/community.py +146 -12
- twitter_openapi_python_generated/models/community_about_timeline_response.py +4 -3
- twitter_openapi_python_generated/models/community_actions.py +4 -3
- twitter_openapi_python_generated/models/community_delete_action_result.py +4 -3
- twitter_openapi_python_generated/models/community_invites_result.py +4 -3
- twitter_openapi_python_generated/models/community_join_action.py +4 -3
- twitter_openapi_python_generated/models/community_join_action_unavailable.py +4 -3
- twitter_openapi_python_generated/models/community_join_requests_result.py +4 -3
- twitter_openapi_python_generated/models/community_leave_action_result.py +4 -3
- twitter_openapi_python_generated/models/community_media_timeline_response.py +4 -3
- twitter_openapi_python_generated/models/community_pin_action_result.py +4 -3
- twitter_openapi_python_generated/models/community_relationship.py +7 -3
- twitter_openapi_python_generated/models/community_result.py +93 -0
- twitter_openapi_python_generated/models/community_rule.py +7 -3
- twitter_openapi_python_generated/models/community_tweets_timeline_response.py +4 -3
- twitter_openapi_python_generated/models/community_unavailable.py +90 -0
- twitter_openapi_python_generated/models/community_union.py +156 -0
- twitter_openapi_python_generated/models/community_unpin_action_result.py +4 -3
- twitter_openapi_python_generated/models/community_urls.py +4 -3
- twitter_openapi_python_generated/models/community_urls_permalink.py +4 -3
- twitter_openapi_python_generated/models/content_disclosure.py +99 -0
- twitter_openapi_python_generated/models/content_disclosure_advertising_disclosure.py +89 -0
- twitter_openapi_python_generated/models/content_disclosure_ai_generated_disclosure.py +103 -0
- twitter_openapi_python_generated/models/conversation_control.py +4 -3
- twitter_openapi_python_generated/models/cover_cta.py +4 -3
- twitter_openapi_python_generated/models/create_bookmark_response.py +4 -3
- twitter_openapi_python_generated/models/create_bookmark_response_data.py +4 -3
- twitter_openapi_python_generated/models/create_retweet.py +4 -3
- twitter_openapi_python_generated/models/create_retweet_response.py +4 -3
- twitter_openapi_python_generated/models/create_retweet_response_data.py +4 -3
- twitter_openapi_python_generated/models/create_retweet_response_result.py +4 -3
- twitter_openapi_python_generated/models/create_tweet.py +4 -3
- twitter_openapi_python_generated/models/create_tweet_response.py +4 -3
- twitter_openapi_python_generated/models/create_tweet_response_data.py +4 -3
- twitter_openapi_python_generated/models/create_tweet_response_result.py +4 -3
- twitter_openapi_python_generated/models/cta_client_event_info.py +4 -3
- twitter_openapi_python_generated/models/delete_bookmark_response.py +4 -3
- twitter_openapi_python_generated/models/delete_bookmark_response_data.py +4 -3
- twitter_openapi_python_generated/models/delete_retweet.py +4 -3
- twitter_openapi_python_generated/models/delete_retweet_response.py +4 -3
- twitter_openapi_python_generated/models/delete_retweet_response_data.py +4 -3
- twitter_openapi_python_generated/models/delete_retweet_response_result.py +4 -3
- twitter_openapi_python_generated/models/delete_tweet_response.py +4 -3
- twitter_openapi_python_generated/models/delete_tweet_response_data.py +4 -3
- twitter_openapi_python_generated/models/delete_tweet_response_result.py +4 -3
- twitter_openapi_python_generated/models/display_treatment.py +4 -3
- twitter_openapi_python_generated/models/entities.py +19 -8
- twitter_openapi_python_generated/models/error_extensions.py +4 -3
- twitter_openapi_python_generated/models/error_response.py +14 -5
- twitter_openapi_python_generated/models/error_response_path_inner.py +144 -0
- twitter_openapi_python_generated/models/ext_media_availability.py +4 -3
- twitter_openapi_python_generated/models/extended_entities.py +4 -3
- twitter_openapi_python_generated/models/favorite_tweet.py +4 -3
- twitter_openapi_python_generated/models/favorite_tweet_response.py +4 -3
- twitter_openapi_python_generated/models/feedback_info.py +4 -3
- twitter_openapi_python_generated/models/follow_response.py +4 -3
- twitter_openapi_python_generated/models/follow_response_data.py +4 -3
- twitter_openapi_python_generated/models/follow_response_result.py +4 -3
- twitter_openapi_python_generated/models/follow_response_user.py +4 -3
- twitter_openapi_python_generated/models/follow_timeline.py +4 -3
- twitter_openapi_python_generated/models/grok_annotation.py +89 -0
- twitter_openapi_python_generated/models/grok_entity.py +97 -0
- twitter_openapi_python_generated/models/grok_entity_ref.py +116 -0
- twitter_openapi_python_generated/models/grok_image_annotation.py +4 -3
- twitter_openapi_python_generated/models/grok_share_attachment.py +4 -3
- twitter_openapi_python_generated/models/grok_share_attachment_item.py +7 -4
- twitter_openapi_python_generated/models/grok_translated_community_note.py +105 -0
- twitter_openapi_python_generated/models/grok_translated_community_note_with_availability.py +95 -0
- twitter_openapi_python_generated/models/grok_translated_post.py +103 -0
- twitter_openapi_python_generated/models/grok_translated_post_with_availability.py +95 -0
- twitter_openapi_python_generated/models/highlight.py +4 -3
- twitter_openapi_python_generated/models/home_timeline_home.py +4 -3
- twitter_openapi_python_generated/models/home_timeline_response_data.py +4 -3
- twitter_openapi_python_generated/models/item_result.py +4 -3
- twitter_openapi_python_generated/models/limited_action_results_data.py +4 -3
- twitter_openapi_python_generated/models/list_latest_tweets_timeline_response.py +4 -3
- twitter_openapi_python_generated/models/list_tweets_timeline_data.py +4 -3
- twitter_openapi_python_generated/models/list_tweets_timeline_list.py +4 -3
- twitter_openapi_python_generated/models/location.py +4 -3
- twitter_openapi_python_generated/models/media.py +17 -4
- twitter_openapi_python_generated/models/media_community_result.py +4 -3
- twitter_openapi_python_generated/models/media_community_results.py +4 -3
- twitter_openapi_python_generated/models/media_community_tweet_data.py +4 -3
- twitter_openapi_python_generated/models/media_extended.py +17 -4
- twitter_openapi_python_generated/models/media_original_info.py +4 -3
- twitter_openapi_python_generated/models/media_original_info_focus_rect.py +4 -3
- twitter_openapi_python_generated/models/media_result.py +4 -3
- twitter_openapi_python_generated/models/media_results.py +4 -3
- twitter_openapi_python_generated/models/media_size.py +4 -3
- twitter_openapi_python_generated/models/media_sizes.py +4 -3
- twitter_openapi_python_generated/models/media_stats.py +4 -3
- twitter_openapi_python_generated/models/media_video_info.py +4 -3
- twitter_openapi_python_generated/models/media_video_info_variant.py +4 -3
- twitter_openapi_python_generated/models/media_visibility_results.py +4 -3
- twitter_openapi_python_generated/models/media_visibility_results_blurred_image_interstitial.py +4 -3
- twitter_openapi_python_generated/models/module_entry.py +4 -3
- twitter_openapi_python_generated/models/module_item.py +7 -3
- twitter_openapi_python_generated/models/note_tweet.py +6 -5
- twitter_openapi_python_generated/models/note_tweet_result.py +4 -3
- twitter_openapi_python_generated/models/note_tweet_result_data.py +7 -3
- twitter_openapi_python_generated/models/note_tweet_result_media.py +4 -3
- twitter_openapi_python_generated/models/note_tweet_result_media_inline_media.py +7 -3
- twitter_openapi_python_generated/models/note_tweet_result_rich_text.py +4 -3
- twitter_openapi_python_generated/models/note_tweet_result_rich_text_tag.py +4 -3
- twitter_openapi_python_generated/models/notification_template.py +4 -3
- twitter_openapi_python_generated/models/notifications_result.py +7 -3
- twitter_openapi_python_generated/models/notifications_timeline_data.py +4 -3
- twitter_openapi_python_generated/models/notifications_timeline_response.py +4 -3
- twitter_openapi_python_generated/models/notifications_user_results.py +4 -3
- twitter_openapi_python_generated/models/notifications_viewer_v2.py +4 -3
- twitter_openapi_python_generated/models/one_factor_login_eligibility.py +4 -3
- twitter_openapi_python_generated/models/other_object_all.py +4 -3
- twitter_openapi_python_generated/models/post_create_bookmark_request.py +4 -3
- twitter_openapi_python_generated/models/post_create_bookmark_request_variables.py +4 -3
- twitter_openapi_python_generated/models/post_create_retweet_request.py +5 -4
- twitter_openapi_python_generated/models/post_create_retweet_request_variables.py +4 -3
- twitter_openapi_python_generated/models/post_create_tweet_request.py +5 -4
- twitter_openapi_python_generated/models/post_create_tweet_request_features.py +30 -15
- twitter_openapi_python_generated/models/post_create_tweet_request_variables.py +4 -3
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_conversation_control.py +4 -3
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media.py +4 -3
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media_media_entities_inner.py +4 -3
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_reply.py +4 -3
- twitter_openapi_python_generated/models/post_cta.py +101 -0
- twitter_openapi_python_generated/models/post_cta_title_text.py +99 -0
- twitter_openapi_python_generated/models/post_cta_title_text_entity.py +97 -0
- twitter_openapi_python_generated/models/post_cta_title_text_entity_ref.py +96 -0
- twitter_openapi_python_generated/models/post_cta_user_results.py +93 -0
- twitter_openapi_python_generated/models/post_cta_user_results_avatar.py +89 -0
- twitter_openapi_python_generated/models/post_cta_user_results_result.py +96 -0
- twitter_openapi_python_generated/models/post_delete_bookmark_request.py +4 -3
- twitter_openapi_python_generated/models/post_delete_retweet_request.py +5 -4
- twitter_openapi_python_generated/models/post_delete_retweet_request_variables.py +4 -3
- twitter_openapi_python_generated/models/post_delete_tweet_request.py +4 -3
- twitter_openapi_python_generated/models/post_favorite_tweet_request.py +4 -3
- twitter_openapi_python_generated/models/post_unfavorite_tweet_request.py +4 -3
- twitter_openapi_python_generated/models/primary_community_topic.py +7 -3
- twitter_openapi_python_generated/models/profile_bio.py +89 -0
- twitter_openapi_python_generated/models/profile_response.py +4 -3
- twitter_openapi_python_generated/models/profile_response_data.py +4 -3
- twitter_openapi_python_generated/models/quoted_ref_result.py +4 -3
- twitter_openapi_python_generated/models/quoted_status_permalink.py +4 -3
- twitter_openapi_python_generated/models/ranked_community_result.py +4 -3
- twitter_openapi_python_generated/models/ranked_community_results.py +4 -3
- twitter_openapi_python_generated/models/ranked_community_tweet_data.py +4 -3
- twitter_openapi_python_generated/models/retweet.py +7 -3
- twitter_openapi_python_generated/models/retweet_legacy.py +4 -3
- twitter_openapi_python_generated/models/rich_message.py +4 -3
- twitter_openapi_python_generated/models/search_by_raw_query.py +4 -3
- twitter_openapi_python_generated/models/search_timeline.py +4 -3
- twitter_openapi_python_generated/models/search_timeline_data.py +4 -3
- twitter_openapi_python_generated/models/search_timeline_response.py +4 -3
- twitter_openapi_python_generated/models/self_thread.py +7 -3
- twitter_openapi_python_generated/models/sensitive_media_warning.py +4 -3
- twitter_openapi_python_generated/models/session.py +16 -3
- twitter_openapi_python_generated/models/smarttag.py +97 -0
- twitter_openapi_python_generated/models/smarttag_tag.py +89 -0
- twitter_openapi_python_generated/models/social_context_landing_url.py +4 -3
- twitter_openapi_python_generated/models/super_follow_user_profile.py +89 -0
- twitter_openapi_python_generated/models/super_follows_reply_user_result.py +4 -3
- twitter_openapi_python_generated/models/super_follows_reply_user_result_core.py +89 -0
- twitter_openapi_python_generated/models/super_follows_reply_user_result_data.py +12 -11
- twitter_openapi_python_generated/models/super_follows_reply_user_result_legacy.py +4 -3
- twitter_openapi_python_generated/models/text.py +4 -3
- twitter_openapi_python_generated/models/text_entity.py +4 -3
- twitter_openapi_python_generated/models/text_entity_ref.py +4 -3
- twitter_openapi_python_generated/models/text_highlight.py +4 -3
- twitter_openapi_python_generated/models/thumbnail_image.py +4 -3
- twitter_openapi_python_generated/models/timeline.py +4 -3
- twitter_openapi_python_generated/models/timeline_add_entries.py +4 -3
- twitter_openapi_python_generated/models/timeline_add_entry.py +10 -3
- twitter_openapi_python_generated/models/timeline_add_to_module.py +4 -3
- twitter_openapi_python_generated/models/timeline_clear_cache.py +4 -3
- twitter_openapi_python_generated/models/timeline_clear_entries_unread_state.py +4 -3
- twitter_openapi_python_generated/models/timeline_community.py +4 -3
- twitter_openapi_python_generated/models/timeline_cover_behavior.py +4 -3
- twitter_openapi_python_generated/models/timeline_cover_behavior_url.py +4 -3
- twitter_openapi_python_generated/models/timeline_general_context.py +4 -3
- twitter_openapi_python_generated/models/timeline_half_cover.py +4 -3
- twitter_openapi_python_generated/models/timeline_mark_entries_unread_greater_than_sort_index.py +7 -3
- twitter_openapi_python_generated/models/timeline_message_prompt.py +4 -3
- twitter_openapi_python_generated/models/timeline_notification.py +4 -3
- twitter_openapi_python_generated/models/timeline_pin_entry.py +4 -3
- twitter_openapi_python_generated/models/timeline_prompt.py +4 -3
- twitter_openapi_python_generated/models/timeline_replace_entry.py +4 -3
- twitter_openapi_python_generated/models/timeline_response.py +4 -3
- twitter_openapi_python_generated/models/timeline_result.py +4 -3
- twitter_openapi_python_generated/models/timeline_show_alert.py +11 -4
- twitter_openapi_python_generated/models/timeline_show_alert_rich_text.py +4 -3
- twitter_openapi_python_generated/models/timeline_show_cover.py +4 -3
- twitter_openapi_python_generated/models/timeline_terminate_timeline.py +4 -3
- twitter_openapi_python_generated/models/timeline_timeline_cursor.py +4 -3
- twitter_openapi_python_generated/models/timeline_timeline_item.py +4 -3
- twitter_openapi_python_generated/models/timeline_timeline_module.py +4 -3
- twitter_openapi_python_generated/models/timeline_tombstone.py +4 -3
- twitter_openapi_python_generated/models/timeline_topic_context.py +4 -3
- twitter_openapi_python_generated/models/timeline_trend.py +4 -3
- twitter_openapi_python_generated/models/timeline_tweet.py +4 -3
- twitter_openapi_python_generated/models/timeline_user.py +4 -3
- twitter_openapi_python_generated/models/timestamp.py +4 -3
- twitter_openapi_python_generated/models/tombstone_entity.py +4 -3
- twitter_openapi_python_generated/models/tombstone_info.py +4 -3
- twitter_openapi_python_generated/models/tombstone_ref.py +4 -3
- twitter_openapi_python_generated/models/tombstone_rich_text.py +4 -3
- twitter_openapi_python_generated/models/topic_context.py +4 -3
- twitter_openapi_python_generated/models/tracing.py +7 -3
- twitter_openapi_python_generated/models/trend_image.py +4 -3
- twitter_openapi_python_generated/models/trend_metadata.py +4 -3
- twitter_openapi_python_generated/models/trend_results.py +7 -3
- twitter_openapi_python_generated/models/tweet.py +39 -7
- twitter_openapi_python_generated/models/tweet_card.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_legacy.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data_image.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_platform.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_platform_audience.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_platform_data.py +4 -3
- twitter_openapi_python_generated/models/tweet_card_platform_device.py +7 -3
- twitter_openapi_python_generated/models/tweet_detail_response.py +4 -3
- twitter_openapi_python_generated/models/tweet_detail_response_data.py +4 -3
- twitter_openapi_python_generated/models/tweet_edit_control.py +13 -3
- twitter_openapi_python_generated/models/tweet_edit_control_initial.py +10 -3
- twitter_openapi_python_generated/models/tweet_edit_prespective.py +4 -3
- twitter_openapi_python_generated/models/tweet_favoriters_response.py +4 -3
- twitter_openapi_python_generated/models/tweet_favoriters_response_data.py +4 -3
- twitter_openapi_python_generated/models/tweet_interstitial.py +6 -5
- twitter_openapi_python_generated/models/tweet_interstitial_reveal_text.py +4 -3
- twitter_openapi_python_generated/models/tweet_interstitial_text.py +4 -3
- twitter_openapi_python_generated/models/tweet_interstitial_text_entity.py +4 -3
- twitter_openapi_python_generated/models/tweet_interstitial_text_entity_ref.py +4 -3
- twitter_openapi_python_generated/models/tweet_legacy.py +26 -4
- twitter_openapi_python_generated/models/tweet_legacy_scopes.py +4 -3
- twitter_openapi_python_generated/models/tweet_limited_action_results.py +4 -3
- twitter_openapi_python_generated/models/tweet_post_cta.py +105 -0
- twitter_openapi_python_generated/models/tweet_preview_display.py +4 -3
- twitter_openapi_python_generated/models/tweet_preview_display_cta.py +4 -3
- twitter_openapi_python_generated/models/tweet_preview_display_cta_url.py +4 -3
- twitter_openapi_python_generated/models/tweet_preview_display_tweet.py +18 -5
- twitter_openapi_python_generated/models/tweet_preview_display_tweet_view_count.py +7 -3
- twitter_openapi_python_generated/models/tweet_previous_counts.py +4 -3
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_data.py +4 -3
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_response.py +4 -3
- twitter_openapi_python_generated/models/tweet_retweeters_response.py +4 -3
- twitter_openapi_python_generated/models/tweet_retweeters_response_data.py +4 -3
- twitter_openapi_python_generated/models/tweet_tombstone.py +4 -3
- twitter_openapi_python_generated/models/tweet_unavailable.py +4 -3
- twitter_openapi_python_generated/models/tweet_view.py +7 -3
- twitter_openapi_python_generated/models/tweet_with_visibility_results.py +4 -3
- twitter_openapi_python_generated/models/type_name.py +2 -0
- twitter_openapi_python_generated/models/unfavorite_tweet.py +4 -3
- twitter_openapi_python_generated/models/unfavorite_tweet_response.py +4 -3
- twitter_openapi_python_generated/models/unified_card.py +4 -3
- twitter_openapi_python_generated/models/url.py +4 -3
- twitter_openapi_python_generated/models/urt_endpoint_options.py +4 -3
- twitter_openapi_python_generated/models/urt_endpoint_request_params.py +4 -3
- twitter_openapi_python_generated/models/user.py +83 -7
- twitter_openapi_python_generated/models/user_avatar.py +89 -0
- twitter_openapi_python_generated/models/user_core.py +104 -0
- twitter_openapi_python_generated/models/user_dm_permissions.py +89 -0
- twitter_openapi_python_generated/models/user_features.py +4 -3
- twitter_openapi_python_generated/models/user_highlights_info.py +4 -3
- twitter_openapi_python_generated/models/user_highlights_tweets_data.py +4 -3
- twitter_openapi_python_generated/models/user_highlights_tweets_response.py +4 -3
- twitter_openapi_python_generated/models/user_highlights_tweets_result.py +4 -3
- twitter_openapi_python_generated/models/user_highlights_tweets_timeline.py +4 -3
- twitter_openapi_python_generated/models/user_highlights_tweets_user.py +4 -3
- twitter_openapi_python_generated/models/user_legacy.py +27 -12
- twitter_openapi_python_generated/models/user_legacy_extended_profile.py +4 -3
- twitter_openapi_python_generated/models/user_legacy_extended_profile_birthdate.py +4 -3
- twitter_openapi_python_generated/models/user_location.py +89 -0
- twitter_openapi_python_generated/models/user_media_permissions.py +89 -0
- twitter_openapi_python_generated/models/user_privacy.py +89 -0
- twitter_openapi_python_generated/models/user_professional.py +9 -5
- twitter_openapi_python_generated/models/user_professional_category.py +4 -3
- twitter_openapi_python_generated/models/user_profile.py +93 -0
- twitter_openapi_python_generated/models/user_relationship_perspectives.py +95 -0
- twitter_openapi_python_generated/models/user_response.py +4 -3
- twitter_openapi_python_generated/models/user_response_data.py +4 -3
- twitter_openapi_python_generated/models/user_result_by_screen_name.py +7 -3
- twitter_openapi_python_generated/models/user_result_by_screen_name_core.py +91 -0
- twitter_openapi_python_generated/models/user_result_by_screen_name_legacy.py +4 -3
- twitter_openapi_python_generated/models/user_result_by_screen_name_result.py +31 -6
- twitter_openapi_python_generated/models/user_result_core.py +4 -3
- twitter_openapi_python_generated/models/user_result_privacy.py +89 -0
- twitter_openapi_python_generated/models/user_result_relationship_perspectives.py +95 -0
- twitter_openapi_python_generated/models/user_results.py +4 -3
- twitter_openapi_python_generated/models/user_tip_jar_settings.py +4 -3
- twitter_openapi_python_generated/models/user_tweets_data.py +4 -3
- twitter_openapi_python_generated/models/user_tweets_response.py +4 -3
- twitter_openapi_python_generated/models/user_tweets_result_v1.py +4 -3
- twitter_openapi_python_generated/models/user_tweets_result_v2.py +4 -3
- twitter_openapi_python_generated/models/user_tweets_user.py +4 -3
- twitter_openapi_python_generated/models/user_unavailable.py +4 -3
- twitter_openapi_python_generated/models/user_value.py +7 -3
- twitter_openapi_python_generated/models/user_verification.py +101 -0
- twitter_openapi_python_generated/models/user_verification_info.py +4 -3
- twitter_openapi_python_generated/models/user_verification_info_reason.py +7 -3
- twitter_openapi_python_generated/models/user_verification_info_reason_description.py +4 -3
- twitter_openapi_python_generated/models/user_verification_info_reason_description_entities.py +4 -3
- twitter_openapi_python_generated/models/user_verification_info_reason_description_entities_ref.py +4 -3
- twitter_openapi_python_generated/models/users_response.py +4 -3
- twitter_openapi_python_generated/models/users_response_data.py +4 -3
- twitter_openapi_python_generated/rest.py +7 -2
- twitter_openapi_python_generated-0.0.34.dist-info/METADATA +816 -0
- twitter_openapi_python_generated-0.0.34.dist-info/RECORD +374 -0
- {twitter_openapi_python_generated-0.0.33.dist-info → twitter_openapi_python_generated-0.0.34.dist-info}/WHEEL +1 -1
- twitter_openapi_python_generated/models/community_data.py +0 -219
- twitter_openapi_python_generated-0.0.33.dist-info/METADATA +0 -29
- twitter_openapi_python_generated-0.0.33.dist-info/RECORD +0 -335
- {twitter_openapi_python_generated-0.0.33.dist-info → twitter_openapi_python_generated-0.0.34.dist-info}/licenses/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.33.dist-info → twitter_openapi_python_generated-0.0.34.dist-info}/licenses/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.33.dist-info → twitter_openapi_python_generated-0.0.34.dist-info}/top_level.txt +0 -0
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
26
27
|
|
|
27
28
|
class CommunityLeaveActionResult(BaseModel):
|
|
28
29
|
"""
|
|
@@ -41,7 +42,8 @@ class CommunityLeaveActionResult(BaseModel):
|
|
|
41
42
|
return value
|
|
42
43
|
|
|
43
44
|
model_config = ConfigDict(
|
|
44
|
-
|
|
45
|
+
validate_by_name=True,
|
|
46
|
+
validate_by_alias=True,
|
|
45
47
|
validate_assignment=True,
|
|
46
48
|
protected_namespaces=(),
|
|
47
49
|
)
|
|
@@ -53,8 +55,7 @@ class CommunityLeaveActionResult(BaseModel):
|
|
|
53
55
|
|
|
54
56
|
def to_json(self) -> str:
|
|
55
57
|
"""Returns the JSON representation of the model using alias"""
|
|
56
|
-
|
|
57
|
-
return json.dumps(self.to_dict())
|
|
58
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
58
59
|
|
|
59
60
|
@classmethod
|
|
60
61
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -24,6 +24,7 @@ from twitter_openapi_python_generated.models.error_response import ErrorResponse
|
|
|
24
24
|
from twitter_openapi_python_generated.models.media_community_tweet_data import MediaCommunityTweetData
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
27
28
|
|
|
28
29
|
class CommunityMediaTimelineResponse(BaseModel):
|
|
29
30
|
"""
|
|
@@ -34,7 +35,8 @@ class CommunityMediaTimelineResponse(BaseModel):
|
|
|
34
35
|
__properties: ClassVar[List[str]] = ["data", "errors"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
|
-
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
38
40
|
validate_assignment=True,
|
|
39
41
|
protected_namespaces=(),
|
|
40
42
|
)
|
|
@@ -46,8 +48,7 @@ class CommunityMediaTimelineResponse(BaseModel):
|
|
|
46
48
|
|
|
47
49
|
def to_json(self) -> str:
|
|
48
50
|
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
52
|
|
|
52
53
|
@classmethod
|
|
53
54
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
26
27
|
|
|
27
28
|
class CommunityPinActionResult(BaseModel):
|
|
28
29
|
"""
|
|
@@ -32,7 +33,8 @@ class CommunityPinActionResult(BaseModel):
|
|
|
32
33
|
__properties: ClassVar[List[str]] = ["__typename"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
35
|
-
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
36
38
|
validate_assignment=True,
|
|
37
39
|
protected_namespaces=(),
|
|
38
40
|
)
|
|
@@ -44,8 +46,7 @@ class CommunityPinActionResult(BaseModel):
|
|
|
44
46
|
|
|
45
47
|
def to_json(self) -> str:
|
|
46
48
|
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
|
|
48
|
-
return json.dumps(self.to_dict())
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
50
|
|
|
50
51
|
@classmethod
|
|
51
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -24,6 +24,7 @@ from typing_extensions import Annotated
|
|
|
24
24
|
from twitter_openapi_python_generated.models.community_actions import CommunityActions
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
27
28
|
|
|
28
29
|
class CommunityRelationship(BaseModel):
|
|
29
30
|
"""
|
|
@@ -38,12 +39,16 @@ class CommunityRelationship(BaseModel):
|
|
|
38
39
|
@field_validator('rest_id')
|
|
39
40
|
def rest_id_validate_regular_expression(cls, value):
|
|
40
41
|
"""Validates the regular expression"""
|
|
42
|
+
if not isinstance(value, str):
|
|
43
|
+
value = str(value)
|
|
44
|
+
|
|
41
45
|
if not re.match(r"^[0-9]+$", value):
|
|
42
46
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
43
47
|
return value
|
|
44
48
|
|
|
45
49
|
model_config = ConfigDict(
|
|
46
|
-
|
|
50
|
+
validate_by_name=True,
|
|
51
|
+
validate_by_alias=True,
|
|
47
52
|
validate_assignment=True,
|
|
48
53
|
protected_namespaces=(),
|
|
49
54
|
)
|
|
@@ -55,8 +60,7 @@ class CommunityRelationship(BaseModel):
|
|
|
55
60
|
|
|
56
61
|
def to_json(self) -> str:
|
|
57
62
|
"""Returns the JSON representation of the model using alias"""
|
|
58
|
-
|
|
59
|
-
return json.dumps(self.to_dict())
|
|
63
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
60
64
|
|
|
61
65
|
@classmethod
|
|
62
66
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.community_union import CommunityUnion
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class CommunityResult(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CommunityResult
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
result: CommunityUnion
|
|
33
|
+
__properties: ClassVar[List[str]] = ["result"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CommunityResult from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of result
|
|
75
|
+
if self.result:
|
|
76
|
+
_dict['result'] = self.result.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of CommunityResult from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"result": CommunityUnion.from_dict(obj["result"]) if obj.get("result") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
26
27
|
|
|
27
28
|
class CommunityRule(BaseModel):
|
|
28
29
|
"""
|
|
@@ -36,12 +37,16 @@ class CommunityRule(BaseModel):
|
|
|
36
37
|
@field_validator('rest_id')
|
|
37
38
|
def rest_id_validate_regular_expression(cls, value):
|
|
38
39
|
"""Validates the regular expression"""
|
|
40
|
+
if not isinstance(value, str):
|
|
41
|
+
value = str(value)
|
|
42
|
+
|
|
39
43
|
if not re.match(r"^[0-9]+$", value):
|
|
40
44
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
41
45
|
return value
|
|
42
46
|
|
|
43
47
|
model_config = ConfigDict(
|
|
44
|
-
|
|
48
|
+
validate_by_name=True,
|
|
49
|
+
validate_by_alias=True,
|
|
45
50
|
validate_assignment=True,
|
|
46
51
|
protected_namespaces=(),
|
|
47
52
|
)
|
|
@@ -53,8 +58,7 @@ class CommunityRule(BaseModel):
|
|
|
53
58
|
|
|
54
59
|
def to_json(self) -> str:
|
|
55
60
|
"""Returns the JSON representation of the model using alias"""
|
|
56
|
-
|
|
57
|
-
return json.dumps(self.to_dict())
|
|
61
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
58
62
|
|
|
59
63
|
@classmethod
|
|
60
64
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -24,6 +24,7 @@ from twitter_openapi_python_generated.models.error_response import ErrorResponse
|
|
|
24
24
|
from twitter_openapi_python_generated.models.ranked_community_tweet_data import RankedCommunityTweetData
|
|
25
25
|
from typing import Optional, Set
|
|
26
26
|
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
27
28
|
|
|
28
29
|
class CommunityTweetsTimelineResponse(BaseModel):
|
|
29
30
|
"""
|
|
@@ -34,7 +35,8 @@ class CommunityTweetsTimelineResponse(BaseModel):
|
|
|
34
35
|
__properties: ClassVar[List[str]] = ["data", "errors"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
|
-
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
38
40
|
validate_assignment=True,
|
|
39
41
|
protected_namespaces=(),
|
|
40
42
|
)
|
|
@@ -46,8 +48,7 @@ class CommunityTweetsTimelineResponse(BaseModel):
|
|
|
46
48
|
|
|
47
49
|
def to_json(self) -> str:
|
|
48
50
|
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
52
|
|
|
52
53
|
@classmethod
|
|
53
54
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class CommunityUnavailable(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CommunityUnavailable
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
typename: TypeName = Field(alias="__typename")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["__typename"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CommunityUnavailable from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of CommunityUnavailable from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"__typename": obj.get("__typename")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
+
from typing import Any, List, Optional
|
|
21
|
+
from twitter_openapi_python_generated.models.community import Community
|
|
22
|
+
from twitter_openapi_python_generated.models.community_unavailable import CommunityUnavailable
|
|
23
|
+
from pydantic import StrictStr, Field
|
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
|
|
27
|
+
COMMUNITYUNION_ONE_OF_SCHEMAS = ["Community", "CommunityUnavailable"]
|
|
28
|
+
|
|
29
|
+
class CommunityUnion(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
CommunityUnion
|
|
32
|
+
"""
|
|
33
|
+
# data type: Community
|
|
34
|
+
oneof_schema_1_validator: Optional[Community] = None
|
|
35
|
+
# data type: CommunityUnavailable
|
|
36
|
+
oneof_schema_2_validator: Optional[CommunityUnavailable] = None
|
|
37
|
+
actual_instance: Optional[Union[Community, CommunityUnavailable]] = None
|
|
38
|
+
one_of_schemas: Set[str] = { "Community", "CommunityUnavailable" }
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
50
|
+
if args:
|
|
51
|
+
if len(args) > 1:
|
|
52
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
53
|
+
if kwargs:
|
|
54
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
55
|
+
super().__init__(actual_instance=args[0])
|
|
56
|
+
else:
|
|
57
|
+
super().__init__(**kwargs)
|
|
58
|
+
|
|
59
|
+
@field_validator('actual_instance')
|
|
60
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
61
|
+
instance = CommunityUnion.model_construct()
|
|
62
|
+
error_messages = []
|
|
63
|
+
match = 0
|
|
64
|
+
# validate data type: Community
|
|
65
|
+
if not isinstance(v, Community):
|
|
66
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Community`")
|
|
67
|
+
else:
|
|
68
|
+
match += 1
|
|
69
|
+
# validate data type: CommunityUnavailable
|
|
70
|
+
if not isinstance(v, CommunityUnavailable):
|
|
71
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CommunityUnavailable`")
|
|
72
|
+
else:
|
|
73
|
+
match += 1
|
|
74
|
+
if match > 1:
|
|
75
|
+
# more than 1 match
|
|
76
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CommunityUnion with oneOf schemas: Community, CommunityUnavailable. Details: " + ", ".join(error_messages))
|
|
77
|
+
elif match == 0:
|
|
78
|
+
# no match
|
|
79
|
+
raise ValueError("No match found when setting `actual_instance` in CommunityUnion with oneOf schemas: Community, CommunityUnavailable. Details: " + ", ".join(error_messages))
|
|
80
|
+
else:
|
|
81
|
+
return v
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
85
|
+
return cls.from_json(json.dumps(obj))
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_json(cls, json_str: str) -> Self:
|
|
89
|
+
"""Returns the object represented by the json string"""
|
|
90
|
+
instance = cls.model_construct()
|
|
91
|
+
error_messages = []
|
|
92
|
+
match = 0
|
|
93
|
+
|
|
94
|
+
# use oneOf discriminator to lookup the data type
|
|
95
|
+
_data_type = json.loads(json_str).get("__typename")
|
|
96
|
+
if not _data_type:
|
|
97
|
+
raise ValueError("Failed to lookup data type from the field `__typename` in the input.")
|
|
98
|
+
|
|
99
|
+
# check if data type is `Community`
|
|
100
|
+
if _data_type == "Community":
|
|
101
|
+
instance.actual_instance = Community.from_json(json_str)
|
|
102
|
+
return instance
|
|
103
|
+
|
|
104
|
+
# check if data type is `CommunityUnavailable`
|
|
105
|
+
if _data_type == "CommunityUnavailable":
|
|
106
|
+
instance.actual_instance = CommunityUnavailable.from_json(json_str)
|
|
107
|
+
return instance
|
|
108
|
+
|
|
109
|
+
# deserialize data into Community
|
|
110
|
+
try:
|
|
111
|
+
instance.actual_instance = Community.from_json(json_str)
|
|
112
|
+
match += 1
|
|
113
|
+
except (ValidationError, ValueError) as e:
|
|
114
|
+
error_messages.append(str(e))
|
|
115
|
+
# deserialize data into CommunityUnavailable
|
|
116
|
+
try:
|
|
117
|
+
instance.actual_instance = CommunityUnavailable.from_json(json_str)
|
|
118
|
+
match += 1
|
|
119
|
+
except (ValidationError, ValueError) as e:
|
|
120
|
+
error_messages.append(str(e))
|
|
121
|
+
|
|
122
|
+
if match > 1:
|
|
123
|
+
# more than 1 match
|
|
124
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CommunityUnion with oneOf schemas: Community, CommunityUnavailable. Details: " + ", ".join(error_messages))
|
|
125
|
+
elif match == 0:
|
|
126
|
+
# no match
|
|
127
|
+
raise ValueError("No match found when deserializing the JSON string into CommunityUnion with oneOf schemas: Community, CommunityUnavailable. Details: " + ", ".join(error_messages))
|
|
128
|
+
else:
|
|
129
|
+
return instance
|
|
130
|
+
|
|
131
|
+
def to_json(self) -> str:
|
|
132
|
+
"""Returns the JSON representation of the actual instance"""
|
|
133
|
+
if self.actual_instance is None:
|
|
134
|
+
return "null"
|
|
135
|
+
|
|
136
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
137
|
+
return self.actual_instance.to_json()
|
|
138
|
+
else:
|
|
139
|
+
return json.dumps(self.actual_instance)
|
|
140
|
+
|
|
141
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], Community, CommunityUnavailable]]:
|
|
142
|
+
"""Returns the dict representation of the actual instance"""
|
|
143
|
+
if self.actual_instance is None:
|
|
144
|
+
return None
|
|
145
|
+
|
|
146
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
147
|
+
return self.actual_instance.to_dict()
|
|
148
|
+
else:
|
|
149
|
+
# primitive type
|
|
150
|
+
return self.actual_instance
|
|
151
|
+
|
|
152
|
+
def to_str(self) -> str:
|
|
153
|
+
"""Returns the string representation of the actual instance"""
|
|
154
|
+
return pprint.pformat(self.model_dump())
|
|
155
|
+
|
|
156
|
+
|
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
26
27
|
|
|
27
28
|
class CommunityUnpinActionResult(BaseModel):
|
|
28
29
|
"""
|
|
@@ -32,7 +33,8 @@ class CommunityUnpinActionResult(BaseModel):
|
|
|
32
33
|
__properties: ClassVar[List[str]] = ["__typename"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
35
|
-
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
36
38
|
validate_assignment=True,
|
|
37
39
|
protected_namespaces=(),
|
|
38
40
|
)
|
|
@@ -44,8 +46,7 @@ class CommunityUnpinActionResult(BaseModel):
|
|
|
44
46
|
|
|
45
47
|
def to_json(self) -> str:
|
|
46
48
|
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
|
|
48
|
-
return json.dumps(self.to_dict())
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
50
|
|
|
50
51
|
@classmethod
|
|
51
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from twitter_openapi_python_generated.models.community_urls_permalink import CommunityUrlsPermalink
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
26
27
|
|
|
27
28
|
class CommunityUrls(BaseModel):
|
|
28
29
|
"""
|
|
@@ -32,7 +33,8 @@ class CommunityUrls(BaseModel):
|
|
|
32
33
|
__properties: ClassVar[List[str]] = ["permalink"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
35
|
-
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
36
38
|
validate_assignment=True,
|
|
37
39
|
protected_namespaces=(),
|
|
38
40
|
)
|
|
@@ -44,8 +46,7 @@ class CommunityUrls(BaseModel):
|
|
|
44
46
|
|
|
45
47
|
def to_json(self) -> str:
|
|
46
48
|
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
|
|
48
|
-
return json.dumps(self.to_dict())
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
50
|
|
|
50
51
|
@classmethod
|
|
51
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
25
26
|
|
|
26
27
|
class CommunityUrlsPermalink(BaseModel):
|
|
27
28
|
"""
|
|
@@ -31,7 +32,8 @@ class CommunityUrlsPermalink(BaseModel):
|
|
|
31
32
|
__properties: ClassVar[List[str]] = ["url"]
|
|
32
33
|
|
|
33
34
|
model_config = ConfigDict(
|
|
34
|
-
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
35
37
|
validate_assignment=True,
|
|
36
38
|
protected_namespaces=(),
|
|
37
39
|
)
|
|
@@ -43,8 +45,7 @@ class CommunityUrlsPermalink(BaseModel):
|
|
|
43
45
|
|
|
44
46
|
def to_json(self) -> str:
|
|
45
47
|
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
|
|
47
|
-
return json.dumps(self.to_dict())
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
48
49
|
|
|
49
50
|
@classmethod
|
|
50
51
|
def from_json(cls, json_str: str) -> Optional[Self]:
|