TwitterClient
Attributes
TRIGGER_OPERATIONS
module-attribute
TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnNewTweet': {'operation_id': 'OnNewTweet', 'path': '/{connectionId}/onnewtweet', 'method': 'get', 'required_parameters': ['searchQuery'], 'callback_payload_type': 'TriggerBatchResponseTweetModel'}}
Classes
TweetModel
dataclass
TweetModel(tweet_text: Optional[str] = None, tweet_id: Optional[str] = None, created_at: Optional[str] = None, created_at_iso: Optional[str] = None, retweet_count: Optional[int] = None, tweeted_by: Optional[str] = None, media_urls: Optional[List[str]] = None, tweet_language_code: Optional[str] = None, tweet_in_reply_to_user_id: Optional[str] = None, favorited: Optional[bool] = None, user_mentions: Optional[List[UserMentionsModel]] = None, original_tweet: Optional[OriginalTweetModel] = None, user_details: Optional[UserDetailsModel] = None)
Response for Get user timeline
Attributes
tweet_text
class-attribute
instance-attribute
Text content of the tweet
tweet_id
class-attribute
instance-attribute
Id of the tweet
created_at
class-attribute
instance-attribute
Time at which the tweet was posted
created_at_iso
class-attribute
instance-attribute
Time at which the tweet was posted
retweet_count
class-attribute
instance-attribute
Total number of re-tweets for the tweet
tweeted_by
class-attribute
instance-attribute
Name of the user who has posted the tweet
media_urls
class-attribute
instance-attribute
Url of the media posted along with the tweet
tweet_language_code
class-attribute
instance-attribute
tweet_language_code: Optional[str] = field(default=None, metadata={'wire_name': 'TweetLanguageCode'})
Language code of the tweet
tweet_in_reply_to_user_id
class-attribute
instance-attribute
tweet_in_reply_to_user_id: Optional[str] = field(default=None, metadata={'wire_name': 'TweetInReplyToUserId'})
User Id of the author of the tweet that the current tweet is a reply to
favorited
class-attribute
instance-attribute
Indicates whether the tweet is marked as favorited or not
UserDetailsModel
dataclass
UserDetailsModel(full_name: Optional[str] = None, location: Optional[str] = None, id: Optional[int] = None, user_name: Optional[str] = None, followers_count: Optional[int] = None, description: Optional[str] = None, statuses_count: Optional[int] = None, friends_count: Optional[int] = None, favourites_count: Optional[int] = None, profile_image_url: Optional[str] = None)
Response for Get followers
Attributes
full_name
class-attribute
instance-attribute
Name of the user
location
class-attribute
instance-attribute
Location of the user
id
class-attribute
instance-attribute
X id (handle) of the user
user_name
class-attribute
instance-attribute
Screen name of the user
followers_count
class-attribute
instance-attribute
Number of followers
description
class-attribute
instance-attribute
User description
statuses_count
class-attribute
instance-attribute
User status count
friends_count
class-attribute
instance-attribute
Number of friends
favourites_count
class-attribute
instance-attribute
Number of tweets that the user has favorited
TweetResponseModel
dataclass
TriggerBatchResponseTweetModel
dataclass
UserMentionsModel
dataclass
UserMentionsModel(id: Optional[int] = None, full_name: Optional[str] = None, user_name: Optional[str] = None)
Definition: UserMentionsModel
Attributes
id
class-attribute
instance-attribute
X id (handle) of the user
full_name
class-attribute
instance-attribute
Full name of the user
OriginalTweetModel
dataclass
OriginalTweetModel(tweet_text: Optional[str] = None, tweet_id: Optional[str] = None, created_at: Optional[str] = None, created_at_iso: Optional[str] = None, retweet_count: Optional[int] = None, tweeted_by: Optional[str] = None, media_urls: Optional[List[str]] = None, tweet_language_code: Optional[str] = None, tweet_in_reply_to_user_id: Optional[str] = None, favorited: Optional[bool] = None, user_mentions: Optional[List[OriginalTweetUserMentionsModel]] = None, user_details: Optional[OriginalTweetUserDetailsModel] = None)
Definition: OriginalTweetModel
Attributes
tweet_text
class-attribute
instance-attribute
Text content of the original retrieved tweet
tweet_id
class-attribute
instance-attribute
Id of the original tweet
created_at
class-attribute
instance-attribute
Time at which original tweet was posted
created_at_iso
class-attribute
instance-attribute
Time at which original tweet was posted
retweet_count
class-attribute
instance-attribute
Total number of re-tweets for this original tweet
tweeted_by
class-attribute
instance-attribute
User name of the person who posted the original tweet
media_urls
class-attribute
instance-attribute
Url of the media posted along with the original tweet
tweet_language_code
class-attribute
instance-attribute
tweet_language_code: Optional[str] = field(default=None, metadata={'wire_name': 'TweetLanguageCode'})
Language code for the original tweet
tweet_in_reply_to_user_id
class-attribute
instance-attribute
tweet_in_reply_to_user_id: Optional[str] = field(default=None, metadata={'wire_name': 'TweetInReplyToUserId'})
User Id of the author of the tweet that the current original tweet is a reply to
favorited
class-attribute
instance-attribute
Indicates whether the original tweet is marked as favorited
OriginalTweetUserMentionsModel
dataclass
OriginalTweetUserMentionsModel(id: Optional[int] = None, full_name: Optional[str] = None, user_name: Optional[str] = None)
Definition: OriginalTweetUserMentionsModel
Attributes
id
class-attribute
instance-attribute
X id (handle) of the user
full_name
class-attribute
instance-attribute
Full name of the user
OriginalTweetUserDetailsModel
dataclass
OriginalTweetUserDetailsModel(full_name: Optional[str] = None, location: Optional[str] = None, id: Optional[int] = None, user_name: Optional[str] = None, followers_count: Optional[int] = None, description: Optional[str] = None, statuses_count: Optional[int] = None, friends_count: Optional[int] = None, favourites_count: Optional[int] = None, profile_image_url: Optional[str] = None)
Definition: OriginalTweetUserDetailsModel
Attributes
full_name
class-attribute
instance-attribute
Name of the user
location
class-attribute
instance-attribute
Location of the user
id
class-attribute
instance-attribute
X id (handle) of the user
user_name
class-attribute
instance-attribute
Screen name of the user
followers_count
class-attribute
instance-attribute
Number of followers
description
class-attribute
instance-attribute
User description
statuses_count
class-attribute
instance-attribute
User status count
friends_count
class-attribute
instance-attribute
Number of friends
favourites_count
class-attribute
instance-attribute
Number of tweets that the user has favorited
TwitterClient
TwitterClient(connection_runtime_url: str, token_provider: Optional[TokenProvider] = None, options: Optional[ConnectorClientOptions] = None)
Bases: ConnectorClientBase
Typed client for twitter connector.
Initialize a TwitterClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_runtime_url
|
str
|
The connection runtime URL from Azure Portal. |
required |
token_provider
|
Optional[TokenProvider]
|
Optional token provider. Defaults to ManagedIdentityTokenProvider. |
None
|
options
|
Optional[ConnectorClientOptions]
|
Optional connector client options. |
None
|
Methods:
user_timeline_async
async
Get user timeline
This operation gets a list of the most recent tweets posted by a given user.
home_timeline_async
async
Get home timeline
This operation gets the most recent tweets and re-tweets posted by me and my followers.
search_tweet_async
async
search_tweet_async(search_query: str, max_results: Optional[int] = None, since_id: Optional[str] = None) -> dict[str, Any] | None
Search tweets
This operation gets a list of relevant tweets matching the search query.
followers_async
async
Get followers
This operation gets the list of users that follow a given user.
my_followers_async
async
Get my followers
This operation gets the list of users who are following me.
following_async
async
Get following
The operation gets the list of people the given user follows.
my_following_async
async
Get my following
This operation gets the list of users that I am following.
user_async
async
Get user
This operation gets the profile details for a given user, such as user name, description, followers count, and more.
tweet_async
async
Post a tweet
This operation posts a new tweet.