Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions twitter_openapi_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "twitter_openapi_python"
version = "0.1.8"
version = "0.1.9"
description = "Twitter OpenAPI"
authors = [{ name = "fa0311", email = "yuki@yuki0311.com" }]
readme = "README.md"
Expand All @@ -9,7 +9,7 @@ license-files = ["LICENSE", "LICENSE.AGPL"]
keywords = ["twitter", "api", "python", "scraper"]
requires-python = ">=3.10"
dependencies = [
"twitter_openapi_python_generated==0.1.7",
"twitter_openapi_python_generated==0.1.8",
"pydantic>=2.6",
"requests>=2.31.0,<3.0.0",
"urllib3>=2.1.0,<3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion twitter_openapi_python/test/api/test_1_default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_get_broadcast_query(self):
logging.info(f"{result.data.status} ({result.data.state}, {result.data.total_watched} watched)")

def test_get_audio_space_by_id(self):
result = self.client.get_audio_space_by_id(id="1qxoNYAlYMXJv")
result = self.client.get_audio_space_by_id(id="1yNGabwXqXnJj")
logging.info(
f"{result.data.metadata.title} ({result.data.metadata.state}, {result.data.participants.total} participants)"
)
Expand Down
2 changes: 1 addition & 1 deletion twitter_openapi_python/twitter_openapi_python/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_v20_post_api(self) -> V20PostApiUtils:


class TwitterOpenapiPython:
hash: str = "6c4914f799402a927ec02727686032443fe6ffe9"
hash: str = "d31ab31b5ddce12cb2175f8c5eaefbabca312143"
placeholder_url = "https://raw.githubusercontent.com/fa0311/twitter-openapi/{hash}/src/config/placeholder.json"
header = "https://raw.githubusercontent.com/fa0311/latest-user-agent/refs/heads/main/header.json"
access_token: str = (
Expand Down
4 changes: 2 additions & 2 deletions twitter_openapi_python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion twitter_openapi_python_generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Twitter OpenAPI(Swagger) specification
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.0.1
- Package version: 0.1.7
- Package version: 0.1.8
- Generator version: 7.26.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

Expand Down
4 changes: 2 additions & 2 deletions twitter_openapi_python_generated/docs/AudioSpaceMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Name | Type | Description | Notes
**scheduled_start** | **int** | | [optional]
**started_at** | **int** | |
**state** | **str** | |
**title** | **str** | |
**title** | **str** | | [optional]
**total_live_listeners** | **int** | |
**total_replay_watched** | **int** | |
**tweet_results** | [**ItemResult**](ItemResult.md) | |
**tweet_results** | [**ItemResult**](ItemResult.md) | | [optional]
**updated_at** | **int** | |

## Example
Expand Down
4 changes: 2 additions & 2 deletions twitter_openapi_python_generated/docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ with twitter_openapi_python_generated.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = twitter_openapi_python_generated.DefaultApi(api_client)
path_query_id = 'zm3JmUpYWDXIUsf_33-ZrA' # str | (default to 'zm3JmUpYWDXIUsf_33-ZrA')
variables = '{"id": "1qxoNYAlYMXJv", "isMetatagsQuery": true, "withReplays": true, "withListeners": true}' # str | (default to '{"id": "1qxoNYAlYMXJv", "isMetatagsQuery": true, "withReplays": true, "withListeners": true}')
variables = '{"id": "1yNGabwXqXnJj", "isMetatagsQuery": true, "withReplays": true, "withListeners": true}' # str | (default to '{"id": "1yNGabwXqXnJj", "isMetatagsQuery": true, "withReplays": true, "withListeners": true}')
features = '{"spaces_2022_h2_spaces_communities": true, "spaces_2022_h2_clipping": true, "creator_subscriptions_tweet_preview_api_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true, "responsive_web_profile_redirect_enabled": true, "rweb_tipjar_consumption_enabled": false, "verified_phone_label_enabled": false, "premium_content_api_read_enabled": false, "communities_web_enable_tweet_community_results_fetch": true, "c9s_tweet_anatomy_moderator_badge_enabled": true, "responsive_web_grok_analyze_button_fetch_trends_enabled": false, "responsive_web_grok_analyze_post_followups_enabled": true, "rweb_cashtags_composer_attachment_enabled": true, "responsive_web_jetfuel_frame": true, "rweb_sports_post_context_enabled": true, "x_elections_post_context_enabled": true, "responsive_web_grok_share_attachment_enabled": true, "responsive_web_grok_annotations_enabled": true, "articles_preview_enabled": true, "responsive_web_edit_tweet_api_enabled": true, "rweb_conversational_replies_downvote_enabled": false, "graphql_is_translatable_rweb_tweet_is_translatable_enabled": true, "view_counts_everywhere_api_enabled": true, "longform_notetweets_consumption_enabled": true, "responsive_web_twitter_article_tweet_consumption_enabled": true, "content_disclosure_indicator_enabled": true, "content_disclosure_ai_generated_indicator_enabled": true, "responsive_web_grok_show_grok_translated_post": true, "responsive_web_grok_analysis_button_from_backend": true, "post_ctas_fetch_enabled": false, "rweb_cashtags_enabled": true, "freedom_of_speech_not_reach_fetch_enabled": true, "standardized_nudges_misinfo": true, "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": true, "longform_notetweets_rich_text_read_enabled": true, "longform_notetweets_inline_media_enabled": false, "responsive_web_nested_quote_preview_enabled": true, "responsive_web_grok_image_annotation_enabled": true, "responsive_web_grok_imagine_annotation_enabled": true, "responsive_web_made_on_x_label_enabled": false, "responsive_web_graphql_timeline_navigation_enabled": true, "responsive_web_grok_community_note_auto_translation_is_enabled": true}' # str | (default to '{"spaces_2022_h2_spaces_communities": true, "spaces_2022_h2_clipping": true, "creator_subscriptions_tweet_preview_api_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true, "responsive_web_profile_redirect_enabled": true, "rweb_tipjar_consumption_enabled": false, "verified_phone_label_enabled": false, "premium_content_api_read_enabled": false, "communities_web_enable_tweet_community_results_fetch": true, "c9s_tweet_anatomy_moderator_badge_enabled": true, "responsive_web_grok_analyze_button_fetch_trends_enabled": false, "responsive_web_grok_analyze_post_followups_enabled": true, "rweb_cashtags_composer_attachment_enabled": true, "responsive_web_jetfuel_frame": true, "rweb_sports_post_context_enabled": true, "x_elections_post_context_enabled": true, "responsive_web_grok_share_attachment_enabled": true, "responsive_web_grok_annotations_enabled": true, "articles_preview_enabled": true, "responsive_web_edit_tweet_api_enabled": true, "rweb_conversational_replies_downvote_enabled": false, "graphql_is_translatable_rweb_tweet_is_translatable_enabled": true, "view_counts_everywhere_api_enabled": true, "longform_notetweets_consumption_enabled": true, "responsive_web_twitter_article_tweet_consumption_enabled": true, "content_disclosure_indicator_enabled": true, "content_disclosure_ai_generated_indicator_enabled": true, "responsive_web_grok_show_grok_translated_post": true, "responsive_web_grok_analysis_button_from_backend": true, "post_ctas_fetch_enabled": false, "rweb_cashtags_enabled": true, "freedom_of_speech_not_reach_fetch_enabled": true, "standardized_nudges_misinfo": true, "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": true, "longform_notetweets_rich_text_read_enabled": true, "longform_notetweets_inline_media_enabled": false, "responsive_web_nested_quote_preview_enabled": true, "responsive_web_grok_image_annotation_enabled": true, "responsive_web_grok_imagine_annotation_enabled": true, "responsive_web_made_on_x_label_enabled": false, "responsive_web_graphql_timeline_navigation_enabled": true, "responsive_web_grok_community_note_auto_translation_is_enabled": true}')

try:
Expand All @@ -226,7 +226,7 @@ with twitter_openapi_python_generated.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**path_query_id** | **str**| | [default to &#39;zm3JmUpYWDXIUsf_33-ZrA&#39;]
**variables** | **str**| | [default to &#39;{&quot;id&quot;: &quot;1qxoNYAlYMXJv&quot;, &quot;isMetatagsQuery&quot;: true, &quot;withReplays&quot;: true, &quot;withListeners&quot;: true}&#39;]
**variables** | **str**| | [default to &#39;{&quot;id&quot;: &quot;1yNGabwXqXnJj&quot;, &quot;isMetatagsQuery&quot;: true, &quot;withReplays&quot;: true, &quot;withListeners&quot;: true}&#39;]
**features** | **str**| | [default to &#39;{&quot;spaces_2022_h2_spaces_communities&quot;: true, &quot;spaces_2022_h2_clipping&quot;: true, &quot;creator_subscriptions_tweet_preview_api_enabled&quot;: true, &quot;profile_label_improvements_pcf_label_in_post_enabled&quot;: true, &quot;responsive_web_profile_redirect_enabled&quot;: true, &quot;rweb_tipjar_consumption_enabled&quot;: false, &quot;verified_phone_label_enabled&quot;: false, &quot;premium_content_api_read_enabled&quot;: false, &quot;communities_web_enable_tweet_community_results_fetch&quot;: true, &quot;c9s_tweet_anatomy_moderator_badge_enabled&quot;: true, &quot;responsive_web_grok_analyze_button_fetch_trends_enabled&quot;: false, &quot;responsive_web_grok_analyze_post_followups_enabled&quot;: true, &quot;rweb_cashtags_composer_attachment_enabled&quot;: true, &quot;responsive_web_jetfuel_frame&quot;: true, &quot;rweb_sports_post_context_enabled&quot;: true, &quot;x_elections_post_context_enabled&quot;: true, &quot;responsive_web_grok_share_attachment_enabled&quot;: true, &quot;responsive_web_grok_annotations_enabled&quot;: true, &quot;articles_preview_enabled&quot;: true, &quot;responsive_web_edit_tweet_api_enabled&quot;: true, &quot;rweb_conversational_replies_downvote_enabled&quot;: false, &quot;graphql_is_translatable_rweb_tweet_is_translatable_enabled&quot;: true, &quot;view_counts_everywhere_api_enabled&quot;: true, &quot;longform_notetweets_consumption_enabled&quot;: true, &quot;responsive_web_twitter_article_tweet_consumption_enabled&quot;: true, &quot;content_disclosure_indicator_enabled&quot;: true, &quot;content_disclosure_ai_generated_indicator_enabled&quot;: true, &quot;responsive_web_grok_show_grok_translated_post&quot;: true, &quot;responsive_web_grok_analysis_button_from_backend&quot;: true, &quot;post_ctas_fetch_enabled&quot;: false, &quot;rweb_cashtags_enabled&quot;: true, &quot;freedom_of_speech_not_reach_fetch_enabled&quot;: true, &quot;standardized_nudges_misinfo&quot;: true, &quot;tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled&quot;: true, &quot;longform_notetweets_rich_text_read_enabled&quot;: true, &quot;longform_notetweets_inline_media_enabled&quot;: false, &quot;responsive_web_nested_quote_preview_enabled&quot;: true, &quot;responsive_web_grok_image_annotation_enabled&quot;: true, &quot;responsive_web_grok_imagine_annotation_enabled&quot;: true, &quot;responsive_web_made_on_x_label_enabled&quot;: false, &quot;responsive_web_graphql_timeline_navigation_enabled&quot;: true, &quot;responsive_web_grok_community_note_auto_translation_is_enabled&quot;: true}&#39;]

### Return type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**is_winner** | **bool** | |
**logo_url** | **str** | |
**name** | **str** | |
**score** | **str** | |
**score** | **str** | | [optional]
**team_rest_id** | [**TweetSportsRestId**](TweetSportsRestId.md) | |

## Example
Expand Down
2 changes: 1 addition & 1 deletion twitter_openapi_python_generated/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "twitter_openapi_python_generated"
version = "0.1.7"
version = "0.1.8"
description = "Twitter OpenAPI"
authors = [
{name = "OpenAPI Generator Community",email = "yuki@yuki0311.com"},
Expand Down
2 changes: 1 addition & 1 deletion twitter_openapi_python_generated/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "twitter_openapi_python_generated"
VERSION = "0.1.7"
VERSION = "0.1.8"
PYTHON_REQUIRES = ">= 3.10"
REQUIRES = [
"urllib3 >= 2.7.0, < 3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,8 @@ def make_instance(self, include_optional) -> AudioSpaceMetadata:
rest_id = '',
started_at = 56,
state = '',
title = '',
total_live_listeners = 56,
total_replay_watched = 56,
tweet_results = twitter_openapi_python_generated.models.item_result.ItemResult(
__typename = 'TimelineTweet',
result = null, ),
updated_at = 56,
)
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def make_instance(self, include_optional) -> TweetSportsCompetitor:
is_winner = True,
logo_url = '',
name = '',
score = '',
team_rest_id = twitter_openapi_python_generated.models.tweet_sports_rest_id.TweetSportsRestId(
rest_id = '4', ),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inputSpec: twitter-openapi/dist/compatible/openapi-3.0.yaml
outputDir: .

packageName: twitter_openapi_python_generated
packageVersion: 0.1.7
packageVersion: 0.1.8
packageUrl: https://github.com/fa0311/twitter_openapi_python_generated
projectName: twitter_openapi_python_generated
projectKeywords: twitter_openapi_python_generated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "0.1.7"
__version__ = "0.1.8"

# Define package exports
__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/0.1.7/python'
self.user_agent = 'OpenAPI-Generator/0.1.8/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def to_debug_report(self) -> str:
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 0.0.1\n"\
"SDK Package Version: 0.1.7".\
"SDK Package Version: 0.1.8".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self) -> List[HostSetting]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class AudioSpaceMetadata(BaseModel):
scheduled_start: Optional[StrictInt] = None
started_at: StrictInt
state: StrictStr
title: StrictStr
title: Optional[StrictStr] = None
total_live_listeners: StrictInt
total_replay_watched: StrictInt
tweet_results: ItemResult
tweet_results: Optional[ItemResult] = None
updated_at: StrictInt
__properties: ClassVar[List[str]] = ["content_type", "conversation_controls", "created_at", "creator_results", "disallow_join", "ended_at", "is_employee_only", "is_locked", "is_muted", "is_space_available_for_clipping", "is_space_available_for_replay", "max_admin_capacity", "max_guest_sessions", "media_key", "mentioned_users", "narrow_cast_space_type", "no_incognito", "rest_id", "scheduled_start", "started_at", "state", "title", "total_live_listeners", "total_replay_watched", "tweet_results", "updated_at"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class BirdwatchEntityRef(BaseModel):
@field_validator('type')
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(['TimelineUrl', 'TimelineRichTextHashtag']):
raise ValueError("must be one of enum values ('TimelineUrl', 'TimelineRichTextHashtag')")
if value not in set(['TimelineUrl', 'TimelineRichTextHashtag', 'TimelineRichTextCashtag']):
raise ValueError("must be one of enum values ('TimelineUrl', 'TimelineRichTextHashtag', 'TimelineRichTextCashtag')")
return value

@field_validator('url_type')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TweetSportsCompetitor(BaseModel):
is_winner: StrictBool
logo_url: StrictStr
name: StrictStr
score: Optional[StrictStr]
score: Optional[StrictStr] = None
team_rest_id: TweetSportsRestId
__properties: ClassVar[List[str]] = ["abbreviation", "dark_logo_url", "is_active", "is_winner", "logo_url", "name", "score", "team_rest_id"]

Expand Down Expand Up @@ -81,11 +81,6 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of team_rest_id
if self.team_rest_id:
_dict['team_rest_id'] = self.team_rest_id.to_dict()
# set to None if score (nullable) is None
# and model_fields_set contains the field
if self.score is None and "score" in self.model_fields_set:
_dict['score'] = None

return _dict

@classmethod
Expand Down