From ef394d269ef6e135b2607f1a944b81802170bf25 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:54:37 +0530 Subject: [PATCH 01/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 17301a6..754bb22 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -147,6 +147,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -255,6 +264,20 @@ dependencies = [ {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + [[package]] org = "ballerina" name = "time" @@ -293,6 +316,7 @@ version = "4.0.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, + {org = "ballerina", name = "test"}, {org = "ballerina", name = "url"}, {org = "ballerinai", name = "observe"} ] From bd9a188150f303a98ae81bd33b5c2a6b48a05dd2 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:05:24 +0530 Subject: [PATCH 02/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 754bb22..ff5cdae 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -101,6 +101,9 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] +modules = [ + {org = "ballerina", packageName = "io", moduleName = "io"} +] [[package]] org = "ballerina" @@ -254,6 +257,9 @@ dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "os", moduleName = "os"} +] [[package]] org = "ballerina" @@ -285,6 +291,9 @@ version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "time", moduleName = "time"} +] [[package]] org = "ballerina" @@ -316,7 +325,10 @@ version = "4.0.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "os"}, {org = "ballerina", name = "test"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"}, {org = "ballerinai", name = "observe"} ] From 5de0646fc731a354e453394328aaf4a314a4424a Mon Sep 17 00:00:00 2001 From: loshan Date: Tue, 2 Jul 2024 11:10:21 +0530 Subject: [PATCH 03/15] Add two example scenarios to examples folder and update folder structure --- example/DM-mentions/.github/README.md | 25 +++++ example/DM-mentions/.gitignore | 11 +++ example/DM-mentions/Ballerina.toml | 5 + example/DM-mentions/Config.toml.template | 1 + .../Direct Message Company Mentions.md | 25 +++++ example/DM-mentions/main.bal | 88 +++++++++++++++++ example/README.md | 52 ++++++++++ {examples => example}/build.gradle | 0 example/build.sh | 63 ++++++++++++ .../.github/README.md | 25 +++++ example/tweet-performance-tracker/.gitignore | 11 +++ .../tweet-performance-tracker/Ballerina.toml | 5 + .../Config.toml.template | 1 + .../Tweet Performance Tracker.md | 25 +++++ example/tweet-performance-tracker/main.bal | 97 +++++++++++++++++++ examples/getFollowers.bal | 42 -------- examples/getLastTenTweets.bal | 41 -------- examples/retweet.bal | 44 --------- examples/tweet.bal | 42 -------- 19 files changed, 434 insertions(+), 169 deletions(-) create mode 100644 example/DM-mentions/.github/README.md create mode 100644 example/DM-mentions/.gitignore create mode 100644 example/DM-mentions/Ballerina.toml create mode 100644 example/DM-mentions/Config.toml.template create mode 100644 example/DM-mentions/Direct Message Company Mentions.md create mode 100644 example/DM-mentions/main.bal create mode 100644 example/README.md rename {examples => example}/build.gradle (100%) create mode 100644 example/build.sh create mode 100644 example/tweet-performance-tracker/.github/README.md create mode 100644 example/tweet-performance-tracker/.gitignore create mode 100644 example/tweet-performance-tracker/Ballerina.toml create mode 100644 example/tweet-performance-tracker/Config.toml.template create mode 100644 example/tweet-performance-tracker/Tweet Performance Tracker.md create mode 100644 example/tweet-performance-tracker/main.bal delete mode 100644 examples/getFollowers.bal delete mode 100644 examples/getLastTenTweets.bal delete mode 100644 examples/retweet.bal delete mode 100644 examples/tweet.bal diff --git a/example/DM-mentions/.github/README.md b/example/DM-mentions/.github/README.md new file mode 100644 index 0000000..e941e51 --- /dev/null +++ b/example/DM-mentions/.github/README.md @@ -0,0 +1,25 @@ +## Customer Support tweets and Feedback Management + +This use case demonstrates how the Twitter API v2 can be utilized to enhance customer engagement by monitoring mentions of a company's support handle and providing timely responses through direct messages. The example involves a sequence of actions that leverage the Twitter API v2 to automate and streamline customer support efforts. + +## Prerequisites + +### 1. Obtain Access token + +Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one + +### 2. Configuration + +Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory + +```bash +accessToken = "" +``` + +## Run the example + +Execute the following command to run the example: + +```bash +bal run +``` \ No newline at end of file diff --git a/example/DM-mentions/.gitignore b/example/DM-mentions/.gitignore new file mode 100644 index 0000000..d5fc29a --- /dev/null +++ b/example/DM-mentions/.gitignore @@ -0,0 +1,11 @@ +# Ballerina generates this directory during the compilation of a package. +# It contains compiler-generated artifacts and the final executable if this is an application package. +target/ + +# Ballerina maintains the compiler-generated source code here. +# Remove this if you want to commit generated sources. +generated/ + +# Contains configuration values used during development time. +# See https://ballerina.io/learn/provide-values-to-configurable-variables/ for more details. +Config.toml diff --git a/example/DM-mentions/Ballerina.toml b/example/DM-mentions/Ballerina.toml new file mode 100644 index 0000000..214a276 --- /dev/null +++ b/example/DM-mentions/Ballerina.toml @@ -0,0 +1,5 @@ +[package] +org = "wso2" +name = "DM_mentions" +version = "0.1.0" +distribution = "2201.9.0" \ No newline at end of file diff --git a/example/DM-mentions/Config.toml.template b/example/DM-mentions/Config.toml.template new file mode 100644 index 0000000..ce1465e --- /dev/null +++ b/example/DM-mentions/Config.toml.template @@ -0,0 +1 @@ +accessToken = "" \ No newline at end of file diff --git a/example/DM-mentions/Direct Message Company Mentions.md b/example/DM-mentions/Direct Message Company Mentions.md new file mode 100644 index 0000000..e941e51 --- /dev/null +++ b/example/DM-mentions/Direct Message Company Mentions.md @@ -0,0 +1,25 @@ +## Customer Support tweets and Feedback Management + +This use case demonstrates how the Twitter API v2 can be utilized to enhance customer engagement by monitoring mentions of a company's support handle and providing timely responses through direct messages. The example involves a sequence of actions that leverage the Twitter API v2 to automate and streamline customer support efforts. + +## Prerequisites + +### 1. Obtain Access token + +Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one + +### 2. Configuration + +Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory + +```bash +accessToken = "" +``` + +## Run the example + +Execute the following command to run the example: + +```bash +bal run +``` \ No newline at end of file diff --git a/example/DM-mentions/main.bal b/example/DM-mentions/main.bal new file mode 100644 index 0000000..defc8f6 --- /dev/null +++ b/example/DM-mentions/main.bal @@ -0,0 +1,88 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/io; +import ballerinax/twitter; + +configurable string accessToken = ?; + +public function main() returns error? { + + // Initialize the client + twitter:Client twitter = check new ({ + auth: { + token: accessToken + } + }); + + // a search query to search for tweets + string searchQuery = "#ballerinaSupport"; + + // search for recent tweets + twitter:Get2TweetsSearchRecentResponse tweetList = check twitter->/tweets/search/recent( + query = searchQuery, + max_results = 10 + ); + + // Initialize tweetIdList and userIdList + twitter:TweetId[] tweetIdList = []; + twitter:UserId[] userIdList = []; + + // Extract tweets from the response + twitter:Tweet[] tweets = tweetList.data ?: []; + + // Iterate through the tweets and extract the tweet IDs + foreach twitter:Tweet tweet in tweets { + tweetIdList.push(tweet.id ?: ""); + } + + // Iterate through the tweet IDs and extract the user IDs + foreach twitter:TweetId tweetId in tweetIdList { + if (tweetId == "") { + continue; + } + + // Find the author ID of the tweet + twitter:FindTweetByIdQueries queries = { + tweet\.fields: ["author_id"] + }; + twitter:Get2TweetsIdResponse tweetResponse = check twitter->/tweets/[tweetId](queries = queries); + + userIdList.push(tweetResponse.data?.author_id ?: ""); + } + + // Iterate through the user IDs and send a DM to each user + foreach twitter:UserId userId in userIdList { + if (userId == "") { + continue; + } + + io:println("User ID: ", userId); + + // Send a DM to the user + twitter:CreateDmEventResponse DMResponse = check twitter->/dm_conversations/with/[userId]/messages.post( + payload = { + text: "Thank you for reaching us! We will reach you soon" + } + ); + + if (DMResponse.data != null) { + io:println("DM sent successfully"); + } else { + io:println("Failed to send DM", DMResponse); + } + } +} \ No newline at end of file diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..c464f65 --- /dev/null +++ b/example/README.md @@ -0,0 +1,52 @@ +# Examples + +The `ballerinax/twitter` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-twitter/tree/main/examples), covering use cases like Direct message company mentions, and tweet performance tracker. + +1. [Direct message company mentions](https://github.com/ballerina-platform/module-ballerinax-twitter/tree/main/examples/DM-mentions) - Integrate Twitter to send direct messages to users who mention the company in tweets. + +2. [Tweet performance tracker](https://github.com/ballerina-platform/module-ballerinax-twitter/tree/main/examples/tweet-performance-tracker) - Analyze the performance of tweets posted by a user over the past month. + + +## Prerequisites + +1. Generate Twitter credentials to authenticate the connector as described in the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide). + +2. For each example, create a `Config.toml` file the related configuration. Here's an example of how your `Config.toml` file should look: + + ```toml + accessToken="" + ``` + +## Running an Example + +Execute the following commands to build an example from the source: + +* To build an example: + + ```bash + bal build + ``` + +* To run an example: + + ```bash + bal run + ``` + +## Building the Examples with the Local Module + +**Warning**: Due to the absence of support for reading local repositories for single Ballerina files, the Bala of the module is manually written to the central repository as a workaround. Consequently, the bash script may modify your local Ballerina repositories. + +Execute the following commands to build all the examples against the changes you have made to the module locally: + +* To build all the examples: + + ```bash + ./build.sh build + ``` + +* To run all the examples: + + ```bash + ./build.sh run + ``` \ No newline at end of file diff --git a/examples/build.gradle b/example/build.gradle similarity index 100% rename from examples/build.gradle rename to example/build.gradle diff --git a/example/build.sh b/example/build.sh new file mode 100644 index 0000000..1014d43 --- /dev/null +++ b/example/build.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +BAL_EXAMPLES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BAL_CENTRAL_DIR="$HOME/.ballerina/repositories/central.ballerina.io" +BAL_HOME_DIR="$BAL_EXAMPLES_DIR/../ballerina" + +set -e + +case "$1" in +build) + BAL_CMD="build" + ;; +run) + BAL_CMD="run" + ;; +*) + echo "Invalid command provided: '$1'. Please provide 'build' or 'run' as the command." + exit 1 + ;; +esac + +# Read Ballerina package name +BAL_PACKAGE_NAME=$(awk -F'"' '/^name/ {print $2}' "$BAL_HOME_DIR/Ballerina.toml") + +# Push the package to the local repository +cd "$BAL_HOME_DIR" && + bal pack && + bal push --repository=local + +# Remove the cache directories in the repositories +cacheDirs=$(ls -d $BAL_CENTRAL_DIR/cache-* 2>/dev/null) || true +for dir in "${cacheDirs[@]}"; do + [ -d "$dir" ] && rm -r "$dir" +done +echo "Successfully cleaned the cache directories" + +# Create the package directory in the central repository, this will not be present if no modules are pulled +mkdir -p "$BAL_CENTRAL_DIR/bala/ballerinax/$BAL_PACKAGE_NAME" + +# Update the central repository +BAL_DESTINATION_DIR="$HOME/.ballerina/repositories/central.ballerina.io/bala/ballerinax/$BAL_PACKAGE_NAME" +BAL_SOURCE_DIR="$HOME/.ballerina/repositories/local/bala/ballerinax/$BAL_PACKAGE_NAME" +[ -d "$BAL_DESTINATION_DIR" ] && rm -r "$BAL_DESTINATION_DIR" +[ -d "$BAL_SOURCE_DIR" ] && cp -r "$BAL_SOURCE_DIR" "$BAL_DESTINATION_DIR" +echo "Successfully updated the local central repositories" + +echo "$BAL_DESTINATION_DIR" +echo "$BAL_SOURCE_DIR" + +# Loop through examples in the examples directory +cd "$BAL_EXAMPLES_DIR" +for dir in $(find "$BAL_EXAMPLES_DIR" -type d -maxdepth 1 -mindepth 1); do + # Skip the build directory + if [[ "$dir" == *build ]]; then + continue + fi + (cd "$dir" && bal "$BAL_CMD" --offline && cd ..); +done + +# Remove generated JAR files +find "$BAL_HOME_DIR" -maxdepth 1 -type f -name "*.jar" | while read -r JAR_FILE; do + rm "$JAR_FILE" +done \ No newline at end of file diff --git a/example/tweet-performance-tracker/.github/README.md b/example/tweet-performance-tracker/.github/README.md new file mode 100644 index 0000000..a5be15e --- /dev/null +++ b/example/tweet-performance-tracker/.github/README.md @@ -0,0 +1,25 @@ +## Analyzing One-Month Tweet Performance + +This use case demonstrates how the Twitter API v2 can be utilized to analyze the performance of tweets posted by a user over the past month. The example involves a sequence of actions that leverage the Twitter API v2 to automate the retrieval of tweets and their performance metrics (likes, retweets, replies), and then create a performance report. + +## Prerequisites + +### 1. Obtain Access token + +Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one + +### 2. Configuration + +Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory + +```bash +accessToken = "" +``` + +## Run the example + +Execute the following command to run the example: + +```bash +bal run +``` \ No newline at end of file diff --git a/example/tweet-performance-tracker/.gitignore b/example/tweet-performance-tracker/.gitignore new file mode 100644 index 0000000..d5fc29a --- /dev/null +++ b/example/tweet-performance-tracker/.gitignore @@ -0,0 +1,11 @@ +# Ballerina generates this directory during the compilation of a package. +# It contains compiler-generated artifacts and the final executable if this is an application package. +target/ + +# Ballerina maintains the compiler-generated source code here. +# Remove this if you want to commit generated sources. +generated/ + +# Contains configuration values used during development time. +# See https://ballerina.io/learn/provide-values-to-configurable-variables/ for more details. +Config.toml diff --git a/example/tweet-performance-tracker/Ballerina.toml b/example/tweet-performance-tracker/Ballerina.toml new file mode 100644 index 0000000..18fdcfe --- /dev/null +++ b/example/tweet-performance-tracker/Ballerina.toml @@ -0,0 +1,5 @@ +[package] +org = "wso2" +name = "tweet_performance_tracker" +version = "0.1.0" +distribution = "2201.9.0" diff --git a/example/tweet-performance-tracker/Config.toml.template b/example/tweet-performance-tracker/Config.toml.template new file mode 100644 index 0000000..ce1465e --- /dev/null +++ b/example/tweet-performance-tracker/Config.toml.template @@ -0,0 +1 @@ +accessToken = "" \ No newline at end of file diff --git a/example/tweet-performance-tracker/Tweet Performance Tracker.md b/example/tweet-performance-tracker/Tweet Performance Tracker.md new file mode 100644 index 0000000..a5be15e --- /dev/null +++ b/example/tweet-performance-tracker/Tweet Performance Tracker.md @@ -0,0 +1,25 @@ +## Analyzing One-Month Tweet Performance + +This use case demonstrates how the Twitter API v2 can be utilized to analyze the performance of tweets posted by a user over the past month. The example involves a sequence of actions that leverage the Twitter API v2 to automate the retrieval of tweets and their performance metrics (likes, retweets, replies), and then create a performance report. + +## Prerequisites + +### 1. Obtain Access token + +Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one + +### 2. Configuration + +Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory + +```bash +accessToken = "" +``` + +## Run the example + +Execute the following command to run the example: + +```bash +bal run +``` \ No newline at end of file diff --git a/example/tweet-performance-tracker/main.bal b/example/tweet-performance-tracker/main.bal new file mode 100644 index 0000000..c2654e1 --- /dev/null +++ b/example/tweet-performance-tracker/main.bal @@ -0,0 +1,97 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/io; +import ballerina/time; +import ballerinax/twitter; + +configurable string accessToken = ?; + +public function main() returns error? { + + // Initialize the client + twitter:Client twitter = check new ({ + auth: { + token: accessToken + } + }); + + // Define the username to track and the time range + string username = ""; + time:Utc utcTimeNow = time:utcNow(); + time:Utc utcTimeBeforeMonth = time:utcAddSeconds(utcTimeNow, -2592000); + + // Initialize tweetsPerformingList + twitter:Tweet[] tweetsPerformingList = []; + + // Retrieve user by username + twitter:Get2UsersByUsernameUsernameResponse responseUser = check twitter->/users/'by/username/[username](); + twitter:User? user = responseUser.data; + + if (user is twitter:User) { + twitter:UserId userId = user.id; + + // Retrieve tweets posted by the user in the past month + twitter:Get2UsersIdTweetsResponse responseUserTweets = check twitter->/users/[userId]/tweets({ + start_time: time:utcToString(utcTimeBeforeMonth), + end_time: time:utcToString(utcTimeNow) + }); + twitter:Tweet[] tweets = responseUserTweets.data ?: []; + + // Define query parameters + twitter:FindTweetByIdQueries queries = { + tweet\.fields: ["public_metrics"] + }; + + // Retrieve detailed metrics for each tweet + foreach twitter:Tweet tweet in tweets { + twitter:TweetId tweetId = tweet.id ?: ""; + twitter:Get2TweetsIdResponse responseTweet = check twitter->/tweets/[tweetId](queries = queries); + twitter:Tweet? tweetData = responseTweet.data; + + if tweetData != null { + tweet.public_metrics = tweetData.public_metrics; + tweetsPerformingList.push(tweet); + } + } + } + + // Sort tweetsPerformingList by like_count using bubble sort + int n = tweetsPerformingList.length(); + boolean swapped = false; + foreach int i in 0 ... n - 2 { + swapped = false; + foreach int j in 1 ... n - 1 - i { + if (tweetsPerformingList[j - 1].public_metrics?.like_count < tweetsPerformingList[j].public_metrics?.like_count) { + twitter:Tweet temp = tweetsPerformingList[j - 1]; + tweetsPerformingList[j - 1] = tweetsPerformingList[j]; + tweetsPerformingList[j] = temp; + swapped = true; + } + } + if (!swapped) { + break; + } + } + + // Print the sorted tweets + io:println("Top Tweets by ", username, " in the last month: "); + foreach var tweet in tweetsPerformingList { + io:println("Tweet: ", tweet.text); + io:println("Likes: ", tweet.public_metrics?.like_count); + io:println("Retweet Count: ", tweet.public_metrics?.retweet_count); + } +} \ No newline at end of file diff --git a/examples/getFollowers.bal b/examples/getFollowers.bal deleted file mode 100644 index a380f44..0000000 --- a/examples/getFollowers.bal +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/log; -import ballerinax/twitter; - -configurable string apiKey = ?; -configurable string apiSecret = ?; -configurable string accessToken = ?; -configurable string accessTokenSecret = ?; - -public function main() returns error? { - - // Add the Twitter credentials as the Configuration - twitter:ConnectionConfig configuration = { - apiKey: apiKey, - apiSecret: apiSecret, - accessToken: accessToken, - accessTokenSecret: accessTokenSecret - }; - - twitter:Client twitterClient = check new (configuration); - - // Set the User ID - int USER_ID = 0; - - twitter:User[] followers = check twitterClient->getFollowers(USER_ID); - log:printInfo("Followers: " + followers.toString()); -} diff --git a/examples/getLastTenTweets.bal b/examples/getLastTenTweets.bal deleted file mode 100644 index a611a24..0000000 --- a/examples/getLastTenTweets.bal +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/log; -import ballerinax/twitter; - -configurable string apiKey = ?; -configurable string apiSecret = ?; -configurable string accessToken = ?; -configurable string accessTokenSecret = ?; - -public function main() returns error? { - - // Add the Twitter credentials as the Configuration - twitter:ConnectionConfig configuration = { - apiKey: apiKey, - apiSecret: apiSecret, - accessToken: accessToken, - accessTokenSecret: accessTokenSecret - }; - - twitter:Client twitterClient = check new (configuration); - - twitter:Tweet[] response = check twitterClient->getLast10Tweets(); - foreach twitter:Tweet tweet in response { - log:printInfo(tweet.toString()); - } -} diff --git a/examples/retweet.bal b/examples/retweet.bal deleted file mode 100644 index 5b2e942..0000000 --- a/examples/retweet.bal +++ /dev/null @@ -1,44 +0,0 @@ - // Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/log; -import ballerinax/twitter; - -configurable string apiKey = ?; -configurable string apiSecret = ?; -configurable string accessToken = ?; -configurable string accessTokenSecret = ?; - -public function main() returns error? { - - // Add the Twitter credentials as the Configuration - twitter:ConnectionConfig configuration = { - apiKey: apiKey, - apiSecret: apiSecret, - accessToken: accessToken, - accessTokenSecret: accessTokenSecret - }; - - twitter:Client twitterClient = check new (configuration); - - string tweetContent = "Retweet"; - - // Set the Tweet ID - int TWEET_ID = 0; - - twitter:Tweet response = check twitterClient->retweet(TWEET_ID); - log:printInfo("Retweeted a Tweet : " + response.toString()); -} diff --git a/examples/tweet.bal b/examples/tweet.bal deleted file mode 100644 index 269c01f..0000000 --- a/examples/tweet.bal +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/log; -import ballerinax/twitter; - -configurable string apiKey = ?; -configurable string apiSecret = ?; -configurable string accessToken = ?; -configurable string accessTokenSecret = ?; - -public function main() returns error? { - - // Add the Twitter credentials as the Configuration - twitter:ConnectionConfig configuration = { - apiKey: apiKey, - apiSecret: apiSecret, - accessToken: accessToken, - accessTokenSecret: accessTokenSecret - }; - - twitter:Client twitterClient = check new (configuration); - - string tweetContent = "Learn Ballerina"; - string link = "https://ballerina.io/learn/by-example/introduction/"; - - twitter:Tweet response = check twitterClient->tweet(tweetContent, link); - log:printInfo("Tweet posted in timeline: " + response.toString()); -} From b47120eacd45b74200bfed3eddf240a116278309 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:18:07 +0530 Subject: [PATCH 04/15] Add test cases and Update the ReadMe file for Tests --- ballerina/tests/README.md | 87 ++++++++++++++++++ ballerina/tests/test.bal | 180 ++++++++++++++++++++++++++++++++++++++ gradle.properties | 2 +- 3 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 ballerina/tests/README.md create mode 100644 ballerina/tests/test.bal diff --git a/ballerina/tests/README.md b/ballerina/tests/README.md new file mode 100644 index 0000000..23557ec --- /dev/null +++ b/ballerina/tests/README.md @@ -0,0 +1,87 @@ +# Running Tests + +## Prerequisites +You need a bearer token and a Access token from twittter(X) developer account. + +To do this, refer to [Ballerina Twitter Connector](https://github.com/ballerina-platform/module-ballerinax-twitter/blob/main/ballerina/Module.md). + +And You need Find Your User ID For run some of the tests. +Via This Website you can find it [Twitter ID Finder](https://twiteridfinder.com/). + + + +# Running Tests + +There are two test environments for running the Twitter(X) connector tests. The default test environment is the mock server for Twitter API. The other test environment is the actual Twitter (X) API. + +You can run the tests in either of these environments and each has its own compatible set of tests. + + Test Groups | Environment +-------------|--------------------------------------------------- + mock_tests | Mock server for Twitter(X) API (Defualt Environment) + live_tests | Twitter(X) API + +## Running Tests in the Mock Server + +To execute the tests on the mock server, ensure that the `IS_LIVE_SERVER` environment variable is either set to `false` or unset before initiating the tests. + +This environment variable can be configured within the `Config.toml` file located in the tests directory or specified as an environmental variable. + +#### Using a Config.toml File + +Create a `Config.toml` file in the tests directory and the following content: + +```toml +isLiveServer = false +``` + +#### Using Environment Variables + +Alternatively, you can set your authentication credentials as environment variables: +If you are using linux or mac, you can use following method: +```bash + export IS_LIVE_SERVER=false +``` +If you are using Windows you can use following method: +```bash + set IS_LIVE_SERVER=false +``` +Then, run the following command to run the tests: + +```bash + ./gradlew clean test +``` + +## Running Tests Against Twitter(X) Live API + +#### Using a Config.toml File + +Create a `Config.toml` file in the tests directory and add your authentication credentials a + +```toml + isLiveServer = true + token = "" + userId = "" +``` + +#### Using Environment Variables + +Alternatively, you can set your authentication credentials as environment variables: +If you are using linux or mac, you can use following method: +```bash + export IS_LIVE_SERVER=true + export TWITTER_TOKEN ="" + export TWITTER_USER_ID ="" +``` + +If you are using Windows you can use following method: +```bash + setx IS_LIVE_SERVER true + setx TWITTER_TOKEN + setx TWITTER_USER_ID = +``` +Then, run the following command to run the tests: + +```bash + ./gradlew clean test +``` diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal new file mode 100644 index 0000000..687080b --- /dev/null +++ b/ballerina/tests/test.bal @@ -0,0 +1,180 @@ +import ballerina/test; +import ballerina/time; +import ballerina/io; +import ballerina/os; + + +configurable boolean isLiveServer = os:getEnv("IS_LIVE_SERVER") == "true"; +configurable string userId = isLiveServer ? os:getEnv("TWITTER_USER_ID") : "test"; +configurable string token = isLiveServer ? os:getEnv("TWITTER_TOKEN") : "test"; +configurable string serviceUrl = isLiveServer ? "https://api.twitter.com/2" : "http://localhost:9090/"; + +ConnectionConfig config = {auth: {token: token}}; +final Client baseClient = check new Client(config, serviceUrl); + +//Test Posting a Tweet +@test:Config { +} +isolated function testPostTweet() returns error? { + io:println(isLiveServer); + io:println(token); + time:Utc utc = time:utcNow(); + string tweetText = "Twitter Test at" + utc.toString(); + TweetCreateResponse response = check baseClient->/tweets.post(payload = { + text: tweetText + }); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("1"); + + io:println(response); +} + +//Test Get Twitter User Id of a user By Username +@test:Config { +} +isolated function testgetUserIdByUseName() returns error? { + Get2UsersByUsernameUsernameResponse response = check baseClient->/users/'by/username/["KumarSanga2"]; + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("2"); + io:println(response); +} + +//Test Like a Post via Post ID +@test:Config { +} +isolated function testUserLikeAPost() returns error? { + UsersLikesCreateResponse response = check baseClient->/users/[userId]/likes.post( + payload = { + tweet_id:"1806286701704462623" + } + ); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("3"); + io:println(response); +} + +//Test Unlike a Post via Post ID +@test:Config { +} +isolated function testUserUnlikeAPost() returns error? { + UsersLikesDeleteResponse response = check baseClient->/users/[userId]/likes/["1806286701704462623"].delete(); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("4"); + io:println(response); +} + +//Test grab information of a specific post via Id +@test:Config { +} +isolated function testPostLookup() returns error? { + Get2TweetsIdResponse response = check baseClient->/tweets/["1806286701704462623"](); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("5"); + io:println(response); +} + +//Test Bookmark a Post +@test:Config { +} +isolated function testBookmarkPost() returns error? { + BookmarkMutationResponse response = check baseClient->/users/[userId]/bookmarks.post( + payload = {tweet_id: "1806286701704462623"} + ); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("6"); + io:println(response); +} + +//Test Unbookmark a Post +@test:Config { +} +isolated function testBookmarkDelete() returns error? { + BookmarkMutationResponse response = check baseClient->/users/[userId]/bookmarks/["1806286701704462623"].delete(); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("7"); + io:println(response); +} + + +//Test Retweet a Post via Post ID +@test:Config { +} +isolated function testRetweet() returns error? { + UsersRetweetsCreateResponse response = check baseClient->/users/[userId]/retweets.post( + payload = {tweet_id: "1806286701704462623"} + ); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("8"); + io:println(response); +} + +//Test Unretweet a Post via Post ID +@test:Config { +} +isolated function testDeleteRetweet() returns error? { + UsersRetweetsDeleteResponse response = check baseClient->/users/[userId]/retweets/["1806286701704462623"].delete(); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("9"); + io:println(response); +} + +//Test Follow a Specific User +@test:Config { +} +isolated function testFollowSpecificUser() returns error? { + UsersFollowingCreateResponse response = check baseClient->/users/[userId]/following.post( + payload={ + target_user_id:"1803011651249278976" + } + ); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("10"); + io:println(response); +} + +//Test Unfollow a Specific User +@test:Config { +} +isolated function testUnfollowSpecificUser() returns error? { + UsersFollowingDeleteResponse response = check baseClient->/users/[userId]/following/["1803011651249278976"].delete(); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("11"); + io:println(response); +} + +//Test Mute a Specific User +@test:Config { +} +isolated function muteSpecificUser() returns error? { + MuteUserMutationResponse response = check baseClient->/users/[userId]/muting.post( + payload={ + target_user_id:"1803011651249278976" + } + ); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("12"); + io:println(response); +} + +//Test Unmute a Specific User +@test:Config { +} +isolated function unmuteSpecificUser() returns error? { + MuteUserMutationResponse response = check baseClient->/users/[userId]/muting/["1803011651249278976"].delete(); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("13"); + io:println(response); +} diff --git a/gradle.properties b/gradle.properties index c20a9ad..6da8c1a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,5 +9,5 @@ downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 testngVersion=7.6.1 eclipseLsp4jVersion=0.12.0 -ballerinaGradlePluginVersion=2.2.4 +ballerinaGradlePluginVersion=2.2.7-SNAPSHOT ballerinaLangVersion=2201.9.0 From 1ff9d7d99b7a4ac6dc7ccbaeb75c25b51b118635 Mon Sep 17 00:00:00 2001 From: loshan Date: Tue, 2 Jul 2024 11:38:33 +0530 Subject: [PATCH 05/15] Add generated mock server and sanitized OpenAPI file --- .../modules/mock/openapi_mock_service.bal | 147 + ballerina/modules/mock/types.bal | 1424 +++ docs/spec/openapi_MOCK.json | 10591 ++++++++++++++++ 3 files changed, 12162 insertions(+) create mode 100644 ballerina/modules/mock/openapi_mock_service.bal create mode 100644 ballerina/modules/mock/types.bal create mode 100644 docs/spec/openapi_MOCK.json diff --git a/ballerina/modules/mock/openapi_mock_service.bal b/ballerina/modules/mock/openapi_mock_service.bal new file mode 100644 index 0000000..e5194cd --- /dev/null +++ b/ballerina/modules/mock/openapi_mock_service.bal @@ -0,0 +1,147 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; + +listener http:Listener ep0 = new (443, config = {host: "api.twitter.com"}); + +service / on ep0 { + resource function get '2/compliance/jobs("tweets"|"users" 'type, "created"|"in_progress"|"failed"|"complete"? status, ("created_at"|"download_expires_at"|"download_url"|"id"|"name"|"resumable"|"status"|"type"|"upload_expires_at"|"upload_url")[]? compliance_job\.fields) returns Get2ComplianceJobsResponse|http:Response { + } + + resource function get '2/dm_events(PaginationToken32? pagination_token, ("attachments"|"created_at"|"dm_conversation_id"|"entities"|"event_type"|"id"|"participant_ids"|"referenced_tweets"|"sender_id"|"text")[]? dm_event\.fields, ("attachments.media_keys"|"participant_ids"|"referenced_tweets.id"|"sender_id")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, int:Signed32 max_results = 100, ("MessageCreate"|"ParticipantsJoin"|"ParticipantsLeave")[] event_types = ["MessageCreate", "ParticipantsLeave", "ParticipantsJoin"]) returns Get2DmEventsResponse|http:Response { + } + + resource function get '2/likes/compliance/'stream(int:Signed32? backfill_minutes, string? start_time, string? end_time) returns LikesComplianceStreamResponse|http:Response { + } + + resource function get '2/likes/firehose/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("created_at"|"id"|"liked_tweet_author_id"|"liked_tweet_id"|"timestamp_ms")[]? like_with_tweet_author\.fields, ("liked_tweet_author_id"|"liked_tweet_id")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns StreamingLikeResponseV2|http:Response { + } + + resource function get '2/likes/sample10/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("created_at"|"id"|"liked_tweet_author_id"|"liked_tweet_id"|"timestamp_ms")[]? like_with_tweet_author\.fields, ("liked_tweet_author_id"|"liked_tweet_id")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns StreamingLikeResponseV2|http:Response { + } + + resource function get '2/openapi\.json() returns record {} { + } + + resource function get '2/spaces(string[] ids, ("created_at"|"creator_id"|"ended_at"|"host_ids"|"id"|"invited_user_ids"|"is_ticketed"|"lang"|"participant_count"|"scheduled_start"|"speaker_ids"|"started_at"|"state"|"subscriber_count"|"title"|"topic_ids"|"updated_at")[]? space\.fields, ("creator_id"|"host_ids"|"invited_user_ids"|"speaker_ids"|"topic_ids")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("description"|"id"|"name")[]? topic\.fields) returns Get2SpacesResponse|http:Response { + } + + resource function get '2/spaces/'by/creator_ids(UserId[] user_ids, ("created_at"|"creator_id"|"ended_at"|"host_ids"|"id"|"invited_user_ids"|"is_ticketed"|"lang"|"participant_count"|"scheduled_start"|"speaker_ids"|"started_at"|"state"|"subscriber_count"|"title"|"topic_ids"|"updated_at")[]? space\.fields, ("creator_id"|"host_ids"|"invited_user_ids"|"speaker_ids"|"topic_ids")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("description"|"id"|"name")[]? topic\.fields) returns Get2SpacesByCreatorIdsResponse|http:Response { + } + + resource function get '2/spaces/search(string query, ("created_at"|"creator_id"|"ended_at"|"host_ids"|"id"|"invited_user_ids"|"is_ticketed"|"lang"|"participant_count"|"scheduled_start"|"speaker_ids"|"started_at"|"state"|"subscriber_count"|"title"|"topic_ids"|"updated_at")[]? space\.fields, ("creator_id"|"host_ids"|"invited_user_ids"|"speaker_ids"|"topic_ids")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("description"|"id"|"name")[]? topic\.fields, "live"|"scheduled"|"all" state = "all", int:Signed32 max_results = 100) returns Get2SpacesSearchResponse|http:Response { + } + + resource function get '2/tweets(TweetId[] ids, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns Get2TweetsResponse|http:Response { + Get2TweetsResponse response = { + "data": [ + { + "author_id": "2244994945", + "created_at": "Wed Jan 06 18:40:40 +0000 2021", + "id": "1346889436626259968", + "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i", + "username": "XDevelopers" + } + ] + }; + return response; + } + + resource function get '2/tweets/compliance/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time) returns TweetComplianceStreamResponse|http:Response { + } + + resource function get '2/tweets/counts/all(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, ("end"|"start"|"tweet_count")[]? search_count\.fields, "minute"|"hour"|"day" granularity = "hour") returns Get2TweetsCountsAllResponse|http:Response { + } + + resource function get '2/tweets/counts/recent(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, ("end"|"start"|"tweet_count")[]? search_count\.fields, "minute"|"hour"|"day" granularity = "hour") returns Get2TweetsCountsRecentResponse|http:Response { + } + + resource function get '2/tweets/firehose/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/firehose/'stream/lang/en(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/firehose/'stream/lang/ja(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/firehose/'stream/lang/ko(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/firehose/'stream/lang/pt(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/label/'stream(int:Signed32? backfill_minutes, string? start_time, string? end_time) returns TweetLabelStreamResponse|http:Response { + } + + resource function get '2/tweets/sample/'stream(int:Signed32? backfill_minutes, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/sample10/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns Get2TweetsSample10StreamResponse|http:Response { + } + + resource function get '2/tweets/search/'stream(int:Signed32? backfill_minutes, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns FilteredStreamingTweetResponse|http:Response { + } + + resource function get '2/tweets/search/'stream/rules(RuleId[]? ids, string? pagination_token, int:Signed32 max_results = 1000) returns RulesLookupResponse|http:Response { + } + + resource function get '2/tweets/search/'stream/rules/counts(("all_project_client_apps"|"cap_per_client_app"|"cap_per_project"|"client_app_rules_count"|"project_rules_count")[]? rules_count\.fields) returns Get2TweetsSearchStreamRulesCountsResponse|http:Response { + } + + resource function get '2/tweets/search/all(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, "recency"|"relevancy"? sort_order, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields, int:Signed32 max_results = 10) returns Get2TweetsSearchAllResponse|http:Response { + } + + resource function get '2/tweets/search/recent(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, "recency"|"relevancy"? sort_order, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields, int:Signed32 max_results = 10) returns Get2TweetsSearchRecentResponse|http:Response { + } + + resource function get '2/usage/tweets(("cap_reset_day"|"daily_client_app_usage"|"daily_project_usage"|"project_cap"|"project_id"|"project_usage")[]? usage\.fields, int:Signed32 days = 7) returns Get2UsageTweetsResponse|http:Response { + } + + resource function get '2/users(UserId[] ids, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersResponse|http:Response { + } + + resource function get '2/users/'by(string[] usernames, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersByResponse|http:Response { + } + + resource function get '2/users/compliance/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time) returns UserComplianceStreamResponse|http:Response { + } + + resource function get '2/users/me(("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersMeResponse|http:Response { + } + + resource function get '2/users/search(UserSearchQuery query, PaginationToken36? next_token, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, int:Signed32 max_results = 100) returns Get2UsersSearchResponse|http:Response { + } + + resource function post '2/compliance/jobs(@http:Payload CreateComplianceJobRequest payload) returns OkCreateComplianceJobResponse|http:Response { + } + + resource function post '2/dm_conversations(@http:Payload CreateDmConversationRequest payload) returns CreateDmEventResponse|http:Response { + } + + resource function post '2/lists(@http:Payload ListCreateRequest payload) returns OkListCreateResponse|http:Response { + } + + resource function post '2/tweets(@http:Payload TweetCreateRequest payload) returns TweetCreateResponse|http:Response { + } + + resource function post '2/tweets/search/'stream/rules(boolean? dry_run, boolean? delete_all, @http:Payload AddOrDeleteRulesRequest payload) returns OkAddOrDeleteRulesResponse|http:Response { + } +} diff --git a/ballerina/modules/mock/types.bal b/ballerina/modules/mock/types.bal new file mode 100644 index 0000000..dc07cec --- /dev/null +++ b/ballerina/modules/mock/types.bal @@ -0,0 +1,1424 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/constraint; +import ballerina/http; + +public type Get2DmConversationsIdDmEventsResponse_meta record { + NextToken next_token?; + PreviousToken previous_token?; + ResultCount result_count?; +}; + +# The previous token. +@constraint:String {minLength: 1} +public type PreviousToken string; + +# Creation time of the compliance job. +public type CreatedAt string; + +public type UnlikeComplianceSchema record { + # Event time. + string event_at; + UnlikeComplianceSchema_favorite favorite; +}; + +public type UserComplianceSchema record { + # Event time. + string event_at; + UserComplianceSchema_user user; +}; + +public type OkCreateComplianceJobResponse record {| + *http:Ok; + CreateComplianceJobResponse body; + map headers; +|}; + +public type Tweet_edit_controls record { + # Time when Tweet is no longer editable. + string editable_until; + # Number of times this Tweet can be edited. + int edits_remaining; + # Indicates if this Tweet is eligible to be edited. + boolean is_edit_eligible; +}; + +public type TweetUnviewableSchema record { + TweetUnviewable public_tweet_unviewable; +}; + +# HTTP Status Code. +@constraint:Int {minValue: 100, maxValue: 599} +public type HttpStatusCode int; + +# Specifies the type of attachments (if any) present in this Tweet. +public type Tweet_attachments record { + # A list of Media Keys for each one of the media attachments (if media are attached). + @constraint:Array {minLength: 1} + MediaKey[] media_keys?; + # A list of Posts the media on this Tweet was originally posted in. For example, if the media on a tweet is re-used in another Tweet, this refers to the original, source Tweet.. + @constraint:Array {minLength: 1} + TweetId[] media_source_tweet_id?; + # A list of poll IDs (if polls are attached). + @constraint:Array {minLength: 1} + PollId[] poll_ids?; +}; + +# Tweet label data. +public type TweetLabelData TweetNoticeSchema|TweetUnviewableSchema; + +public type UserScrubGeoObjectSchema record { + # Event time. + string event_at; + TweetId up_to_tweet_id; + UserComplianceSchema_user user; +}; + +# A request to create a new batch compliance job. +public type CreateComplianceJobRequest record { + ComplianceJobName name?; + # If true, this endpoint will return a pre-signed URL with resumable uploads enabled. + boolean resumable?; + # Type of compliance job to list. + "tweets"|"users" 'type; +}; + +# +public type Space record { + # Creation time of the Space. + string created_at?; + UserId creator_id?; + # End time of the Space. + string ended_at?; + # The user ids for the hosts of the Space. + UserId[] host_ids?; + SpaceId id; + # An array of user ids for people who were invited to a Space. + UserId[] invited_user_ids?; + # Denotes if the Space is a ticketed Space. + boolean is_ticketed?; + # The language of the Space. + string lang?; + # The number of participants in a Space. + int:Signed32 participant_count?; + # A date time stamp for when a Space is scheduled to begin. + string scheduled_start?; + # An array of user ids for people who were speakers in a Space. + UserId[] speaker_ids?; + # When the Space was started as a date string. + string started_at?; + # The current state of the Space. + "live"|"scheduled"|"ended" state; + # The number of people who have either purchased a ticket or set a reminder for this Space. + int:Signed32 subscriber_count?; + # The title of the Space. + string title?; + # The topics of a Space, as selected by its creator. + Space_topics[] topics?; + # When the Space was last updated. + string updated_at?; +}; + +# Expanded details for the URL specified in the User's profile, with start and end indices. +public type User_entities_url record { + @constraint:Array {minLength: 1} + UrlEntity[] urls?; +}; + +# A response from deleting user-specified stream filtering rules. +public type DeleteRulesRequest record { + DeleteRulesRequest_delete delete; +}; + +# A request to add a user-specified stream filtering rule. +public type AddRulesRequest record { + RuleNoId[] add; +}; + +# Place ID being attached to the Tweet for geo location. +public type TweetCreateRequest_geo record {| + string place_id?; +|}; + +# Represent the portion of text recognized as a URL, and its start and end position within the text. +public type UrlEntityDm record { + *EntityIndicesInclusiveExclusive; + *UrlFields; +}; + +# Annotation inferred from the Tweet text. +public type ContextAnnotation record { + ContextAnnotationDomainFields domain; + ContextAnnotationEntityFields entity; +}; + +public type UserComplianceSchema_user record { + UserId id; +}; + +# Represent the portion of text recognized as a URL, and its start and end position within the text. +public type UrlEntity record { + *EntityIndicesInclusiveExclusive; + *UrlFields; +}; + +# Represent the portion of text recognized as a User mention, and its start and end position within the text. +public type MentionFields record { + UserId id?; + UserName username; +}; + +public type CreateDmConversationRequest record {| + # The conversation type that is being created. + "Group" conversation_type; + CreateMessageRequest message; + DmParticipants participant_ids; +|}; + +# Represents the data for the context annotation entity. +public type ContextAnnotationEntityFields record { + # Description of the context annotation entity. + string description?; + # The unique id for a context annotation entity. + @constraint:String {pattern: re `^[0-9]{1,19}$`} + string id; + # Name of the context annotation entity. + string name?; +}; + +public type Get2UsersSearchResponse record { + @constraint:Array {minLength: 1} + User[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + Get2UsersSearchResponse_meta meta?; +}; + +public type ListCreateResponse record { + ListCreateResponse_data data?; + @constraint:Array {minLength: 1} + Problem[] errors?; +}; + +public type CreateDmEventResponse record { + CreateDmEventResponse_data data?; + @constraint:Array {minLength: 1} + Problem[] errors?; +}; + +# Unique identifier of a DM Event. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type DmEventId string; + +public type DmEvent record { + DmEvent_attachments attachments?; + @constraint:Array {minLength: 1} + CashtagEntity[] cashtags?; + string created_at?; + DmConversationId dm_conversation_id?; + string event_type; + @constraint:Array {minLength: 1} + HashtagEntity[] hashtags?; + DmEventId id; + @constraint:Array {minLength: 1} + MentionEntity[] mentions?; + # A list of participants for a ParticipantsJoin or ParticipantsLeave event_type. + @constraint:Array {minLength: 1} + UserId[] participant_ids?; + # A list of Posts this DM refers to. + @constraint:Array {minLength: 1} + DmEvent_referenced_tweets[] referenced_tweets?; + UserId sender_id?; + string text?; + @constraint:Array {minLength: 1} + UrlEntityDm[] urls?; +}; + +public type LikeComplianceSchema record { + UnlikeComplianceSchema delete; +}; + +public type Get2TweetsResponse record { + @constraint:Array {minLength: 1} + Tweet[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +public type DmEvent_referenced_tweets record { + TweetId id; +}; + +# Client App Rule Counts for all applications in the project +public type AllProjectClientApps AppRulesCount[]; + +# The daily usage breakdown for a project +public type Usage_daily_project_usage record { + # The unique identifier for this project + int:Signed32 project_id?; + # The usage value + @constraint:Array {minLength: 1} + UsageFields[] usage?; +}; + +# Specifies the type of attachments (if any) present in this DM. +public type DmEvent_attachments record { + # A list of card IDs (if cards are attached). + @constraint:Array {minLength: 1} + string[] card_ids?; + # A list of Media Keys for each one of the media attachments (if media are attached). + @constraint:Array {minLength: 1} + MediaKey[] media_keys?; +}; + +public type Get2TweetsSearchStreamRulesCountsResponse record { + RulesCount data?; + @constraint:Array {minLength: 1} + Problem[] errors?; +}; + +public type Expansions record { + @constraint:Array {minLength: 1} + Media[] media?; + @constraint:Array {minLength: 1} + Place[] places?; + @constraint:Array {minLength: 1} + Poll[] polls?; + @constraint:Array {minLength: 1} + Topic[] topics?; + @constraint:Array {minLength: 1} + Tweet[] tweets?; + @constraint:Array {minLength: 1} + User[] users?; +}; + +public type TweetCreateResponse_data record { + TweetId id; + TweetText text; +}; + +public type UserDeleteComplianceSchema record { + UserComplianceSchema user_delete; +}; + +public type Get2TweetsCountsAllResponse record { + @constraint:Array {minLength: 1} + SearchCount[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Get2TweetsCountsAllResponse_meta meta?; +}; + +# User-provided name for a compliance job. +@constraint:String {maxLength: 64} +public type ComplianceJobName string; + +# Nonpublic engagement metrics for the Tweet at the time of the request. +public type Tweet_non_public_metrics record { + # Number of times this Tweet has been viewed. + int:Signed32 impression_count?; +}; + +public type Tweet_referenced_tweets record { + TweetId id; + "retweeted"|"quoted"|"replied_to" 'type; +}; + +public type TweetDropComplianceSchema record { + TweetComplianceSchema drop; +}; + +# The sum of results returned in this response. +public type Aggregate int:Signed32; + +public type Place record { + @constraint:Array {minLength: 1} + PlaceId[] contained_within?; + # The full name of the county in which this place exists. + string country?; + CountryCode country_code?; + # The full name of this place. + string full_name; + Geo geo?; + PlaceId id; + # The human readable name of this place. + string name?; + PlaceType place_type?; +}; + +public type UserUnprotectComplianceSchema record { + UserComplianceSchema user_unprotect; +}; + +# User compliance stream events. +public type UserComplianceStreamResponse record {UserComplianceData data;}|record {Problem[] errors;}; + +public type PlaceType "poi"|"neighborhood"|"city"|"admin"|"country"|"unknown"; + +# The start time of the bucket. +public type Start string; + +public type Tweet record { + Tweet_attachments attachments?; + UserId author_id?; + @constraint:Array {minLength: 1} + ContextAnnotation[] context_annotations?; + TweetId conversation_id?; + # Creation time of the Tweet. + string created_at?; + Tweet_edit_controls edit_controls?; + # A list of Tweet Ids in this Tweet chain. + @constraint:Array {minLength: 1} + TweetId[] edit_history_tweet_ids?; + FullTextEntities entities?; + Tweet_geo geo?; + TweetId id?; + UserId in_reply_to_user_id?; + # Language of the Tweet, if detected by X. Returned as a BCP47 language tag. + string lang?; + Tweet_non_public_metrics non_public_metrics?; + Tweet_note_tweet note_tweet?; + Tweet_organic_metrics organic_metrics?; + # Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences. + boolean possibly_sensitive?; + Tweet_promoted_metrics promoted_metrics?; + Tweet_public_metrics public_metrics?; + # A list of Posts this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent. + @constraint:Array {minLength: 1} + Tweet_referenced_tweets[] referenced_tweets?; + ReplySettingsWithVerifiedUsers reply_settings?; + Tweet_scopes scopes?; + # This is deprecated. + string 'source?; + TweetText text?; + UserName username?; + TweetWithheld withheld?; +}; + +# Type of compliance job to list. +public type ComplianceJobType "tweets"|"users"; + +# A base32 pagination token. +@constraint:String {minLength: 16} +public type PaginationToken32 string; + +# Participants for the DM Conversation. +@constraint:Array {maxLength: 49, minLength: 2} +public type DmParticipants UserId[]; + +# The ID of the client application +@constraint:String {maxLength: 19, minLength: 1} +public type ClientAppId string; + +# The unique identifier of this Like. +@constraint:String {pattern: re `^[A-Za-z0-9_]{1,40}$`} +public type LikeId string; + +# Represent the portion of text recognized as a Hashtag, and its start and end position within the text. +public type HashtagFields record { + # The text of the Hashtag. + string tag; +}; + +public type TweetWithheldComplianceSchema record { + TweetTakedownComplianceSchema withheld; +}; + +# URL from which the user will retrieve their compliance results. +public type DownloadUrl string; + +@constraint:String {maxLength: 25, minLength: 1} +public type TweetCreateRequest_pollOptionsItemsString string; + +# A user-provided stream filtering rule. +public type RuleNoId record { + RuleTag tag?; + RuleValue value; +}; + +public type UserProfileModificationObjectSchema record { + # Event time. + string event_at; + string new_value; + string profile_field; + UserComplianceSchema_user user; +}; + +public type Get2UsersByResponse record { + @constraint:Array {minLength: 1} + User[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +public type Get2TweetsCountsRecentResponse record { + @constraint:Array {minLength: 1} + SearchCount[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Get2TweetsCountsAllResponse_meta meta?; +}; + +# The unique identifier of this Media. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type MediaId string; + +# An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807). +public type Problem record { + string detail?; + int status?; + string title; + string 'type; +}; + +public type UnlikeComplianceSchema_favorite record { + TweetId id; + UserId user_id; +}; + +# The end time of the bucket. +public type End string; + +public type FilteredStreamingTweetResponse_matching_rules record { + RuleId id; + RuleTag tag?; +}; + +# A count of user-provided stream filtering rules at the application and project levels. +public type RulesCount record { + AllProjectClientApps all_project_client_apps?; + # Cap of number of rules allowed per client application + int:Signed32 cap_per_client_app?; + # Cap of number of rules allowed per project + int:Signed32 cap_per_project?; + AppRulesCount client_app_rules_count?; + # Number of rules for project + int:Signed32 project_rules_count?; +}; + +# URL to which the user will upload their Tweet or user IDs. +public type UploadUrl string; + +# A list of metadata found in the User's profile description. +public type User_entities record { + FullTextEntities description?; + User_entities_url url?; +}; + +public type RulesResponseMetadata record { + NextToken next_token?; + # Number of Rules in result set. + int:Signed32 result_count?; + string sent; + RulesRequestSummary summary?; +}; + +# Promoted nonpublic engagement metrics for the Tweet at the time of the request. +public type Tweet_promoted_metrics record { + # Number of times this Tweet has been viewed. + int:Signed32 impression_count?; + # Number of times this Tweet has been liked. + int:Signed32 like_count?; + # Number of times this Tweet has been replied to. + int:Signed32 reply_count?; + # Number of times this Tweet has been Retweeted. + int:Signed32 retweet_count?; +}; + +# The content of the Tweet. +public type TweetText string; + +# A list of metrics for this User. +public type User_public_metrics record { + # Number of Users who are following this User. + int followers_count; + # Number of Users this User is following. + int following_count; + # The number of likes created by this User. + int like_count?; + # The number of lists that include this User. + int listed_count; + # The number of Posts (including Retweets) posted by this User. + int tweet_count; +}; + +public type TweetComplianceSchema_tweet record { + UserId author_id; + TweetId id; +}; + +# The text of a poll choice. +@constraint:String {maxLength: 25, minLength: 1} +public type PollOptionLabel string; + +public type AddOrDeleteRulesRequest AddRulesRequest|DeleteRulesRequest; + +public type RulesLookupResponse record { + Rule[] data?; + RulesResponseMetadata meta; +}; + +public type CreateDmEventResponse_data record { + DmConversationId dm_conversation_id; + DmEventId dm_event_id; +}; + +public type Get2SpacesResponse record { + @constraint:Array {minLength: 1} + Space[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +public type FullTextEntities record { + @constraint:Array {minLength: 1} + record {*EntityIndicesInclusiveInclusive; string normalized_text?; decimal probability?; string 'type?;}[] annotations?; + @constraint:Array {minLength: 1} + CashtagEntity[] cashtags?; + @constraint:Array {minLength: 1} + HashtagEntity[] hashtags?; + @constraint:Array {minLength: 1} + MentionEntity[] mentions?; + @constraint:Array {minLength: 1} + UrlEntity[] urls?; +}; + +# Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive. +public type EntityIndicesInclusiveExclusive record { + # Index (zero-based) at which position this entity ends. The index is exclusive. + @constraint:Int {minValue: 0} + int end; + # Index (zero-based) at which position this entity starts. The index is inclusive. + @constraint:Int {minValue: 0} + int 'start; +}; + +# Describes a choice in a Poll object. +public type PollOption record { + PollOptionLabel label; + # Position of this choice in the poll. + int position; + # Number of users who voted for this choice. + int votes; +}; + +# The the search string by which to query for users. +@constraint:String {pattern: re `^[A-Za-z0-9_]{1,32}$`} +public type UserSearchQuery string; + +# The X handle (screen name) of this user. +@constraint:String {pattern: re `^[A-Za-z0-9_]{1,15}$`} +public type UserName string; + +# The X Topic object. +public type Space_topics record { + # The description of the given topic. + string description?; + # An ID suitable for use in the REST API. + string id; + # The name of the given topic. + string name; +}; + +public type Get2ComplianceJobsResponse record { + @constraint:Array {minLength: 1} + ComplianceJob[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Get2ComplianceJobsResponse_meta meta?; +}; + +# Usage per client app +public type ClientAppUsage record { + # The unique identifier for this project + string client_app_id?; + # The usage value + @constraint:Array {minLength: 1} + UsageFields[] usage?; + # The number of results returned + int:Signed32 usage_result_count?; +}; + +# Tweet information of the Tweet being replied to. +public type TweetCreateRequest_reply record {| + # A list of User Ids to be excluded from the reply Tweet. + UserId[] exclude_reply_user_ids?; + TweetId in_reply_to_tweet_id; +|}; + +public type CreateAttachmentsMessageRequest record { + DmAttachments attachments; + # Text of the message. + @constraint:String {minLength: 1} + string text?; +}; + +public type StreamingTweetResponse record { + Tweet data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +# Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). +public type TweetWithheld record { + # Indicates if the content is being withheld for on the basis of copyright infringement. + boolean copyright; + # Provides a list of countries where this content is not available. + @constraint:Array {minLength: 1} + CountryCode[] country_codes; + # Indicates whether the content being withheld is the `tweet` or a `user`. + "tweet"|"user" scope?; +}; + +# IDs and values of all deleted user-specified stream filtering rules. +public type DeleteRulesRequest_delete record { + # IDs of all deleted user-specified stream filtering rules. + RuleId[] ids?; + # Values of all deleted user-specified stream filtering rules. + RuleValue[] values?; +}; + +# A count of user-provided stream filtering rules at the client application level. +public type AppRulesCount record { + ClientAppId client_app_id?; + # Number of rules for client application + int:Signed32 rule_count?; +}; + +public type UserProtectComplianceSchema record { + UserComplianceSchema user_protect; +}; + +@constraint:Number {minValue: -180, maxValue: 180} +public type GeoBboxItemsNumber decimal; + +# Tweet compliance stream events. +public type TweetComplianceStreamResponse record {TweetComplianceData data;}|record {Problem[] errors;}; + +public type UserWithheldComplianceSchema record { + UserTakedownComplianceSchema user_withheld; +}; + +public type DmMediaAttachment record { + MediaId media_id; +}; + +public type Tweet_note_tweet_entities record { + @constraint:Array {minLength: 1} + CashtagEntity[] cashtags?; + @constraint:Array {minLength: 1} + HashtagEntity[] hashtags?; + @constraint:Array {minLength: 1} + MentionEntity[] mentions?; + @constraint:Array {minLength: 1} + UrlEntity[] urls?; +}; + +# The number of results returned in this response. +public type ResultCount int:Signed32; + +# A Like event, with the tweet author user and the tweet being liked +public type LikeWithTweetAuthor record { + # Creation time of the Tweet. + string created_at?; + LikeId id?; + TweetId liked_tweet_id?; + # Timestamp in milliseconds of creation. + int:Signed32 timestamp_ms?; + UserId tweet_author_id?; +}; + +public type UserSuspendComplianceSchema record { + UserComplianceSchema user_suspend; +}; + +public type CashtagEntity record { + *EntityIndicesInclusiveExclusive; + *CashtagFields; +}; + +# Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type TweetId string; + +public type HashtagEntity record { + *EntityIndicesInclusiveExclusive; + *HashtagFields; +}; + +# Organic nonpublic engagement metrics for the Tweet at the time of the request. +public type Tweet_organic_metrics record { + # Number of times this Tweet has been viewed. + int impression_count; + # Number of times this Tweet has been liked. + int like_count; + # Number of times this Tweet has been replied to. + int reply_count; + # Number of times this Tweet has been Retweeted. + int retweet_count; +}; + +# Expiration time of the download URL. +public type DownloadExpiration string; + +public type UserUndeleteComplianceSchema record { + UserComplianceSchema user_undelete; +}; + +public type ComplianceJob record { + CreatedAt created_at; + DownloadExpiration download_expires_at; + DownloadUrl download_url; + JobId id; + ComplianceJobName name?; + ComplianceJobStatus status; + ComplianceJobType 'type; + UploadExpiration upload_expires_at; + UploadUrl upload_url; +}; + +# A [GeoJson Position](https://tools.ietf.org/html/rfc7946#section-3.1.1) in the format `[longitude,latitude]`. +@constraint:Array {maxLength: 2, minLength: 2} +public type Position decimal[]; + +# The note content of the Tweet. +public type NoteTweetText string; + +# Represents the data for Usage +public type UsageFields record { + # The time period for the usage + string date?; + # The usage value + int:Signed32 usage?; +}; + +public type Geo record { + @constraint:Array {maxLength: 4, minLength: 4} + GeoBboxItemsNumber[] bbox; + Point geometry?; + record {} properties; + "Feature" 'type; +}; + +public type TweetEditComplianceObjectSchema record { + @constraint:Array {minLength: 1} + TweetId[] edit_tweet_ids; + # Event time. + string event_at; + TweetId initial_tweet_id; + DmEvent_referenced_tweets tweet; +}; + +public type Get2UsersMeResponse record { + User data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +# Tweet compliance data. +public type TweetComplianceData TweetDeleteComplianceSchema|TweetWithheldComplianceSchema|TweetDropComplianceSchema|TweetUndropComplianceSchema|TweetEditComplianceSchema; + +# A user-provided stream filtering rule. +public type Rule record { + RuleId id?; + RuleTag tag?; + RuleValue value; +}; + +public type RulesRequestSummary record {int:Signed32 created; int:Signed32 invalid; int:Signed32 not_created; int:Signed32 valid;}|record {int:Signed32 deleted; int:Signed32 not_deleted;}; + +# A X List is a curated group of accounts. +public type ListCreateResponse_data record { + ListId id; + # The name of this List. + string name; +}; + +public type TweetNoticeSchema record { + TweetNotice public_tweet_notice; +}; + +# User compliance data. +public type UserComplianceData UserProtectComplianceSchema|UserUnprotectComplianceSchema|UserDeleteComplianceSchema|UserUndeleteComplianceSchema|UserSuspendComplianceSchema|UserUnsuspendComplianceSchema|UserWithheldComplianceSchema|UserScrubGeoSchema|UserProfileModificationComplianceSchema; + +public type TweetNotice record { + # If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. + string application; + # Information shown on the Tweet label + string details?; + # Event time. + string event_at; + # The type of label on the Tweet + string event_type; + # Link to more information about this kind of label + string extended_details_url?; + # Title/header of the Tweet label + string label_title?; + TweetComplianceSchema_tweet tweet; +}; + +# A validly formatted URL. +public type Url string; + +public type CreateTextMessageRequest record { + DmAttachments attachments?; + # Text of the message. + @constraint:String {minLength: 1} + string text; +}; + +# The count for the bucket. +public type TweetCount int; + +# A tag meant for the labeling of user provided rules. +public type RuleTag string; + +public type FullTextEntitiesAnnotationsItemsnull record { + *EntityIndicesInclusiveInclusive; + string normalized_text?; + decimal probability?; + string 'type?; +}; + +public type StreamingLikeResponseV2 record { + LikeWithTweetAuthor data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +# Represent the portion of text recognized as a URL. +public type UrlFields record { + # Description of the URL landing page. + string description?; + # The URL as displayed in the X client. + string display_url?; + Url expanded_url?; + @constraint:Array {minLength: 1} + UrlImage[] images?; + MediaKey media_key?; + HttpStatusCode status?; + # Title of the page the URL points to. + string title?; + # Fully resolved url. + string unwound_url?; + Url url; +}; + +# Usage per client app +public type Usage record { + # Number of days left for the Tweet cap to reset + int:Signed32 cap_reset_day?; + # The daily usage breakdown for each Client Application a project + @constraint:Array {minLength: 1} + ClientAppUsage[] daily_client_app_usage?; + Usage_daily_project_usage daily_project_usage?; + # Total number of Posts that can be read in this project per month + int:Signed32 project_cap?; + # The unique identifier for this project + string project_id?; + # The number of Posts read in this project + int:Signed32 project_usage?; +}; + +public type TweetCreateRequest record {| + # Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link. + string card_uri?; + # Link to take the conversation from the public timeline to a private Direct Message. + string direct_message_deep_link?; + # Exclusive Tweet for super followers. + boolean for_super_followers_only = false; + TweetCreateRequest_geo geo?; + TweetCreateRequest_media media?; + # Nullcasted (promoted-only) Posts do not appear in the public timeline and are not served to followers. + boolean nullcast = false; + TweetCreateRequest_poll poll?; + TweetId quote_tweet_id?; + TweetCreateRequest_reply reply?; + # Settings to indicate who can reply to the Tweet. + "following"|"mentionedUsers"|"subscribers" reply_settings?; + TweetText text?; +|}; + +public type Get2SpacesSearchResponse record { + @constraint:Array {minLength: 1} + Space[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + Get2ComplianceJobsResponse_meta meta?; +}; + +public type TweetDeleteComplianceSchema record { + TweetComplianceSchema delete; +}; + +# Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, subscribers, verified and following. +public type ReplySettingsWithVerifiedUsers "everyone"|"mentionedUsers"|"following"|"other"|"subscribers"|"verified"; + +public type TweetComplianceSchema record { + # Event time. + string event_at; + TweetId quote_tweet_id?; + TweetComplianceSchema_tweet tweet; +}; + +# A base36 pagination token. +@constraint:String {minLength: 1} +public type PaginationToken36 string; + +# Engagement metrics for the Tweet at the time of the request. +public type Tweet_public_metrics record { + # Number of times this Tweet has been bookmarked. + int:Signed32 bookmark_count; + # Number of times this Tweet has been viewed. + int:Signed32 impression_count; + # Number of times this Tweet has been liked. + int like_count; + # Number of times this Tweet has been quoted. + int quote_count?; + # Number of times this Tweet has been replied to. + int reply_count; + # Number of times this Tweet has been Retweeted. + int retweet_count; +}; + +# Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is inclusive. +public type EntityIndicesInclusiveInclusive record { + # Index (zero-based) at which position this entity ends. The index is inclusive. + @constraint:Int {minValue: 0} + int end; + # Index (zero-based) at which position this entity starts. The index is inclusive. + @constraint:Int {minValue: 0} + int 'start; +}; + +public type Get2TweetsSearchAllResponse record { + @constraint:Array {minLength: 1} + Tweet[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + Get2TweetsSearchAllResponse_meta meta?; +}; + +public type TweetTakedownComplianceSchema record { + # Event time. + string event_at; + TweetId quote_tweet_id?; + TweetComplianceSchema_tweet tweet; + @constraint:Array {minLength: 1} + CountryCode[] withheld_in_countries; +}; + +# Likes compliance stream events. +public type LikesComplianceStreamResponse record {LikeComplianceSchema data;}|record {Problem[] errors;}; + +public type Get2TweetsSample10StreamResponse record { + Tweet data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; + +# Represent the information for the URL image. +public type UrlImage record { + MediaHeight height?; + Url url?; + MediaWidth width?; +}; + +# The newest id in this response. +public type NewestId string; + +# Unique identifier of this poll. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type PollId string; + +public type Get2TweetsSearchRecentResponse record { + @constraint:Array {minLength: 1} + Tweet[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + Get2TweetsSearchAllResponse_meta meta?; +}; + +# Attachments to a DM Event. +public type DmAttachments DmMediaAttachment[]; + +# The filterlang value of the rule. +public type RuleValue string; + +# Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations. +@constraint:String {pattern: re `^([0-9]{1,19}-[0-9]{1,19}|[0-9]{15,19})$`} +public type DmConversationId string; + +# Represent the portion of text recognized as a Cashtag, and its start and end position within the text. +public type CashtagFields record { + string tag; +}; + +public type UserScrubGeoSchema record { + UserScrubGeoObjectSchema scrub_geo; +}; + +public type Get2DmEventsResponse record { + @constraint:Array {minLength: 1} + DmEvent[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + Get2DmConversationsIdDmEventsResponse_meta meta?; +}; + +public type Get2UsageTweetsResponse record { + Usage data?; + @constraint:Array {minLength: 1} + Problem[] errors?; +}; + +# The width of the media in pixels. +@constraint:Int {minValue: 0} +public type MediaWidth int; + +# Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI. +public type TweetCreateRequest_media record {| + # A list of Media Ids to be attached to a created Tweet. + @constraint:Array {maxLength: 4, minLength: 1} + MediaId[] media_ids; + # A list of User Ids to be tagged in the media for created Tweet. + @constraint:Array {maxLength: 10} + UserId[] tagged_user_ids?; +|}; + +public type Get2SpacesByCreatorIdsResponse record { + @constraint:Array {minLength: 1} + Space[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + Get2ComplianceJobsResponse_meta meta?; +}; + +# The oldest id in this response. +public type OldestId string; + +public type CreateComplianceJobResponse record { + ComplianceJob data?; + @constraint:Array {minLength: 1} + Problem[] errors?; +}; + +# Represent a Search Count Result. +public type SearchCount record { + End end; + Start 'start; + TweetCount tweet_count; +}; + +# The identifier for this place. +public type PlaceId string; + +# Represents the data for the context annotation domain. +public type ContextAnnotationDomainFields record { + # Description of the context annotation domain. + string description?; + # The unique id for a context annotation domain. + @constraint:String {pattern: re `^[0-9]{1,19}$`} + string id; + # Name of the context annotation domain. + string name?; +}; + +# The scopes for this tweet +public type Tweet_scopes record { + # Indicates if this Tweet is viewable by followers without the Tweet ID + boolean followers?; +}; + +public type Get2TweetsSearchAllResponse_meta record { + NewestId newest_id?; + NextToken next_token?; + OldestId oldest_id?; + ResultCount result_count?; +}; + +public type OkListCreateResponse record {| + *http:Ok; + ListCreateResponse body; + map headers; +|}; + +public type Media record { + MediaHeight height?; + MediaKey media_key?; + string 'type; + MediaWidth width?; +}; + +# The full-content of the Tweet, including text beyond 280 characters. +public type Tweet_note_tweet record { + Tweet_note_tweet_entities entities?; + NoteTweetText text?; +}; + +# A response from modifying user-specified stream filtering rules. +public type AddOrDeleteRulesResponse record { + # All user-specified stream filtering rules that were created. + Rule[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + RulesResponseMetadata meta; +}; + +# The location tagged on the Tweet, if the user provided one. +public type Tweet_geo record { + Point coordinates?; + PlaceId place_id?; +}; + +# Status of a compliance job. +public type ComplianceJobStatus "created"|"in_progress"|"failed"|"complete"|"expired"; + +public type CreateMessageRequest CreateTextMessageRequest|CreateAttachmentsMessageRequest; + +# Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI. +public type TweetCreateRequest_poll record {| + # Duration of the poll in minutes. + @constraint:Int {minValue: 5, maxValue: 10080} + int:Signed32 duration_minutes; + @constraint:Array {maxLength: 4, minLength: 2} + TweetCreateRequest_pollOptionsItemsString[] options; + # Settings to indicate who can reply to the Tweet. + "following"|"mentionedUsers" reply_settings?; +|}; + +public type TweetCreateResponse record { + TweetCreateResponse_data data?; + @constraint:Array {minLength: 1} + Problem[] errors?; +}; + +# The height of the media in pixels. +@constraint:Int {minValue: 0} +public type MediaHeight int; + +public type TweetUndropComplianceSchema record { + TweetComplianceSchema undrop; +}; + +# The X User object. +public type User record { + # Returns detailed information about the relationship between two users. + ("follow_request_received"|"follow_request_sent"|"blocking"|"followed_by"|"following"|"muting")[] connection_status?; + # Creation time of this User. + string created_at?; + # The text of this User's profile description (also known as bio), if the User provided one. + string description?; + User_entities entities?; + UserId id; + # The location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries. + string location?; + TweetId most_recent_tweet_id?; + # The friendly name of this User, as shown on their profile. + string name; + TweetId pinned_tweet_id?; + # The URL to the profile image for this User. + string profile_image_url?; + # Indicates if this User has chosen to protect their Posts (in other words, if this User's Posts are private). + boolean protected?; + User_public_metrics public_metrics?; + # Indicates if you can send a DM to this User + boolean receives_your_dm?; + # The X Blue subscription type of the user, eg: Basic, Premium, PremiumPlus or None. + "Basic"|"Premium"|"PremiumPlus"|"None" subscription_type?; + # The URL specified in the User's profile. + string url?; + UserName username; + # Indicate if this User is a verified X User. + boolean verified?; + # The X Blue verified type of the user, eg: blue, government, business or none. + "blue"|"government"|"business"|"none" verified_type?; + UserWithheld withheld?; +}; + +# Tweet label stream events. +public type TweetLabelStreamResponse record {TweetLabelData data;}|record {Problem[] errors;}; + +# A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched. +public type FilteredStreamingTweetResponse record { + Tweet data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; + # The list of rules which matched the Tweet + FilteredStreamingTweetResponse_matching_rules[] matching_rules?; +}; + +# The next token. +@constraint:String {minLength: 1} +public type NextToken string; + +# Unique identifier of this rule. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type RuleId string; + +public type UserTakedownComplianceSchema record { + # Event time. + string event_at; + UserComplianceSchema_user user; + @constraint:Array {minLength: 1} + CountryCode[] withheld_in_countries; +}; + +# The Media Key identifier for this attachment. +@constraint:String {pattern: re `^([0-9]+)_([0-9]+)$`} +public type MediaKey string; + +# The unique identifier of this List. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type ListId string; + +public type UserUnsuspendComplianceSchema record { + UserComplianceSchema user_unsuspend; +}; + +# Unique identifier of this Topic. +public type TopicId string; + +public type TweetEditComplianceSchema record { + TweetEditComplianceObjectSchema tweet_edit; +}; + +# A two-letter ISO 3166-1 alpha-2 country code. +@constraint:String {pattern: re `^[A-Z]{2}$`} +public type CountryCode string; + +# The topic of a Space, as selected by its creator. +public type Topic record { + # The description of the given topic. + string description?; + TopicId id; + # The name of the given topic. + string name; +}; + +# Compliance Job ID. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type JobId string; + +public type TweetUnviewable record { + # If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. + string application; + # Event time. + string event_at; + TweetComplianceSchema_tweet tweet; +}; + +public type UserProfileModificationComplianceSchema record { + UserProfileModificationObjectSchema user_profile_modification; +}; + +public type MentionEntity record { + *EntityIndicesInclusiveExclusive; + *MentionFields; +}; + +public type Get2TweetsCountsAllResponse_meta record { + NewestId newest_id?; + NextToken next_token?; + OldestId oldest_id?; + Aggregate total_tweet_count?; +}; + +# The unique identifier of this Space. +@constraint:String {pattern: re `^[a-zA-Z0-9]{1,13}$`} +public type SpaceId string; + +# Expiration time of the upload URL. +public type UploadExpiration string; + +# A [GeoJson Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) geometry object. +public type Point record { + Position coordinates; + "Point" 'type; +}; + +public type OkAddOrDeleteRulesResponse record {| + *http:Ok; + AddOrDeleteRulesResponse body; + map headers; +|}; + +public type Get2ComplianceJobsResponse_meta record { + ResultCount result_count?; +}; + +public type ListCreateRequest record { + @constraint:String {maxLength: 100} + string description?; + @constraint:String {maxLength: 25, minLength: 1} + string name; + boolean 'private = false; +}; + +public type Get2UsersSearchResponse_meta record { + NextToken next_token?; + PreviousToken previous_token?; +}; + +# Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. +@constraint:String {pattern: re `^[0-9]{1,19}$`} +public type UserId string; + +# Represent a Poll attached to a Tweet. +public type Poll record { + @constraint:Int {minValue: 5, maxValue: 10080} + int:Signed32 duration_minutes?; + string end_datetime?; + PollId id; + @constraint:Array {maxLength: 4, minLength: 2} + PollOption[] options; + "open"|"closed" voting_status?; +}; + +# Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). +public type UserWithheld record { + # Provides a list of countries where this content is not available. + @constraint:Array {minLength: 1} + CountryCode[] country_codes; + # Indicates that the content being withheld is a `user`. + "user" scope?; +}; + +public type Get2UsersResponse record { + @constraint:Array {minLength: 1} + User[] data?; + @constraint:Array {minLength: 1} + Problem[] errors?; + Expansions includes?; +}; diff --git a/docs/spec/openapi_MOCK.json b/docs/spec/openapi_MOCK.json new file mode 100644 index 0000000..9feffbb --- /dev/null +++ b/docs/spec/openapi_MOCK.json @@ -0,0 +1,10591 @@ +{ + "openapi" : "3.0.0", + "info" : { + "description" : "Twitter API v2 available endpoints", + "version" : "2.102", + "title" : "Twitter API v2", + "termsOfService" : "https://developer.twitter.com/en/developer-terms/agreement-and-policy.html", + "contact" : { + "name" : "Twitter Developers", + "url" : "https://developer.twitter.com/" + }, + "license" : { + "name" : "Twitter Developer Agreement and Policy", + "url" : "https://developer.twitter.com/en/developer-terms/agreement-and-policy.html" + } + }, + "paths" : { + "/2/compliance/jobs" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Compliance" + ], + "summary" : "List Compliance Jobs", + "description" : "Returns recent Compliance Jobs for a given job type and optional job status", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs" + }, + "operationId" : "listBatchComplianceJobs", + "parameters" : [ + { + "name" : "type", + "in" : "query", + "description" : "Type of Compliance Job to list.", + "required" : true, + "schema" : { + "type" : "string", + "enum" : [ + "tweets", + "users" + ] + }, + "style" : "form" + }, + { + "name" : "status", + "in" : "query", + "description" : "Status of Compliance Job to list.", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "created", + "in_progress", + "failed", + "complete" + ] + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/ComplianceJobFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2ComplianceJobsResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + }, + "post" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Compliance" + ], + "summary" : "Create compliance job", + "description" : "Creates a compliance for the given job type", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs" + }, + "operationId" : "createBatchComplianceJob", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateComplianceJobRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateComplianceJobResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/dm_conversations" : { + "post" : { + "security" : [ + { + "OAuth2UserToken" : [ + "dm.write", + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Direct Messages" + ], + "summary" : "Create a new DM Conversation", + "description" : "Creates a new DM Conversation.", + "operationId" : "dmConversationIdCreate", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateDmConversationRequest" + } + } + } + }, + "responses" : { + "201" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateDmEventResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/dm_events" : { + "get" : { + "security" : [ + { + "OAuth2UserToken" : [ + "dm.read", + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Direct Messages" + ], + "summary" : "Get recent DM Events", + "description" : "Returns recent DM Events across DM conversations", + "operationId" : "getDmEvents", + "parameters" : [ + { + "name" : "max_results", + "in" : "query", + "description" : "The maximum number of results.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 100, + "format" : "int32", + "default" : 100 + }, + "style" : "form" + }, + { + "name" : "pagination_token", + "in" : "query", + "description" : "This parameter is used to get a specified 'page' of results.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken32" + }, + "style" : "form" + }, + { + "name" : "event_types", + "in" : "query", + "description" : "The set of event_types to include in the results.", + "required" : false, + "schema" : { + "type" : "array", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "MessageCreate", + "ParticipantsJoin", + "ParticipantsLeave" + ] + }, + "default" : [ + "MessageCreate", + "ParticipantsLeave", + "ParticipantsJoin" + ], + "example" : [ + "MessageCreate", + "ParticipantsLeave" + ] + }, + "explode" : false, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/DmEventFieldsParameter" + }, + { + "$ref" : "#/components/parameters/DmEventExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2DmEventsResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/likes/compliance/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Compliance" + ], + "summary" : "Likes Compliance stream", + "description" : "Streams 100% of compliance data for Users", + "operationId" : "getLikesComplianceStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Likes Compliance events will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Likes Compliance events will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/LikesComplianceStreamResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/likes/firehose/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Likes" + ], + "summary" : "Likes Firehose stream", + "description" : "Streams 100% of public Likes.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-likes-firehose-stream" + }, + "operationId" : "likesFirehoseStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 20, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Likes will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/LikeWithTweetAuthorFieldsParameter" + }, + { + "$ref" : "#/components/parameters/LikeWithTweetAuthorExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingLikeResponseV2" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/likes/sample10/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Likes" + ], + "summary" : "Likes Sample 10 stream", + "description" : "Streams 10% of public Likes.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/likes/firehose/api-reference/get-likes-sample10-stream" + }, + "operationId" : "likesSample10Stream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 2, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Likes will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/LikeWithTweetAuthorFieldsParameter" + }, + { + "$ref" : "#/components/parameters/LikeWithTweetAuthorExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingLikeResponseV2" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/lists" : { + "post" : { + "security" : [ + { + "OAuth2UserToken" : [ + "list.read", + "list.write", + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Lists" + ], + "summary" : "Create List", + "description" : "Creates a new List.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists" + }, + "operationId" : "listIdCreate", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListCreateRequest" + } + } + } + }, + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ListCreateResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/openapi.json" : { + "get" : { + "tags" : [ + "General" + ], + "summary" : "Returns the OpenAPI Specification document.", + "description" : "Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md)", + "operationId" : "getOpenApiSpec", + "parameters" : [ ], + "responses" : { + "200" : { + "description" : "The request was successful", + "content" : { + "application/json" : { + "schema" : { + "type" : "object" + } + } + } + } + } + } + }, + "/2/spaces" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "space.read", + "tweet.read", + "users.read" + ] + } + ], + "tags" : [ + "Spaces" + ], + "summary" : "Space lookup up Space IDs", + "description" : "Returns a variety of information about the Spaces specified by the requested IDs", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces" + }, + "operationId" : "findSpacesByIds", + "parameters" : [ + { + "name" : "ids", + "in" : "query", + "description" : "The list of Space IDs to return.", + "required" : true, + "schema" : { + "type" : "array", + "minItems" : 1, + "maxItems" : 100, + "items" : { + "type" : "string", + "description" : "The unique identifier of this Space.", + "pattern" : "^[a-zA-Z0-9]{1,13}$", + "example" : "1SLjjRYNejbKM" + } + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/SpaceFieldsParameter" + }, + { + "$ref" : "#/components/parameters/SpaceExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TopicFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2SpacesResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/spaces/by/creator_ids" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "space.read", + "tweet.read", + "users.read" + ] + } + ], + "tags" : [ + "Spaces" + ], + "summary" : "Space lookup by their creators", + "description" : "Returns a variety of information about the Spaces created by the provided User IDs", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids" + }, + "operationId" : "findSpacesByCreatorIds", + "parameters" : [ + { + "name" : "user_ids", + "in" : "query", + "description" : "The IDs of Users to search through.", + "required" : true, + "schema" : { + "type" : "array", + "minItems" : 1, + "maxItems" : 100, + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/SpaceFieldsParameter" + }, + { + "$ref" : "#/components/parameters/SpaceExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TopicFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2SpacesByCreatorIdsResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/spaces/search" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "space.read", + "tweet.read", + "users.read" + ] + } + ], + "tags" : [ + "Spaces" + ], + "summary" : "Search for Spaces", + "description" : "Returns Spaces that match the provided query.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search" + }, + "operationId" : "searchSpaces", + "parameters" : [ + { + "name" : "query", + "in" : "query", + "description" : "The search query.", + "required" : true, + "example" : "crypto", + "schema" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 2048, + "example" : "crypto" + }, + "style" : "form" + }, + { + "name" : "state", + "in" : "query", + "description" : "The state of Spaces to search for.", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "live", + "scheduled", + "all" + ], + "default" : "all" + }, + "style" : "form" + }, + { + "name" : "max_results", + "in" : "query", + "description" : "The number of results to return.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 100, + "format" : "int32", + "default" : 100 + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/SpaceFieldsParameter" + }, + { + "$ref" : "#/components/parameters/SpaceExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TopicFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2SpacesSearchResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Post lookup by Post IDs", + "description" : "Returns a variety of information about the Post specified by the requested ID.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets" + }, + "operationId" : "findTweetsById", + "parameters" : [ + { + "name" : "ids", + "in" : "query", + "description" : "A comma separated list of Post IDs. Up to 100 are allowed in a single request.", + "required" : true, + "schema" : { + "type" : "array", + "minItems" : 1, + "maxItems" : 100, + "items" : { + "$ref" : "#/components/schemas/TweetId" + } + }, + "explode" : false, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + }, + "post" : { + "security" : [ + { + "OAuth2UserToken" : [ + "tweet.read", + "tweet.write", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Creation of a Post", + "description" : "Causes the User to create a Post under the authorized account.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets" + }, + "operationId" : "createTweet", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TweetCreateRequest" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TweetCreateResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets/compliance/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Compliance" + ], + "summary" : "Posts Compliance stream", + "description" : "Streams 100% of compliance data for Posts", + "operationId" : "getTweetsComplianceStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 4, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Post Compliance events will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Post Compliance events will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TweetComplianceStreamResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/counts/all" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Full archive search counts", + "description" : "Returns Post Counts that match a search query.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all" + }, + "operationId" : "tweetCountsFullArchiveSearch", + "parameters" : [ + { + "name" : "query", + "in" : "query", + "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", + "required" : true, + "schema" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 4096, + "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "since_id", + "in" : "query", + "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "until_id", + "in" : "query", + "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "next_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "pagination_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "granularity", + "in" : "query", + "description" : "The granularity for the search counts results.", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "minute", + "hour", + "day" + ], + "default" : "hour" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/SearchCountFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsCountsAllResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets/counts/recent" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Recent search counts", + "description" : "Returns Post Counts from the last 7 days that match a search query.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent" + }, + "operationId" : "tweetCountsRecentSearch", + "parameters" : [ + { + "name" : "query", + "in" : "query", + "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", + "required" : true, + "schema" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 4096, + "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "since_id", + "in" : "query", + "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "until_id", + "in" : "query", + "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "next_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "pagination_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "granularity", + "in" : "query", + "description" : "The granularity for the search counts results.", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "minute", + "hour", + "day" + ], + "default" : "hour" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/SearchCountFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsCountsRecentResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets/firehose/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Firehose stream", + "description" : "Streams 100% of public Posts.", + "operationId" : "getTweetsFirehoseStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 20, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/firehose/stream/lang/en" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "English Language Firehose stream", + "description" : "Streams 100% of English Language public Posts.", + "operationId" : "getTweetsFirehoseStreamLangEn", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 8, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/firehose/stream/lang/ja" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Japanese Language Firehose stream", + "description" : "Streams 100% of Japanese Language public Posts.", + "operationId" : "getTweetsFirehoseStreamLangJa", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 2, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/firehose/stream/lang/ko" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Korean Language Firehose stream", + "description" : "Streams 100% of Korean Language public Posts.", + "operationId" : "getTweetsFirehoseStreamLangKo", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 2, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/firehose/stream/lang/pt" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Portuguese Language Firehose stream", + "description" : "Streams 100% of Portuguese Language public Posts.", + "operationId" : "getTweetsFirehoseStreamLangPt", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 2, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/label/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Compliance" + ], + "summary" : "Posts Label stream", + "description" : "Streams 100% of labeling events applied to Posts", + "operationId" : "getTweetsLabelStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Post labels will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Post labels will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/TweetLabelStreamResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/sample/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Sample stream", + "description" : "Streams a deterministic 1% of public Posts.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream" + }, + "operationId" : "sampleStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/sample10/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Sample 10% stream", + "description" : "Streams a deterministic 10% of public Posts.", + "operationId" : "getTweetsSample10Stream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 2, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsSample10StreamResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/search/all" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Full-archive search", + "description" : "Returns Posts that match a search query.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all" + }, + "operationId" : "tweetsFullarchiveSearch", + "parameters" : [ + { + "name" : "query", + "in" : "query", + "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", + "required" : true, + "schema" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 4096, + "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "since_id", + "in" : "query", + "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "until_id", + "in" : "query", + "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "max_results", + "in" : "query", + "description" : "The maximum number of search results to be returned by a request.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 10, + "maximum" : 500, + "format" : "int32", + "default" : 10 + }, + "style" : "form" + }, + { + "name" : "next_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "pagination_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "sort_order", + "in" : "query", + "description" : "This order in which to return results.", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "recency", + "relevancy" + ] + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsSearchAllResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets/search/recent" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Recent search", + "description" : "Returns Posts from the last 7 days that match a search query.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent" + }, + "operationId" : "tweetsRecentSearch", + "parameters" : [ + { + "name" : "query", + "in" : "query", + "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", + "required" : true, + "schema" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 4096, + "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", + "required" : false, + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "since_id", + "in" : "query", + "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "until_id", + "in" : "query", + "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/TweetId" + }, + "style" : "form" + }, + { + "name" : "max_results", + "in" : "query", + "description" : "The maximum number of search results to be returned by a request.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 10, + "maximum" : 100, + "format" : "int32", + "default" : 10 + }, + "style" : "form" + }, + { + "name" : "next_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "pagination_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "name" : "sort_order", + "in" : "query", + "description" : "This order in which to return results.", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "recency", + "relevancy" + ] + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsSearchRecentResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets/search/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Filtered stream", + "description" : "Streams Posts matching the stream's active rule set.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream" + }, + "operationId" : "searchStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Posts will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", + "required" : false, + "example" : "2021-02-14T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + }, + { + "$ref" : "#/components/parameters/TweetExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/MediaFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PollFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/PlaceFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FilteredStreamingTweetResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/tweets/search/stream/rules" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Rules lookup", + "description" : "Returns rules from a User's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules" + }, + "operationId" : "getRules", + "parameters" : [ + { + "name" : "ids", + "in" : "query", + "description" : "A comma-separated list of Rule IDs.", + "required" : false, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RuleId" + } + }, + "style" : "form" + }, + { + "name" : "max_results", + "in" : "query", + "description" : "The maximum number of results.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 1000, + "format" : "int32", + "default" : 1000 + }, + "style" : "form" + }, + { + "name" : "pagination_token", + "in" : "query", + "description" : "This value is populated by passing the 'next_token' returned in a request to paginate through results.", + "required" : false, + "schema" : { + "type" : "string", + "minLength" : 16, + "maxLength" : 16 + }, + "style" : "form" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/RulesLookupResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + }, + "post" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Tweets" + ], + "summary" : "Add/Delete rules", + "description" : "Add or delete rules from a User's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/post-tweets-search-stream-rules" + }, + "operationId" : "addOrDeleteRules", + "parameters" : [ + { + "name" : "dry_run", + "in" : "query", + "description" : "Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes.", + "required" : false, + "schema" : { + "type" : "boolean" + }, + "style" : "form" + }, + { + "name" : "delete_all", + "in" : "query", + "description" : "Delete All can be used to delete all of the rules associated this client app, it should be specified with no other parameters. Once deleted, rules cannot be recovered.", + "required" : false, + "schema" : { + "type" : "boolean" + }, + "style" : "form" + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AddOrDeleteRulesRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/AddOrDeleteRulesResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/tweets/search/stream/rules/counts" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "General" + ], + "summary" : "Rules Count", + "description" : "Returns the counts of rules from a User's active rule set, to reflect usage by project and application.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules-counts" + }, + "operationId" : "getRuleCount", + "parameters" : [ + { + "$ref" : "#/components/parameters/RulesCountFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2TweetsSearchStreamRulesCountsResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/usage/tweets" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Usage" + ], + "summary" : "Post Usage", + "description" : "Returns the Post Usage.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/usage/tweets/api-reference/get-usage-tweets" + }, + "operationId" : "getUsageTweets", + "parameters" : [ + { + "name" : "days", + "in" : "query", + "description" : "The number of days for which you need usage for.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 90, + "format" : "int32", + "default" : 7 + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/UsageFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2UsageTweetsResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/users" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Users" + ], + "summary" : "User lookup by IDs", + "description" : "This endpoint returns information about Users. Specify Users by their ID.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users" + }, + "operationId" : "findUsersById", + "parameters" : [ + { + "name" : "ids", + "in" : "query", + "description" : "A list of User IDs, comma-separated. You can specify up to 100 IDs.", + "required" : true, + "example" : "2244994945,6253282,12", + "schema" : { + "type" : "array", + "minItems" : 1, + "maxItems" : 100, + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "explode" : false, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2UsersResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/users/by" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + }, + { + "OAuth2UserToken" : [ + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Users" + ], + "summary" : "User lookup by usernames", + "description" : "This endpoint returns information about Users. Specify Users by their username.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by" + }, + "operationId" : "findUsersByUsername", + "parameters" : [ + { + "name" : "usernames", + "in" : "query", + "description" : "A list of usernames, comma-separated.", + "required" : true, + "schema" : { + "type" : "array", + "minItems" : 1, + "maxItems" : 100, + "items" : { + "type" : "string", + "description" : "The X handle (screen name) of this User.", + "pattern" : "^[A-Za-z0-9_]{1,15}$" + }, + "example" : "TwitterDev,TwitterAPI" + }, + "explode" : false, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2UsersByResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/users/compliance/stream" : { + "get" : { + "security" : [ + { + "BearerToken" : [ ] + } + ], + "tags" : [ + "Compliance" + ], + "summary" : "Users Compliance stream", + "description" : "Streams 100% of compliance data for Users", + "operationId" : "getUsersComplianceStream", + "parameters" : [ + { + "name" : "backfill_minutes", + "in" : "query", + "description" : "The number of minutes of backfill requested.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 0, + "maximum" : 5, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "partition", + "in" : "query", + "description" : "The partition number.", + "required" : true, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 4, + "format" : "int32" + }, + "style" : "form" + }, + { + "name" : "start_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + }, + { + "name" : "end_time", + "in" : "query", + "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided.", + "required" : false, + "example" : "2021-02-01T18:40:40.000Z", + "schema" : { + "type" : "string", + "format" : "date-time" + }, + "style" : "form" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UserComplianceStreamResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "x-twitter-streaming" : true + } + }, + "/2/users/me" : { + "get" : { + "security" : [ + { + "OAuth2UserToken" : [ + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Users" + ], + "summary" : "User lookup me", + "description" : "This endpoint returns information about the requesting User.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me" + }, + "operationId" : "findMyUser", + "parameters" : [ + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2UsersMeResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + }, + "/2/users/search" : { + "get" : { + "security" : [ + { + "OAuth2UserToken" : [ + "tweet.read", + "users.read" + ] + }, + { + "UserToken" : [ ] + } + ], + "tags" : [ + "Users" + ], + "summary" : "User search", + "description" : "Returns Users that match a search query.", + "externalDocs" : { + "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-search" + }, + "operationId" : "searchUserByQuery", + "parameters" : [ + { + "name" : "query", + "in" : "query", + "description" : "TThe the query string by which to query for users.", + "required" : true, + "example" : "someXUser", + "schema" : { + "$ref" : "#/components/schemas/UserSearchQuery" + }, + "style" : "form" + }, + { + "name" : "max_results", + "in" : "query", + "description" : "The maximum number of results.", + "required" : false, + "schema" : { + "type" : "integer", + "minimum" : 1, + "maximum" : 1000, + "format" : "int32", + "default" : 100 + }, + "style" : "form" + }, + { + "name" : "next_token", + "in" : "query", + "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", + "required" : false, + "schema" : { + "$ref" : "#/components/schemas/PaginationToken36" + }, + "style" : "form" + }, + { + "$ref" : "#/components/parameters/UserFieldsParameter" + }, + { + "$ref" : "#/components/parameters/UserExpansionsParameter" + }, + { + "$ref" : "#/components/parameters/TweetFieldsParameter" + } + ], + "responses" : { + "200" : { + "description" : "The request has succeeded.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Get2UsersSearchResponse" + } + } + } + }, + "default" : { + "description" : "The request has failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + } + } + } + }, + "servers" : [ + { + "description" : "Twitter API", + "url" : "https://api.twitter.com" + } + ], + "tags" : [ + { + "name" : "Bookmarks", + "description" : "Endpoints related to retrieving, managing bookmarks of a user", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/bookmarks" + } + }, + { + "name" : "Compliance", + "description" : "Endpoints related to keeping X data in your systems compliant", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/compliance/batch-tweet/introduction" + } + }, + { + "name" : "Direct Messages", + "description" : "Endpoints related to retrieving, managing Direct Messages", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/direct-messages" + } + }, + { + "name" : "General", + "description" : "Miscellaneous endpoints for general API functionality", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api" + } + }, + { + "name" : "Lists", + "description" : "Endpoints related to retrieving, managing Lists", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/lists" + } + }, + { + "name" : "Spaces", + "description" : "Endpoints related to retrieving, managing Spaces", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces" + } + }, + { + "name" : "Tweets", + "description" : "Endpoints related to retrieving, searching, and modifying Tweets", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/lookup" + } + }, + { + "name" : "Users", + "description" : "Endpoints related to retrieving, managing relationships of Users", + "externalDocs" : { + "description" : "Find out more", + "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup" + } + } + ], + "components" : { + "securitySchemes" : { + "BearerToken" : { + "type" : "http", + "scheme" : "bearer" + }, + "OAuth2UserToken" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://api.twitter.com/2/oauth2/authorize", + "tokenUrl" : "https://api.twitter.com/2/oauth2/token", + "scopes" : { + "block.read" : "Accounts you’ve blocked.", + "bookmark.read" : "Allows an app to read bookmarked Tweets", + "bookmark.write" : "Allows an app to create and delete bookmarks", + "dm.read" : "All your Direct Messages", + "dm.write" : "Send and manage Direct Messages for you", + "follows.read" : "People who follow you and people who you follow.", + "follows.write" : "Follow and unfollow people for you.", + "like.read" : "Tweets you’ve liked and likes you can view.", + "like.write" : "Like and un-like Tweets for you.", + "list.read" : "Lists, list members, and list followers of lists you’ve created or are a member of, including private lists.", + "list.write" : "Create and manage Lists for you.", + "mute.read" : "Accounts you’ve muted.", + "mute.write" : "Mute and unmute accounts for you.", + "offline.access" : "App can request refresh token.", + "space.read" : "Access all of the Spaces you can see.", + "tweet.moderate.write" : "Hide and unhide replies to your Tweets.", + "tweet.read" : "All the Tweets you can see, including Tweets from protected accounts.", + "tweet.write" : "Tweet and retweet for you.", + "users.read" : "Any account you can see, including protected accounts. Any account you can see, including protected accounts." + } + } + } + }, + "UserToken" : { + "type" : "http", + "scheme" : "OAuth" + } + }, + "schemas" : { + "AddOrDeleteRulesRequest" : { + "oneOf" : [ + { + "$ref" : "#/components/schemas/AddRulesRequest" + }, + { + "$ref" : "#/components/schemas/DeleteRulesRequest" + } + ] + }, + "AddOrDeleteRulesResponse" : { + "type" : "object", + "description" : "A response from modifying user-specified stream filtering rules.", + "required" : [ + "meta" + ], + "properties" : { + "data" : { + "type" : "array", + "description" : "All user-specified stream filtering rules that were created.", + "items" : { + "$ref" : "#/components/schemas/Rule" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "meta" : { + "$ref" : "#/components/schemas/RulesResponseMetadata" + } + } + }, + "AddRulesRequest" : { + "type" : "object", + "description" : "A request to add a user-specified stream filtering rule.", + "required" : [ + "add" + ], + "properties" : { + "add" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RuleNoId" + } + } + } + }, + "Aggregate" : { + "type" : "integer", + "description" : "The sum of results returned in this response.", + "format" : "int32" + }, + "AllProjectClientApps" : { + "type" : "array", + "description" : "Client App Rule Counts for all applications in the project", + "items" : { + "$ref" : "#/components/schemas/AppRulesCount" + } + }, + "AnimatedGif" : { + "allOf" : [ + { + "$ref" : "#/components/schemas/Media" + }, + { + "type" : "object", + "properties" : { + "preview_image_url" : { + "type" : "string", + "format" : "uri" + }, + "variants" : { + "$ref" : "#/components/schemas/Variants" + } + } + } + ] + }, + "AppRulesCount" : { + "type" : "object", + "description" : "A count of user-provided stream filtering rules at the client application level.", + "properties" : { + "client_app_id" : { + "$ref" : "#/components/schemas/ClientAppId" + }, + "rule_count" : { + "type" : "integer", + "description" : "Number of rules for client application", + "format" : "int32" + } + } + }, + "BookmarkAddRequest" : { + "type" : "object", + "required" : [ + "tweet_id" + ], + "properties" : { + "tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + }, + "BookmarkMutationResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "bookmarked" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "CashtagEntity" : { + "allOf" : [ + { + "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" + }, + { + "$ref" : "#/components/schemas/CashtagFields" + } + ] + }, + "CashtagFields" : { + "type" : "object", + "description" : "Represent the portion of text recognized as a Cashtag, and its start and end position within the text.", + "required" : [ + "tag" + ], + "properties" : { + "tag" : { + "type" : "string", + "example" : "TWTR" + } + } + }, + "ClientAppId" : { + "type" : "string", + "description" : "The ID of the client application", + "minLength" : 1, + "maxLength" : 19 + }, + "ClientAppUsage" : { + "type" : "object", + "description" : "Usage per client app", + "properties" : { + "client_app_id" : { + "type" : "string", + "description" : "The unique identifier for this project", + "format" : "^[0-9]{1,19}$" + }, + "usage" : { + "type" : "array", + "description" : "The usage value", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UsageFields" + } + }, + "usage_result_count" : { + "type" : "integer", + "description" : "The number of results returned", + "format" : "int32" + } + } + }, + "ClientDisconnectedProblem" : { + "description" : "Your client has gone away.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "ClientForbiddenProblem" : { + "description" : "A problem that indicates your client is forbidden from making this request.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "properties" : { + "reason" : { + "type" : "string", + "enum" : [ + "official-client-forbidden", + "client-not-enrolled" + ] + }, + "registration_url" : { + "type" : "string", + "format" : "uri" + } + } + } + ] + }, + "ComplianceJob" : { + "type" : "object", + "required" : [ + "id", + "type", + "created_at", + "upload_url", + "download_url", + "upload_expires_at", + "download_expires_at", + "status" + ], + "properties" : { + "created_at" : { + "$ref" : "#/components/schemas/CreatedAt" + }, + "download_expires_at" : { + "$ref" : "#/components/schemas/DownloadExpiration" + }, + "download_url" : { + "$ref" : "#/components/schemas/DownloadUrl" + }, + "id" : { + "$ref" : "#/components/schemas/JobId" + }, + "name" : { + "$ref" : "#/components/schemas/ComplianceJobName" + }, + "status" : { + "$ref" : "#/components/schemas/ComplianceJobStatus" + }, + "type" : { + "$ref" : "#/components/schemas/ComplianceJobType" + }, + "upload_expires_at" : { + "$ref" : "#/components/schemas/UploadExpiration" + }, + "upload_url" : { + "$ref" : "#/components/schemas/UploadUrl" + } + } + }, + "ComplianceJobName" : { + "type" : "string", + "description" : "User-provided name for a compliance job.", + "maxLength" : 64, + "example" : "my-job" + }, + "ComplianceJobStatus" : { + "type" : "string", + "description" : "Status of a compliance job.", + "enum" : [ + "created", + "in_progress", + "failed", + "complete", + "expired" + ] + }, + "ComplianceJobType" : { + "type" : "string", + "description" : "Type of compliance job to list.", + "enum" : [ + "tweets", + "users" + ] + }, + "ConflictProblem" : { + "description" : "You cannot create a new job if one is already in progress.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "ConnectionExceptionProblem" : { + "description" : "A problem that indicates something is wrong with the connection.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "properties" : { + "connection_issue" : { + "type" : "string", + "enum" : [ + "TooManyConnections", + "ProvisioningSubscription", + "RuleConfigurationIssue", + "RulesInvalidIssue" + ] + } + } + } + ] + }, + "ContextAnnotation" : { + "type" : "object", + "description" : "Annotation inferred from the Tweet text.", + "required" : [ + "domain", + "entity" + ], + "properties" : { + "domain" : { + "$ref" : "#/components/schemas/ContextAnnotationDomainFields" + }, + "entity" : { + "$ref" : "#/components/schemas/ContextAnnotationEntityFields" + } + } + }, + "ContextAnnotationDomainFields" : { + "type" : "object", + "description" : "Represents the data for the context annotation domain.", + "required" : [ + "id" + ], + "properties" : { + "description" : { + "type" : "string", + "description" : "Description of the context annotation domain." + }, + "id" : { + "type" : "string", + "description" : "The unique id for a context annotation domain.", + "pattern" : "^[0-9]{1,19}$" + }, + "name" : { + "type" : "string", + "description" : "Name of the context annotation domain." + } + } + }, + "ContextAnnotationEntityFields" : { + "type" : "object", + "description" : "Represents the data for the context annotation entity.", + "required" : [ + "id" + ], + "properties" : { + "description" : { + "type" : "string", + "description" : "Description of the context annotation entity." + }, + "id" : { + "type" : "string", + "description" : "The unique id for a context annotation entity.", + "pattern" : "^[0-9]{1,19}$" + }, + "name" : { + "type" : "string", + "description" : "Name of the context annotation entity." + } + } + }, + "CountryCode" : { + "type" : "string", + "description" : "A two-letter ISO 3166-1 alpha-2 country code.", + "pattern" : "^[A-Z]{2}$", + "example" : "US" + }, + "CreateAttachmentsMessageRequest" : { + "type" : "object", + "required" : [ + "attachments" + ], + "properties" : { + "attachments" : { + "$ref" : "#/components/schemas/DmAttachments" + }, + "text" : { + "type" : "string", + "description" : "Text of the message.", + "minLength" : 1 + } + } + }, + "CreateComplianceJobRequest" : { + "type" : "object", + "description" : "A request to create a new batch compliance job.", + "required" : [ + "type" + ], + "properties" : { + "name" : { + "$ref" : "#/components/schemas/ComplianceJobName" + }, + "resumable" : { + "type" : "boolean", + "description" : "If true, this endpoint will return a pre-signed URL with resumable uploads enabled." + }, + "type" : { + "type" : "string", + "description" : "Type of compliance job to list.", + "enum" : [ + "tweets", + "users" + ] + } + } + }, + "CreateComplianceJobResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/ComplianceJob" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "CreateDmConversationRequest" : { + "type" : "object", + "required" : [ + "conversation_type", + "participant_ids", + "message" + ], + "properties" : { + "conversation_type" : { + "type" : "string", + "description" : "The conversation type that is being created.", + "enum" : [ + "Group" + ] + }, + "message" : { + "$ref" : "#/components/schemas/CreateMessageRequest" + }, + "participant_ids" : { + "$ref" : "#/components/schemas/DmParticipants" + } + }, + "additionalProperties" : false + }, + "CreateDmEventResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "required" : [ + "dm_conversation_id", + "dm_event_id" + ], + "properties" : { + "dm_conversation_id" : { + "$ref" : "#/components/schemas/DmConversationId" + }, + "dm_event_id" : { + "$ref" : "#/components/schemas/DmEventId" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "CreateMessageRequest" : { + "anyOf" : [ + { + "$ref" : "#/components/schemas/CreateTextMessageRequest" + }, + { + "$ref" : "#/components/schemas/CreateAttachmentsMessageRequest" + } + ] + }, + "CreateTextMessageRequest" : { + "type" : "object", + "required" : [ + "text" + ], + "properties" : { + "attachments" : { + "$ref" : "#/components/schemas/DmAttachments" + }, + "text" : { + "type" : "string", + "description" : "Text of the message.", + "minLength" : 1 + } + } + }, + "CreatedAt" : { + "type" : "string", + "description" : "Creation time of the compliance job.", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "DeleteDmResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "deleted" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "DeleteRulesRequest" : { + "type" : "object", + "description" : "A response from deleting user-specified stream filtering rules.", + "required" : [ + "delete" + ], + "properties" : { + "delete" : { + "type" : "object", + "description" : "IDs and values of all deleted user-specified stream filtering rules.", + "properties" : { + "ids" : { + "type" : "array", + "description" : "IDs of all deleted user-specified stream filtering rules.", + "items" : { + "$ref" : "#/components/schemas/RuleId" + } + }, + "values" : { + "type" : "array", + "description" : "Values of all deleted user-specified stream filtering rules.", + "items" : { + "$ref" : "#/components/schemas/RuleValue" + } + } + } + } + } + }, + "DisallowedResourceProblem" : { + "description" : "A problem that indicates that the resource requested violates the precepts of this API.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "required" : [ + "resource_id", + "resource_type", + "section" + ], + "properties" : { + "resource_id" : { + "type" : "string" + }, + "resource_type" : { + "type" : "string", + "enum" : [ + "user", + "tweet", + "media", + "list", + "space" + ] + }, + "section" : { + "type" : "string", + "enum" : [ + "data", + "includes" + ] + } + } + } + ] + }, + "DmAttachments" : { + "type" : "array", + "description" : "Attachments to a DM Event.", + "items" : { + "$ref" : "#/components/schemas/DmMediaAttachment" + } + }, + "DmConversationId" : { + "type" : "string", + "description" : "Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations.", + "pattern" : "^([0-9]{1,19}-[0-9]{1,19}|[0-9]{15,19})$", + "example" : "123123123-456456456" + }, + "DmEvent" : { + "type" : "object", + "required" : [ + "id", + "event_type" + ], + "properties" : { + "attachments" : { + "type" : "object", + "description" : "Specifies the type of attachments (if any) present in this DM.", + "properties" : { + "card_ids" : { + "type" : "array", + "description" : "A list of card IDs (if cards are attached).", + "minItems" : 1, + "items" : { + "type" : "string" + } + }, + "media_keys" : { + "type" : "array", + "description" : "A list of Media Keys for each one of the media attachments (if media are attached).", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/MediaKey" + } + } + } + }, + "cashtags" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/CashtagEntity" + } + }, + "created_at" : { + "type" : "string", + "format" : "date-time" + }, + "dm_conversation_id" : { + "$ref" : "#/components/schemas/DmConversationId" + }, + "event_type" : { + "type" : "string", + "example" : "MessageCreate" + }, + "hashtags" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/HashtagEntity" + } + }, + "id" : { + "$ref" : "#/components/schemas/DmEventId" + }, + "mentions" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/MentionEntity" + } + }, + "participant_ids" : { + "type" : "array", + "description" : "A list of participants for a ParticipantsJoin or ParticipantsLeave event_type.", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "referenced_tweets" : { + "type" : "array", + "description" : "A list of Posts this DM refers to.", + "minItems" : 1, + "items" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + } + }, + "sender_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "text" : { + "type" : "string" + }, + "urls" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UrlEntityDm" + } + } + } + }, + "DmEventId" : { + "type" : "string", + "description" : "Unique identifier of a DM Event.", + "pattern" : "^[0-9]{1,19}$", + "example" : "1146654567674912769" + }, + "DmMediaAttachment" : { + "type" : "object", + "required" : [ + "media_id" + ], + "properties" : { + "media_id" : { + "$ref" : "#/components/schemas/MediaId" + } + } + }, + "DmParticipants" : { + "type" : "array", + "description" : "Participants for the DM Conversation.", + "minItems" : 2, + "maxItems" : 49, + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "DownloadExpiration" : { + "type" : "string", + "description" : "Expiration time of the download URL.", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "DownloadUrl" : { + "type" : "string", + "description" : "URL from which the user will retrieve their compliance results.", + "format" : "uri" + }, + "DuplicateRuleProblem" : { + "description" : "The rule you have submitted is a duplicate.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "value" : { + "type" : "string" + } + } + } + ] + }, + "End" : { + "type" : "string", + "description" : "The end time of the bucket.", + "format" : "date-time" + }, + "EntityIndicesInclusiveExclusive" : { + "type" : "object", + "description" : "Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive.", + "required" : [ + "start", + "end" + ], + "properties" : { + "end" : { + "type" : "integer", + "description" : "Index (zero-based) at which position this entity ends. The index is exclusive.", + "minimum" : 0, + "example" : 61 + }, + "start" : { + "type" : "integer", + "description" : "Index (zero-based) at which position this entity starts. The index is inclusive.", + "minimum" : 0, + "example" : 50 + } + } + }, + "EntityIndicesInclusiveInclusive" : { + "type" : "object", + "description" : "Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is inclusive.", + "required" : [ + "start", + "end" + ], + "properties" : { + "end" : { + "type" : "integer", + "description" : "Index (zero-based) at which position this entity ends. The index is inclusive.", + "minimum" : 0, + "example" : 61 + }, + "start" : { + "type" : "integer", + "description" : "Index (zero-based) at which position this entity starts. The index is inclusive.", + "minimum" : 0, + "example" : 50 + } + } + }, + "Error" : { + "type" : "object", + "required" : [ + "code", + "message" + ], + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "message" : { + "type" : "string" + } + } + }, + "Expansions" : { + "type" : "object", + "properties" : { + "media" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Media" + } + }, + "places" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Place" + } + }, + "polls" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Poll" + } + }, + "topics" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Topic" + } + }, + "tweets" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "users" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "FieldUnauthorizedProblem" : { + "description" : "A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "required" : [ + "resource_type", + "field", + "section" + ], + "properties" : { + "field" : { + "type" : "string" + }, + "resource_type" : { + "type" : "string", + "enum" : [ + "user", + "tweet", + "media", + "list", + "space" + ] + }, + "section" : { + "type" : "string", + "enum" : [ + "data", + "includes" + ] + } + } + } + ] + }, + "FilteredStreamingTweetResponse" : { + "type" : "object", + "description" : "A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched.", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "matching_rules" : { + "type" : "array", + "description" : "The list of rules which matched the Tweet", + "items" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/RuleId" + }, + "tag" : { + "$ref" : "#/components/schemas/RuleTag" + } + } + } + } + } + }, + "FullTextEntities" : { + "type" : "object", + "properties" : { + "annotations" : { + "type" : "array", + "minItems" : 1, + "items" : { + "description" : "Annotation for entities based on the Tweet text.", + "allOf" : [ + { + "$ref" : "#/components/schemas/EntityIndicesInclusiveInclusive" + }, + { + "type" : "object", + "description" : "Represents the data for the annotation.", + "properties" : { + "normalized_text" : { + "type" : "string", + "description" : "Text used to determine annotation.", + "example" : "Barack Obama" + }, + "probability" : { + "type" : "number", + "description" : "Confidence factor for annotation type.", + "minimum" : 0, + "maximum" : 1, + "format" : "double" + }, + "type" : { + "type" : "string", + "description" : "Annotation type.", + "example" : "Person" + } + } + } + ] + } + }, + "cashtags" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/CashtagEntity" + } + }, + "hashtags" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/HashtagEntity" + } + }, + "mentions" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/MentionEntity" + } + }, + "urls" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UrlEntity" + } + } + } + }, + "GenericProblem" : { + "description" : "A generic problem with no additional information beyond that provided by the HTTP status code.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "Geo" : { + "type" : "object", + "required" : [ + "type", + "bbox", + "properties" + ], + "properties" : { + "bbox" : { + "type" : "array", + "minItems" : 4, + "maxItems" : 4, + "items" : { + "type" : "number", + "minimum" : -180, + "maximum" : 180, + "format" : "double" + }, + "example" : [ + -105.193475, + 39.60973, + -105.053164, + 39.761974 + ] + }, + "geometry" : { + "$ref" : "#/components/schemas/Point" + }, + "properties" : { + "type" : "object" + }, + "type" : { + "type" : "string", + "enum" : [ + "Feature" + ] + } + } + }, + "Get2ComplianceJobsIdResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/ComplianceJob" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "Get2ComplianceJobsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/ComplianceJob" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "meta" : { + "type" : "object", + "properties" : { + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2DmConversationsIdDmEventsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/DmEvent" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2DmConversationsWithParticipantIdDmEventsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/DmEvent" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2DmEventsEventIdResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/DmEvent" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2DmEventsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/DmEvent" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2LikesFirehoseStreamResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/LikeWithTweetAuthor" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2LikesSample10StreamResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/LikeWithTweetAuthor" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2ListsIdFollowersResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2ListsIdMembersResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2ListsIdResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/List" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2ListsIdTweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2SpacesByCreatorIdsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Space" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2SpacesIdBuyersResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2SpacesIdResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Space" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2SpacesIdTweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2SpacesResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Space" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2SpacesSearchResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Space" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TrendsByWoeidWoeidResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Trend" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "Get2TweetsCountsAllResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/SearchCount" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "total_tweet_count" : { + "$ref" : "#/components/schemas/Aggregate" + } + } + } + } + }, + "Get2TweetsCountsRecentResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/SearchCount" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "total_tweet_count" : { + "$ref" : "#/components/schemas/Aggregate" + } + } + } + } + }, + "Get2TweetsFirehoseStreamLangEnResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsFirehoseStreamLangJaResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsFirehoseStreamLangKoResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsFirehoseStreamLangPtResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsFirehoseStreamResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsIdLikingUsersResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TweetsIdQuoteTweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TweetsIdResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsIdRetweetedByResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TweetsIdRetweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsSample10StreamResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsSampleStreamResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsSearchAllResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TweetsSearchRecentResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2TweetsSearchStreamResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2TweetsSearchStreamRulesCountsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/RulesCount" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "Get2UsageTweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Usage" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "Get2UsersByResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2UsersByUsernameUsernameResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/User" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2UsersIdBlockingResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdBookmarksResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdFollowedListsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/List" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdFollowersResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdFollowingResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdLikedTweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdListMembershipsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/List" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdMentionsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdMutingResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdOwnedListsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/List" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdPinnedListsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/List" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/User" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2UsersIdTimelinesReverseChronologicalResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersIdTweetsResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Tweet" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "newest_id" : { + "$ref" : "#/components/schemas/NewestId" + }, + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "oldest_id" : { + "$ref" : "#/components/schemas/OldestId" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + }, + "result_count" : { + "$ref" : "#/components/schemas/ResultCount" + } + } + } + } + }, + "Get2UsersMeResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/User" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2UsersResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Get2UsersSearchResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/User" + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + }, + "meta" : { + "type" : "object", + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "previous_token" : { + "$ref" : "#/components/schemas/PreviousToken" + } + } + } + } + }, + "HashtagEntity" : { + "allOf" : [ + { + "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" + }, + { + "$ref" : "#/components/schemas/HashtagFields" + } + ] + }, + "HashtagFields" : { + "type" : "object", + "description" : "Represent the portion of text recognized as a Hashtag, and its start and end position within the text.", + "required" : [ + "tag" + ], + "properties" : { + "tag" : { + "type" : "string", + "description" : "The text of the Hashtag.", + "example" : "MondayMotivation" + } + } + }, + "HttpStatusCode" : { + "type" : "integer", + "description" : "HTTP Status Code.", + "minimum" : 100, + "maximum" : 599 + }, + "InvalidRequestProblem" : { + "description" : "A problem that indicates this request is invalid.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "properties" : { + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "type" : "object", + "properties" : { + "message" : { + "type" : "string" + }, + "parameters" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + } + } + } + ] + }, + "InvalidRuleProblem" : { + "description" : "The rule you have submitted is invalid.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "JobId" : { + "type" : "string", + "description" : "Compliance Job ID.", + "pattern" : "^[0-9]{1,19}$", + "example" : "1372966999991541762" + }, + "LikeComplianceSchema" : { + "type" : "object", + "required" : [ + "delete" + ], + "properties" : { + "delete" : { + "$ref" : "#/components/schemas/UnlikeComplianceSchema" + } + } + }, + "LikeId" : { + "type" : "string", + "description" : "The unique identifier of this Like.", + "pattern" : "^[A-Za-z0-9_]{1,40}$", + "example" : "8ba4f34e6235d905a46bac021d98e923" + }, + "LikeWithTweetAuthor" : { + "type" : "object", + "description" : "A Like event, with the tweet author user and the tweet being liked", + "properties" : { + "created_at" : { + "type" : "string", + "description" : "Creation time of the Tweet.", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "id" : { + "$ref" : "#/components/schemas/LikeId" + }, + "liked_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "timestamp_ms" : { + "type" : "integer", + "description" : "Timestamp in milliseconds of creation.", + "format" : "int32" + }, + "tweet_author_id" : { + "$ref" : "#/components/schemas/UserId" + } + } + }, + "LikesComplianceStreamResponse" : { + "description" : "Likes compliance stream events.", + "oneOf" : [ + { + "type" : "object", + "description" : "Compliance event.", + "required" : [ + "data" + ], + "properties" : { + "data" : { + "$ref" : "#/components/schemas/LikeComplianceSchema" + } + } + }, + { + "type" : "object", + "required" : [ + "errors" + ], + "properties" : { + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + ] + }, + "List" : { + "type" : "object", + "description" : "A X List is a curated group of accounts.", + "required" : [ + "id", + "name" + ], + "properties" : { + "created_at" : { + "type" : "string", + "format" : "date-time" + }, + "description" : { + "type" : "string" + }, + "follower_count" : { + "type" : "integer" + }, + "id" : { + "$ref" : "#/components/schemas/ListId" + }, + "member_count" : { + "type" : "integer" + }, + "name" : { + "type" : "string", + "description" : "The name of this List." + }, + "owner_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "private" : { + "type" : "boolean" + } + } + }, + "ListAddUserRequest" : { + "type" : "object", + "required" : [ + "user_id" + ], + "properties" : { + "user_id" : { + "$ref" : "#/components/schemas/UserId" + } + } + }, + "ListCreateRequest" : { + "type" : "object", + "required" : [ + "name" + ], + "properties" : { + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 100 + }, + "name" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 25 + }, + "private" : { + "type" : "boolean", + "default" : false + } + } + }, + "ListCreateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "description" : "A X List is a curated group of accounts.", + "required" : [ + "id", + "name" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/ListId" + }, + "name" : { + "type" : "string", + "description" : "The name of this List." + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "ListDeleteResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "deleted" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "ListFollowedRequest" : { + "type" : "object", + "required" : [ + "list_id" + ], + "properties" : { + "list_id" : { + "$ref" : "#/components/schemas/ListId" + } + } + }, + "ListFollowedResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "following" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "ListId" : { + "type" : "string", + "description" : "The unique identifier of this List.", + "pattern" : "^[0-9]{1,19}$", + "example" : "1146654567674912769" + }, + "ListMutateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "is_member" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "ListPinnedRequest" : { + "type" : "object", + "required" : [ + "list_id" + ], + "properties" : { + "list_id" : { + "$ref" : "#/components/schemas/ListId" + } + } + }, + "ListPinnedResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "pinned" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "ListUnpinResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "pinned" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "ListUpdateRequest" : { + "type" : "object", + "properties" : { + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 100 + }, + "name" : { + "type" : "string", + "minLength" : 1, + "maxLength" : 25 + }, + "private" : { + "type" : "boolean" + } + } + }, + "ListUpdateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "updated" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "Media" : { + "type" : "object", + "required" : [ + "type" + ], + "properties" : { + "height" : { + "$ref" : "#/components/schemas/MediaHeight" + }, + "media_key" : { + "$ref" : "#/components/schemas/MediaKey" + }, + "type" : { + "type" : "string" + }, + "width" : { + "$ref" : "#/components/schemas/MediaWidth" + } + }, + "discriminator" : { + "propertyName" : "type", + "mapping" : { + "animated_gif" : "#/components/schemas/AnimatedGif", + "photo" : "#/components/schemas/Photo", + "video" : "#/components/schemas/Video" + } + } + }, + "MediaHeight" : { + "type" : "integer", + "description" : "The height of the media in pixels.", + "minimum" : 0 + }, + "MediaId" : { + "type" : "string", + "description" : "The unique identifier of this Media.", + "pattern" : "^[0-9]{1,19}$", + "example" : "1146654567674912769" + }, + "MediaKey" : { + "type" : "string", + "description" : "The Media Key identifier for this attachment.", + "pattern" : "^([0-9]+)_([0-9]+)$" + }, + "MediaWidth" : { + "type" : "integer", + "description" : "The width of the media in pixels.", + "minimum" : 0 + }, + "MentionEntity" : { + "allOf" : [ + { + "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" + }, + { + "$ref" : "#/components/schemas/MentionFields" + } + ] + }, + "MentionFields" : { + "type" : "object", + "description" : "Represent the portion of text recognized as a User mention, and its start and end position within the text.", + "required" : [ + "username" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/UserId" + }, + "username" : { + "$ref" : "#/components/schemas/UserName" + } + } + }, + "MuteUserMutationResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "muting" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "MuteUserRequest" : { + "type" : "object", + "required" : [ + "target_user_id" + ], + "properties" : { + "target_user_id" : { + "$ref" : "#/components/schemas/UserId" + } + } + }, + "NewestId" : { + "type" : "string", + "description" : "The newest id in this response." + }, + "NextToken" : { + "type" : "string", + "description" : "The next token.", + "minLength" : 1 + }, + "NonCompliantRulesProblem" : { + "description" : "A problem that indicates the user's rule set is not compliant.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "NoteTweetText" : { + "type" : "string", + "description" : "The note content of the Tweet.", + "example" : "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" + }, + "Oauth1PermissionsProblem" : { + "description" : "A problem that indicates your client application does not have the required OAuth1 permissions for the requested endpoint.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "OldestId" : { + "type" : "string", + "description" : "The oldest id in this response." + }, + "OperationalDisconnectProblem" : { + "description" : "You have been disconnected for operational reasons.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "properties" : { + "disconnect_type" : { + "type" : "string", + "enum" : [ + "OperationalDisconnect", + "UpstreamOperationalDisconnect", + "ForceDisconnect", + "UpstreamUncleanDisconnect", + "SlowReader", + "InternalError", + "ClientApplicationStateDegraded", + "InvalidRules" + ] + } + } + } + ] + }, + "PaginationToken32" : { + "type" : "string", + "description" : "A base32 pagination token.", + "minLength" : 16 + }, + "PaginationToken36" : { + "type" : "string", + "description" : "A base36 pagination token.", + "minLength" : 1 + }, + "PaginationTokenLong" : { + "type" : "string", + "description" : "A 'long' pagination token.", + "minLength" : 1, + "maxLength" : 19 + }, + "Photo" : { + "allOf" : [ + { + "$ref" : "#/components/schemas/Media" + }, + { + "type" : "object", + "properties" : { + "alt_text" : { + "type" : "string" + }, + "url" : { + "type" : "string", + "format" : "uri" + } + } + } + ] + }, + "Place" : { + "type" : "object", + "required" : [ + "id", + "full_name" + ], + "properties" : { + "contained_within" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/PlaceId" + } + }, + "country" : { + "type" : "string", + "description" : "The full name of the county in which this place exists.", + "example" : "United States" + }, + "country_code" : { + "$ref" : "#/components/schemas/CountryCode" + }, + "full_name" : { + "type" : "string", + "description" : "The full name of this place.", + "example" : "Lakewood, CO" + }, + "geo" : { + "$ref" : "#/components/schemas/Geo" + }, + "id" : { + "$ref" : "#/components/schemas/PlaceId" + }, + "name" : { + "type" : "string", + "description" : "The human readable name of this place.", + "example" : "Lakewood" + }, + "place_type" : { + "$ref" : "#/components/schemas/PlaceType" + } + } + }, + "PlaceId" : { + "type" : "string", + "description" : "The identifier for this place.", + "example" : "f7eb2fa2fea288b1" + }, + "PlaceType" : { + "type" : "string", + "enum" : [ + "poi", + "neighborhood", + "city", + "admin", + "country", + "unknown" + ], + "example" : "city" + }, + "Point" : { + "type" : "object", + "description" : "A [GeoJson Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) geometry object.", + "required" : [ + "type", + "coordinates" + ], + "properties" : { + "coordinates" : { + "$ref" : "#/components/schemas/Position" + }, + "type" : { + "type" : "string", + "enum" : [ + "Point" + ], + "example" : "Point" + } + } + }, + "Poll" : { + "type" : "object", + "description" : "Represent a Poll attached to a Tweet.", + "required" : [ + "id", + "options" + ], + "properties" : { + "duration_minutes" : { + "type" : "integer", + "minimum" : 5, + "maximum" : 10080, + "format" : "int32" + }, + "end_datetime" : { + "type" : "string", + "format" : "date-time" + }, + "id" : { + "$ref" : "#/components/schemas/PollId" + }, + "options" : { + "type" : "array", + "minItems" : 2, + "maxItems" : 4, + "items" : { + "$ref" : "#/components/schemas/PollOption" + } + }, + "voting_status" : { + "type" : "string", + "enum" : [ + "open", + "closed" + ] + } + } + }, + "PollId" : { + "type" : "string", + "description" : "Unique identifier of this poll.", + "pattern" : "^[0-9]{1,19}$", + "example" : "1365059861688410112" + }, + "PollOption" : { + "type" : "object", + "description" : "Describes a choice in a Poll object.", + "required" : [ + "position", + "label", + "votes" + ], + "properties" : { + "label" : { + "$ref" : "#/components/schemas/PollOptionLabel" + }, + "position" : { + "type" : "integer", + "description" : "Position of this choice in the poll." + }, + "votes" : { + "type" : "integer", + "description" : "Number of users who voted for this choice." + } + } + }, + "PollOptionLabel" : { + "type" : "string", + "description" : "The text of a poll choice.", + "minLength" : 1, + "maxLength" : 25 + }, + "Position" : { + "type" : "array", + "description" : "A [GeoJson Position](https://tools.ietf.org/html/rfc7946#section-3.1.1) in the format `[longitude,latitude]`.", + "minItems" : 2, + "maxItems" : 2, + "items" : { + "type" : "number" + }, + "example" : [ + -105.18816086351444, + 40.247749999999996 + ] + }, + "PreviousToken" : { + "type" : "string", + "description" : "The previous token.", + "minLength" : 1 + }, + "Problem" : { + "type" : "object", + "description" : "An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).", + "required" : [ + "type", + "title" + ], + "properties" : { + "detail" : { + "type" : "string" + }, + "status" : { + "type" : "integer" + }, + "title" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + }, + "discriminator" : { + "propertyName" : "type", + "mapping" : { + "about:blank" : "#/components/schemas/GenericProblem", + "https://api.twitter.com/2/problems/client-disconnected" : "#/components/schemas/ClientDisconnectedProblem", + "https://api.twitter.com/2/problems/client-forbidden" : "#/components/schemas/ClientForbiddenProblem", + "https://api.twitter.com/2/problems/conflict" : "#/components/schemas/ConflictProblem", + "https://api.twitter.com/2/problems/disallowed-resource" : "#/components/schemas/DisallowedResourceProblem", + "https://api.twitter.com/2/problems/duplicate-rules" : "#/components/schemas/DuplicateRuleProblem", + "https://api.twitter.com/2/problems/invalid-request" : "#/components/schemas/InvalidRequestProblem", + "https://api.twitter.com/2/problems/invalid-rules" : "#/components/schemas/InvalidRuleProblem", + "https://api.twitter.com/2/problems/noncompliant-rules" : "#/components/schemas/NonCompliantRulesProblem", + "https://api.twitter.com/2/problems/not-authorized-for-field" : "#/components/schemas/FieldUnauthorizedProblem", + "https://api.twitter.com/2/problems/not-authorized-for-resource" : "#/components/schemas/ResourceUnauthorizedProblem", + "https://api.twitter.com/2/problems/oauth1-permissions" : "#/components/schemas/Oauth1PermissionsProblem", + "https://api.twitter.com/2/problems/operational-disconnect" : "#/components/schemas/OperationalDisconnectProblem", + "https://api.twitter.com/2/problems/resource-not-found" : "#/components/schemas/ResourceNotFoundProblem", + "https://api.twitter.com/2/problems/resource-unavailable" : "#/components/schemas/ResourceUnavailableProblem", + "https://api.twitter.com/2/problems/rule-cap" : "#/components/schemas/RulesCapProblem", + "https://api.twitter.com/2/problems/streaming-connection" : "#/components/schemas/ConnectionExceptionProblem", + "https://api.twitter.com/2/problems/unsupported-authentication" : "#/components/schemas/UnsupportedAuthenticationProblem", + "https://api.twitter.com/2/problems/usage-capped" : "#/components/schemas/UsageCapExceededProblem" + } + } + }, + "ReplySettings" : { + "type" : "string", + "description" : "Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following.", + "pattern" : "^[A-Za-z]{1,12}$", + "enum" : [ + "everyone", + "mentionedUsers", + "following", + "other" + ] + }, + "ReplySettingsWithVerifiedUsers" : { + "type" : "string", + "description" : "Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, subscribers, verified and following.", + "pattern" : "^[A-Za-z]{1,12}$", + "enum" : [ + "everyone", + "mentionedUsers", + "following", + "other", + "subscribers", + "verified" + ] + }, + "ResourceNotFoundProblem" : { + "description" : "A problem that indicates that a given Tweet, User, etc. does not exist.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "required" : [ + "parameter", + "value", + "resource_id", + "resource_type" + ], + "properties" : { + "parameter" : { + "type" : "string", + "minLength" : 1 + }, + "resource_id" : { + "type" : "string" + }, + "resource_type" : { + "type" : "string", + "enum" : [ + "user", + "tweet", + "media", + "list", + "space" + ] + }, + "value" : { + "type" : "string", + "description" : "Value will match the schema of the field." + } + } + } + ] + }, + "ResourceUnauthorizedProblem" : { + "description" : "A problem that indicates you are not allowed to see a particular Tweet, User, etc.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "required" : [ + "value", + "resource_id", + "resource_type", + "section", + "parameter" + ], + "properties" : { + "parameter" : { + "type" : "string" + }, + "resource_id" : { + "type" : "string" + }, + "resource_type" : { + "type" : "string", + "enum" : [ + "user", + "tweet", + "media", + "list", + "space" + ] + }, + "section" : { + "type" : "string", + "enum" : [ + "data", + "includes" + ] + }, + "value" : { + "type" : "string" + } + } + } + ] + }, + "ResourceUnavailableProblem" : { + "description" : "A problem that indicates a particular Tweet, User, etc. is not available to you.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "required" : [ + "parameter", + "resource_id", + "resource_type" + ], + "properties" : { + "parameter" : { + "type" : "string", + "minLength" : 1 + }, + "resource_id" : { + "type" : "string" + }, + "resource_type" : { + "type" : "string", + "enum" : [ + "user", + "tweet", + "media", + "list", + "space" + ] + } + } + } + ] + }, + "ResultCount" : { + "type" : "integer", + "description" : "The number of results returned in this response.", + "format" : "int32" + }, + "Rule" : { + "type" : "object", + "description" : "A user-provided stream filtering rule.", + "required" : [ + "value" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/RuleId" + }, + "tag" : { + "$ref" : "#/components/schemas/RuleTag" + }, + "value" : { + "$ref" : "#/components/schemas/RuleValue" + } + } + }, + "RuleId" : { + "type" : "string", + "description" : "Unique identifier of this rule.", + "pattern" : "^[0-9]{1,19}$", + "example" : "120897978112909812" + }, + "RuleNoId" : { + "type" : "object", + "description" : "A user-provided stream filtering rule.", + "required" : [ + "value" + ], + "properties" : { + "tag" : { + "$ref" : "#/components/schemas/RuleTag" + }, + "value" : { + "$ref" : "#/components/schemas/RuleValue" + } + } + }, + "RuleTag" : { + "type" : "string", + "description" : "A tag meant for the labeling of user provided rules.", + "example" : "Non-retweeted coffee Posts" + }, + "RuleValue" : { + "type" : "string", + "description" : "The filterlang value of the rule.", + "example" : "coffee -is:retweet" + }, + "RulesCapProblem" : { + "description" : "You have exceeded the maximum number of rules.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "RulesCount" : { + "type" : "object", + "description" : "A count of user-provided stream filtering rules at the application and project levels.", + "properties" : { + "all_project_client_apps" : { + "$ref" : "#/components/schemas/AllProjectClientApps" + }, + "cap_per_client_app" : { + "type" : "integer", + "description" : "Cap of number of rules allowed per client application", + "format" : "int32" + }, + "cap_per_project" : { + "type" : "integer", + "description" : "Cap of number of rules allowed per project", + "format" : "int32" + }, + "client_app_rules_count" : { + "$ref" : "#/components/schemas/AppRulesCount" + }, + "project_rules_count" : { + "type" : "integer", + "description" : "Number of rules for project", + "format" : "int32" + } + } + }, + "RulesLookupResponse" : { + "type" : "object", + "required" : [ + "meta" + ], + "properties" : { + "data" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Rule" + } + }, + "meta" : { + "$ref" : "#/components/schemas/RulesResponseMetadata" + } + } + }, + "RulesRequestSummary" : { + "oneOf" : [ + { + "type" : "object", + "description" : "A summary of the results of the addition of user-specified stream filtering rules.", + "required" : [ + "created", + "not_created", + "valid", + "invalid" + ], + "properties" : { + "created" : { + "type" : "integer", + "description" : "Number of user-specified stream filtering rules that were created.", + "format" : "int32", + "example" : 1 + }, + "invalid" : { + "type" : "integer", + "description" : "Number of invalid user-specified stream filtering rules.", + "format" : "int32", + "example" : 1 + }, + "not_created" : { + "type" : "integer", + "description" : "Number of user-specified stream filtering rules that were not created.", + "format" : "int32", + "example" : 1 + }, + "valid" : { + "type" : "integer", + "description" : "Number of valid user-specified stream filtering rules.", + "format" : "int32", + "example" : 1 + } + } + }, + { + "type" : "object", + "required" : [ + "deleted", + "not_deleted" + ], + "properties" : { + "deleted" : { + "type" : "integer", + "description" : "Number of user-specified stream filtering rules that were deleted.", + "format" : "int32" + }, + "not_deleted" : { + "type" : "integer", + "description" : "Number of user-specified stream filtering rules that were not deleted.", + "format" : "int32" + } + } + } + ] + }, + "RulesResponseMetadata" : { + "type" : "object", + "required" : [ + "sent" + ], + "properties" : { + "next_token" : { + "$ref" : "#/components/schemas/NextToken" + }, + "result_count" : { + "type" : "integer", + "description" : "Number of Rules in result set.", + "format" : "int32" + }, + "sent" : { + "type" : "string" + }, + "summary" : { + "$ref" : "#/components/schemas/RulesRequestSummary" + } + } + }, + "SearchCount" : { + "type" : "object", + "description" : "Represent a Search Count Result.", + "required" : [ + "end", + "start", + "tweet_count" + ], + "properties" : { + "end" : { + "$ref" : "#/components/schemas/End" + }, + "start" : { + "$ref" : "#/components/schemas/Start" + }, + "tweet_count" : { + "$ref" : "#/components/schemas/TweetCount" + } + } + }, + "Space" : { + "type" : "object", + "description" : "", + "required" : [ + "id", + "state" + ], + "properties" : { + "created_at" : { + "type" : "string", + "description" : "Creation time of the Space.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "creator_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "ended_at" : { + "type" : "string", + "description" : "End time of the Space.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "host_ids" : { + "type" : "array", + "description" : "The user ids for the hosts of the Space.", + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "id" : { + "$ref" : "#/components/schemas/SpaceId" + }, + "invited_user_ids" : { + "type" : "array", + "description" : "An array of user ids for people who were invited to a Space.", + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "is_ticketed" : { + "type" : "boolean", + "description" : "Denotes if the Space is a ticketed Space.", + "example" : "false" + }, + "lang" : { + "type" : "string", + "description" : "The language of the Space.", + "example" : "en" + }, + "participant_count" : { + "type" : "integer", + "description" : "The number of participants in a Space.", + "format" : "int32", + "example" : 10 + }, + "scheduled_start" : { + "type" : "string", + "description" : "A date time stamp for when a Space is scheduled to begin.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "speaker_ids" : { + "type" : "array", + "description" : "An array of user ids for people who were speakers in a Space.", + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "started_at" : { + "type" : "string", + "description" : "When the Space was started as a date string.", + "format" : "date-time", + "example" : "2021-7-14T04:35:55Z" + }, + "state" : { + "type" : "string", + "description" : "The current state of the Space.", + "enum" : [ + "live", + "scheduled", + "ended" + ], + "example" : "live" + }, + "subscriber_count" : { + "type" : "integer", + "description" : "The number of people who have either purchased a ticket or set a reminder for this Space.", + "format" : "int32", + "example" : 10 + }, + "title" : { + "type" : "string", + "description" : "The title of the Space.", + "example" : "Spaces are Awesome" + }, + "topics" : { + "type" : "array", + "description" : "The topics of a Space, as selected by its creator.", + "items" : { + "type" : "object", + "description" : "The X Topic object.", + "required" : [ + "id", + "name" + ], + "properties" : { + "description" : { + "type" : "string", + "description" : "The description of the given topic." + }, + "id" : { + "type" : "string", + "description" : "An ID suitable for use in the REST API." + }, + "name" : { + "type" : "string", + "description" : "The name of the given topic." + } + }, + "example" : { + "description" : "All about technology", + "id" : "848920371311001600", + "name" : "Technology" + } + } + }, + "updated_at" : { + "type" : "string", + "description" : "When the Space was last updated.", + "format" : "date-time", + "example" : "2021-7-14T04:35:55Z" + } + } + }, + "SpaceId" : { + "type" : "string", + "description" : "The unique identifier of this Space.", + "pattern" : "^[a-zA-Z0-9]{1,13}$", + "example" : "1SLjjRYNejbKM" + }, + "Start" : { + "type" : "string", + "description" : "The start time of the bucket.", + "format" : "date-time" + }, + "StreamingLikeResponseV2" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/LikeWithTweetAuthor" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "StreamingTweetResponse" : { + "type" : "object", + "properties" : { + "data" : { + "$ref" : "#/components/schemas/Tweet" + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + }, + "includes" : { + "$ref" : "#/components/schemas/Expansions" + } + } + }, + "Topic" : { + "type" : "object", + "description" : "The topic of a Space, as selected by its creator.", + "required" : [ + "id", + "name" + ], + "properties" : { + "description" : { + "type" : "string", + "description" : "The description of the given topic.", + "example" : "All about technology" + }, + "id" : { + "$ref" : "#/components/schemas/TopicId" + }, + "name" : { + "type" : "string", + "description" : "The name of the given topic.", + "example" : "Technology" + } + } + }, + "TopicId" : { + "type" : "string", + "description" : "Unique identifier of this Topic." + }, + "Trend" : { + "type" : "object", + "description" : "A trend.", + "properties" : { + "trend_name" : { + "type" : "string", + "description" : "Name of the trend." + }, + "tweet_count" : { + "type" : "integer", + "description" : "Number of Posts in this trend.", + "format" : "int32" + } + } + }, + "Tweet" : { + "type" : "object", + "properties" : { + "attachments" : { + "type" : "object", + "description" : "Specifies the type of attachments (if any) present in this Tweet.", + "properties" : { + "media_keys" : { + "type" : "array", + "description" : "A list of Media Keys for each one of the media attachments (if media are attached).", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/MediaKey" + } + }, + "media_source_tweet_id" : { + "type" : "array", + "description" : "A list of Posts the media on this Tweet was originally posted in. For example, if the media on a tweet is re-used in another Tweet, this refers to the original, source Tweet..", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/TweetId" + } + }, + "poll_ids" : { + "type" : "array", + "description" : "A list of poll IDs (if polls are attached).", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/PollId" + } + } + } + }, + "author_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "context_annotations" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/ContextAnnotation" + } + }, + "conversation_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "created_at" : { + "type" : "string", + "description" : "Creation time of the Tweet.", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "edit_controls" : { + "type" : "object", + "required" : [ + "is_edit_eligible", + "editable_until", + "edits_remaining" + ], + "properties" : { + "editable_until" : { + "type" : "string", + "description" : "Time when Tweet is no longer editable.", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "edits_remaining" : { + "type" : "integer", + "description" : "Number of times this Tweet can be edited." + }, + "is_edit_eligible" : { + "type" : "boolean", + "description" : "Indicates if this Tweet is eligible to be edited.", + "example" : false + } + } + }, + "edit_history_tweet_ids" : { + "type" : "array", + "description" : "A list of Tweet Ids in this Tweet chain.", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/TweetId" + } + }, + "entities" : { + "$ref" : "#/components/schemas/FullTextEntities" + }, + "geo" : { + "type" : "object", + "description" : "The location tagged on the Tweet, if the user provided one.", + "properties" : { + "coordinates" : { + "$ref" : "#/components/schemas/Point" + }, + "place_id" : { + "$ref" : "#/components/schemas/PlaceId" + } + } + }, + "id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "in_reply_to_user_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "lang" : { + "type" : "string", + "description" : "Language of the Tweet, if detected by X. Returned as a BCP47 language tag.", + "example" : "en" + }, + "non_public_metrics" : { + "type" : "object", + "description" : "Nonpublic engagement metrics for the Tweet at the time of the request.", + "properties" : { + "impression_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been viewed.", + "format" : "int32" + } + } + }, + "note_tweet" : { + "type" : "object", + "description" : "The full-content of the Tweet, including text beyond 280 characters.", + "properties" : { + "entities" : { + "type" : "object", + "properties" : { + "cashtags" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/CashtagEntity" + } + }, + "hashtags" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/HashtagEntity" + } + }, + "mentions" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/MentionEntity" + } + }, + "urls" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UrlEntity" + } + } + } + }, + "text" : { + "$ref" : "#/components/schemas/NoteTweetText" + } + } + }, + "organic_metrics" : { + "type" : "object", + "description" : "Organic nonpublic engagement metrics for the Tweet at the time of the request.", + "required" : [ + "impression_count", + "retweet_count", + "reply_count", + "like_count" + ], + "properties" : { + "impression_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been viewed." + }, + "like_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been liked." + }, + "reply_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been replied to." + }, + "retweet_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been Retweeted." + } + } + }, + "possibly_sensitive" : { + "type" : "boolean", + "description" : "Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.", + "example" : false + }, + "promoted_metrics" : { + "type" : "object", + "description" : "Promoted nonpublic engagement metrics for the Tweet at the time of the request.", + "properties" : { + "impression_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been viewed.", + "format" : "int32" + }, + "like_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been liked.", + "format" : "int32" + }, + "reply_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been replied to.", + "format" : "int32" + }, + "retweet_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been Retweeted.", + "format" : "int32" + } + } + }, + "public_metrics" : { + "type" : "object", + "description" : "Engagement metrics for the Tweet at the time of the request.", + "required" : [ + "retweet_count", + "reply_count", + "like_count", + "impression_count", + "bookmark_count" + ], + "properties" : { + "bookmark_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been bookmarked.", + "format" : "int32" + }, + "impression_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been viewed.", + "format" : "int32" + }, + "like_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been liked." + }, + "quote_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been quoted." + }, + "reply_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been replied to." + }, + "retweet_count" : { + "type" : "integer", + "description" : "Number of times this Tweet has been Retweeted." + } + } + }, + "referenced_tweets" : { + "type" : "array", + "description" : "A list of Posts this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.", + "minItems" : 1, + "items" : { + "type" : "object", + "required" : [ + "type", + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "type" : { + "type" : "string", + "enum" : [ + "retweeted", + "quoted", + "replied_to" + ] + } + } + } + }, + "reply_settings" : { + "$ref" : "#/components/schemas/ReplySettingsWithVerifiedUsers" + }, + "scopes" : { + "type" : "object", + "description" : "The scopes for this tweet", + "properties" : { + "followers" : { + "type" : "boolean", + "description" : "Indicates if this Tweet is viewable by followers without the Tweet ID", + "example" : false + } + } + }, + "source" : { + "type" : "string", + "description" : "This is deprecated." + }, + "text" : { + "$ref" : "#/components/schemas/TweetText" + }, + "username" : { + "$ref" : "#/components/schemas/UserName" + }, + "withheld" : { + "$ref" : "#/components/schemas/TweetWithheld" + } + }, + "example" : { + "author_id" : "2244994945", + "created_at" : "Wed Jan 06 18:40:40 +0000 2021", + "id" : "1346889436626259968", + "text" : "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i", + "username" : "XDevelopers" + } + }, + "TweetComplianceData" : { + "description" : "Tweet compliance data.", + "oneOf" : [ + { + "$ref" : "#/components/schemas/TweetDeleteComplianceSchema" + }, + { + "$ref" : "#/components/schemas/TweetWithheldComplianceSchema" + }, + { + "$ref" : "#/components/schemas/TweetDropComplianceSchema" + }, + { + "$ref" : "#/components/schemas/TweetUndropComplianceSchema" + }, + { + "$ref" : "#/components/schemas/TweetEditComplianceSchema" + } + ] + }, + "TweetComplianceSchema" : { + "type" : "object", + "required" : [ + "tweet", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "quote_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "tweet" : { + "type" : "object", + "required" : [ + "id", + "author_id" + ], + "properties" : { + "author_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + } + } + }, + "TweetComplianceStreamResponse" : { + "description" : "Tweet compliance stream events.", + "oneOf" : [ + { + "type" : "object", + "description" : "Compliance event.", + "required" : [ + "data" + ], + "properties" : { + "data" : { + "$ref" : "#/components/schemas/TweetComplianceData" + } + } + }, + { + "type" : "object", + "required" : [ + "errors" + ], + "properties" : { + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + ] + }, + "TweetCount" : { + "type" : "integer", + "description" : "The count for the bucket." + }, + "TweetCreateRequest" : { + "type" : "object", + "properties" : { + "card_uri" : { + "type" : "string", + "description" : "Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link." + }, + "direct_message_deep_link" : { + "type" : "string", + "description" : "Link to take the conversation from the public timeline to a private Direct Message." + }, + "for_super_followers_only" : { + "type" : "boolean", + "description" : "Exclusive Tweet for super followers.", + "default" : false + }, + "geo" : { + "type" : "object", + "description" : "Place ID being attached to the Tweet for geo location.", + "properties" : { + "place_id" : { + "type" : "string" + } + }, + "additionalProperties" : false + }, + "media" : { + "type" : "object", + "description" : "Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI.", + "required" : [ + "media_ids" + ], + "properties" : { + "media_ids" : { + "type" : "array", + "description" : "A list of Media Ids to be attached to a created Tweet.", + "minItems" : 1, + "maxItems" : 4, + "items" : { + "$ref" : "#/components/schemas/MediaId" + } + }, + "tagged_user_ids" : { + "type" : "array", + "description" : "A list of User Ids to be tagged in the media for created Tweet.", + "minItems" : 0, + "maxItems" : 10, + "items" : { + "$ref" : "#/components/schemas/UserId" + } + } + }, + "additionalProperties" : false + }, + "nullcast" : { + "type" : "boolean", + "description" : "Nullcasted (promoted-only) Posts do not appear in the public timeline and are not served to followers.", + "default" : false + }, + "poll" : { + "type" : "object", + "description" : "Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI.", + "required" : [ + "options", + "duration_minutes" + ], + "properties" : { + "duration_minutes" : { + "type" : "integer", + "description" : "Duration of the poll in minutes.", + "minimum" : 5, + "maximum" : 10080, + "format" : "int32" + }, + "options" : { + "type" : "array", + "minItems" : 2, + "maxItems" : 4, + "items" : { + "type" : "string", + "description" : "The text of a poll choice.", + "minLength" : 1, + "maxLength" : 25 + } + }, + "reply_settings" : { + "type" : "string", + "description" : "Settings to indicate who can reply to the Tweet.", + "enum" : [ + "following", + "mentionedUsers" + ] + } + }, + "additionalProperties" : false + }, + "quote_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "reply" : { + "type" : "object", + "description" : "Tweet information of the Tweet being replied to.", + "required" : [ + "in_reply_to_tweet_id" + ], + "properties" : { + "exclude_reply_user_ids" : { + "type" : "array", + "description" : "A list of User Ids to be excluded from the reply Tweet.", + "items" : { + "$ref" : "#/components/schemas/UserId" + } + }, + "in_reply_to_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + } + }, + "additionalProperties" : false + }, + "reply_settings" : { + "type" : "string", + "description" : "Settings to indicate who can reply to the Tweet.", + "enum" : [ + "following", + "mentionedUsers", + "subscribers" + ] + }, + "text" : { + "$ref" : "#/components/schemas/TweetText" + } + }, + "additionalProperties" : false + }, + "TweetCreateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "required" : [ + "id", + "text" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "text" : { + "$ref" : "#/components/schemas/TweetText" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "TweetDeleteComplianceSchema" : { + "type" : "object", + "required" : [ + "delete" + ], + "properties" : { + "delete" : { + "$ref" : "#/components/schemas/TweetComplianceSchema" + } + } + }, + "TweetDeleteResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "required" : [ + "deleted" + ], + "properties" : { + "deleted" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "TweetDropComplianceSchema" : { + "type" : "object", + "required" : [ + "drop" + ], + "properties" : { + "drop" : { + "$ref" : "#/components/schemas/TweetComplianceSchema" + } + } + }, + "TweetEditComplianceObjectSchema" : { + "type" : "object", + "required" : [ + "tweet", + "event_at", + "initial_tweet_id", + "edit_tweet_ids" + ], + "properties" : { + "edit_tweet_ids" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/TweetId" + } + }, + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "initial_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "tweet" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + } + } + }, + "TweetEditComplianceSchema" : { + "type" : "object", + "required" : [ + "tweet_edit" + ], + "properties" : { + "tweet_edit" : { + "$ref" : "#/components/schemas/TweetEditComplianceObjectSchema" + } + } + }, + "TweetHideRequest" : { + "type" : "object", + "required" : [ + "hidden" + ], + "properties" : { + "hidden" : { + "type" : "boolean" + } + } + }, + "TweetHideResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "hidden" : { + "type" : "boolean" + } + } + } + } + }, + "TweetId" : { + "type" : "string", + "description" : "Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.", + "pattern" : "^[0-9]{1,19}$", + "example" : "1346889436626259968" + }, + "TweetLabelData" : { + "description" : "Tweet label data.", + "oneOf" : [ + { + "$ref" : "#/components/schemas/TweetNoticeSchema" + }, + { + "$ref" : "#/components/schemas/TweetUnviewableSchema" + } + ] + }, + "TweetLabelStreamResponse" : { + "description" : "Tweet label stream events.", + "oneOf" : [ + { + "type" : "object", + "description" : "Tweet Label event.", + "required" : [ + "data" + ], + "properties" : { + "data" : { + "$ref" : "#/components/schemas/TweetLabelData" + } + } + }, + { + "type" : "object", + "required" : [ + "errors" + ], + "properties" : { + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + ] + }, + "TweetNotice" : { + "type" : "object", + "required" : [ + "tweet", + "event_type", + "event_at", + "application" + ], + "properties" : { + "application" : { + "type" : "string", + "description" : "If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’.", + "example" : "apply" + }, + "details" : { + "type" : "string", + "description" : "Information shown on the Tweet label" + }, + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "event_type" : { + "type" : "string", + "description" : "The type of label on the Tweet", + "example" : "misleading" + }, + "extended_details_url" : { + "type" : "string", + "description" : "Link to more information about this kind of label" + }, + "label_title" : { + "type" : "string", + "description" : "Title/header of the Tweet label" + }, + "tweet" : { + "type" : "object", + "required" : [ + "id", + "author_id" + ], + "properties" : { + "author_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + } + } + }, + "TweetNoticeSchema" : { + "type" : "object", + "required" : [ + "public_tweet_notice" + ], + "properties" : { + "public_tweet_notice" : { + "$ref" : "#/components/schemas/TweetNotice" + } + } + }, + "TweetTakedownComplianceSchema" : { + "type" : "object", + "required" : [ + "tweet", + "withheld_in_countries", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "quote_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "tweet" : { + "type" : "object", + "required" : [ + "id", + "author_id" + ], + "properties" : { + "author_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + }, + "withheld_in_countries" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/CountryCode" + } + } + } + }, + "TweetText" : { + "type" : "string", + "description" : "The content of the Tweet.", + "example" : "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" + }, + "TweetUndropComplianceSchema" : { + "type" : "object", + "required" : [ + "undrop" + ], + "properties" : { + "undrop" : { + "$ref" : "#/components/schemas/TweetComplianceSchema" + } + } + }, + "TweetUnviewable" : { + "type" : "object", + "required" : [ + "tweet", + "event_at", + "application" + ], + "properties" : { + "application" : { + "type" : "string", + "description" : "If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’.", + "example" : "apply" + }, + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "tweet" : { + "type" : "object", + "required" : [ + "id", + "author_id" + ], + "properties" : { + "author_id" : { + "$ref" : "#/components/schemas/UserId" + }, + "id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + } + } + }, + "TweetUnviewableSchema" : { + "type" : "object", + "required" : [ + "public_tweet_unviewable" + ], + "properties" : { + "public_tweet_unviewable" : { + "$ref" : "#/components/schemas/TweetUnviewable" + } + } + }, + "TweetWithheld" : { + "type" : "object", + "description" : "Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country).", + "required" : [ + "copyright", + "country_codes" + ], + "properties" : { + "copyright" : { + "type" : "boolean", + "description" : "Indicates if the content is being withheld for on the basis of copyright infringement." + }, + "country_codes" : { + "type" : "array", + "description" : "Provides a list of countries where this content is not available.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "$ref" : "#/components/schemas/CountryCode" + } + }, + "scope" : { + "type" : "string", + "description" : "Indicates whether the content being withheld is the `tweet` or a `user`.", + "enum" : [ + "tweet", + "user" + ] + } + } + }, + "TweetWithheldComplianceSchema" : { + "type" : "object", + "required" : [ + "withheld" + ], + "properties" : { + "withheld" : { + "$ref" : "#/components/schemas/TweetTakedownComplianceSchema" + } + } + }, + "UnlikeComplianceSchema" : { + "type" : "object", + "required" : [ + "favorite", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "favorite" : { + "type" : "object", + "required" : [ + "id", + "user_id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "user_id" : { + "$ref" : "#/components/schemas/UserId" + } + } + } + } + }, + "UnsupportedAuthenticationProblem" : { + "description" : "A problem that indicates that the authentication used is not supported.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + } + ] + }, + "UploadExpiration" : { + "type" : "string", + "description" : "Expiration time of the upload URL.", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "UploadUrl" : { + "type" : "string", + "description" : "URL to which the user will upload their Tweet or user IDs.", + "format" : "uri" + }, + "Url" : { + "type" : "string", + "description" : "A validly formatted URL.", + "format" : "uri", + "example" : "https://developer.twitter.com/en/docs/twitter-api" + }, + "UrlEntity" : { + "description" : "Represent the portion of text recognized as a URL, and its start and end position within the text.", + "allOf" : [ + { + "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" + }, + { + "$ref" : "#/components/schemas/UrlFields" + } + ] + }, + "UrlEntityDm" : { + "description" : "Represent the portion of text recognized as a URL, and its start and end position within the text.", + "allOf" : [ + { + "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" + }, + { + "$ref" : "#/components/schemas/UrlFields" + } + ] + }, + "UrlFields" : { + "type" : "object", + "description" : "Represent the portion of text recognized as a URL.", + "required" : [ + "url" + ], + "properties" : { + "description" : { + "type" : "string", + "description" : "Description of the URL landing page.", + "example" : "This is a description of the website." + }, + "display_url" : { + "type" : "string", + "description" : "The URL as displayed in the X client.", + "example" : "twittercommunity.com/t/introducing-…" + }, + "expanded_url" : { + "$ref" : "#/components/schemas/Url" + }, + "images" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UrlImage" + } + }, + "media_key" : { + "$ref" : "#/components/schemas/MediaKey" + }, + "status" : { + "$ref" : "#/components/schemas/HttpStatusCode" + }, + "title" : { + "type" : "string", + "description" : "Title of the page the URL points to.", + "example" : "Introducing the v2 follow lookup endpoints" + }, + "unwound_url" : { + "type" : "string", + "description" : "Fully resolved url.", + "format" : "uri", + "example" : "https://twittercommunity.com/t/introducing-the-v2-follow-lookup-endpoints/147118" + }, + "url" : { + "$ref" : "#/components/schemas/Url" + } + } + }, + "UrlImage" : { + "type" : "object", + "description" : "Represent the information for the URL image.", + "properties" : { + "height" : { + "$ref" : "#/components/schemas/MediaHeight" + }, + "url" : { + "$ref" : "#/components/schemas/Url" + }, + "width" : { + "$ref" : "#/components/schemas/MediaWidth" + } + } + }, + "Usage" : { + "type" : "object", + "description" : "Usage per client app", + "properties" : { + "cap_reset_day" : { + "type" : "integer", + "description" : "Number of days left for the Tweet cap to reset", + "format" : "int32" + }, + "daily_client_app_usage" : { + "type" : "array", + "description" : "The daily usage breakdown for each Client Application a project", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/ClientAppUsage" + } + }, + "daily_project_usage" : { + "type" : "object", + "description" : "The daily usage breakdown for a project", + "properties" : { + "project_id" : { + "type" : "integer", + "description" : "The unique identifier for this project", + "format" : "int32" + }, + "usage" : { + "type" : "array", + "description" : "The usage value", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UsageFields" + } + } + } + }, + "project_cap" : { + "type" : "integer", + "description" : "Total number of Posts that can be read in this project per month", + "format" : "int32" + }, + "project_id" : { + "type" : "string", + "description" : "The unique identifier for this project", + "format" : "^[0-9]{1,19}$" + }, + "project_usage" : { + "type" : "integer", + "description" : "The number of Posts read in this project", + "format" : "int32" + } + } + }, + "UsageCapExceededProblem" : { + "description" : "A problem that indicates that a usage cap has been exceeded.", + "allOf" : [ + { + "$ref" : "#/components/schemas/Problem" + }, + { + "type" : "object", + "properties" : { + "period" : { + "type" : "string", + "enum" : [ + "Daily", + "Monthly" + ] + }, + "scope" : { + "type" : "string", + "enum" : [ + "Account", + "Product" + ] + } + } + } + ] + }, + "UsageFields" : { + "type" : "object", + "description" : "Represents the data for Usage", + "properties" : { + "date" : { + "type" : "string", + "description" : "The time period for the usage", + "format" : "date-time", + "example" : "2021-01-06T18:40:40.000Z" + }, + "usage" : { + "type" : "integer", + "description" : "The usage value", + "format" : "int32" + } + } + }, + "User" : { + "type" : "object", + "description" : "The X User object.", + "required" : [ + "id", + "name", + "username" + ], + "properties" : { + "connection_status" : { + "type" : "array", + "description" : "Returns detailed information about the relationship between two users.", + "minItems" : 0, + "items" : { + "type" : "string", + "description" : "Type of connection between users.", + "enum" : [ + "follow_request_received", + "follow_request_sent", + "blocking", + "followed_by", + "following", + "muting" + ] + } + }, + "created_at" : { + "type" : "string", + "description" : "Creation time of this User.", + "format" : "date-time" + }, + "description" : { + "type" : "string", + "description" : "The text of this User's profile description (also known as bio), if the User provided one." + }, + "entities" : { + "type" : "object", + "description" : "A list of metadata found in the User's profile description.", + "properties" : { + "description" : { + "$ref" : "#/components/schemas/FullTextEntities" + }, + "url" : { + "type" : "object", + "description" : "Expanded details for the URL specified in the User's profile, with start and end indices.", + "properties" : { + "urls" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/UrlEntity" + } + } + } + } + } + }, + "id" : { + "$ref" : "#/components/schemas/UserId" + }, + "location" : { + "type" : "string", + "description" : "The location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries." + }, + "most_recent_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "name" : { + "type" : "string", + "description" : "The friendly name of this User, as shown on their profile." + }, + "pinned_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "profile_image_url" : { + "type" : "string", + "description" : "The URL to the profile image for this User.", + "format" : "uri" + }, + "protected" : { + "type" : "boolean", + "description" : "Indicates if this User has chosen to protect their Posts (in other words, if this User's Posts are private)." + }, + "public_metrics" : { + "type" : "object", + "description" : "A list of metrics for this User.", + "required" : [ + "followers_count", + "following_count", + "tweet_count", + "listed_count" + ], + "properties" : { + "followers_count" : { + "type" : "integer", + "description" : "Number of Users who are following this User." + }, + "following_count" : { + "type" : "integer", + "description" : "Number of Users this User is following." + }, + "like_count" : { + "type" : "integer", + "description" : "The number of likes created by this User." + }, + "listed_count" : { + "type" : "integer", + "description" : "The number of lists that include this User." + }, + "tweet_count" : { + "type" : "integer", + "description" : "The number of Posts (including Retweets) posted by this User." + } + } + }, + "receives_your_dm" : { + "type" : "boolean", + "description" : "Indicates if you can send a DM to this User" + }, + "subscription_type" : { + "type" : "string", + "description" : "The X Blue subscription type of the user, eg: Basic, Premium, PremiumPlus or None.", + "enum" : [ + "Basic", + "Premium", + "PremiumPlus", + "None" + ] + }, + "url" : { + "type" : "string", + "description" : "The URL specified in the User's profile." + }, + "username" : { + "$ref" : "#/components/schemas/UserName" + }, + "verified" : { + "type" : "boolean", + "description" : "Indicate if this User is a verified X User." + }, + "verified_type" : { + "type" : "string", + "description" : "The X Blue verified type of the user, eg: blue, government, business or none.", + "enum" : [ + "blue", + "government", + "business", + "none" + ] + }, + "withheld" : { + "$ref" : "#/components/schemas/UserWithheld" + } + }, + "example" : { + "created_at" : "2013-12-14T04:35:55Z", + "id" : "2244994945", + "name" : "X Dev", + "protected" : false, + "username" : "TwitterDev" + } + }, + "UserComplianceData" : { + "description" : "User compliance data.", + "oneOf" : [ + { + "$ref" : "#/components/schemas/UserProtectComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserUnprotectComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserDeleteComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserUndeleteComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserSuspendComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserUnsuspendComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserWithheldComplianceSchema" + }, + { + "$ref" : "#/components/schemas/UserScrubGeoSchema" + }, + { + "$ref" : "#/components/schemas/UserProfileModificationComplianceSchema" + } + ] + }, + "UserComplianceSchema" : { + "type" : "object", + "required" : [ + "user", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "user" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/UserId" + } + } + } + } + }, + "UserComplianceStreamResponse" : { + "description" : "User compliance stream events.", + "oneOf" : [ + { + "type" : "object", + "description" : "User compliance event.", + "required" : [ + "data" + ], + "properties" : { + "data" : { + "$ref" : "#/components/schemas/UserComplianceData" + } + } + }, + { + "type" : "object", + "required" : [ + "errors" + ], + "properties" : { + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + ] + }, + "UserDeleteComplianceSchema" : { + "type" : "object", + "required" : [ + "user_delete" + ], + "properties" : { + "user_delete" : { + "$ref" : "#/components/schemas/UserComplianceSchema" + } + } + }, + "UserId" : { + "type" : "string", + "description" : "Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.", + "pattern" : "^[0-9]{1,19}$", + "example" : "2244994945" + }, + "UserIdMatchesAuthenticatedUser" : { + "type" : "string", + "description" : "Unique identifier of this User. The value must be the same as the authenticated user.", + "example" : "2244994945" + }, + "UserName" : { + "type" : "string", + "description" : "The X handle (screen name) of this user.", + "pattern" : "^[A-Za-z0-9_]{1,15}$" + }, + "UserProfileModificationComplianceSchema" : { + "type" : "object", + "required" : [ + "user_profile_modification" + ], + "properties" : { + "user_profile_modification" : { + "$ref" : "#/components/schemas/UserProfileModificationObjectSchema" + } + } + }, + "UserProfileModificationObjectSchema" : { + "type" : "object", + "required" : [ + "user", + "profile_field", + "new_value", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "new_value" : { + "type" : "string" + }, + "profile_field" : { + "type" : "string" + }, + "user" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/UserId" + } + } + } + } + }, + "UserProtectComplianceSchema" : { + "type" : "object", + "required" : [ + "user_protect" + ], + "properties" : { + "user_protect" : { + "$ref" : "#/components/schemas/UserComplianceSchema" + } + } + }, + "UserScrubGeoObjectSchema" : { + "type" : "object", + "required" : [ + "user", + "up_to_tweet_id", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "up_to_tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "user" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/UserId" + } + } + } + } + }, + "UserScrubGeoSchema" : { + "type" : "object", + "required" : [ + "scrub_geo" + ], + "properties" : { + "scrub_geo" : { + "$ref" : "#/components/schemas/UserScrubGeoObjectSchema" + } + } + }, + "UserSearchQuery" : { + "type" : "string", + "description" : "The the search string by which to query for users.", + "pattern" : "^[A-Za-z0-9_]{1,32}$" + }, + "UserSuspendComplianceSchema" : { + "type" : "object", + "required" : [ + "user_suspend" + ], + "properties" : { + "user_suspend" : { + "$ref" : "#/components/schemas/UserComplianceSchema" + } + } + }, + "UserTakedownComplianceSchema" : { + "type" : "object", + "required" : [ + "user", + "withheld_in_countries", + "event_at" + ], + "properties" : { + "event_at" : { + "type" : "string", + "description" : "Event time.", + "format" : "date-time", + "example" : "2021-07-06T18:40:40.000Z" + }, + "user" : { + "type" : "object", + "required" : [ + "id" + ], + "properties" : { + "id" : { + "$ref" : "#/components/schemas/UserId" + } + } + }, + "withheld_in_countries" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/CountryCode" + } + } + } + }, + "UserUndeleteComplianceSchema" : { + "type" : "object", + "required" : [ + "user_undelete" + ], + "properties" : { + "user_undelete" : { + "$ref" : "#/components/schemas/UserComplianceSchema" + } + } + }, + "UserUnprotectComplianceSchema" : { + "type" : "object", + "required" : [ + "user_unprotect" + ], + "properties" : { + "user_unprotect" : { + "$ref" : "#/components/schemas/UserComplianceSchema" + } + } + }, + "UserUnsuspendComplianceSchema" : { + "type" : "object", + "required" : [ + "user_unsuspend" + ], + "properties" : { + "user_unsuspend" : { + "$ref" : "#/components/schemas/UserComplianceSchema" + } + } + }, + "UserWithheld" : { + "type" : "object", + "description" : "Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country).", + "required" : [ + "country_codes" + ], + "properties" : { + "country_codes" : { + "type" : "array", + "description" : "Provides a list of countries where this content is not available.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "$ref" : "#/components/schemas/CountryCode" + } + }, + "scope" : { + "type" : "string", + "description" : "Indicates that the content being withheld is a `user`.", + "enum" : [ + "user" + ] + } + } + }, + "UserWithheldComplianceSchema" : { + "type" : "object", + "required" : [ + "user_withheld" + ], + "properties" : { + "user_withheld" : { + "$ref" : "#/components/schemas/UserTakedownComplianceSchema" + } + } + }, + "UsersFollowingCreateRequest" : { + "type" : "object", + "required" : [ + "target_user_id" + ], + "properties" : { + "target_user_id" : { + "$ref" : "#/components/schemas/UserId" + } + } + }, + "UsersFollowingCreateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "following" : { + "type" : "boolean" + }, + "pending_follow" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "UsersFollowingDeleteResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "following" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "UsersLikesCreateRequest" : { + "type" : "object", + "required" : [ + "tweet_id" + ], + "properties" : { + "tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + } + } + }, + "UsersLikesCreateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "liked" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "UsersLikesDeleteResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "liked" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "UsersRetweetsCreateRequest" : { + "type" : "object", + "required" : [ + "tweet_id" + ], + "properties" : { + "tweet_id" : { + "$ref" : "#/components/schemas/TweetId" + } + }, + "additionalProperties" : false + }, + "UsersRetweetsCreateResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "id" : { + "$ref" : "#/components/schemas/TweetId" + }, + "retweeted" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "UsersRetweetsDeleteResponse" : { + "type" : "object", + "properties" : { + "data" : { + "type" : "object", + "properties" : { + "retweeted" : { + "type" : "boolean" + } + } + }, + "errors" : { + "type" : "array", + "minItems" : 1, + "items" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "Variant" : { + "type" : "object", + "properties" : { + "bit_rate" : { + "type" : "integer", + "description" : "The bit rate of the media." + }, + "content_type" : { + "type" : "string", + "description" : "The content type of the media." + }, + "url" : { + "type" : "string", + "description" : "The url to the media.", + "format" : "uri" + } + } + }, + "Variants" : { + "type" : "array", + "description" : "An array of all available variants of the media.", + "items" : { + "$ref" : "#/components/schemas/Variant" + } + }, + "Video" : { + "allOf" : [ + { + "$ref" : "#/components/schemas/Media" + }, + { + "type" : "object", + "properties" : { + "duration_ms" : { + "type" : "integer" + }, + "non_public_metrics" : { + "type" : "object", + "description" : "Nonpublic engagement metrics for the Media at the time of the request.", + "properties" : { + "playback_0_count" : { + "type" : "integer", + "description" : "Number of users who made it through 0% of the video.", + "format" : "int32" + }, + "playback_100_count" : { + "type" : "integer", + "description" : "Number of users who made it through 100% of the video.", + "format" : "int32" + }, + "playback_25_count" : { + "type" : "integer", + "description" : "Number of users who made it through 25% of the video.", + "format" : "int32" + }, + "playback_50_count" : { + "type" : "integer", + "description" : "Number of users who made it through 50% of the video.", + "format" : "int32" + }, + "playback_75_count" : { + "type" : "integer", + "description" : "Number of users who made it through 75% of the video.", + "format" : "int32" + } + } + }, + "organic_metrics" : { + "type" : "object", + "description" : "Organic nonpublic engagement metrics for the Media at the time of the request.", + "properties" : { + "playback_0_count" : { + "type" : "integer", + "description" : "Number of users who made it through 0% of the video.", + "format" : "int32" + }, + "playback_100_count" : { + "type" : "integer", + "description" : "Number of users who made it through 100% of the video.", + "format" : "int32" + }, + "playback_25_count" : { + "type" : "integer", + "description" : "Number of users who made it through 25% of the video.", + "format" : "int32" + }, + "playback_50_count" : { + "type" : "integer", + "description" : "Number of users who made it through 50% of the video.", + "format" : "int32" + }, + "playback_75_count" : { + "type" : "integer", + "description" : "Number of users who made it through 75% of the video.", + "format" : "int32" + }, + "view_count" : { + "type" : "integer", + "description" : "Number of times this video has been viewed.", + "format" : "int32" + } + } + }, + "preview_image_url" : { + "type" : "string", + "format" : "uri" + }, + "promoted_metrics" : { + "type" : "object", + "description" : "Promoted nonpublic engagement metrics for the Media at the time of the request.", + "properties" : { + "playback_0_count" : { + "type" : "integer", + "description" : "Number of users who made it through 0% of the video.", + "format" : "int32" + }, + "playback_100_count" : { + "type" : "integer", + "description" : "Number of users who made it through 100% of the video.", + "format" : "int32" + }, + "playback_25_count" : { + "type" : "integer", + "description" : "Number of users who made it through 25% of the video.", + "format" : "int32" + }, + "playback_50_count" : { + "type" : "integer", + "description" : "Number of users who made it through 50% of the video.", + "format" : "int32" + }, + "playback_75_count" : { + "type" : "integer", + "description" : "Number of users who made it through 75% of the video.", + "format" : "int32" + }, + "view_count" : { + "type" : "integer", + "description" : "Number of times this video has been viewed.", + "format" : "int32" + } + } + }, + "public_metrics" : { + "type" : "object", + "description" : "Engagement metrics for the Media at the time of the request.", + "properties" : { + "view_count" : { + "type" : "integer", + "description" : "Number of times this video has been viewed.", + "format" : "int32" + } + } + }, + "variants" : { + "$ref" : "#/components/schemas/Variants" + } + } + } + ] + } + }, + "parameters" : { + "ComplianceJobFieldsParameter" : { + "name" : "compliance_job.fields", + "in" : "query", + "description" : "A comma separated list of ComplianceJob fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a ComplianceJob object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "created_at", + "download_expires_at", + "download_url", + "id", + "name", + "resumable", + "status", + "type", + "upload_expires_at", + "upload_url" + ] + }, + "example" : [ + "created_at", + "download_expires_at", + "download_url", + "id", + "name", + "resumable", + "status", + "type", + "upload_expires_at", + "upload_url" + ] + }, + "explode" : false, + "style" : "form" + }, + "DmConversationFieldsParameter" : { + "name" : "dm_conversation.fields", + "in" : "query", + "description" : "A comma separated list of DmConversation fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a DmConversation object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "id" + ] + }, + "example" : [ + "id" + ] + }, + "explode" : false, + "style" : "form" + }, + "DmEventExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [DmEvent](#DmEvent) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "attachments.media_keys", + "participant_ids", + "referenced_tweets.id", + "sender_id" + ] + }, + "example" : [ + "attachments.media_keys", + "participant_ids", + "referenced_tweets.id", + "sender_id" + ] + }, + "explode" : false, + "style" : "form" + }, + "DmEventFieldsParameter" : { + "name" : "dm_event.fields", + "in" : "query", + "description" : "A comma separated list of DmEvent fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a DmEvent object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "attachments", + "created_at", + "dm_conversation_id", + "entities", + "event_type", + "id", + "participant_ids", + "referenced_tweets", + "sender_id", + "text" + ] + }, + "example" : [ + "attachments", + "created_at", + "dm_conversation_id", + "entities", + "event_type", + "id", + "participant_ids", + "referenced_tweets", + "sender_id", + "text" + ] + }, + "explode" : false, + "style" : "form" + }, + "LikeExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [Like](#Like) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "liked_tweet_id" + ] + }, + "example" : [ + "liked_tweet_id" + ] + }, + "explode" : false, + "style" : "form" + }, + "LikeFieldsParameter" : { + "name" : "like.fields", + "in" : "query", + "description" : "A comma separated list of Like fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Like object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "created_at", + "id", + "liked_tweet_id", + "timestamp_ms" + ] + }, + "example" : [ + "created_at", + "id", + "liked_tweet_id", + "timestamp_ms" + ] + }, + "explode" : false, + "style" : "form" + }, + "LikeWithTweetAuthorExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [LikeWithTweetAuthor](#LikeWithTweetAuthor) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "liked_tweet_author_id", + "liked_tweet_id" + ] + }, + "example" : [ + "liked_tweet_author_id", + "liked_tweet_id" + ] + }, + "explode" : false, + "style" : "form" + }, + "LikeWithTweetAuthorFieldsParameter" : { + "name" : "like_with_tweet_author.fields", + "in" : "query", + "description" : "A comma separated list of LikeWithTweetAuthor fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a LikeWithTweetAuthor object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "created_at", + "id", + "liked_tweet_author_id", + "liked_tweet_id", + "timestamp_ms" + ] + }, + "example" : [ + "created_at", + "id", + "liked_tweet_author_id", + "liked_tweet_id", + "timestamp_ms" + ] + }, + "explode" : false, + "style" : "form" + }, + "ListExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [List](#List) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "owner_id" + ] + }, + "example" : [ + "owner_id" + ] + }, + "explode" : false, + "style" : "form" + }, + "ListFieldsParameter" : { + "name" : "list.fields", + "in" : "query", + "description" : "A comma separated list of List fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a List object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "created_at", + "description", + "follower_count", + "id", + "member_count", + "name", + "owner_id", + "private" + ] + }, + "example" : [ + "created_at", + "description", + "follower_count", + "id", + "member_count", + "name", + "owner_id", + "private" + ] + }, + "explode" : false, + "style" : "form" + }, + "MediaFieldsParameter" : { + "name" : "media.fields", + "in" : "query", + "description" : "A comma separated list of Media fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Media object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "alt_text", + "duration_ms", + "height", + "media_key", + "non_public_metrics", + "organic_metrics", + "preview_image_url", + "promoted_metrics", + "public_metrics", + "type", + "url", + "variants", + "width" + ] + }, + "example" : [ + "alt_text", + "duration_ms", + "height", + "media_key", + "non_public_metrics", + "organic_metrics", + "preview_image_url", + "promoted_metrics", + "public_metrics", + "type", + "url", + "variants", + "width" + ] + }, + "explode" : false, + "style" : "form" + }, + "PlaceFieldsParameter" : { + "name" : "place.fields", + "in" : "query", + "description" : "A comma separated list of Place fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Place object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "contained_within", + "country", + "country_code", + "full_name", + "geo", + "id", + "name", + "place_type" + ] + }, + "example" : [ + "contained_within", + "country", + "country_code", + "full_name", + "geo", + "id", + "name", + "place_type" + ] + }, + "explode" : false, + "style" : "form" + }, + "PollFieldsParameter" : { + "name" : "poll.fields", + "in" : "query", + "description" : "A comma separated list of Poll fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Poll object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "duration_minutes", + "end_datetime", + "id", + "options", + "voting_status" + ] + }, + "example" : [ + "duration_minutes", + "end_datetime", + "id", + "options", + "voting_status" + ] + }, + "explode" : false, + "style" : "form" + }, + "RulesCountFieldsParameter" : { + "name" : "rules_count.fields", + "in" : "query", + "description" : "A comma separated list of RulesCount fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a RulesCount object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "all_project_client_apps", + "cap_per_client_app", + "cap_per_project", + "client_app_rules_count", + "project_rules_count" + ] + }, + "example" : [ + "all_project_client_apps", + "cap_per_client_app", + "cap_per_project", + "client_app_rules_count", + "project_rules_count" + ] + }, + "explode" : false, + "style" : "form" + }, + "SearchCountFieldsParameter" : { + "name" : "search_count.fields", + "in" : "query", + "description" : "A comma separated list of SearchCount fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a SearchCount object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "end", + "start", + "tweet_count" + ] + }, + "example" : [ + "end", + "start", + "tweet_count" + ] + }, + "explode" : false, + "style" : "form" + }, + "SpaceExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [Space](#Space) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "creator_id", + "host_ids", + "invited_user_ids", + "speaker_ids", + "topic_ids" + ] + }, + "example" : [ + "creator_id", + "host_ids", + "invited_user_ids", + "speaker_ids", + "topic_ids" + ] + }, + "explode" : false, + "style" : "form" + }, + "SpaceFieldsParameter" : { + "name" : "space.fields", + "in" : "query", + "description" : "A comma separated list of Space fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Space object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "created_at", + "creator_id", + "ended_at", + "host_ids", + "id", + "invited_user_ids", + "is_ticketed", + "lang", + "participant_count", + "scheduled_start", + "speaker_ids", + "started_at", + "state", + "subscriber_count", + "title", + "topic_ids", + "updated_at" + ] + }, + "example" : [ + "created_at", + "creator_id", + "ended_at", + "host_ids", + "id", + "invited_user_ids", + "is_ticketed", + "lang", + "participant_count", + "scheduled_start", + "speaker_ids", + "started_at", + "state", + "subscriber_count", + "title", + "topic_ids", + "updated_at" + ] + }, + "explode" : false, + "style" : "form" + }, + "TopicFieldsParameter" : { + "name" : "topic.fields", + "in" : "query", + "description" : "A comma separated list of Topic fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Topic object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "description", + "id", + "name" + ] + }, + "example" : [ + "description", + "id", + "name" + ] + }, + "explode" : false, + "style" : "form" + }, + "TrendFieldsParameter" : { + "name" : "trend.fields", + "in" : "query", + "description" : "A comma separated list of Trend fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Trend object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "trend_name", + "tweet_count" + ] + }, + "example" : [ + "trend_name", + "tweet_count" + ] + }, + "explode" : false, + "style" : "form" + }, + "TweetExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [Tweet](#Tweet) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "attachments.media_keys", + "attachments.media_source_tweet", + "attachments.poll_ids", + "author_id", + "edit_history_tweet_ids", + "entities.mentions.username", + "geo.place_id", + "in_reply_to_user_id", + "entities.note.mentions.username", + "referenced_tweets.id", + "referenced_tweets.id.author_id", + "author_screen_name" + ] + }, + "example" : [ + "attachments.media_keys", + "attachments.media_source_tweet", + "attachments.poll_ids", + "author_id", + "edit_history_tweet_ids", + "entities.mentions.username", + "geo.place_id", + "in_reply_to_user_id", + "entities.note.mentions.username", + "referenced_tweets.id", + "referenced_tweets.id.author_id", + "author_screen_name" + ] + }, + "explode" : false, + "style" : "form" + }, + "TweetFieldsParameter" : { + "name" : "tweet.fields", + "in" : "query", + "description" : "A comma separated list of Tweet fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Tweet object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "attachments", + "author_id", + "card_uri", + "context_annotations", + "conversation_id", + "created_at", + "edit_controls", + "edit_history_tweet_ids", + "entities", + "geo", + "id", + "in_reply_to_user_id", + "lang", + "non_public_metrics", + "note_tweet", + "organic_metrics", + "possibly_sensitive", + "promoted_metrics", + "public_metrics", + "referenced_tweets", + "reply_settings", + "scopes", + "source", + "text", + "username", + "withheld" + ] + }, + "example" : [ + "attachments", + "author_id", + "card_uri", + "context_annotations", + "conversation_id", + "created_at", + "edit_controls", + "edit_history_tweet_ids", + "entities", + "geo", + "id", + "in_reply_to_user_id", + "lang", + "non_public_metrics", + "note_tweet", + "organic_metrics", + "possibly_sensitive", + "promoted_metrics", + "public_metrics", + "referenced_tweets", + "reply_settings", + "scopes", + "source", + "text", + "username", + "withheld" + ] + }, + "explode" : false, + "style" : "form" + }, + "UsageFieldsParameter" : { + "name" : "usage.fields", + "in" : "query", + "description" : "A comma separated list of Usage fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a Usage object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "cap_reset_day", + "daily_client_app_usage", + "daily_project_usage", + "project_cap", + "project_id", + "project_usage" + ] + }, + "example" : [ + "cap_reset_day", + "daily_client_app_usage", + "daily_project_usage", + "project_cap", + "project_id", + "project_usage" + ] + }, + "explode" : false, + "style" : "form" + }, + "UserExpansionsParameter" : { + "name" : "expansions", + "in" : "query", + "description" : "A comma separated list of fields to expand.", + "schema" : { + "type" : "array", + "description" : "The list of fields you can expand for a [User](#User) object. If the field has an ID, it can be expanded into a full object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "most_recent_tweet_id", + "pinned_tweet_id" + ] + }, + "example" : [ + "most_recent_tweet_id", + "pinned_tweet_id" + ] + }, + "explode" : false, + "style" : "form" + }, + "UserFieldsParameter" : { + "name" : "user.fields", + "in" : "query", + "description" : "A comma separated list of User fields to display.", + "required" : false, + "schema" : { + "type" : "array", + "description" : "The fields available for a User object.", + "minItems" : 1, + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ + "connection_status", + "created_at", + "description", + "entities", + "id", + "location", + "most_recent_tweet_id", + "name", + "pinned_tweet_id", + "profile_banner_url", + "profile_image_url", + "protected", + "public_metrics", + "receives_your_dm", + "subscription_type", + "url", + "username", + "verified", + "verified_type", + "withheld" + ] + }, + "example" : [ + "connection_status", + "created_at", + "description", + "entities", + "id", + "location", + "most_recent_tweet_id", + "name", + "pinned_tweet_id", + "profile_banner_url", + "profile_image_url", + "protected", + "public_metrics", + "receives_your_dm", + "subscription_type", + "url", + "username", + "verified", + "verified_type", + "withheld" + ] + }, + "explode" : false, + "style" : "form" + } + } + } + } \ No newline at end of file From 955d6adec75ad54c7348e57392ad4322f6e36bf8 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:38:37 +0530 Subject: [PATCH 06/15] Update test.bal with new tests for Find Users via iD Api --- ballerina/tests/test.bal | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 687080b..05d3246 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -178,3 +178,14 @@ isolated function unmuteSpecificUser() returns error? { io:println("13"); io:println(response); } + +//Test FInd User Via ID +@test:Config { +} +isolated function findSpecificUser() returns error? { + Get2UsersResponse response = check baseClient->/users(ids = ["1803011651249278976"]); + test:assertTrue(response?.data !is ()); + test:assertTrue(response?.errors is ()); + io:println("14"); + io:println(response); +} From b0531ba2895c404982f771f1e1edf53ca193c5c4 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:02:34 +0530 Subject: [PATCH 07/15] Add mock server for the test cases --- ballerina/Dependencies.toml | 8 +- .../modules/mock/openapi_mock_service.bal | 147 -- ballerina/modules/mock/types.bal | 1424 ----------------- ballerina/tests/mock_service.bal | 217 +++ ballerina/tests/test.bal | 35 +- 5 files changed, 222 insertions(+), 1609 deletions(-) delete mode 100644 ballerina/modules/mock/openapi_mock_service.bal delete mode 100644 ballerina/modules/mock/types.bal create mode 100644 ballerina/tests/mock_service.bal diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index ff5cdae..f120218 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -101,9 +101,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] -modules = [ - {org = "ballerina", packageName = "io", moduleName = "io"} -] [[package]] org = "ballerina" @@ -217,6 +214,9 @@ dependencies = [ {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "observe"} ] +modules = [ + {org = "ballerina", packageName = "log", moduleName = "log"} +] [[package]] org = "ballerina" @@ -325,7 +325,7 @@ version = "4.0.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, + {org = "ballerina", name = "log"}, {org = "ballerina", name = "os"}, {org = "ballerina", name = "test"}, {org = "ballerina", name = "time"}, diff --git a/ballerina/modules/mock/openapi_mock_service.bal b/ballerina/modules/mock/openapi_mock_service.bal deleted file mode 100644 index e5194cd..0000000 --- a/ballerina/modules/mock/openapi_mock_service.bal +++ /dev/null @@ -1,147 +0,0 @@ -// AUTO-GENERATED FILE. DO NOT MODIFY. -// This file is auto-generated by the Ballerina OpenAPI tool. - -// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; - -listener http:Listener ep0 = new (443, config = {host: "api.twitter.com"}); - -service / on ep0 { - resource function get '2/compliance/jobs("tweets"|"users" 'type, "created"|"in_progress"|"failed"|"complete"? status, ("created_at"|"download_expires_at"|"download_url"|"id"|"name"|"resumable"|"status"|"type"|"upload_expires_at"|"upload_url")[]? compliance_job\.fields) returns Get2ComplianceJobsResponse|http:Response { - } - - resource function get '2/dm_events(PaginationToken32? pagination_token, ("attachments"|"created_at"|"dm_conversation_id"|"entities"|"event_type"|"id"|"participant_ids"|"referenced_tweets"|"sender_id"|"text")[]? dm_event\.fields, ("attachments.media_keys"|"participant_ids"|"referenced_tweets.id"|"sender_id")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, int:Signed32 max_results = 100, ("MessageCreate"|"ParticipantsJoin"|"ParticipantsLeave")[] event_types = ["MessageCreate", "ParticipantsLeave", "ParticipantsJoin"]) returns Get2DmEventsResponse|http:Response { - } - - resource function get '2/likes/compliance/'stream(int:Signed32? backfill_minutes, string? start_time, string? end_time) returns LikesComplianceStreamResponse|http:Response { - } - - resource function get '2/likes/firehose/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("created_at"|"id"|"liked_tweet_author_id"|"liked_tweet_id"|"timestamp_ms")[]? like_with_tweet_author\.fields, ("liked_tweet_author_id"|"liked_tweet_id")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns StreamingLikeResponseV2|http:Response { - } - - resource function get '2/likes/sample10/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("created_at"|"id"|"liked_tweet_author_id"|"liked_tweet_id"|"timestamp_ms")[]? like_with_tweet_author\.fields, ("liked_tweet_author_id"|"liked_tweet_id")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns StreamingLikeResponseV2|http:Response { - } - - resource function get '2/openapi\.json() returns record {} { - } - - resource function get '2/spaces(string[] ids, ("created_at"|"creator_id"|"ended_at"|"host_ids"|"id"|"invited_user_ids"|"is_ticketed"|"lang"|"participant_count"|"scheduled_start"|"speaker_ids"|"started_at"|"state"|"subscriber_count"|"title"|"topic_ids"|"updated_at")[]? space\.fields, ("creator_id"|"host_ids"|"invited_user_ids"|"speaker_ids"|"topic_ids")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("description"|"id"|"name")[]? topic\.fields) returns Get2SpacesResponse|http:Response { - } - - resource function get '2/spaces/'by/creator_ids(UserId[] user_ids, ("created_at"|"creator_id"|"ended_at"|"host_ids"|"id"|"invited_user_ids"|"is_ticketed"|"lang"|"participant_count"|"scheduled_start"|"speaker_ids"|"started_at"|"state"|"subscriber_count"|"title"|"topic_ids"|"updated_at")[]? space\.fields, ("creator_id"|"host_ids"|"invited_user_ids"|"speaker_ids"|"topic_ids")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("description"|"id"|"name")[]? topic\.fields) returns Get2SpacesByCreatorIdsResponse|http:Response { - } - - resource function get '2/spaces/search(string query, ("created_at"|"creator_id"|"ended_at"|"host_ids"|"id"|"invited_user_ids"|"is_ticketed"|"lang"|"participant_count"|"scheduled_start"|"speaker_ids"|"started_at"|"state"|"subscriber_count"|"title"|"topic_ids"|"updated_at")[]? space\.fields, ("creator_id"|"host_ids"|"invited_user_ids"|"speaker_ids"|"topic_ids")[]? expansions, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("description"|"id"|"name")[]? topic\.fields, "live"|"scheduled"|"all" state = "all", int:Signed32 max_results = 100) returns Get2SpacesSearchResponse|http:Response { - } - - resource function get '2/tweets(TweetId[] ids, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns Get2TweetsResponse|http:Response { - Get2TweetsResponse response = { - "data": [ - { - "author_id": "2244994945", - "created_at": "Wed Jan 06 18:40:40 +0000 2021", - "id": "1346889436626259968", - "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i", - "username": "XDevelopers" - } - ] - }; - return response; - } - - resource function get '2/tweets/compliance/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time) returns TweetComplianceStreamResponse|http:Response { - } - - resource function get '2/tweets/counts/all(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, ("end"|"start"|"tweet_count")[]? search_count\.fields, "minute"|"hour"|"day" granularity = "hour") returns Get2TweetsCountsAllResponse|http:Response { - } - - resource function get '2/tweets/counts/recent(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, ("end"|"start"|"tweet_count")[]? search_count\.fields, "minute"|"hour"|"day" granularity = "hour") returns Get2TweetsCountsRecentResponse|http:Response { - } - - resource function get '2/tweets/firehose/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/firehose/'stream/lang/en(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/firehose/'stream/lang/ja(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/firehose/'stream/lang/ko(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/firehose/'stream/lang/pt(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/label/'stream(int:Signed32? backfill_minutes, string? start_time, string? end_time) returns TweetLabelStreamResponse|http:Response { - } - - resource function get '2/tweets/sample/'stream(int:Signed32? backfill_minutes, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns StreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/sample10/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns Get2TweetsSample10StreamResponse|http:Response { - } - - resource function get '2/tweets/search/'stream(int:Signed32? backfill_minutes, string? start_time, string? end_time, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns FilteredStreamingTweetResponse|http:Response { - } - - resource function get '2/tweets/search/'stream/rules(RuleId[]? ids, string? pagination_token, int:Signed32 max_results = 1000) returns RulesLookupResponse|http:Response { - } - - resource function get '2/tweets/search/'stream/rules/counts(("all_project_client_apps"|"cap_per_client_app"|"cap_per_project"|"client_app_rules_count"|"project_rules_count")[]? rules_count\.fields) returns Get2TweetsSearchStreamRulesCountsResponse|http:Response { - } - - resource function get '2/tweets/search/all(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, "recency"|"relevancy"? sort_order, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields, int:Signed32 max_results = 10) returns Get2TweetsSearchAllResponse|http:Response { - } - - resource function get '2/tweets/search/recent(string query, string? start_time, string? end_time, TweetId? since_id, TweetId? until_id, PaginationToken36? next_token, PaginationToken36? pagination_token, "recency"|"relevancy"? sort_order, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields, int:Signed32 max_results = 10) returns Get2TweetsSearchRecentResponse|http:Response { - } - - resource function get '2/usage/tweets(("cap_reset_day"|"daily_client_app_usage"|"daily_project_usage"|"project_cap"|"project_id"|"project_usage")[]? usage\.fields, int:Signed32 days = 7) returns Get2UsageTweetsResponse|http:Response { - } - - resource function get '2/users(UserId[] ids, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersResponse|http:Response { - } - - resource function get '2/users/'by(string[] usernames, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersByResponse|http:Response { - } - - resource function get '2/users/compliance/'stream(int:Signed32? backfill_minutes, int:Signed32 partition, string? start_time, string? end_time) returns UserComplianceStreamResponse|http:Response { - } - - resource function get '2/users/me(("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersMeResponse|http:Response { - } - - resource function get '2/users/search(UserSearchQuery query, PaginationToken36? next_token, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_banner_url"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, int:Signed32 max_results = 100) returns Get2UsersSearchResponse|http:Response { - } - - resource function post '2/compliance/jobs(@http:Payload CreateComplianceJobRequest payload) returns OkCreateComplianceJobResponse|http:Response { - } - - resource function post '2/dm_conversations(@http:Payload CreateDmConversationRequest payload) returns CreateDmEventResponse|http:Response { - } - - resource function post '2/lists(@http:Payload ListCreateRequest payload) returns OkListCreateResponse|http:Response { - } - - resource function post '2/tweets(@http:Payload TweetCreateRequest payload) returns TweetCreateResponse|http:Response { - } - - resource function post '2/tweets/search/'stream/rules(boolean? dry_run, boolean? delete_all, @http:Payload AddOrDeleteRulesRequest payload) returns OkAddOrDeleteRulesResponse|http:Response { - } -} diff --git a/ballerina/modules/mock/types.bal b/ballerina/modules/mock/types.bal deleted file mode 100644 index dc07cec..0000000 --- a/ballerina/modules/mock/types.bal +++ /dev/null @@ -1,1424 +0,0 @@ -// AUTO-GENERATED FILE. DO NOT MODIFY. -// This file is auto-generated by the Ballerina OpenAPI tool. - -// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/constraint; -import ballerina/http; - -public type Get2DmConversationsIdDmEventsResponse_meta record { - NextToken next_token?; - PreviousToken previous_token?; - ResultCount result_count?; -}; - -# The previous token. -@constraint:String {minLength: 1} -public type PreviousToken string; - -# Creation time of the compliance job. -public type CreatedAt string; - -public type UnlikeComplianceSchema record { - # Event time. - string event_at; - UnlikeComplianceSchema_favorite favorite; -}; - -public type UserComplianceSchema record { - # Event time. - string event_at; - UserComplianceSchema_user user; -}; - -public type OkCreateComplianceJobResponse record {| - *http:Ok; - CreateComplianceJobResponse body; - map headers; -|}; - -public type Tweet_edit_controls record { - # Time when Tweet is no longer editable. - string editable_until; - # Number of times this Tweet can be edited. - int edits_remaining; - # Indicates if this Tweet is eligible to be edited. - boolean is_edit_eligible; -}; - -public type TweetUnviewableSchema record { - TweetUnviewable public_tweet_unviewable; -}; - -# HTTP Status Code. -@constraint:Int {minValue: 100, maxValue: 599} -public type HttpStatusCode int; - -# Specifies the type of attachments (if any) present in this Tweet. -public type Tweet_attachments record { - # A list of Media Keys for each one of the media attachments (if media are attached). - @constraint:Array {minLength: 1} - MediaKey[] media_keys?; - # A list of Posts the media on this Tweet was originally posted in. For example, if the media on a tweet is re-used in another Tweet, this refers to the original, source Tweet.. - @constraint:Array {minLength: 1} - TweetId[] media_source_tweet_id?; - # A list of poll IDs (if polls are attached). - @constraint:Array {minLength: 1} - PollId[] poll_ids?; -}; - -# Tweet label data. -public type TweetLabelData TweetNoticeSchema|TweetUnviewableSchema; - -public type UserScrubGeoObjectSchema record { - # Event time. - string event_at; - TweetId up_to_tweet_id; - UserComplianceSchema_user user; -}; - -# A request to create a new batch compliance job. -public type CreateComplianceJobRequest record { - ComplianceJobName name?; - # If true, this endpoint will return a pre-signed URL with resumable uploads enabled. - boolean resumable?; - # Type of compliance job to list. - "tweets"|"users" 'type; -}; - -# -public type Space record { - # Creation time of the Space. - string created_at?; - UserId creator_id?; - # End time of the Space. - string ended_at?; - # The user ids for the hosts of the Space. - UserId[] host_ids?; - SpaceId id; - # An array of user ids for people who were invited to a Space. - UserId[] invited_user_ids?; - # Denotes if the Space is a ticketed Space. - boolean is_ticketed?; - # The language of the Space. - string lang?; - # The number of participants in a Space. - int:Signed32 participant_count?; - # A date time stamp for when a Space is scheduled to begin. - string scheduled_start?; - # An array of user ids for people who were speakers in a Space. - UserId[] speaker_ids?; - # When the Space was started as a date string. - string started_at?; - # The current state of the Space. - "live"|"scheduled"|"ended" state; - # The number of people who have either purchased a ticket or set a reminder for this Space. - int:Signed32 subscriber_count?; - # The title of the Space. - string title?; - # The topics of a Space, as selected by its creator. - Space_topics[] topics?; - # When the Space was last updated. - string updated_at?; -}; - -# Expanded details for the URL specified in the User's profile, with start and end indices. -public type User_entities_url record { - @constraint:Array {minLength: 1} - UrlEntity[] urls?; -}; - -# A response from deleting user-specified stream filtering rules. -public type DeleteRulesRequest record { - DeleteRulesRequest_delete delete; -}; - -# A request to add a user-specified stream filtering rule. -public type AddRulesRequest record { - RuleNoId[] add; -}; - -# Place ID being attached to the Tweet for geo location. -public type TweetCreateRequest_geo record {| - string place_id?; -|}; - -# Represent the portion of text recognized as a URL, and its start and end position within the text. -public type UrlEntityDm record { - *EntityIndicesInclusiveExclusive; - *UrlFields; -}; - -# Annotation inferred from the Tweet text. -public type ContextAnnotation record { - ContextAnnotationDomainFields domain; - ContextAnnotationEntityFields entity; -}; - -public type UserComplianceSchema_user record { - UserId id; -}; - -# Represent the portion of text recognized as a URL, and its start and end position within the text. -public type UrlEntity record { - *EntityIndicesInclusiveExclusive; - *UrlFields; -}; - -# Represent the portion of text recognized as a User mention, and its start and end position within the text. -public type MentionFields record { - UserId id?; - UserName username; -}; - -public type CreateDmConversationRequest record {| - # The conversation type that is being created. - "Group" conversation_type; - CreateMessageRequest message; - DmParticipants participant_ids; -|}; - -# Represents the data for the context annotation entity. -public type ContextAnnotationEntityFields record { - # Description of the context annotation entity. - string description?; - # The unique id for a context annotation entity. - @constraint:String {pattern: re `^[0-9]{1,19}$`} - string id; - # Name of the context annotation entity. - string name?; -}; - -public type Get2UsersSearchResponse record { - @constraint:Array {minLength: 1} - User[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - Get2UsersSearchResponse_meta meta?; -}; - -public type ListCreateResponse record { - ListCreateResponse_data data?; - @constraint:Array {minLength: 1} - Problem[] errors?; -}; - -public type CreateDmEventResponse record { - CreateDmEventResponse_data data?; - @constraint:Array {minLength: 1} - Problem[] errors?; -}; - -# Unique identifier of a DM Event. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type DmEventId string; - -public type DmEvent record { - DmEvent_attachments attachments?; - @constraint:Array {minLength: 1} - CashtagEntity[] cashtags?; - string created_at?; - DmConversationId dm_conversation_id?; - string event_type; - @constraint:Array {minLength: 1} - HashtagEntity[] hashtags?; - DmEventId id; - @constraint:Array {minLength: 1} - MentionEntity[] mentions?; - # A list of participants for a ParticipantsJoin or ParticipantsLeave event_type. - @constraint:Array {minLength: 1} - UserId[] participant_ids?; - # A list of Posts this DM refers to. - @constraint:Array {minLength: 1} - DmEvent_referenced_tweets[] referenced_tweets?; - UserId sender_id?; - string text?; - @constraint:Array {minLength: 1} - UrlEntityDm[] urls?; -}; - -public type LikeComplianceSchema record { - UnlikeComplianceSchema delete; -}; - -public type Get2TweetsResponse record { - @constraint:Array {minLength: 1} - Tweet[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -public type DmEvent_referenced_tweets record { - TweetId id; -}; - -# Client App Rule Counts for all applications in the project -public type AllProjectClientApps AppRulesCount[]; - -# The daily usage breakdown for a project -public type Usage_daily_project_usage record { - # The unique identifier for this project - int:Signed32 project_id?; - # The usage value - @constraint:Array {minLength: 1} - UsageFields[] usage?; -}; - -# Specifies the type of attachments (if any) present in this DM. -public type DmEvent_attachments record { - # A list of card IDs (if cards are attached). - @constraint:Array {minLength: 1} - string[] card_ids?; - # A list of Media Keys for each one of the media attachments (if media are attached). - @constraint:Array {minLength: 1} - MediaKey[] media_keys?; -}; - -public type Get2TweetsSearchStreamRulesCountsResponse record { - RulesCount data?; - @constraint:Array {minLength: 1} - Problem[] errors?; -}; - -public type Expansions record { - @constraint:Array {minLength: 1} - Media[] media?; - @constraint:Array {minLength: 1} - Place[] places?; - @constraint:Array {minLength: 1} - Poll[] polls?; - @constraint:Array {minLength: 1} - Topic[] topics?; - @constraint:Array {minLength: 1} - Tweet[] tweets?; - @constraint:Array {minLength: 1} - User[] users?; -}; - -public type TweetCreateResponse_data record { - TweetId id; - TweetText text; -}; - -public type UserDeleteComplianceSchema record { - UserComplianceSchema user_delete; -}; - -public type Get2TweetsCountsAllResponse record { - @constraint:Array {minLength: 1} - SearchCount[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Get2TweetsCountsAllResponse_meta meta?; -}; - -# User-provided name for a compliance job. -@constraint:String {maxLength: 64} -public type ComplianceJobName string; - -# Nonpublic engagement metrics for the Tweet at the time of the request. -public type Tweet_non_public_metrics record { - # Number of times this Tweet has been viewed. - int:Signed32 impression_count?; -}; - -public type Tweet_referenced_tweets record { - TweetId id; - "retweeted"|"quoted"|"replied_to" 'type; -}; - -public type TweetDropComplianceSchema record { - TweetComplianceSchema drop; -}; - -# The sum of results returned in this response. -public type Aggregate int:Signed32; - -public type Place record { - @constraint:Array {minLength: 1} - PlaceId[] contained_within?; - # The full name of the county in which this place exists. - string country?; - CountryCode country_code?; - # The full name of this place. - string full_name; - Geo geo?; - PlaceId id; - # The human readable name of this place. - string name?; - PlaceType place_type?; -}; - -public type UserUnprotectComplianceSchema record { - UserComplianceSchema user_unprotect; -}; - -# User compliance stream events. -public type UserComplianceStreamResponse record {UserComplianceData data;}|record {Problem[] errors;}; - -public type PlaceType "poi"|"neighborhood"|"city"|"admin"|"country"|"unknown"; - -# The start time of the bucket. -public type Start string; - -public type Tweet record { - Tweet_attachments attachments?; - UserId author_id?; - @constraint:Array {minLength: 1} - ContextAnnotation[] context_annotations?; - TweetId conversation_id?; - # Creation time of the Tweet. - string created_at?; - Tweet_edit_controls edit_controls?; - # A list of Tweet Ids in this Tweet chain. - @constraint:Array {minLength: 1} - TweetId[] edit_history_tweet_ids?; - FullTextEntities entities?; - Tweet_geo geo?; - TweetId id?; - UserId in_reply_to_user_id?; - # Language of the Tweet, if detected by X. Returned as a BCP47 language tag. - string lang?; - Tweet_non_public_metrics non_public_metrics?; - Tweet_note_tweet note_tweet?; - Tweet_organic_metrics organic_metrics?; - # Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences. - boolean possibly_sensitive?; - Tweet_promoted_metrics promoted_metrics?; - Tweet_public_metrics public_metrics?; - # A list of Posts this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent. - @constraint:Array {minLength: 1} - Tweet_referenced_tweets[] referenced_tweets?; - ReplySettingsWithVerifiedUsers reply_settings?; - Tweet_scopes scopes?; - # This is deprecated. - string 'source?; - TweetText text?; - UserName username?; - TweetWithheld withheld?; -}; - -# Type of compliance job to list. -public type ComplianceJobType "tweets"|"users"; - -# A base32 pagination token. -@constraint:String {minLength: 16} -public type PaginationToken32 string; - -# Participants for the DM Conversation. -@constraint:Array {maxLength: 49, minLength: 2} -public type DmParticipants UserId[]; - -# The ID of the client application -@constraint:String {maxLength: 19, minLength: 1} -public type ClientAppId string; - -# The unique identifier of this Like. -@constraint:String {pattern: re `^[A-Za-z0-9_]{1,40}$`} -public type LikeId string; - -# Represent the portion of text recognized as a Hashtag, and its start and end position within the text. -public type HashtagFields record { - # The text of the Hashtag. - string tag; -}; - -public type TweetWithheldComplianceSchema record { - TweetTakedownComplianceSchema withheld; -}; - -# URL from which the user will retrieve their compliance results. -public type DownloadUrl string; - -@constraint:String {maxLength: 25, minLength: 1} -public type TweetCreateRequest_pollOptionsItemsString string; - -# A user-provided stream filtering rule. -public type RuleNoId record { - RuleTag tag?; - RuleValue value; -}; - -public type UserProfileModificationObjectSchema record { - # Event time. - string event_at; - string new_value; - string profile_field; - UserComplianceSchema_user user; -}; - -public type Get2UsersByResponse record { - @constraint:Array {minLength: 1} - User[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -public type Get2TweetsCountsRecentResponse record { - @constraint:Array {minLength: 1} - SearchCount[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Get2TweetsCountsAllResponse_meta meta?; -}; - -# The unique identifier of this Media. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type MediaId string; - -# An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807). -public type Problem record { - string detail?; - int status?; - string title; - string 'type; -}; - -public type UnlikeComplianceSchema_favorite record { - TweetId id; - UserId user_id; -}; - -# The end time of the bucket. -public type End string; - -public type FilteredStreamingTweetResponse_matching_rules record { - RuleId id; - RuleTag tag?; -}; - -# A count of user-provided stream filtering rules at the application and project levels. -public type RulesCount record { - AllProjectClientApps all_project_client_apps?; - # Cap of number of rules allowed per client application - int:Signed32 cap_per_client_app?; - # Cap of number of rules allowed per project - int:Signed32 cap_per_project?; - AppRulesCount client_app_rules_count?; - # Number of rules for project - int:Signed32 project_rules_count?; -}; - -# URL to which the user will upload their Tweet or user IDs. -public type UploadUrl string; - -# A list of metadata found in the User's profile description. -public type User_entities record { - FullTextEntities description?; - User_entities_url url?; -}; - -public type RulesResponseMetadata record { - NextToken next_token?; - # Number of Rules in result set. - int:Signed32 result_count?; - string sent; - RulesRequestSummary summary?; -}; - -# Promoted nonpublic engagement metrics for the Tweet at the time of the request. -public type Tweet_promoted_metrics record { - # Number of times this Tweet has been viewed. - int:Signed32 impression_count?; - # Number of times this Tweet has been liked. - int:Signed32 like_count?; - # Number of times this Tweet has been replied to. - int:Signed32 reply_count?; - # Number of times this Tweet has been Retweeted. - int:Signed32 retweet_count?; -}; - -# The content of the Tweet. -public type TweetText string; - -# A list of metrics for this User. -public type User_public_metrics record { - # Number of Users who are following this User. - int followers_count; - # Number of Users this User is following. - int following_count; - # The number of likes created by this User. - int like_count?; - # The number of lists that include this User. - int listed_count; - # The number of Posts (including Retweets) posted by this User. - int tweet_count; -}; - -public type TweetComplianceSchema_tweet record { - UserId author_id; - TweetId id; -}; - -# The text of a poll choice. -@constraint:String {maxLength: 25, minLength: 1} -public type PollOptionLabel string; - -public type AddOrDeleteRulesRequest AddRulesRequest|DeleteRulesRequest; - -public type RulesLookupResponse record { - Rule[] data?; - RulesResponseMetadata meta; -}; - -public type CreateDmEventResponse_data record { - DmConversationId dm_conversation_id; - DmEventId dm_event_id; -}; - -public type Get2SpacesResponse record { - @constraint:Array {minLength: 1} - Space[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -public type FullTextEntities record { - @constraint:Array {minLength: 1} - record {*EntityIndicesInclusiveInclusive; string normalized_text?; decimal probability?; string 'type?;}[] annotations?; - @constraint:Array {minLength: 1} - CashtagEntity[] cashtags?; - @constraint:Array {minLength: 1} - HashtagEntity[] hashtags?; - @constraint:Array {minLength: 1} - MentionEntity[] mentions?; - @constraint:Array {minLength: 1} - UrlEntity[] urls?; -}; - -# Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive. -public type EntityIndicesInclusiveExclusive record { - # Index (zero-based) at which position this entity ends. The index is exclusive. - @constraint:Int {minValue: 0} - int end; - # Index (zero-based) at which position this entity starts. The index is inclusive. - @constraint:Int {minValue: 0} - int 'start; -}; - -# Describes a choice in a Poll object. -public type PollOption record { - PollOptionLabel label; - # Position of this choice in the poll. - int position; - # Number of users who voted for this choice. - int votes; -}; - -# The the search string by which to query for users. -@constraint:String {pattern: re `^[A-Za-z0-9_]{1,32}$`} -public type UserSearchQuery string; - -# The X handle (screen name) of this user. -@constraint:String {pattern: re `^[A-Za-z0-9_]{1,15}$`} -public type UserName string; - -# The X Topic object. -public type Space_topics record { - # The description of the given topic. - string description?; - # An ID suitable for use in the REST API. - string id; - # The name of the given topic. - string name; -}; - -public type Get2ComplianceJobsResponse record { - @constraint:Array {minLength: 1} - ComplianceJob[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Get2ComplianceJobsResponse_meta meta?; -}; - -# Usage per client app -public type ClientAppUsage record { - # The unique identifier for this project - string client_app_id?; - # The usage value - @constraint:Array {minLength: 1} - UsageFields[] usage?; - # The number of results returned - int:Signed32 usage_result_count?; -}; - -# Tweet information of the Tweet being replied to. -public type TweetCreateRequest_reply record {| - # A list of User Ids to be excluded from the reply Tweet. - UserId[] exclude_reply_user_ids?; - TweetId in_reply_to_tweet_id; -|}; - -public type CreateAttachmentsMessageRequest record { - DmAttachments attachments; - # Text of the message. - @constraint:String {minLength: 1} - string text?; -}; - -public type StreamingTweetResponse record { - Tweet data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -# Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). -public type TweetWithheld record { - # Indicates if the content is being withheld for on the basis of copyright infringement. - boolean copyright; - # Provides a list of countries where this content is not available. - @constraint:Array {minLength: 1} - CountryCode[] country_codes; - # Indicates whether the content being withheld is the `tweet` or a `user`. - "tweet"|"user" scope?; -}; - -# IDs and values of all deleted user-specified stream filtering rules. -public type DeleteRulesRequest_delete record { - # IDs of all deleted user-specified stream filtering rules. - RuleId[] ids?; - # Values of all deleted user-specified stream filtering rules. - RuleValue[] values?; -}; - -# A count of user-provided stream filtering rules at the client application level. -public type AppRulesCount record { - ClientAppId client_app_id?; - # Number of rules for client application - int:Signed32 rule_count?; -}; - -public type UserProtectComplianceSchema record { - UserComplianceSchema user_protect; -}; - -@constraint:Number {minValue: -180, maxValue: 180} -public type GeoBboxItemsNumber decimal; - -# Tweet compliance stream events. -public type TweetComplianceStreamResponse record {TweetComplianceData data;}|record {Problem[] errors;}; - -public type UserWithheldComplianceSchema record { - UserTakedownComplianceSchema user_withheld; -}; - -public type DmMediaAttachment record { - MediaId media_id; -}; - -public type Tweet_note_tweet_entities record { - @constraint:Array {minLength: 1} - CashtagEntity[] cashtags?; - @constraint:Array {minLength: 1} - HashtagEntity[] hashtags?; - @constraint:Array {minLength: 1} - MentionEntity[] mentions?; - @constraint:Array {minLength: 1} - UrlEntity[] urls?; -}; - -# The number of results returned in this response. -public type ResultCount int:Signed32; - -# A Like event, with the tweet author user and the tweet being liked -public type LikeWithTweetAuthor record { - # Creation time of the Tweet. - string created_at?; - LikeId id?; - TweetId liked_tweet_id?; - # Timestamp in milliseconds of creation. - int:Signed32 timestamp_ms?; - UserId tweet_author_id?; -}; - -public type UserSuspendComplianceSchema record { - UserComplianceSchema user_suspend; -}; - -public type CashtagEntity record { - *EntityIndicesInclusiveExclusive; - *CashtagFields; -}; - -# Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type TweetId string; - -public type HashtagEntity record { - *EntityIndicesInclusiveExclusive; - *HashtagFields; -}; - -# Organic nonpublic engagement metrics for the Tweet at the time of the request. -public type Tweet_organic_metrics record { - # Number of times this Tweet has been viewed. - int impression_count; - # Number of times this Tweet has been liked. - int like_count; - # Number of times this Tweet has been replied to. - int reply_count; - # Number of times this Tweet has been Retweeted. - int retweet_count; -}; - -# Expiration time of the download URL. -public type DownloadExpiration string; - -public type UserUndeleteComplianceSchema record { - UserComplianceSchema user_undelete; -}; - -public type ComplianceJob record { - CreatedAt created_at; - DownloadExpiration download_expires_at; - DownloadUrl download_url; - JobId id; - ComplianceJobName name?; - ComplianceJobStatus status; - ComplianceJobType 'type; - UploadExpiration upload_expires_at; - UploadUrl upload_url; -}; - -# A [GeoJson Position](https://tools.ietf.org/html/rfc7946#section-3.1.1) in the format `[longitude,latitude]`. -@constraint:Array {maxLength: 2, minLength: 2} -public type Position decimal[]; - -# The note content of the Tweet. -public type NoteTweetText string; - -# Represents the data for Usage -public type UsageFields record { - # The time period for the usage - string date?; - # The usage value - int:Signed32 usage?; -}; - -public type Geo record { - @constraint:Array {maxLength: 4, minLength: 4} - GeoBboxItemsNumber[] bbox; - Point geometry?; - record {} properties; - "Feature" 'type; -}; - -public type TweetEditComplianceObjectSchema record { - @constraint:Array {minLength: 1} - TweetId[] edit_tweet_ids; - # Event time. - string event_at; - TweetId initial_tweet_id; - DmEvent_referenced_tweets tweet; -}; - -public type Get2UsersMeResponse record { - User data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -# Tweet compliance data. -public type TweetComplianceData TweetDeleteComplianceSchema|TweetWithheldComplianceSchema|TweetDropComplianceSchema|TweetUndropComplianceSchema|TweetEditComplianceSchema; - -# A user-provided stream filtering rule. -public type Rule record { - RuleId id?; - RuleTag tag?; - RuleValue value; -}; - -public type RulesRequestSummary record {int:Signed32 created; int:Signed32 invalid; int:Signed32 not_created; int:Signed32 valid;}|record {int:Signed32 deleted; int:Signed32 not_deleted;}; - -# A X List is a curated group of accounts. -public type ListCreateResponse_data record { - ListId id; - # The name of this List. - string name; -}; - -public type TweetNoticeSchema record { - TweetNotice public_tweet_notice; -}; - -# User compliance data. -public type UserComplianceData UserProtectComplianceSchema|UserUnprotectComplianceSchema|UserDeleteComplianceSchema|UserUndeleteComplianceSchema|UserSuspendComplianceSchema|UserUnsuspendComplianceSchema|UserWithheldComplianceSchema|UserScrubGeoSchema|UserProfileModificationComplianceSchema; - -public type TweetNotice record { - # If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. - string application; - # Information shown on the Tweet label - string details?; - # Event time. - string event_at; - # The type of label on the Tweet - string event_type; - # Link to more information about this kind of label - string extended_details_url?; - # Title/header of the Tweet label - string label_title?; - TweetComplianceSchema_tweet tweet; -}; - -# A validly formatted URL. -public type Url string; - -public type CreateTextMessageRequest record { - DmAttachments attachments?; - # Text of the message. - @constraint:String {minLength: 1} - string text; -}; - -# The count for the bucket. -public type TweetCount int; - -# A tag meant for the labeling of user provided rules. -public type RuleTag string; - -public type FullTextEntitiesAnnotationsItemsnull record { - *EntityIndicesInclusiveInclusive; - string normalized_text?; - decimal probability?; - string 'type?; -}; - -public type StreamingLikeResponseV2 record { - LikeWithTweetAuthor data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -# Represent the portion of text recognized as a URL. -public type UrlFields record { - # Description of the URL landing page. - string description?; - # The URL as displayed in the X client. - string display_url?; - Url expanded_url?; - @constraint:Array {minLength: 1} - UrlImage[] images?; - MediaKey media_key?; - HttpStatusCode status?; - # Title of the page the URL points to. - string title?; - # Fully resolved url. - string unwound_url?; - Url url; -}; - -# Usage per client app -public type Usage record { - # Number of days left for the Tweet cap to reset - int:Signed32 cap_reset_day?; - # The daily usage breakdown for each Client Application a project - @constraint:Array {minLength: 1} - ClientAppUsage[] daily_client_app_usage?; - Usage_daily_project_usage daily_project_usage?; - # Total number of Posts that can be read in this project per month - int:Signed32 project_cap?; - # The unique identifier for this project - string project_id?; - # The number of Posts read in this project - int:Signed32 project_usage?; -}; - -public type TweetCreateRequest record {| - # Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link. - string card_uri?; - # Link to take the conversation from the public timeline to a private Direct Message. - string direct_message_deep_link?; - # Exclusive Tweet for super followers. - boolean for_super_followers_only = false; - TweetCreateRequest_geo geo?; - TweetCreateRequest_media media?; - # Nullcasted (promoted-only) Posts do not appear in the public timeline and are not served to followers. - boolean nullcast = false; - TweetCreateRequest_poll poll?; - TweetId quote_tweet_id?; - TweetCreateRequest_reply reply?; - # Settings to indicate who can reply to the Tweet. - "following"|"mentionedUsers"|"subscribers" reply_settings?; - TweetText text?; -|}; - -public type Get2SpacesSearchResponse record { - @constraint:Array {minLength: 1} - Space[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - Get2ComplianceJobsResponse_meta meta?; -}; - -public type TweetDeleteComplianceSchema record { - TweetComplianceSchema delete; -}; - -# Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, subscribers, verified and following. -public type ReplySettingsWithVerifiedUsers "everyone"|"mentionedUsers"|"following"|"other"|"subscribers"|"verified"; - -public type TweetComplianceSchema record { - # Event time. - string event_at; - TweetId quote_tweet_id?; - TweetComplianceSchema_tweet tweet; -}; - -# A base36 pagination token. -@constraint:String {minLength: 1} -public type PaginationToken36 string; - -# Engagement metrics for the Tweet at the time of the request. -public type Tweet_public_metrics record { - # Number of times this Tweet has been bookmarked. - int:Signed32 bookmark_count; - # Number of times this Tweet has been viewed. - int:Signed32 impression_count; - # Number of times this Tweet has been liked. - int like_count; - # Number of times this Tweet has been quoted. - int quote_count?; - # Number of times this Tweet has been replied to. - int reply_count; - # Number of times this Tweet has been Retweeted. - int retweet_count; -}; - -# Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is inclusive. -public type EntityIndicesInclusiveInclusive record { - # Index (zero-based) at which position this entity ends. The index is inclusive. - @constraint:Int {minValue: 0} - int end; - # Index (zero-based) at which position this entity starts. The index is inclusive. - @constraint:Int {minValue: 0} - int 'start; -}; - -public type Get2TweetsSearchAllResponse record { - @constraint:Array {minLength: 1} - Tweet[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - Get2TweetsSearchAllResponse_meta meta?; -}; - -public type TweetTakedownComplianceSchema record { - # Event time. - string event_at; - TweetId quote_tweet_id?; - TweetComplianceSchema_tweet tweet; - @constraint:Array {minLength: 1} - CountryCode[] withheld_in_countries; -}; - -# Likes compliance stream events. -public type LikesComplianceStreamResponse record {LikeComplianceSchema data;}|record {Problem[] errors;}; - -public type Get2TweetsSample10StreamResponse record { - Tweet data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; - -# Represent the information for the URL image. -public type UrlImage record { - MediaHeight height?; - Url url?; - MediaWidth width?; -}; - -# The newest id in this response. -public type NewestId string; - -# Unique identifier of this poll. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type PollId string; - -public type Get2TweetsSearchRecentResponse record { - @constraint:Array {minLength: 1} - Tweet[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - Get2TweetsSearchAllResponse_meta meta?; -}; - -# Attachments to a DM Event. -public type DmAttachments DmMediaAttachment[]; - -# The filterlang value of the rule. -public type RuleValue string; - -# Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations. -@constraint:String {pattern: re `^([0-9]{1,19}-[0-9]{1,19}|[0-9]{15,19})$`} -public type DmConversationId string; - -# Represent the portion of text recognized as a Cashtag, and its start and end position within the text. -public type CashtagFields record { - string tag; -}; - -public type UserScrubGeoSchema record { - UserScrubGeoObjectSchema scrub_geo; -}; - -public type Get2DmEventsResponse record { - @constraint:Array {minLength: 1} - DmEvent[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - Get2DmConversationsIdDmEventsResponse_meta meta?; -}; - -public type Get2UsageTweetsResponse record { - Usage data?; - @constraint:Array {minLength: 1} - Problem[] errors?; -}; - -# The width of the media in pixels. -@constraint:Int {minValue: 0} -public type MediaWidth int; - -# Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI. -public type TweetCreateRequest_media record {| - # A list of Media Ids to be attached to a created Tweet. - @constraint:Array {maxLength: 4, minLength: 1} - MediaId[] media_ids; - # A list of User Ids to be tagged in the media for created Tweet. - @constraint:Array {maxLength: 10} - UserId[] tagged_user_ids?; -|}; - -public type Get2SpacesByCreatorIdsResponse record { - @constraint:Array {minLength: 1} - Space[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - Get2ComplianceJobsResponse_meta meta?; -}; - -# The oldest id in this response. -public type OldestId string; - -public type CreateComplianceJobResponse record { - ComplianceJob data?; - @constraint:Array {minLength: 1} - Problem[] errors?; -}; - -# Represent a Search Count Result. -public type SearchCount record { - End end; - Start 'start; - TweetCount tweet_count; -}; - -# The identifier for this place. -public type PlaceId string; - -# Represents the data for the context annotation domain. -public type ContextAnnotationDomainFields record { - # Description of the context annotation domain. - string description?; - # The unique id for a context annotation domain. - @constraint:String {pattern: re `^[0-9]{1,19}$`} - string id; - # Name of the context annotation domain. - string name?; -}; - -# The scopes for this tweet -public type Tweet_scopes record { - # Indicates if this Tweet is viewable by followers without the Tweet ID - boolean followers?; -}; - -public type Get2TweetsSearchAllResponse_meta record { - NewestId newest_id?; - NextToken next_token?; - OldestId oldest_id?; - ResultCount result_count?; -}; - -public type OkListCreateResponse record {| - *http:Ok; - ListCreateResponse body; - map headers; -|}; - -public type Media record { - MediaHeight height?; - MediaKey media_key?; - string 'type; - MediaWidth width?; -}; - -# The full-content of the Tweet, including text beyond 280 characters. -public type Tweet_note_tweet record { - Tweet_note_tweet_entities entities?; - NoteTweetText text?; -}; - -# A response from modifying user-specified stream filtering rules. -public type AddOrDeleteRulesResponse record { - # All user-specified stream filtering rules that were created. - Rule[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - RulesResponseMetadata meta; -}; - -# The location tagged on the Tweet, if the user provided one. -public type Tweet_geo record { - Point coordinates?; - PlaceId place_id?; -}; - -# Status of a compliance job. -public type ComplianceJobStatus "created"|"in_progress"|"failed"|"complete"|"expired"; - -public type CreateMessageRequest CreateTextMessageRequest|CreateAttachmentsMessageRequest; - -# Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI. -public type TweetCreateRequest_poll record {| - # Duration of the poll in minutes. - @constraint:Int {minValue: 5, maxValue: 10080} - int:Signed32 duration_minutes; - @constraint:Array {maxLength: 4, minLength: 2} - TweetCreateRequest_pollOptionsItemsString[] options; - # Settings to indicate who can reply to the Tweet. - "following"|"mentionedUsers" reply_settings?; -|}; - -public type TweetCreateResponse record { - TweetCreateResponse_data data?; - @constraint:Array {minLength: 1} - Problem[] errors?; -}; - -# The height of the media in pixels. -@constraint:Int {minValue: 0} -public type MediaHeight int; - -public type TweetUndropComplianceSchema record { - TweetComplianceSchema undrop; -}; - -# The X User object. -public type User record { - # Returns detailed information about the relationship between two users. - ("follow_request_received"|"follow_request_sent"|"blocking"|"followed_by"|"following"|"muting")[] connection_status?; - # Creation time of this User. - string created_at?; - # The text of this User's profile description (also known as bio), if the User provided one. - string description?; - User_entities entities?; - UserId id; - # The location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries. - string location?; - TweetId most_recent_tweet_id?; - # The friendly name of this User, as shown on their profile. - string name; - TweetId pinned_tweet_id?; - # The URL to the profile image for this User. - string profile_image_url?; - # Indicates if this User has chosen to protect their Posts (in other words, if this User's Posts are private). - boolean protected?; - User_public_metrics public_metrics?; - # Indicates if you can send a DM to this User - boolean receives_your_dm?; - # The X Blue subscription type of the user, eg: Basic, Premium, PremiumPlus or None. - "Basic"|"Premium"|"PremiumPlus"|"None" subscription_type?; - # The URL specified in the User's profile. - string url?; - UserName username; - # Indicate if this User is a verified X User. - boolean verified?; - # The X Blue verified type of the user, eg: blue, government, business or none. - "blue"|"government"|"business"|"none" verified_type?; - UserWithheld withheld?; -}; - -# Tweet label stream events. -public type TweetLabelStreamResponse record {TweetLabelData data;}|record {Problem[] errors;}; - -# A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched. -public type FilteredStreamingTweetResponse record { - Tweet data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; - # The list of rules which matched the Tweet - FilteredStreamingTweetResponse_matching_rules[] matching_rules?; -}; - -# The next token. -@constraint:String {minLength: 1} -public type NextToken string; - -# Unique identifier of this rule. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type RuleId string; - -public type UserTakedownComplianceSchema record { - # Event time. - string event_at; - UserComplianceSchema_user user; - @constraint:Array {minLength: 1} - CountryCode[] withheld_in_countries; -}; - -# The Media Key identifier for this attachment. -@constraint:String {pattern: re `^([0-9]+)_([0-9]+)$`} -public type MediaKey string; - -# The unique identifier of this List. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type ListId string; - -public type UserUnsuspendComplianceSchema record { - UserComplianceSchema user_unsuspend; -}; - -# Unique identifier of this Topic. -public type TopicId string; - -public type TweetEditComplianceSchema record { - TweetEditComplianceObjectSchema tweet_edit; -}; - -# A two-letter ISO 3166-1 alpha-2 country code. -@constraint:String {pattern: re `^[A-Z]{2}$`} -public type CountryCode string; - -# The topic of a Space, as selected by its creator. -public type Topic record { - # The description of the given topic. - string description?; - TopicId id; - # The name of the given topic. - string name; -}; - -# Compliance Job ID. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type JobId string; - -public type TweetUnviewable record { - # If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. - string application; - # Event time. - string event_at; - TweetComplianceSchema_tweet tweet; -}; - -public type UserProfileModificationComplianceSchema record { - UserProfileModificationObjectSchema user_profile_modification; -}; - -public type MentionEntity record { - *EntityIndicesInclusiveExclusive; - *MentionFields; -}; - -public type Get2TweetsCountsAllResponse_meta record { - NewestId newest_id?; - NextToken next_token?; - OldestId oldest_id?; - Aggregate total_tweet_count?; -}; - -# The unique identifier of this Space. -@constraint:String {pattern: re `^[a-zA-Z0-9]{1,13}$`} -public type SpaceId string; - -# Expiration time of the upload URL. -public type UploadExpiration string; - -# A [GeoJson Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) geometry object. -public type Point record { - Position coordinates; - "Point" 'type; -}; - -public type OkAddOrDeleteRulesResponse record {| - *http:Ok; - AddOrDeleteRulesResponse body; - map headers; -|}; - -public type Get2ComplianceJobsResponse_meta record { - ResultCount result_count?; -}; - -public type ListCreateRequest record { - @constraint:String {maxLength: 100} - string description?; - @constraint:String {maxLength: 25, minLength: 1} - string name; - boolean 'private = false; -}; - -public type Get2UsersSearchResponse_meta record { - NextToken next_token?; - PreviousToken previous_token?; -}; - -# Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. -@constraint:String {pattern: re `^[0-9]{1,19}$`} -public type UserId string; - -# Represent a Poll attached to a Tweet. -public type Poll record { - @constraint:Int {minValue: 5, maxValue: 10080} - int:Signed32 duration_minutes?; - string end_datetime?; - PollId id; - @constraint:Array {maxLength: 4, minLength: 2} - PollOption[] options; - "open"|"closed" voting_status?; -}; - -# Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). -public type UserWithheld record { - # Provides a list of countries where this content is not available. - @constraint:Array {minLength: 1} - CountryCode[] country_codes; - # Indicates that the content being withheld is a `user`. - "user" scope?; -}; - -public type Get2UsersResponse record { - @constraint:Array {minLength: 1} - User[] data?; - @constraint:Array {minLength: 1} - Problem[] errors?; - Expansions includes?; -}; diff --git a/ballerina/tests/mock_service.bal b/ballerina/tests/mock_service.bal new file mode 100644 index 0000000..19c6732 --- /dev/null +++ b/ballerina/tests/mock_service.bal @@ -0,0 +1,217 @@ +// AUTO-GENERATED FILE. +// This file is auto-generated by the Ballerina OpenAPI tool. + +import ballerina/http; +import ballerina/log; + +listener http:Listener httpListener = new (9090); + +http:Service mockService = service object { + + + # Remove a bookmarked Post + # + # + id - The ID of the authenticated source User whose bookmark is to be removed. + # + tweet_id - The ID of the Post that the source User is removing from bookmarks. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function delete users/[UserIdMatchesAuthenticatedUser id]/bookmarks/[TweetId tweet_id]() returns BookmarkMutationResponse|http:Response { + BookmarkMutationResponse response = { + "data":{"bookmarked":false} + }; + return response; + } + + + + # Causes the User (in the path) to unlike the specified Post + # + # + id - The ID of the authenticated source User that is requesting to unlike the Post. + # + tweet_id - The ID of the Post that the User is requesting to unlike. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function delete users/[UserIdMatchesAuthenticatedUser id]/likes/[TweetId tweet_id]() returns UsersLikesDeleteResponse|http:Response { + UsersLikesDeleteResponse response = { + "data":{"liked":false} + }; + return response; + } + + # Causes the User (in the path) to unretweet the specified Post + # + # + id - The ID of the authenticated source User that is requesting to repost the Post. + # + source_tweet_id - The ID of the Post that the User is requesting to unretweet. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function delete users/[UserIdMatchesAuthenticatedUser id]/retweets/[TweetId source_tweet_id]() returns UsersRetweetsDeleteResponse|http:Response { + UsersRetweetsDeleteResponse response = { + "data":{"retweeted":false} + }; + return response; + } + + # Unfollow User + # + # + source_user_id - The ID of the authenticated source User that is requesting to unfollow the target User. + # + target_user_id - The ID of the User that the source User is requesting to unfollow. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function delete users/[UserIdMatchesAuthenticatedUser source_user_id]/following/[UserId target_user_id]() returns UsersFollowingDeleteResponse|http:Response { + UsersFollowingDeleteResponse response = { + "data":{"following":false} + }; + return response; + } + + # Unmute User by User ID + # + # + source_user_id - The ID of the authenticated source User that is requesting to unmute the target User. + # + target_user_id - The ID of the User that the source User is requesting to unmute. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function delete users/[UserIdMatchesAuthenticatedUser source_user_id]/muting/[UserId target_user_id]() returns MuteUserMutationResponse|http:Response { + MuteUserMutationResponse response = { + "data":{"muting":false} + }; + return response; + } + + # Post lookup by Post ID + # + # + id - A single Post ID. + # + tweet\.fields - A comma separated list of Tweet fields to display. + # + expansions - A comma separated list of fields to expand. + # + media\.fields - A comma separated list of Media fields to display. + # + poll\.fields - A comma separated list of Poll fields to display. + # + user\.fields - A comma separated list of User fields to display. + # + place\.fields - A comma separated list of Place fields to display. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function get tweets/[TweetId id](("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns Get2TweetsIdResponse|http:Response { + Get2TweetsIdResponse response = { + "data":{"edit_history_tweet_ids":["1806286701704462623"],"id":"1806286701704462623","text":"aasbcascbasjbc"} + }; + return response; + } + + resource function get users/'by/username/[string username](("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersByUsernameUsernameResponse|http:Response { + Get2UsersByUsernameUsernameResponse response = { + "data":{"id":"350224247","name":"Kumar Sangakkara","username":"KumarSanga2"} + }; + return response; + } + + + # Creation of a Post + # + # + return - returns can be any of following types + # http:Created (The request has succeeded.) + # http:Response (The request has failed.) + resource function post tweets(@http:Payload TweetCreateRequest payload) returns TweetCreateResponse|http:Response { + TweetCreateResponse response = { + "data":{"id":"1807808193139204482","text":"Twitter Test at[1719850035,0.227505100]","edit_history_tweet_ids":["1807808193139204482"]} + }; + return response; + } + + + # Add Post to Bookmarks + # + # + id - The ID of the authenticated source User for whom to add bookmarks. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function post users/[UserIdMatchesAuthenticatedUser id]/bookmarks(@http:Payload BookmarkAddRequest payload) returns BookmarkMutationResponse|http:Response { + BookmarkMutationResponse response ={ + "data":{"bookmarked":true} + }; + return response; + } + + + # Follow User + # + # + id - The ID of the authenticated source User that is requesting to follow the target User. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function post users/[UserIdMatchesAuthenticatedUser id]/following(@http:Payload UsersFollowingCreateRequest payload) returns UsersFollowingCreateResponse|http:Response { + UsersFollowingCreateResponse response = { + "data":{"following":true,"pending_follow":false} + }; + return response; + } + + # Causes the User (in the path) to like the specified Post + # + # + id - The ID of the authenticated source User that is requesting to like the Post. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function post users/[UserIdMatchesAuthenticatedUser id]/likes(@http:Payload UsersLikesCreateRequest payload) returns UsersLikesCreateResponse|http:Response { + UsersLikesCreateResponse response = { + "data":{"liked":true} + }; + return response; + } + + # Mute User by User ID. + # + # + id - The ID of the authenticated source User that is requesting to mute the target User. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function post users/[UserIdMatchesAuthenticatedUser id]/muting(@http:Payload MuteUserRequest payload) returns MuteUserMutationResponse|http:Response { + MuteUserMutationResponse response = { + "data":{"muting":true} + }; + return response; + } + + + # Causes the User (in the path) to repost the specified Post. + # + # + id - The ID of the authenticated source User that is requesting to repost the Post. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function post users/[UserIdMatchesAuthenticatedUser id]/retweets(@http:Payload UsersRetweetsCreateRequest payload) returns UsersRetweetsCreateResponse|http:Response { + UsersRetweetsCreateResponse response ={ + "data":{"retweeted":true,"rest_id":"1807808194787590411"} + }; + return response; + } + + # User lookup by IDs + # + # + ids - A list of User IDs, comma-separated. You can specify up to 100 IDs. + # + user\.fields - A comma separated list of User fields to display. + # + expansions - A comma separated list of fields to expand. + # + tweet\.fields - A comma separated list of Tweet fields to display. + # + return - returns can be any of following types + # http:Ok (The request has succeeded.) + # http:Response (The request has failed.) + resource function get users(UserId[] ids, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersResponse|http:Response { + Get2UsersResponse response = { + "data":[{"id":"350224247","name":"Kumar Sangakkara","username":"KumarSanga2"}] + }; + return response; + } +}; + +function init() returns error? { + if isLiveServer { + log:printInfo("Skiping mock server initialization as the tests are running on live server"); + return; + } + log:printInfo("Initiating mock server"); + check httpListener.attach(mockService, "/"); + check httpListener.'start(); +} + \ No newline at end of file diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 05d3246..6b4f12b 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -1,9 +1,7 @@ import ballerina/test; import ballerina/time; -import ballerina/io; import ballerina/os; - configurable boolean isLiveServer = os:getEnv("IS_LIVE_SERVER") == "true"; configurable string userId = isLiveServer ? os:getEnv("TWITTER_USER_ID") : "test"; configurable string token = isLiveServer ? os:getEnv("TWITTER_TOKEN") : "test"; @@ -16,18 +14,13 @@ final Client baseClient = check new Client(config, serviceUrl); @test:Config { } isolated function testPostTweet() returns error? { - io:println(isLiveServer); - io:println(token); time:Utc utc = time:utcNow(); - string tweetText = "Twitter Test at" + utc.toString(); + string tweetText = "Twitter Test at " + utc.toString(); TweetCreateResponse response = check baseClient->/tweets.post(payload = { text: tweetText }); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("1"); - - io:println(response); } //Test Get Twitter User Id of a user By Username @@ -37,8 +30,6 @@ isolated function testgetUserIdByUseName() returns error? { Get2UsersByUsernameUsernameResponse response = check baseClient->/users/'by/username/["KumarSanga2"]; test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("2"); - io:println(response); } //Test Like a Post via Post ID @@ -52,8 +43,6 @@ isolated function testUserLikeAPost() returns error? { ); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("3"); - io:println(response); } //Test Unlike a Post via Post ID @@ -63,8 +52,6 @@ isolated function testUserUnlikeAPost() returns error? { UsersLikesDeleteResponse response = check baseClient->/users/[userId]/likes/["1806286701704462623"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("4"); - io:println(response); } //Test grab information of a specific post via Id @@ -74,8 +61,6 @@ isolated function testPostLookup() returns error? { Get2TweetsIdResponse response = check baseClient->/tweets/["1806286701704462623"](); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("5"); - io:println(response); } //Test Bookmark a Post @@ -87,8 +72,6 @@ isolated function testBookmarkPost() returns error? { ); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("6"); - io:println(response); } //Test Unbookmark a Post @@ -98,8 +81,6 @@ isolated function testBookmarkDelete() returns error? { BookmarkMutationResponse response = check baseClient->/users/[userId]/bookmarks/["1806286701704462623"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("7"); - io:println(response); } @@ -112,8 +93,6 @@ isolated function testRetweet() returns error? { ); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("8"); - io:println(response); } //Test Unretweet a Post via Post ID @@ -123,8 +102,6 @@ isolated function testDeleteRetweet() returns error? { UsersRetweetsDeleteResponse response = check baseClient->/users/[userId]/retweets/["1806286701704462623"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("9"); - io:println(response); } //Test Follow a Specific User @@ -138,8 +115,6 @@ isolated function testFollowSpecificUser() returns error? { ); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("10"); - io:println(response); } //Test Unfollow a Specific User @@ -149,8 +124,6 @@ isolated function testUnfollowSpecificUser() returns error? { UsersFollowingDeleteResponse response = check baseClient->/users/[userId]/following/["1803011651249278976"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("11"); - io:println(response); } //Test Mute a Specific User @@ -164,8 +137,6 @@ isolated function muteSpecificUser() returns error? { ); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("12"); - io:println(response); } //Test Unmute a Specific User @@ -175,8 +146,6 @@ isolated function unmuteSpecificUser() returns error? { MuteUserMutationResponse response = check baseClient->/users/[userId]/muting/["1803011651249278976"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("13"); - io:println(response); } //Test FInd User Via ID @@ -186,6 +155,4 @@ isolated function findSpecificUser() returns error? { Get2UsersResponse response = check baseClient->/users(ids = ["1803011651249278976"]); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); - io:println("14"); - io:println(response); } From d57a1a204646ee2f17170dce0483a8bf1777dd63 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:04:16 +0530 Subject: [PATCH 08/15] Add License to test files --- ballerina/tests/mock_service.bal | 18 ++++++++++++++++-- ballerina/tests/test.bal | 16 ++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ballerina/tests/mock_service.bal b/ballerina/tests/mock_service.bal index 19c6732..dac085c 100644 --- a/ballerina/tests/mock_service.bal +++ b/ballerina/tests/mock_service.bal @@ -1,5 +1,19 @@ -// AUTO-GENERATED FILE. -// This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + import ballerina/http; import ballerina/log; diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 6b4f12b..8c9ab2f 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -1,3 +1,19 @@ +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + import ballerina/test; import ballerina/time; import ballerina/os; From 18e0ce4ca64a1c5114fab655c1572c29262a961e Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:14:28 +0530 Subject: [PATCH 09/15] Delete openapi_MOCK.json --- docs/spec/openapi_MOCK.json | 10591 ---------------------------------- 1 file changed, 10591 deletions(-) delete mode 100644 docs/spec/openapi_MOCK.json diff --git a/docs/spec/openapi_MOCK.json b/docs/spec/openapi_MOCK.json deleted file mode 100644 index 9feffbb..0000000 --- a/docs/spec/openapi_MOCK.json +++ /dev/null @@ -1,10591 +0,0 @@ -{ - "openapi" : "3.0.0", - "info" : { - "description" : "Twitter API v2 available endpoints", - "version" : "2.102", - "title" : "Twitter API v2", - "termsOfService" : "https://developer.twitter.com/en/developer-terms/agreement-and-policy.html", - "contact" : { - "name" : "Twitter Developers", - "url" : "https://developer.twitter.com/" - }, - "license" : { - "name" : "Twitter Developer Agreement and Policy", - "url" : "https://developer.twitter.com/en/developer-terms/agreement-and-policy.html" - } - }, - "paths" : { - "/2/compliance/jobs" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Compliance" - ], - "summary" : "List Compliance Jobs", - "description" : "Returns recent Compliance Jobs for a given job type and optional job status", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs" - }, - "operationId" : "listBatchComplianceJobs", - "parameters" : [ - { - "name" : "type", - "in" : "query", - "description" : "Type of Compliance Job to list.", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ - "tweets", - "users" - ] - }, - "style" : "form" - }, - { - "name" : "status", - "in" : "query", - "description" : "Status of Compliance Job to list.", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "created", - "in_progress", - "failed", - "complete" - ] - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/ComplianceJobFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2ComplianceJobsResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - }, - "post" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Compliance" - ], - "summary" : "Create compliance job", - "description" : "Creates a compliance for the given job type", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs" - }, - "operationId" : "createBatchComplianceJob", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateComplianceJobRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateComplianceJobResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/dm_conversations" : { - "post" : { - "security" : [ - { - "OAuth2UserToken" : [ - "dm.write", - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Direct Messages" - ], - "summary" : "Create a new DM Conversation", - "description" : "Creates a new DM Conversation.", - "operationId" : "dmConversationIdCreate", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateDmConversationRequest" - } - } - } - }, - "responses" : { - "201" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateDmEventResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/dm_events" : { - "get" : { - "security" : [ - { - "OAuth2UserToken" : [ - "dm.read", - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Direct Messages" - ], - "summary" : "Get recent DM Events", - "description" : "Returns recent DM Events across DM conversations", - "operationId" : "getDmEvents", - "parameters" : [ - { - "name" : "max_results", - "in" : "query", - "description" : "The maximum number of results.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 100, - "format" : "int32", - "default" : 100 - }, - "style" : "form" - }, - { - "name" : "pagination_token", - "in" : "query", - "description" : "This parameter is used to get a specified 'page' of results.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken32" - }, - "style" : "form" - }, - { - "name" : "event_types", - "in" : "query", - "description" : "The set of event_types to include in the results.", - "required" : false, - "schema" : { - "type" : "array", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "MessageCreate", - "ParticipantsJoin", - "ParticipantsLeave" - ] - }, - "default" : [ - "MessageCreate", - "ParticipantsLeave", - "ParticipantsJoin" - ], - "example" : [ - "MessageCreate", - "ParticipantsLeave" - ] - }, - "explode" : false, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/DmEventFieldsParameter" - }, - { - "$ref" : "#/components/parameters/DmEventExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2DmEventsResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/likes/compliance/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Compliance" - ], - "summary" : "Likes Compliance stream", - "description" : "Streams 100% of compliance data for Users", - "operationId" : "getLikesComplianceStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Likes Compliance events will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Likes Compliance events will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/LikesComplianceStreamResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/likes/firehose/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Likes" - ], - "summary" : "Likes Firehose stream", - "description" : "Streams 100% of public Likes.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-likes-firehose-stream" - }, - "operationId" : "likesFirehoseStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 20, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Likes will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/LikeWithTweetAuthorFieldsParameter" - }, - { - "$ref" : "#/components/parameters/LikeWithTweetAuthorExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingLikeResponseV2" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/likes/sample10/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Likes" - ], - "summary" : "Likes Sample 10 stream", - "description" : "Streams 10% of public Likes.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/likes/firehose/api-reference/get-likes-sample10-stream" - }, - "operationId" : "likesSample10Stream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 2, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Likes will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/LikeWithTweetAuthorFieldsParameter" - }, - { - "$ref" : "#/components/parameters/LikeWithTweetAuthorExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingLikeResponseV2" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/lists" : { - "post" : { - "security" : [ - { - "OAuth2UserToken" : [ - "list.read", - "list.write", - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Lists" - ], - "summary" : "Create List", - "description" : "Creates a new List.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists" - }, - "operationId" : "listIdCreate", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListCreateRequest" - } - } - } - }, - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ListCreateResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/openapi.json" : { - "get" : { - "tags" : [ - "General" - ], - "summary" : "Returns the OpenAPI Specification document.", - "description" : "Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md)", - "operationId" : "getOpenApiSpec", - "parameters" : [ ], - "responses" : { - "200" : { - "description" : "The request was successful", - "content" : { - "application/json" : { - "schema" : { - "type" : "object" - } - } - } - } - } - } - }, - "/2/spaces" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "space.read", - "tweet.read", - "users.read" - ] - } - ], - "tags" : [ - "Spaces" - ], - "summary" : "Space lookup up Space IDs", - "description" : "Returns a variety of information about the Spaces specified by the requested IDs", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces" - }, - "operationId" : "findSpacesByIds", - "parameters" : [ - { - "name" : "ids", - "in" : "query", - "description" : "The list of Space IDs to return.", - "required" : true, - "schema" : { - "type" : "array", - "minItems" : 1, - "maxItems" : 100, - "items" : { - "type" : "string", - "description" : "The unique identifier of this Space.", - "pattern" : "^[a-zA-Z0-9]{1,13}$", - "example" : "1SLjjRYNejbKM" - } - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/SpaceFieldsParameter" - }, - { - "$ref" : "#/components/parameters/SpaceExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TopicFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2SpacesResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/spaces/by/creator_ids" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "space.read", - "tweet.read", - "users.read" - ] - } - ], - "tags" : [ - "Spaces" - ], - "summary" : "Space lookup by their creators", - "description" : "Returns a variety of information about the Spaces created by the provided User IDs", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids" - }, - "operationId" : "findSpacesByCreatorIds", - "parameters" : [ - { - "name" : "user_ids", - "in" : "query", - "description" : "The IDs of Users to search through.", - "required" : true, - "schema" : { - "type" : "array", - "minItems" : 1, - "maxItems" : 100, - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/SpaceFieldsParameter" - }, - { - "$ref" : "#/components/parameters/SpaceExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TopicFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2SpacesByCreatorIdsResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/spaces/search" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "space.read", - "tweet.read", - "users.read" - ] - } - ], - "tags" : [ - "Spaces" - ], - "summary" : "Search for Spaces", - "description" : "Returns Spaces that match the provided query.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search" - }, - "operationId" : "searchSpaces", - "parameters" : [ - { - "name" : "query", - "in" : "query", - "description" : "The search query.", - "required" : true, - "example" : "crypto", - "schema" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 2048, - "example" : "crypto" - }, - "style" : "form" - }, - { - "name" : "state", - "in" : "query", - "description" : "The state of Spaces to search for.", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "live", - "scheduled", - "all" - ], - "default" : "all" - }, - "style" : "form" - }, - { - "name" : "max_results", - "in" : "query", - "description" : "The number of results to return.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 100, - "format" : "int32", - "default" : 100 - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/SpaceFieldsParameter" - }, - { - "$ref" : "#/components/parameters/SpaceExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TopicFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2SpacesSearchResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Post lookup by Post IDs", - "description" : "Returns a variety of information about the Post specified by the requested ID.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets" - }, - "operationId" : "findTweetsById", - "parameters" : [ - { - "name" : "ids", - "in" : "query", - "description" : "A comma separated list of Post IDs. Up to 100 are allowed in a single request.", - "required" : true, - "schema" : { - "type" : "array", - "minItems" : 1, - "maxItems" : 100, - "items" : { - "$ref" : "#/components/schemas/TweetId" - } - }, - "explode" : false, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - }, - "post" : { - "security" : [ - { - "OAuth2UserToken" : [ - "tweet.read", - "tweet.write", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Creation of a Post", - "description" : "Causes the User to create a Post under the authorized account.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets" - }, - "operationId" : "createTweet", - "parameters" : [ ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/TweetCreateRequest" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/TweetCreateResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets/compliance/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Compliance" - ], - "summary" : "Posts Compliance stream", - "description" : "Streams 100% of compliance data for Posts", - "operationId" : "getTweetsComplianceStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 4, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Post Compliance events will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Post Compliance events will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/TweetComplianceStreamResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/counts/all" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Full archive search counts", - "description" : "Returns Post Counts that match a search query.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all" - }, - "operationId" : "tweetCountsFullArchiveSearch", - "parameters" : [ - { - "name" : "query", - "in" : "query", - "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", - "required" : true, - "schema" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 4096, - "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "since_id", - "in" : "query", - "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "until_id", - "in" : "query", - "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "next_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "pagination_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "granularity", - "in" : "query", - "description" : "The granularity for the search counts results.", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "minute", - "hour", - "day" - ], - "default" : "hour" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/SearchCountFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsCountsAllResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets/counts/recent" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Recent search counts", - "description" : "Returns Post Counts from the last 7 days that match a search query.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent" - }, - "operationId" : "tweetCountsRecentSearch", - "parameters" : [ - { - "name" : "query", - "in" : "query", - "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", - "required" : true, - "schema" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 4096, - "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "since_id", - "in" : "query", - "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "until_id", - "in" : "query", - "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "next_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "pagination_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "granularity", - "in" : "query", - "description" : "The granularity for the search counts results.", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "minute", - "hour", - "day" - ], - "default" : "hour" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/SearchCountFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsCountsRecentResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets/firehose/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Firehose stream", - "description" : "Streams 100% of public Posts.", - "operationId" : "getTweetsFirehoseStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 20, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/firehose/stream/lang/en" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "English Language Firehose stream", - "description" : "Streams 100% of English Language public Posts.", - "operationId" : "getTweetsFirehoseStreamLangEn", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 8, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/firehose/stream/lang/ja" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Japanese Language Firehose stream", - "description" : "Streams 100% of Japanese Language public Posts.", - "operationId" : "getTweetsFirehoseStreamLangJa", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 2, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/firehose/stream/lang/ko" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Korean Language Firehose stream", - "description" : "Streams 100% of Korean Language public Posts.", - "operationId" : "getTweetsFirehoseStreamLangKo", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 2, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/firehose/stream/lang/pt" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Portuguese Language Firehose stream", - "description" : "Streams 100% of Portuguese Language public Posts.", - "operationId" : "getTweetsFirehoseStreamLangPt", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 2, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/label/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Compliance" - ], - "summary" : "Posts Label stream", - "description" : "Streams 100% of labeling events applied to Posts", - "operationId" : "getTweetsLabelStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Post labels will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Post labels will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/TweetLabelStreamResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/sample/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Sample stream", - "description" : "Streams a deterministic 1% of public Posts.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream" - }, - "operationId" : "sampleStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/StreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/sample10/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Sample 10% stream", - "description" : "Streams a deterministic 10% of public Posts.", - "operationId" : "getTweetsSample10Stream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 2, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsSample10StreamResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/search/all" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Full-archive search", - "description" : "Returns Posts that match a search query.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all" - }, - "operationId" : "tweetsFullarchiveSearch", - "parameters" : [ - { - "name" : "query", - "in" : "query", - "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", - "required" : true, - "schema" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 4096, - "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "since_id", - "in" : "query", - "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "until_id", - "in" : "query", - "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "max_results", - "in" : "query", - "description" : "The maximum number of search results to be returned by a request.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 10, - "maximum" : 500, - "format" : "int32", - "default" : 10 - }, - "style" : "form" - }, - { - "name" : "next_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "pagination_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "sort_order", - "in" : "query", - "description" : "This order in which to return results.", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "recency", - "relevancy" - ] - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsSearchAllResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets/search/recent" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Recent search", - "description" : "Returns Posts from the last 7 days that match a search query.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent" - }, - "operationId" : "tweetsRecentSearch", - "parameters" : [ - { - "name" : "query", - "in" : "query", - "description" : "One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.", - "required" : true, - "schema" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 4096, - "example" : "(from:TwitterDev OR from:TwitterAPI) has:media -is:retweet" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).", - "required" : false, - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "since_id", - "in" : "query", - "description" : "Returns results with a Post ID greater than (that is, more recent than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "until_id", - "in" : "query", - "description" : "Returns results with a Post ID less than (that is, older than) the specified ID.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/TweetId" - }, - "style" : "form" - }, - { - "name" : "max_results", - "in" : "query", - "description" : "The maximum number of search results to be returned by a request.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 10, - "maximum" : 100, - "format" : "int32", - "default" : 10 - }, - "style" : "form" - }, - { - "name" : "next_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "pagination_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "name" : "sort_order", - "in" : "query", - "description" : "This order in which to return results.", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "recency", - "relevancy" - ] - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsSearchRecentResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets/search/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Filtered stream", - "description" : "Streams Posts matching the stream's active rule set.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream" - }, - "operationId" : "searchStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Posts will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Posts will be provided.", - "required" : false, - "example" : "2021-02-14T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - }, - { - "$ref" : "#/components/parameters/TweetExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/MediaFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PollFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/PlaceFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/FilteredStreamingTweetResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/tweets/search/stream/rules" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Rules lookup", - "description" : "Returns rules from a User's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules" - }, - "operationId" : "getRules", - "parameters" : [ - { - "name" : "ids", - "in" : "query", - "description" : "A comma-separated list of Rule IDs.", - "required" : false, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RuleId" - } - }, - "style" : "form" - }, - { - "name" : "max_results", - "in" : "query", - "description" : "The maximum number of results.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 1000, - "format" : "int32", - "default" : 1000 - }, - "style" : "form" - }, - { - "name" : "pagination_token", - "in" : "query", - "description" : "This value is populated by passing the 'next_token' returned in a request to paginate through results.", - "required" : false, - "schema" : { - "type" : "string", - "minLength" : 16, - "maxLength" : 16 - }, - "style" : "form" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/RulesLookupResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - }, - "post" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Tweets" - ], - "summary" : "Add/Delete rules", - "description" : "Add or delete rules from a User's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/post-tweets-search-stream-rules" - }, - "operationId" : "addOrDeleteRules", - "parameters" : [ - { - "name" : "dry_run", - "in" : "query", - "description" : "Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes.", - "required" : false, - "schema" : { - "type" : "boolean" - }, - "style" : "form" - }, - { - "name" : "delete_all", - "in" : "query", - "description" : "Delete All can be used to delete all of the rules associated this client app, it should be specified with no other parameters. Once deleted, rules cannot be recovered.", - "required" : false, - "schema" : { - "type" : "boolean" - }, - "style" : "form" - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/AddOrDeleteRulesRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/AddOrDeleteRulesResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/tweets/search/stream/rules/counts" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "General" - ], - "summary" : "Rules Count", - "description" : "Returns the counts of rules from a User's active rule set, to reflect usage by project and application.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules-counts" - }, - "operationId" : "getRuleCount", - "parameters" : [ - { - "$ref" : "#/components/parameters/RulesCountFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2TweetsSearchStreamRulesCountsResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/usage/tweets" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Usage" - ], - "summary" : "Post Usage", - "description" : "Returns the Post Usage.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/usage/tweets/api-reference/get-usage-tweets" - }, - "operationId" : "getUsageTweets", - "parameters" : [ - { - "name" : "days", - "in" : "query", - "description" : "The number of days for which you need usage for.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 90, - "format" : "int32", - "default" : 7 - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/UsageFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2UsageTweetsResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/users" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Users" - ], - "summary" : "User lookup by IDs", - "description" : "This endpoint returns information about Users. Specify Users by their ID.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users" - }, - "operationId" : "findUsersById", - "parameters" : [ - { - "name" : "ids", - "in" : "query", - "description" : "A list of User IDs, comma-separated. You can specify up to 100 IDs.", - "required" : true, - "example" : "2244994945,6253282,12", - "schema" : { - "type" : "array", - "minItems" : 1, - "maxItems" : 100, - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "explode" : false, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2UsersResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/users/by" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - }, - { - "OAuth2UserToken" : [ - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Users" - ], - "summary" : "User lookup by usernames", - "description" : "This endpoint returns information about Users. Specify Users by their username.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by" - }, - "operationId" : "findUsersByUsername", - "parameters" : [ - { - "name" : "usernames", - "in" : "query", - "description" : "A list of usernames, comma-separated.", - "required" : true, - "schema" : { - "type" : "array", - "minItems" : 1, - "maxItems" : 100, - "items" : { - "type" : "string", - "description" : "The X handle (screen name) of this User.", - "pattern" : "^[A-Za-z0-9_]{1,15}$" - }, - "example" : "TwitterDev,TwitterAPI" - }, - "explode" : false, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2UsersByResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/users/compliance/stream" : { - "get" : { - "security" : [ - { - "BearerToken" : [ ] - } - ], - "tags" : [ - "Compliance" - ], - "summary" : "Users Compliance stream", - "description" : "Streams 100% of compliance data for Users", - "operationId" : "getUsersComplianceStream", - "parameters" : [ - { - "name" : "backfill_minutes", - "in" : "query", - "description" : "The number of minutes of backfill requested.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 0, - "maximum" : 5, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "partition", - "in" : "query", - "description" : "The partition number.", - "required" : true, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 4, - "format" : "int32" - }, - "style" : "form" - }, - { - "name" : "start_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - }, - { - "name" : "end_time", - "in" : "query", - "description" : "YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided.", - "required" : false, - "example" : "2021-02-01T18:40:40.000Z", - "schema" : { - "type" : "string", - "format" : "date-time" - }, - "style" : "form" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UserComplianceStreamResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "x-twitter-streaming" : true - } - }, - "/2/users/me" : { - "get" : { - "security" : [ - { - "OAuth2UserToken" : [ - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Users" - ], - "summary" : "User lookup me", - "description" : "This endpoint returns information about the requesting User.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me" - }, - "operationId" : "findMyUser", - "parameters" : [ - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2UsersMeResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - }, - "/2/users/search" : { - "get" : { - "security" : [ - { - "OAuth2UserToken" : [ - "tweet.read", - "users.read" - ] - }, - { - "UserToken" : [ ] - } - ], - "tags" : [ - "Users" - ], - "summary" : "User search", - "description" : "Returns Users that match a search query.", - "externalDocs" : { - "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-search" - }, - "operationId" : "searchUserByQuery", - "parameters" : [ - { - "name" : "query", - "in" : "query", - "description" : "TThe the query string by which to query for users.", - "required" : true, - "example" : "someXUser", - "schema" : { - "$ref" : "#/components/schemas/UserSearchQuery" - }, - "style" : "form" - }, - { - "name" : "max_results", - "in" : "query", - "description" : "The maximum number of results.", - "required" : false, - "schema" : { - "type" : "integer", - "minimum" : 1, - "maximum" : 1000, - "format" : "int32", - "default" : 100 - }, - "style" : "form" - }, - { - "name" : "next_token", - "in" : "query", - "description" : "This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.", - "required" : false, - "schema" : { - "$ref" : "#/components/schemas/PaginationToken36" - }, - "style" : "form" - }, - { - "$ref" : "#/components/parameters/UserFieldsParameter" - }, - { - "$ref" : "#/components/parameters/UserExpansionsParameter" - }, - { - "$ref" : "#/components/parameters/TweetFieldsParameter" - } - ], - "responses" : { - "200" : { - "description" : "The request has succeeded.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Get2UsersSearchResponse" - } - } - } - }, - "default" : { - "description" : "The request has failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } - }, - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - } - } - } - }, - "servers" : [ - { - "description" : "Twitter API", - "url" : "https://api.twitter.com" - } - ], - "tags" : [ - { - "name" : "Bookmarks", - "description" : "Endpoints related to retrieving, managing bookmarks of a user", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/bookmarks" - } - }, - { - "name" : "Compliance", - "description" : "Endpoints related to keeping X data in your systems compliant", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/compliance/batch-tweet/introduction" - } - }, - { - "name" : "Direct Messages", - "description" : "Endpoints related to retrieving, managing Direct Messages", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/direct-messages" - } - }, - { - "name" : "General", - "description" : "Miscellaneous endpoints for general API functionality", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api" - } - }, - { - "name" : "Lists", - "description" : "Endpoints related to retrieving, managing Lists", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/lists" - } - }, - { - "name" : "Spaces", - "description" : "Endpoints related to retrieving, managing Spaces", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/spaces" - } - }, - { - "name" : "Tweets", - "description" : "Endpoints related to retrieving, searching, and modifying Tweets", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/tweets/lookup" - } - }, - { - "name" : "Users", - "description" : "Endpoints related to retrieving, managing relationships of Users", - "externalDocs" : { - "description" : "Find out more", - "url" : "https://developer.twitter.com/en/docs/twitter-api/users/lookup" - } - } - ], - "components" : { - "securitySchemes" : { - "BearerToken" : { - "type" : "http", - "scheme" : "bearer" - }, - "OAuth2UserToken" : { - "type" : "oauth2", - "flows" : { - "authorizationCode" : { - "authorizationUrl" : "https://api.twitter.com/2/oauth2/authorize", - "tokenUrl" : "https://api.twitter.com/2/oauth2/token", - "scopes" : { - "block.read" : "Accounts you’ve blocked.", - "bookmark.read" : "Allows an app to read bookmarked Tweets", - "bookmark.write" : "Allows an app to create and delete bookmarks", - "dm.read" : "All your Direct Messages", - "dm.write" : "Send and manage Direct Messages for you", - "follows.read" : "People who follow you and people who you follow.", - "follows.write" : "Follow and unfollow people for you.", - "like.read" : "Tweets you’ve liked and likes you can view.", - "like.write" : "Like and un-like Tweets for you.", - "list.read" : "Lists, list members, and list followers of lists you’ve created or are a member of, including private lists.", - "list.write" : "Create and manage Lists for you.", - "mute.read" : "Accounts you’ve muted.", - "mute.write" : "Mute and unmute accounts for you.", - "offline.access" : "App can request refresh token.", - "space.read" : "Access all of the Spaces you can see.", - "tweet.moderate.write" : "Hide and unhide replies to your Tweets.", - "tweet.read" : "All the Tweets you can see, including Tweets from protected accounts.", - "tweet.write" : "Tweet and retweet for you.", - "users.read" : "Any account you can see, including protected accounts. Any account you can see, including protected accounts." - } - } - } - }, - "UserToken" : { - "type" : "http", - "scheme" : "OAuth" - } - }, - "schemas" : { - "AddOrDeleteRulesRequest" : { - "oneOf" : [ - { - "$ref" : "#/components/schemas/AddRulesRequest" - }, - { - "$ref" : "#/components/schemas/DeleteRulesRequest" - } - ] - }, - "AddOrDeleteRulesResponse" : { - "type" : "object", - "description" : "A response from modifying user-specified stream filtering rules.", - "required" : [ - "meta" - ], - "properties" : { - "data" : { - "type" : "array", - "description" : "All user-specified stream filtering rules that were created.", - "items" : { - "$ref" : "#/components/schemas/Rule" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "meta" : { - "$ref" : "#/components/schemas/RulesResponseMetadata" - } - } - }, - "AddRulesRequest" : { - "type" : "object", - "description" : "A request to add a user-specified stream filtering rule.", - "required" : [ - "add" - ], - "properties" : { - "add" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RuleNoId" - } - } - } - }, - "Aggregate" : { - "type" : "integer", - "description" : "The sum of results returned in this response.", - "format" : "int32" - }, - "AllProjectClientApps" : { - "type" : "array", - "description" : "Client App Rule Counts for all applications in the project", - "items" : { - "$ref" : "#/components/schemas/AppRulesCount" - } - }, - "AnimatedGif" : { - "allOf" : [ - { - "$ref" : "#/components/schemas/Media" - }, - { - "type" : "object", - "properties" : { - "preview_image_url" : { - "type" : "string", - "format" : "uri" - }, - "variants" : { - "$ref" : "#/components/schemas/Variants" - } - } - } - ] - }, - "AppRulesCount" : { - "type" : "object", - "description" : "A count of user-provided stream filtering rules at the client application level.", - "properties" : { - "client_app_id" : { - "$ref" : "#/components/schemas/ClientAppId" - }, - "rule_count" : { - "type" : "integer", - "description" : "Number of rules for client application", - "format" : "int32" - } - } - }, - "BookmarkAddRequest" : { - "type" : "object", - "required" : [ - "tweet_id" - ], - "properties" : { - "tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - }, - "BookmarkMutationResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "bookmarked" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "CashtagEntity" : { - "allOf" : [ - { - "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" - }, - { - "$ref" : "#/components/schemas/CashtagFields" - } - ] - }, - "CashtagFields" : { - "type" : "object", - "description" : "Represent the portion of text recognized as a Cashtag, and its start and end position within the text.", - "required" : [ - "tag" - ], - "properties" : { - "tag" : { - "type" : "string", - "example" : "TWTR" - } - } - }, - "ClientAppId" : { - "type" : "string", - "description" : "The ID of the client application", - "minLength" : 1, - "maxLength" : 19 - }, - "ClientAppUsage" : { - "type" : "object", - "description" : "Usage per client app", - "properties" : { - "client_app_id" : { - "type" : "string", - "description" : "The unique identifier for this project", - "format" : "^[0-9]{1,19}$" - }, - "usage" : { - "type" : "array", - "description" : "The usage value", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UsageFields" - } - }, - "usage_result_count" : { - "type" : "integer", - "description" : "The number of results returned", - "format" : "int32" - } - } - }, - "ClientDisconnectedProblem" : { - "description" : "Your client has gone away.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "ClientForbiddenProblem" : { - "description" : "A problem that indicates your client is forbidden from making this request.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "properties" : { - "reason" : { - "type" : "string", - "enum" : [ - "official-client-forbidden", - "client-not-enrolled" - ] - }, - "registration_url" : { - "type" : "string", - "format" : "uri" - } - } - } - ] - }, - "ComplianceJob" : { - "type" : "object", - "required" : [ - "id", - "type", - "created_at", - "upload_url", - "download_url", - "upload_expires_at", - "download_expires_at", - "status" - ], - "properties" : { - "created_at" : { - "$ref" : "#/components/schemas/CreatedAt" - }, - "download_expires_at" : { - "$ref" : "#/components/schemas/DownloadExpiration" - }, - "download_url" : { - "$ref" : "#/components/schemas/DownloadUrl" - }, - "id" : { - "$ref" : "#/components/schemas/JobId" - }, - "name" : { - "$ref" : "#/components/schemas/ComplianceJobName" - }, - "status" : { - "$ref" : "#/components/schemas/ComplianceJobStatus" - }, - "type" : { - "$ref" : "#/components/schemas/ComplianceJobType" - }, - "upload_expires_at" : { - "$ref" : "#/components/schemas/UploadExpiration" - }, - "upload_url" : { - "$ref" : "#/components/schemas/UploadUrl" - } - } - }, - "ComplianceJobName" : { - "type" : "string", - "description" : "User-provided name for a compliance job.", - "maxLength" : 64, - "example" : "my-job" - }, - "ComplianceJobStatus" : { - "type" : "string", - "description" : "Status of a compliance job.", - "enum" : [ - "created", - "in_progress", - "failed", - "complete", - "expired" - ] - }, - "ComplianceJobType" : { - "type" : "string", - "description" : "Type of compliance job to list.", - "enum" : [ - "tweets", - "users" - ] - }, - "ConflictProblem" : { - "description" : "You cannot create a new job if one is already in progress.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "ConnectionExceptionProblem" : { - "description" : "A problem that indicates something is wrong with the connection.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "properties" : { - "connection_issue" : { - "type" : "string", - "enum" : [ - "TooManyConnections", - "ProvisioningSubscription", - "RuleConfigurationIssue", - "RulesInvalidIssue" - ] - } - } - } - ] - }, - "ContextAnnotation" : { - "type" : "object", - "description" : "Annotation inferred from the Tweet text.", - "required" : [ - "domain", - "entity" - ], - "properties" : { - "domain" : { - "$ref" : "#/components/schemas/ContextAnnotationDomainFields" - }, - "entity" : { - "$ref" : "#/components/schemas/ContextAnnotationEntityFields" - } - } - }, - "ContextAnnotationDomainFields" : { - "type" : "object", - "description" : "Represents the data for the context annotation domain.", - "required" : [ - "id" - ], - "properties" : { - "description" : { - "type" : "string", - "description" : "Description of the context annotation domain." - }, - "id" : { - "type" : "string", - "description" : "The unique id for a context annotation domain.", - "pattern" : "^[0-9]{1,19}$" - }, - "name" : { - "type" : "string", - "description" : "Name of the context annotation domain." - } - } - }, - "ContextAnnotationEntityFields" : { - "type" : "object", - "description" : "Represents the data for the context annotation entity.", - "required" : [ - "id" - ], - "properties" : { - "description" : { - "type" : "string", - "description" : "Description of the context annotation entity." - }, - "id" : { - "type" : "string", - "description" : "The unique id for a context annotation entity.", - "pattern" : "^[0-9]{1,19}$" - }, - "name" : { - "type" : "string", - "description" : "Name of the context annotation entity." - } - } - }, - "CountryCode" : { - "type" : "string", - "description" : "A two-letter ISO 3166-1 alpha-2 country code.", - "pattern" : "^[A-Z]{2}$", - "example" : "US" - }, - "CreateAttachmentsMessageRequest" : { - "type" : "object", - "required" : [ - "attachments" - ], - "properties" : { - "attachments" : { - "$ref" : "#/components/schemas/DmAttachments" - }, - "text" : { - "type" : "string", - "description" : "Text of the message.", - "minLength" : 1 - } - } - }, - "CreateComplianceJobRequest" : { - "type" : "object", - "description" : "A request to create a new batch compliance job.", - "required" : [ - "type" - ], - "properties" : { - "name" : { - "$ref" : "#/components/schemas/ComplianceJobName" - }, - "resumable" : { - "type" : "boolean", - "description" : "If true, this endpoint will return a pre-signed URL with resumable uploads enabled." - }, - "type" : { - "type" : "string", - "description" : "Type of compliance job to list.", - "enum" : [ - "tweets", - "users" - ] - } - } - }, - "CreateComplianceJobResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/ComplianceJob" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "CreateDmConversationRequest" : { - "type" : "object", - "required" : [ - "conversation_type", - "participant_ids", - "message" - ], - "properties" : { - "conversation_type" : { - "type" : "string", - "description" : "The conversation type that is being created.", - "enum" : [ - "Group" - ] - }, - "message" : { - "$ref" : "#/components/schemas/CreateMessageRequest" - }, - "participant_ids" : { - "$ref" : "#/components/schemas/DmParticipants" - } - }, - "additionalProperties" : false - }, - "CreateDmEventResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "required" : [ - "dm_conversation_id", - "dm_event_id" - ], - "properties" : { - "dm_conversation_id" : { - "$ref" : "#/components/schemas/DmConversationId" - }, - "dm_event_id" : { - "$ref" : "#/components/schemas/DmEventId" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "CreateMessageRequest" : { - "anyOf" : [ - { - "$ref" : "#/components/schemas/CreateTextMessageRequest" - }, - { - "$ref" : "#/components/schemas/CreateAttachmentsMessageRequest" - } - ] - }, - "CreateTextMessageRequest" : { - "type" : "object", - "required" : [ - "text" - ], - "properties" : { - "attachments" : { - "$ref" : "#/components/schemas/DmAttachments" - }, - "text" : { - "type" : "string", - "description" : "Text of the message.", - "minLength" : 1 - } - } - }, - "CreatedAt" : { - "type" : "string", - "description" : "Creation time of the compliance job.", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "DeleteDmResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "deleted" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "DeleteRulesRequest" : { - "type" : "object", - "description" : "A response from deleting user-specified stream filtering rules.", - "required" : [ - "delete" - ], - "properties" : { - "delete" : { - "type" : "object", - "description" : "IDs and values of all deleted user-specified stream filtering rules.", - "properties" : { - "ids" : { - "type" : "array", - "description" : "IDs of all deleted user-specified stream filtering rules.", - "items" : { - "$ref" : "#/components/schemas/RuleId" - } - }, - "values" : { - "type" : "array", - "description" : "Values of all deleted user-specified stream filtering rules.", - "items" : { - "$ref" : "#/components/schemas/RuleValue" - } - } - } - } - } - }, - "DisallowedResourceProblem" : { - "description" : "A problem that indicates that the resource requested violates the precepts of this API.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "required" : [ - "resource_id", - "resource_type", - "section" - ], - "properties" : { - "resource_id" : { - "type" : "string" - }, - "resource_type" : { - "type" : "string", - "enum" : [ - "user", - "tweet", - "media", - "list", - "space" - ] - }, - "section" : { - "type" : "string", - "enum" : [ - "data", - "includes" - ] - } - } - } - ] - }, - "DmAttachments" : { - "type" : "array", - "description" : "Attachments to a DM Event.", - "items" : { - "$ref" : "#/components/schemas/DmMediaAttachment" - } - }, - "DmConversationId" : { - "type" : "string", - "description" : "Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations.", - "pattern" : "^([0-9]{1,19}-[0-9]{1,19}|[0-9]{15,19})$", - "example" : "123123123-456456456" - }, - "DmEvent" : { - "type" : "object", - "required" : [ - "id", - "event_type" - ], - "properties" : { - "attachments" : { - "type" : "object", - "description" : "Specifies the type of attachments (if any) present in this DM.", - "properties" : { - "card_ids" : { - "type" : "array", - "description" : "A list of card IDs (if cards are attached).", - "minItems" : 1, - "items" : { - "type" : "string" - } - }, - "media_keys" : { - "type" : "array", - "description" : "A list of Media Keys for each one of the media attachments (if media are attached).", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/MediaKey" - } - } - } - }, - "cashtags" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/CashtagEntity" - } - }, - "created_at" : { - "type" : "string", - "format" : "date-time" - }, - "dm_conversation_id" : { - "$ref" : "#/components/schemas/DmConversationId" - }, - "event_type" : { - "type" : "string", - "example" : "MessageCreate" - }, - "hashtags" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/HashtagEntity" - } - }, - "id" : { - "$ref" : "#/components/schemas/DmEventId" - }, - "mentions" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/MentionEntity" - } - }, - "participant_ids" : { - "type" : "array", - "description" : "A list of participants for a ParticipantsJoin or ParticipantsLeave event_type.", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "referenced_tweets" : { - "type" : "array", - "description" : "A list of Posts this DM refers to.", - "minItems" : 1, - "items" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - } - }, - "sender_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "text" : { - "type" : "string" - }, - "urls" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UrlEntityDm" - } - } - } - }, - "DmEventId" : { - "type" : "string", - "description" : "Unique identifier of a DM Event.", - "pattern" : "^[0-9]{1,19}$", - "example" : "1146654567674912769" - }, - "DmMediaAttachment" : { - "type" : "object", - "required" : [ - "media_id" - ], - "properties" : { - "media_id" : { - "$ref" : "#/components/schemas/MediaId" - } - } - }, - "DmParticipants" : { - "type" : "array", - "description" : "Participants for the DM Conversation.", - "minItems" : 2, - "maxItems" : 49, - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "DownloadExpiration" : { - "type" : "string", - "description" : "Expiration time of the download URL.", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "DownloadUrl" : { - "type" : "string", - "description" : "URL from which the user will retrieve their compliance results.", - "format" : "uri" - }, - "DuplicateRuleProblem" : { - "description" : "The rule you have submitted is a duplicate.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "value" : { - "type" : "string" - } - } - } - ] - }, - "End" : { - "type" : "string", - "description" : "The end time of the bucket.", - "format" : "date-time" - }, - "EntityIndicesInclusiveExclusive" : { - "type" : "object", - "description" : "Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive.", - "required" : [ - "start", - "end" - ], - "properties" : { - "end" : { - "type" : "integer", - "description" : "Index (zero-based) at which position this entity ends. The index is exclusive.", - "minimum" : 0, - "example" : 61 - }, - "start" : { - "type" : "integer", - "description" : "Index (zero-based) at which position this entity starts. The index is inclusive.", - "minimum" : 0, - "example" : 50 - } - } - }, - "EntityIndicesInclusiveInclusive" : { - "type" : "object", - "description" : "Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is inclusive.", - "required" : [ - "start", - "end" - ], - "properties" : { - "end" : { - "type" : "integer", - "description" : "Index (zero-based) at which position this entity ends. The index is inclusive.", - "minimum" : 0, - "example" : 61 - }, - "start" : { - "type" : "integer", - "description" : "Index (zero-based) at which position this entity starts. The index is inclusive.", - "minimum" : 0, - "example" : 50 - } - } - }, - "Error" : { - "type" : "object", - "required" : [ - "code", - "message" - ], - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "message" : { - "type" : "string" - } - } - }, - "Expansions" : { - "type" : "object", - "properties" : { - "media" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Media" - } - }, - "places" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Place" - } - }, - "polls" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Poll" - } - }, - "topics" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Topic" - } - }, - "tweets" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "users" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - } - } - }, - "FieldUnauthorizedProblem" : { - "description" : "A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "required" : [ - "resource_type", - "field", - "section" - ], - "properties" : { - "field" : { - "type" : "string" - }, - "resource_type" : { - "type" : "string", - "enum" : [ - "user", - "tweet", - "media", - "list", - "space" - ] - }, - "section" : { - "type" : "string", - "enum" : [ - "data", - "includes" - ] - } - } - } - ] - }, - "FilteredStreamingTweetResponse" : { - "type" : "object", - "description" : "A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched.", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "matching_rules" : { - "type" : "array", - "description" : "The list of rules which matched the Tweet", - "items" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/RuleId" - }, - "tag" : { - "$ref" : "#/components/schemas/RuleTag" - } - } - } - } - } - }, - "FullTextEntities" : { - "type" : "object", - "properties" : { - "annotations" : { - "type" : "array", - "minItems" : 1, - "items" : { - "description" : "Annotation for entities based on the Tweet text.", - "allOf" : [ - { - "$ref" : "#/components/schemas/EntityIndicesInclusiveInclusive" - }, - { - "type" : "object", - "description" : "Represents the data for the annotation.", - "properties" : { - "normalized_text" : { - "type" : "string", - "description" : "Text used to determine annotation.", - "example" : "Barack Obama" - }, - "probability" : { - "type" : "number", - "description" : "Confidence factor for annotation type.", - "minimum" : 0, - "maximum" : 1, - "format" : "double" - }, - "type" : { - "type" : "string", - "description" : "Annotation type.", - "example" : "Person" - } - } - } - ] - } - }, - "cashtags" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/CashtagEntity" - } - }, - "hashtags" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/HashtagEntity" - } - }, - "mentions" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/MentionEntity" - } - }, - "urls" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UrlEntity" - } - } - } - }, - "GenericProblem" : { - "description" : "A generic problem with no additional information beyond that provided by the HTTP status code.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "Geo" : { - "type" : "object", - "required" : [ - "type", - "bbox", - "properties" - ], - "properties" : { - "bbox" : { - "type" : "array", - "minItems" : 4, - "maxItems" : 4, - "items" : { - "type" : "number", - "minimum" : -180, - "maximum" : 180, - "format" : "double" - }, - "example" : [ - -105.193475, - 39.60973, - -105.053164, - 39.761974 - ] - }, - "geometry" : { - "$ref" : "#/components/schemas/Point" - }, - "properties" : { - "type" : "object" - }, - "type" : { - "type" : "string", - "enum" : [ - "Feature" - ] - } - } - }, - "Get2ComplianceJobsIdResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/ComplianceJob" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "Get2ComplianceJobsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/ComplianceJob" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "meta" : { - "type" : "object", - "properties" : { - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2DmConversationsIdDmEventsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/DmEvent" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2DmConversationsWithParticipantIdDmEventsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/DmEvent" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2DmEventsEventIdResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/DmEvent" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2DmEventsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/DmEvent" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2LikesFirehoseStreamResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/LikeWithTweetAuthor" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2LikesSample10StreamResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/LikeWithTweetAuthor" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2ListsIdFollowersResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2ListsIdMembersResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2ListsIdResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/List" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2ListsIdTweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2SpacesByCreatorIdsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Space" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2SpacesIdBuyersResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2SpacesIdResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Space" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2SpacesIdTweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2SpacesResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Space" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2SpacesSearchResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Space" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TrendsByWoeidWoeidResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Trend" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "Get2TweetsCountsAllResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/SearchCount" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "total_tweet_count" : { - "$ref" : "#/components/schemas/Aggregate" - } - } - } - } - }, - "Get2TweetsCountsRecentResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/SearchCount" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "total_tweet_count" : { - "$ref" : "#/components/schemas/Aggregate" - } - } - } - } - }, - "Get2TweetsFirehoseStreamLangEnResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsFirehoseStreamLangJaResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsFirehoseStreamLangKoResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsFirehoseStreamLangPtResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsFirehoseStreamResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsIdLikingUsersResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TweetsIdQuoteTweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TweetsIdResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsIdRetweetedByResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TweetsIdRetweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsSample10StreamResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsSampleStreamResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsSearchAllResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TweetsSearchRecentResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2TweetsSearchStreamResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2TweetsSearchStreamRulesCountsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/RulesCount" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "Get2UsageTweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Usage" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "Get2UsersByResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2UsersByUsernameUsernameResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/User" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2UsersIdBlockingResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdBookmarksResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdFollowedListsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/List" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdFollowersResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdFollowingResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdLikedTweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdListMembershipsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/List" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdMentionsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdMutingResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdOwnedListsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/List" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdPinnedListsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/List" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/User" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2UsersIdTimelinesReverseChronologicalResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersIdTweetsResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Tweet" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "newest_id" : { - "$ref" : "#/components/schemas/NewestId" - }, - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "oldest_id" : { - "$ref" : "#/components/schemas/OldestId" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - }, - "result_count" : { - "$ref" : "#/components/schemas/ResultCount" - } - } - } - } - }, - "Get2UsersMeResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/User" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2UsersResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Get2UsersSearchResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/User" - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - }, - "meta" : { - "type" : "object", - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "previous_token" : { - "$ref" : "#/components/schemas/PreviousToken" - } - } - } - } - }, - "HashtagEntity" : { - "allOf" : [ - { - "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" - }, - { - "$ref" : "#/components/schemas/HashtagFields" - } - ] - }, - "HashtagFields" : { - "type" : "object", - "description" : "Represent the portion of text recognized as a Hashtag, and its start and end position within the text.", - "required" : [ - "tag" - ], - "properties" : { - "tag" : { - "type" : "string", - "description" : "The text of the Hashtag.", - "example" : "MondayMotivation" - } - } - }, - "HttpStatusCode" : { - "type" : "integer", - "description" : "HTTP Status Code.", - "minimum" : 100, - "maximum" : 599 - }, - "InvalidRequestProblem" : { - "description" : "A problem that indicates this request is invalid.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "properties" : { - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "type" : "object", - "properties" : { - "message" : { - "type" : "string" - }, - "parameters" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - } - } - } - } - ] - }, - "InvalidRuleProblem" : { - "description" : "The rule you have submitted is invalid.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "JobId" : { - "type" : "string", - "description" : "Compliance Job ID.", - "pattern" : "^[0-9]{1,19}$", - "example" : "1372966999991541762" - }, - "LikeComplianceSchema" : { - "type" : "object", - "required" : [ - "delete" - ], - "properties" : { - "delete" : { - "$ref" : "#/components/schemas/UnlikeComplianceSchema" - } - } - }, - "LikeId" : { - "type" : "string", - "description" : "The unique identifier of this Like.", - "pattern" : "^[A-Za-z0-9_]{1,40}$", - "example" : "8ba4f34e6235d905a46bac021d98e923" - }, - "LikeWithTweetAuthor" : { - "type" : "object", - "description" : "A Like event, with the tweet author user and the tweet being liked", - "properties" : { - "created_at" : { - "type" : "string", - "description" : "Creation time of the Tweet.", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "id" : { - "$ref" : "#/components/schemas/LikeId" - }, - "liked_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "timestamp_ms" : { - "type" : "integer", - "description" : "Timestamp in milliseconds of creation.", - "format" : "int32" - }, - "tweet_author_id" : { - "$ref" : "#/components/schemas/UserId" - } - } - }, - "LikesComplianceStreamResponse" : { - "description" : "Likes compliance stream events.", - "oneOf" : [ - { - "type" : "object", - "description" : "Compliance event.", - "required" : [ - "data" - ], - "properties" : { - "data" : { - "$ref" : "#/components/schemas/LikeComplianceSchema" - } - } - }, - { - "type" : "object", - "required" : [ - "errors" - ], - "properties" : { - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - ] - }, - "List" : { - "type" : "object", - "description" : "A X List is a curated group of accounts.", - "required" : [ - "id", - "name" - ], - "properties" : { - "created_at" : { - "type" : "string", - "format" : "date-time" - }, - "description" : { - "type" : "string" - }, - "follower_count" : { - "type" : "integer" - }, - "id" : { - "$ref" : "#/components/schemas/ListId" - }, - "member_count" : { - "type" : "integer" - }, - "name" : { - "type" : "string", - "description" : "The name of this List." - }, - "owner_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "private" : { - "type" : "boolean" - } - } - }, - "ListAddUserRequest" : { - "type" : "object", - "required" : [ - "user_id" - ], - "properties" : { - "user_id" : { - "$ref" : "#/components/schemas/UserId" - } - } - }, - "ListCreateRequest" : { - "type" : "object", - "required" : [ - "name" - ], - "properties" : { - "description" : { - "type" : "string", - "minLength" : 0, - "maxLength" : 100 - }, - "name" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 25 - }, - "private" : { - "type" : "boolean", - "default" : false - } - } - }, - "ListCreateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "description" : "A X List is a curated group of accounts.", - "required" : [ - "id", - "name" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/ListId" - }, - "name" : { - "type" : "string", - "description" : "The name of this List." - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "ListDeleteResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "deleted" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "ListFollowedRequest" : { - "type" : "object", - "required" : [ - "list_id" - ], - "properties" : { - "list_id" : { - "$ref" : "#/components/schemas/ListId" - } - } - }, - "ListFollowedResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "following" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "ListId" : { - "type" : "string", - "description" : "The unique identifier of this List.", - "pattern" : "^[0-9]{1,19}$", - "example" : "1146654567674912769" - }, - "ListMutateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "is_member" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "ListPinnedRequest" : { - "type" : "object", - "required" : [ - "list_id" - ], - "properties" : { - "list_id" : { - "$ref" : "#/components/schemas/ListId" - } - } - }, - "ListPinnedResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "pinned" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "ListUnpinResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "pinned" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "ListUpdateRequest" : { - "type" : "object", - "properties" : { - "description" : { - "type" : "string", - "minLength" : 0, - "maxLength" : 100 - }, - "name" : { - "type" : "string", - "minLength" : 1, - "maxLength" : 25 - }, - "private" : { - "type" : "boolean" - } - } - }, - "ListUpdateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "updated" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "Media" : { - "type" : "object", - "required" : [ - "type" - ], - "properties" : { - "height" : { - "$ref" : "#/components/schemas/MediaHeight" - }, - "media_key" : { - "$ref" : "#/components/schemas/MediaKey" - }, - "type" : { - "type" : "string" - }, - "width" : { - "$ref" : "#/components/schemas/MediaWidth" - } - }, - "discriminator" : { - "propertyName" : "type", - "mapping" : { - "animated_gif" : "#/components/schemas/AnimatedGif", - "photo" : "#/components/schemas/Photo", - "video" : "#/components/schemas/Video" - } - } - }, - "MediaHeight" : { - "type" : "integer", - "description" : "The height of the media in pixels.", - "minimum" : 0 - }, - "MediaId" : { - "type" : "string", - "description" : "The unique identifier of this Media.", - "pattern" : "^[0-9]{1,19}$", - "example" : "1146654567674912769" - }, - "MediaKey" : { - "type" : "string", - "description" : "The Media Key identifier for this attachment.", - "pattern" : "^([0-9]+)_([0-9]+)$" - }, - "MediaWidth" : { - "type" : "integer", - "description" : "The width of the media in pixels.", - "minimum" : 0 - }, - "MentionEntity" : { - "allOf" : [ - { - "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" - }, - { - "$ref" : "#/components/schemas/MentionFields" - } - ] - }, - "MentionFields" : { - "type" : "object", - "description" : "Represent the portion of text recognized as a User mention, and its start and end position within the text.", - "required" : [ - "username" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UserId" - }, - "username" : { - "$ref" : "#/components/schemas/UserName" - } - } - }, - "MuteUserMutationResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "muting" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "MuteUserRequest" : { - "type" : "object", - "required" : [ - "target_user_id" - ], - "properties" : { - "target_user_id" : { - "$ref" : "#/components/schemas/UserId" - } - } - }, - "NewestId" : { - "type" : "string", - "description" : "The newest id in this response." - }, - "NextToken" : { - "type" : "string", - "description" : "The next token.", - "minLength" : 1 - }, - "NonCompliantRulesProblem" : { - "description" : "A problem that indicates the user's rule set is not compliant.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "NoteTweetText" : { - "type" : "string", - "description" : "The note content of the Tweet.", - "example" : "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" - }, - "Oauth1PermissionsProblem" : { - "description" : "A problem that indicates your client application does not have the required OAuth1 permissions for the requested endpoint.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "OldestId" : { - "type" : "string", - "description" : "The oldest id in this response." - }, - "OperationalDisconnectProblem" : { - "description" : "You have been disconnected for operational reasons.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "properties" : { - "disconnect_type" : { - "type" : "string", - "enum" : [ - "OperationalDisconnect", - "UpstreamOperationalDisconnect", - "ForceDisconnect", - "UpstreamUncleanDisconnect", - "SlowReader", - "InternalError", - "ClientApplicationStateDegraded", - "InvalidRules" - ] - } - } - } - ] - }, - "PaginationToken32" : { - "type" : "string", - "description" : "A base32 pagination token.", - "minLength" : 16 - }, - "PaginationToken36" : { - "type" : "string", - "description" : "A base36 pagination token.", - "minLength" : 1 - }, - "PaginationTokenLong" : { - "type" : "string", - "description" : "A 'long' pagination token.", - "minLength" : 1, - "maxLength" : 19 - }, - "Photo" : { - "allOf" : [ - { - "$ref" : "#/components/schemas/Media" - }, - { - "type" : "object", - "properties" : { - "alt_text" : { - "type" : "string" - }, - "url" : { - "type" : "string", - "format" : "uri" - } - } - } - ] - }, - "Place" : { - "type" : "object", - "required" : [ - "id", - "full_name" - ], - "properties" : { - "contained_within" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/PlaceId" - } - }, - "country" : { - "type" : "string", - "description" : "The full name of the county in which this place exists.", - "example" : "United States" - }, - "country_code" : { - "$ref" : "#/components/schemas/CountryCode" - }, - "full_name" : { - "type" : "string", - "description" : "The full name of this place.", - "example" : "Lakewood, CO" - }, - "geo" : { - "$ref" : "#/components/schemas/Geo" - }, - "id" : { - "$ref" : "#/components/schemas/PlaceId" - }, - "name" : { - "type" : "string", - "description" : "The human readable name of this place.", - "example" : "Lakewood" - }, - "place_type" : { - "$ref" : "#/components/schemas/PlaceType" - } - } - }, - "PlaceId" : { - "type" : "string", - "description" : "The identifier for this place.", - "example" : "f7eb2fa2fea288b1" - }, - "PlaceType" : { - "type" : "string", - "enum" : [ - "poi", - "neighborhood", - "city", - "admin", - "country", - "unknown" - ], - "example" : "city" - }, - "Point" : { - "type" : "object", - "description" : "A [GeoJson Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) geometry object.", - "required" : [ - "type", - "coordinates" - ], - "properties" : { - "coordinates" : { - "$ref" : "#/components/schemas/Position" - }, - "type" : { - "type" : "string", - "enum" : [ - "Point" - ], - "example" : "Point" - } - } - }, - "Poll" : { - "type" : "object", - "description" : "Represent a Poll attached to a Tweet.", - "required" : [ - "id", - "options" - ], - "properties" : { - "duration_minutes" : { - "type" : "integer", - "minimum" : 5, - "maximum" : 10080, - "format" : "int32" - }, - "end_datetime" : { - "type" : "string", - "format" : "date-time" - }, - "id" : { - "$ref" : "#/components/schemas/PollId" - }, - "options" : { - "type" : "array", - "minItems" : 2, - "maxItems" : 4, - "items" : { - "$ref" : "#/components/schemas/PollOption" - } - }, - "voting_status" : { - "type" : "string", - "enum" : [ - "open", - "closed" - ] - } - } - }, - "PollId" : { - "type" : "string", - "description" : "Unique identifier of this poll.", - "pattern" : "^[0-9]{1,19}$", - "example" : "1365059861688410112" - }, - "PollOption" : { - "type" : "object", - "description" : "Describes a choice in a Poll object.", - "required" : [ - "position", - "label", - "votes" - ], - "properties" : { - "label" : { - "$ref" : "#/components/schemas/PollOptionLabel" - }, - "position" : { - "type" : "integer", - "description" : "Position of this choice in the poll." - }, - "votes" : { - "type" : "integer", - "description" : "Number of users who voted for this choice." - } - } - }, - "PollOptionLabel" : { - "type" : "string", - "description" : "The text of a poll choice.", - "minLength" : 1, - "maxLength" : 25 - }, - "Position" : { - "type" : "array", - "description" : "A [GeoJson Position](https://tools.ietf.org/html/rfc7946#section-3.1.1) in the format `[longitude,latitude]`.", - "minItems" : 2, - "maxItems" : 2, - "items" : { - "type" : "number" - }, - "example" : [ - -105.18816086351444, - 40.247749999999996 - ] - }, - "PreviousToken" : { - "type" : "string", - "description" : "The previous token.", - "minLength" : 1 - }, - "Problem" : { - "type" : "object", - "description" : "An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).", - "required" : [ - "type", - "title" - ], - "properties" : { - "detail" : { - "type" : "string" - }, - "status" : { - "type" : "integer" - }, - "title" : { - "type" : "string" - }, - "type" : { - "type" : "string" - } - }, - "discriminator" : { - "propertyName" : "type", - "mapping" : { - "about:blank" : "#/components/schemas/GenericProblem", - "https://api.twitter.com/2/problems/client-disconnected" : "#/components/schemas/ClientDisconnectedProblem", - "https://api.twitter.com/2/problems/client-forbidden" : "#/components/schemas/ClientForbiddenProblem", - "https://api.twitter.com/2/problems/conflict" : "#/components/schemas/ConflictProblem", - "https://api.twitter.com/2/problems/disallowed-resource" : "#/components/schemas/DisallowedResourceProblem", - "https://api.twitter.com/2/problems/duplicate-rules" : "#/components/schemas/DuplicateRuleProblem", - "https://api.twitter.com/2/problems/invalid-request" : "#/components/schemas/InvalidRequestProblem", - "https://api.twitter.com/2/problems/invalid-rules" : "#/components/schemas/InvalidRuleProblem", - "https://api.twitter.com/2/problems/noncompliant-rules" : "#/components/schemas/NonCompliantRulesProblem", - "https://api.twitter.com/2/problems/not-authorized-for-field" : "#/components/schemas/FieldUnauthorizedProblem", - "https://api.twitter.com/2/problems/not-authorized-for-resource" : "#/components/schemas/ResourceUnauthorizedProblem", - "https://api.twitter.com/2/problems/oauth1-permissions" : "#/components/schemas/Oauth1PermissionsProblem", - "https://api.twitter.com/2/problems/operational-disconnect" : "#/components/schemas/OperationalDisconnectProblem", - "https://api.twitter.com/2/problems/resource-not-found" : "#/components/schemas/ResourceNotFoundProblem", - "https://api.twitter.com/2/problems/resource-unavailable" : "#/components/schemas/ResourceUnavailableProblem", - "https://api.twitter.com/2/problems/rule-cap" : "#/components/schemas/RulesCapProblem", - "https://api.twitter.com/2/problems/streaming-connection" : "#/components/schemas/ConnectionExceptionProblem", - "https://api.twitter.com/2/problems/unsupported-authentication" : "#/components/schemas/UnsupportedAuthenticationProblem", - "https://api.twitter.com/2/problems/usage-capped" : "#/components/schemas/UsageCapExceededProblem" - } - } - }, - "ReplySettings" : { - "type" : "string", - "description" : "Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following.", - "pattern" : "^[A-Za-z]{1,12}$", - "enum" : [ - "everyone", - "mentionedUsers", - "following", - "other" - ] - }, - "ReplySettingsWithVerifiedUsers" : { - "type" : "string", - "description" : "Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, subscribers, verified and following.", - "pattern" : "^[A-Za-z]{1,12}$", - "enum" : [ - "everyone", - "mentionedUsers", - "following", - "other", - "subscribers", - "verified" - ] - }, - "ResourceNotFoundProblem" : { - "description" : "A problem that indicates that a given Tweet, User, etc. does not exist.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "required" : [ - "parameter", - "value", - "resource_id", - "resource_type" - ], - "properties" : { - "parameter" : { - "type" : "string", - "minLength" : 1 - }, - "resource_id" : { - "type" : "string" - }, - "resource_type" : { - "type" : "string", - "enum" : [ - "user", - "tweet", - "media", - "list", - "space" - ] - }, - "value" : { - "type" : "string", - "description" : "Value will match the schema of the field." - } - } - } - ] - }, - "ResourceUnauthorizedProblem" : { - "description" : "A problem that indicates you are not allowed to see a particular Tweet, User, etc.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "required" : [ - "value", - "resource_id", - "resource_type", - "section", - "parameter" - ], - "properties" : { - "parameter" : { - "type" : "string" - }, - "resource_id" : { - "type" : "string" - }, - "resource_type" : { - "type" : "string", - "enum" : [ - "user", - "tweet", - "media", - "list", - "space" - ] - }, - "section" : { - "type" : "string", - "enum" : [ - "data", - "includes" - ] - }, - "value" : { - "type" : "string" - } - } - } - ] - }, - "ResourceUnavailableProblem" : { - "description" : "A problem that indicates a particular Tweet, User, etc. is not available to you.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "required" : [ - "parameter", - "resource_id", - "resource_type" - ], - "properties" : { - "parameter" : { - "type" : "string", - "minLength" : 1 - }, - "resource_id" : { - "type" : "string" - }, - "resource_type" : { - "type" : "string", - "enum" : [ - "user", - "tweet", - "media", - "list", - "space" - ] - } - } - } - ] - }, - "ResultCount" : { - "type" : "integer", - "description" : "The number of results returned in this response.", - "format" : "int32" - }, - "Rule" : { - "type" : "object", - "description" : "A user-provided stream filtering rule.", - "required" : [ - "value" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/RuleId" - }, - "tag" : { - "$ref" : "#/components/schemas/RuleTag" - }, - "value" : { - "$ref" : "#/components/schemas/RuleValue" - } - } - }, - "RuleId" : { - "type" : "string", - "description" : "Unique identifier of this rule.", - "pattern" : "^[0-9]{1,19}$", - "example" : "120897978112909812" - }, - "RuleNoId" : { - "type" : "object", - "description" : "A user-provided stream filtering rule.", - "required" : [ - "value" - ], - "properties" : { - "tag" : { - "$ref" : "#/components/schemas/RuleTag" - }, - "value" : { - "$ref" : "#/components/schemas/RuleValue" - } - } - }, - "RuleTag" : { - "type" : "string", - "description" : "A tag meant for the labeling of user provided rules.", - "example" : "Non-retweeted coffee Posts" - }, - "RuleValue" : { - "type" : "string", - "description" : "The filterlang value of the rule.", - "example" : "coffee -is:retweet" - }, - "RulesCapProblem" : { - "description" : "You have exceeded the maximum number of rules.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "RulesCount" : { - "type" : "object", - "description" : "A count of user-provided stream filtering rules at the application and project levels.", - "properties" : { - "all_project_client_apps" : { - "$ref" : "#/components/schemas/AllProjectClientApps" - }, - "cap_per_client_app" : { - "type" : "integer", - "description" : "Cap of number of rules allowed per client application", - "format" : "int32" - }, - "cap_per_project" : { - "type" : "integer", - "description" : "Cap of number of rules allowed per project", - "format" : "int32" - }, - "client_app_rules_count" : { - "$ref" : "#/components/schemas/AppRulesCount" - }, - "project_rules_count" : { - "type" : "integer", - "description" : "Number of rules for project", - "format" : "int32" - } - } - }, - "RulesLookupResponse" : { - "type" : "object", - "required" : [ - "meta" - ], - "properties" : { - "data" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Rule" - } - }, - "meta" : { - "$ref" : "#/components/schemas/RulesResponseMetadata" - } - } - }, - "RulesRequestSummary" : { - "oneOf" : [ - { - "type" : "object", - "description" : "A summary of the results of the addition of user-specified stream filtering rules.", - "required" : [ - "created", - "not_created", - "valid", - "invalid" - ], - "properties" : { - "created" : { - "type" : "integer", - "description" : "Number of user-specified stream filtering rules that were created.", - "format" : "int32", - "example" : 1 - }, - "invalid" : { - "type" : "integer", - "description" : "Number of invalid user-specified stream filtering rules.", - "format" : "int32", - "example" : 1 - }, - "not_created" : { - "type" : "integer", - "description" : "Number of user-specified stream filtering rules that were not created.", - "format" : "int32", - "example" : 1 - }, - "valid" : { - "type" : "integer", - "description" : "Number of valid user-specified stream filtering rules.", - "format" : "int32", - "example" : 1 - } - } - }, - { - "type" : "object", - "required" : [ - "deleted", - "not_deleted" - ], - "properties" : { - "deleted" : { - "type" : "integer", - "description" : "Number of user-specified stream filtering rules that were deleted.", - "format" : "int32" - }, - "not_deleted" : { - "type" : "integer", - "description" : "Number of user-specified stream filtering rules that were not deleted.", - "format" : "int32" - } - } - } - ] - }, - "RulesResponseMetadata" : { - "type" : "object", - "required" : [ - "sent" - ], - "properties" : { - "next_token" : { - "$ref" : "#/components/schemas/NextToken" - }, - "result_count" : { - "type" : "integer", - "description" : "Number of Rules in result set.", - "format" : "int32" - }, - "sent" : { - "type" : "string" - }, - "summary" : { - "$ref" : "#/components/schemas/RulesRequestSummary" - } - } - }, - "SearchCount" : { - "type" : "object", - "description" : "Represent a Search Count Result.", - "required" : [ - "end", - "start", - "tweet_count" - ], - "properties" : { - "end" : { - "$ref" : "#/components/schemas/End" - }, - "start" : { - "$ref" : "#/components/schemas/Start" - }, - "tweet_count" : { - "$ref" : "#/components/schemas/TweetCount" - } - } - }, - "Space" : { - "type" : "object", - "description" : "", - "required" : [ - "id", - "state" - ], - "properties" : { - "created_at" : { - "type" : "string", - "description" : "Creation time of the Space.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "creator_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "ended_at" : { - "type" : "string", - "description" : "End time of the Space.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "host_ids" : { - "type" : "array", - "description" : "The user ids for the hosts of the Space.", - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "id" : { - "$ref" : "#/components/schemas/SpaceId" - }, - "invited_user_ids" : { - "type" : "array", - "description" : "An array of user ids for people who were invited to a Space.", - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "is_ticketed" : { - "type" : "boolean", - "description" : "Denotes if the Space is a ticketed Space.", - "example" : "false" - }, - "lang" : { - "type" : "string", - "description" : "The language of the Space.", - "example" : "en" - }, - "participant_count" : { - "type" : "integer", - "description" : "The number of participants in a Space.", - "format" : "int32", - "example" : 10 - }, - "scheduled_start" : { - "type" : "string", - "description" : "A date time stamp for when a Space is scheduled to begin.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "speaker_ids" : { - "type" : "array", - "description" : "An array of user ids for people who were speakers in a Space.", - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "started_at" : { - "type" : "string", - "description" : "When the Space was started as a date string.", - "format" : "date-time", - "example" : "2021-7-14T04:35:55Z" - }, - "state" : { - "type" : "string", - "description" : "The current state of the Space.", - "enum" : [ - "live", - "scheduled", - "ended" - ], - "example" : "live" - }, - "subscriber_count" : { - "type" : "integer", - "description" : "The number of people who have either purchased a ticket or set a reminder for this Space.", - "format" : "int32", - "example" : 10 - }, - "title" : { - "type" : "string", - "description" : "The title of the Space.", - "example" : "Spaces are Awesome" - }, - "topics" : { - "type" : "array", - "description" : "The topics of a Space, as selected by its creator.", - "items" : { - "type" : "object", - "description" : "The X Topic object.", - "required" : [ - "id", - "name" - ], - "properties" : { - "description" : { - "type" : "string", - "description" : "The description of the given topic." - }, - "id" : { - "type" : "string", - "description" : "An ID suitable for use in the REST API." - }, - "name" : { - "type" : "string", - "description" : "The name of the given topic." - } - }, - "example" : { - "description" : "All about technology", - "id" : "848920371311001600", - "name" : "Technology" - } - } - }, - "updated_at" : { - "type" : "string", - "description" : "When the Space was last updated.", - "format" : "date-time", - "example" : "2021-7-14T04:35:55Z" - } - } - }, - "SpaceId" : { - "type" : "string", - "description" : "The unique identifier of this Space.", - "pattern" : "^[a-zA-Z0-9]{1,13}$", - "example" : "1SLjjRYNejbKM" - }, - "Start" : { - "type" : "string", - "description" : "The start time of the bucket.", - "format" : "date-time" - }, - "StreamingLikeResponseV2" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/LikeWithTweetAuthor" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "StreamingTweetResponse" : { - "type" : "object", - "properties" : { - "data" : { - "$ref" : "#/components/schemas/Tweet" - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - }, - "includes" : { - "$ref" : "#/components/schemas/Expansions" - } - } - }, - "Topic" : { - "type" : "object", - "description" : "The topic of a Space, as selected by its creator.", - "required" : [ - "id", - "name" - ], - "properties" : { - "description" : { - "type" : "string", - "description" : "The description of the given topic.", - "example" : "All about technology" - }, - "id" : { - "$ref" : "#/components/schemas/TopicId" - }, - "name" : { - "type" : "string", - "description" : "The name of the given topic.", - "example" : "Technology" - } - } - }, - "TopicId" : { - "type" : "string", - "description" : "Unique identifier of this Topic." - }, - "Trend" : { - "type" : "object", - "description" : "A trend.", - "properties" : { - "trend_name" : { - "type" : "string", - "description" : "Name of the trend." - }, - "tweet_count" : { - "type" : "integer", - "description" : "Number of Posts in this trend.", - "format" : "int32" - } - } - }, - "Tweet" : { - "type" : "object", - "properties" : { - "attachments" : { - "type" : "object", - "description" : "Specifies the type of attachments (if any) present in this Tweet.", - "properties" : { - "media_keys" : { - "type" : "array", - "description" : "A list of Media Keys for each one of the media attachments (if media are attached).", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/MediaKey" - } - }, - "media_source_tweet_id" : { - "type" : "array", - "description" : "A list of Posts the media on this Tweet was originally posted in. For example, if the media on a tweet is re-used in another Tweet, this refers to the original, source Tweet..", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/TweetId" - } - }, - "poll_ids" : { - "type" : "array", - "description" : "A list of poll IDs (if polls are attached).", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/PollId" - } - } - } - }, - "author_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "context_annotations" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/ContextAnnotation" - } - }, - "conversation_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "created_at" : { - "type" : "string", - "description" : "Creation time of the Tweet.", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "edit_controls" : { - "type" : "object", - "required" : [ - "is_edit_eligible", - "editable_until", - "edits_remaining" - ], - "properties" : { - "editable_until" : { - "type" : "string", - "description" : "Time when Tweet is no longer editable.", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "edits_remaining" : { - "type" : "integer", - "description" : "Number of times this Tweet can be edited." - }, - "is_edit_eligible" : { - "type" : "boolean", - "description" : "Indicates if this Tweet is eligible to be edited.", - "example" : false - } - } - }, - "edit_history_tweet_ids" : { - "type" : "array", - "description" : "A list of Tweet Ids in this Tweet chain.", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/TweetId" - } - }, - "entities" : { - "$ref" : "#/components/schemas/FullTextEntities" - }, - "geo" : { - "type" : "object", - "description" : "The location tagged on the Tweet, if the user provided one.", - "properties" : { - "coordinates" : { - "$ref" : "#/components/schemas/Point" - }, - "place_id" : { - "$ref" : "#/components/schemas/PlaceId" - } - } - }, - "id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "in_reply_to_user_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "lang" : { - "type" : "string", - "description" : "Language of the Tweet, if detected by X. Returned as a BCP47 language tag.", - "example" : "en" - }, - "non_public_metrics" : { - "type" : "object", - "description" : "Nonpublic engagement metrics for the Tweet at the time of the request.", - "properties" : { - "impression_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been viewed.", - "format" : "int32" - } - } - }, - "note_tweet" : { - "type" : "object", - "description" : "The full-content of the Tweet, including text beyond 280 characters.", - "properties" : { - "entities" : { - "type" : "object", - "properties" : { - "cashtags" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/CashtagEntity" - } - }, - "hashtags" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/HashtagEntity" - } - }, - "mentions" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/MentionEntity" - } - }, - "urls" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UrlEntity" - } - } - } - }, - "text" : { - "$ref" : "#/components/schemas/NoteTweetText" - } - } - }, - "organic_metrics" : { - "type" : "object", - "description" : "Organic nonpublic engagement metrics for the Tweet at the time of the request.", - "required" : [ - "impression_count", - "retweet_count", - "reply_count", - "like_count" - ], - "properties" : { - "impression_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been viewed." - }, - "like_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been liked." - }, - "reply_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been replied to." - }, - "retweet_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been Retweeted." - } - } - }, - "possibly_sensitive" : { - "type" : "boolean", - "description" : "Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.", - "example" : false - }, - "promoted_metrics" : { - "type" : "object", - "description" : "Promoted nonpublic engagement metrics for the Tweet at the time of the request.", - "properties" : { - "impression_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been viewed.", - "format" : "int32" - }, - "like_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been liked.", - "format" : "int32" - }, - "reply_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been replied to.", - "format" : "int32" - }, - "retweet_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been Retweeted.", - "format" : "int32" - } - } - }, - "public_metrics" : { - "type" : "object", - "description" : "Engagement metrics for the Tweet at the time of the request.", - "required" : [ - "retweet_count", - "reply_count", - "like_count", - "impression_count", - "bookmark_count" - ], - "properties" : { - "bookmark_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been bookmarked.", - "format" : "int32" - }, - "impression_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been viewed.", - "format" : "int32" - }, - "like_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been liked." - }, - "quote_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been quoted." - }, - "reply_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been replied to." - }, - "retweet_count" : { - "type" : "integer", - "description" : "Number of times this Tweet has been Retweeted." - } - } - }, - "referenced_tweets" : { - "type" : "array", - "description" : "A list of Posts this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.", - "minItems" : 1, - "items" : { - "type" : "object", - "required" : [ - "type", - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "type" : { - "type" : "string", - "enum" : [ - "retweeted", - "quoted", - "replied_to" - ] - } - } - } - }, - "reply_settings" : { - "$ref" : "#/components/schemas/ReplySettingsWithVerifiedUsers" - }, - "scopes" : { - "type" : "object", - "description" : "The scopes for this tweet", - "properties" : { - "followers" : { - "type" : "boolean", - "description" : "Indicates if this Tweet is viewable by followers without the Tweet ID", - "example" : false - } - } - }, - "source" : { - "type" : "string", - "description" : "This is deprecated." - }, - "text" : { - "$ref" : "#/components/schemas/TweetText" - }, - "username" : { - "$ref" : "#/components/schemas/UserName" - }, - "withheld" : { - "$ref" : "#/components/schemas/TweetWithheld" - } - }, - "example" : { - "author_id" : "2244994945", - "created_at" : "Wed Jan 06 18:40:40 +0000 2021", - "id" : "1346889436626259968", - "text" : "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i", - "username" : "XDevelopers" - } - }, - "TweetComplianceData" : { - "description" : "Tweet compliance data.", - "oneOf" : [ - { - "$ref" : "#/components/schemas/TweetDeleteComplianceSchema" - }, - { - "$ref" : "#/components/schemas/TweetWithheldComplianceSchema" - }, - { - "$ref" : "#/components/schemas/TweetDropComplianceSchema" - }, - { - "$ref" : "#/components/schemas/TweetUndropComplianceSchema" - }, - { - "$ref" : "#/components/schemas/TweetEditComplianceSchema" - } - ] - }, - "TweetComplianceSchema" : { - "type" : "object", - "required" : [ - "tweet", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "quote_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "tweet" : { - "type" : "object", - "required" : [ - "id", - "author_id" - ], - "properties" : { - "author_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - } - } - }, - "TweetComplianceStreamResponse" : { - "description" : "Tweet compliance stream events.", - "oneOf" : [ - { - "type" : "object", - "description" : "Compliance event.", - "required" : [ - "data" - ], - "properties" : { - "data" : { - "$ref" : "#/components/schemas/TweetComplianceData" - } - } - }, - { - "type" : "object", - "required" : [ - "errors" - ], - "properties" : { - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - ] - }, - "TweetCount" : { - "type" : "integer", - "description" : "The count for the bucket." - }, - "TweetCreateRequest" : { - "type" : "object", - "properties" : { - "card_uri" : { - "type" : "string", - "description" : "Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link." - }, - "direct_message_deep_link" : { - "type" : "string", - "description" : "Link to take the conversation from the public timeline to a private Direct Message." - }, - "for_super_followers_only" : { - "type" : "boolean", - "description" : "Exclusive Tweet for super followers.", - "default" : false - }, - "geo" : { - "type" : "object", - "description" : "Place ID being attached to the Tweet for geo location.", - "properties" : { - "place_id" : { - "type" : "string" - } - }, - "additionalProperties" : false - }, - "media" : { - "type" : "object", - "description" : "Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI.", - "required" : [ - "media_ids" - ], - "properties" : { - "media_ids" : { - "type" : "array", - "description" : "A list of Media Ids to be attached to a created Tweet.", - "minItems" : 1, - "maxItems" : 4, - "items" : { - "$ref" : "#/components/schemas/MediaId" - } - }, - "tagged_user_ids" : { - "type" : "array", - "description" : "A list of User Ids to be tagged in the media for created Tweet.", - "minItems" : 0, - "maxItems" : 10, - "items" : { - "$ref" : "#/components/schemas/UserId" - } - } - }, - "additionalProperties" : false - }, - "nullcast" : { - "type" : "boolean", - "description" : "Nullcasted (promoted-only) Posts do not appear in the public timeline and are not served to followers.", - "default" : false - }, - "poll" : { - "type" : "object", - "description" : "Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI.", - "required" : [ - "options", - "duration_minutes" - ], - "properties" : { - "duration_minutes" : { - "type" : "integer", - "description" : "Duration of the poll in minutes.", - "minimum" : 5, - "maximum" : 10080, - "format" : "int32" - }, - "options" : { - "type" : "array", - "minItems" : 2, - "maxItems" : 4, - "items" : { - "type" : "string", - "description" : "The text of a poll choice.", - "minLength" : 1, - "maxLength" : 25 - } - }, - "reply_settings" : { - "type" : "string", - "description" : "Settings to indicate who can reply to the Tweet.", - "enum" : [ - "following", - "mentionedUsers" - ] - } - }, - "additionalProperties" : false - }, - "quote_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "reply" : { - "type" : "object", - "description" : "Tweet information of the Tweet being replied to.", - "required" : [ - "in_reply_to_tweet_id" - ], - "properties" : { - "exclude_reply_user_ids" : { - "type" : "array", - "description" : "A list of User Ids to be excluded from the reply Tweet.", - "items" : { - "$ref" : "#/components/schemas/UserId" - } - }, - "in_reply_to_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - } - }, - "additionalProperties" : false - }, - "reply_settings" : { - "type" : "string", - "description" : "Settings to indicate who can reply to the Tweet.", - "enum" : [ - "following", - "mentionedUsers", - "subscribers" - ] - }, - "text" : { - "$ref" : "#/components/schemas/TweetText" - } - }, - "additionalProperties" : false - }, - "TweetCreateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "required" : [ - "id", - "text" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "text" : { - "$ref" : "#/components/schemas/TweetText" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "TweetDeleteComplianceSchema" : { - "type" : "object", - "required" : [ - "delete" - ], - "properties" : { - "delete" : { - "$ref" : "#/components/schemas/TweetComplianceSchema" - } - } - }, - "TweetDeleteResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "required" : [ - "deleted" - ], - "properties" : { - "deleted" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "TweetDropComplianceSchema" : { - "type" : "object", - "required" : [ - "drop" - ], - "properties" : { - "drop" : { - "$ref" : "#/components/schemas/TweetComplianceSchema" - } - } - }, - "TweetEditComplianceObjectSchema" : { - "type" : "object", - "required" : [ - "tweet", - "event_at", - "initial_tweet_id", - "edit_tweet_ids" - ], - "properties" : { - "edit_tweet_ids" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/TweetId" - } - }, - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "initial_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "tweet" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - } - } - }, - "TweetEditComplianceSchema" : { - "type" : "object", - "required" : [ - "tweet_edit" - ], - "properties" : { - "tweet_edit" : { - "$ref" : "#/components/schemas/TweetEditComplianceObjectSchema" - } - } - }, - "TweetHideRequest" : { - "type" : "object", - "required" : [ - "hidden" - ], - "properties" : { - "hidden" : { - "type" : "boolean" - } - } - }, - "TweetHideResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "hidden" : { - "type" : "boolean" - } - } - } - } - }, - "TweetId" : { - "type" : "string", - "description" : "Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.", - "pattern" : "^[0-9]{1,19}$", - "example" : "1346889436626259968" - }, - "TweetLabelData" : { - "description" : "Tweet label data.", - "oneOf" : [ - { - "$ref" : "#/components/schemas/TweetNoticeSchema" - }, - { - "$ref" : "#/components/schemas/TweetUnviewableSchema" - } - ] - }, - "TweetLabelStreamResponse" : { - "description" : "Tweet label stream events.", - "oneOf" : [ - { - "type" : "object", - "description" : "Tweet Label event.", - "required" : [ - "data" - ], - "properties" : { - "data" : { - "$ref" : "#/components/schemas/TweetLabelData" - } - } - }, - { - "type" : "object", - "required" : [ - "errors" - ], - "properties" : { - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - ] - }, - "TweetNotice" : { - "type" : "object", - "required" : [ - "tweet", - "event_type", - "event_at", - "application" - ], - "properties" : { - "application" : { - "type" : "string", - "description" : "If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’.", - "example" : "apply" - }, - "details" : { - "type" : "string", - "description" : "Information shown on the Tweet label" - }, - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "event_type" : { - "type" : "string", - "description" : "The type of label on the Tweet", - "example" : "misleading" - }, - "extended_details_url" : { - "type" : "string", - "description" : "Link to more information about this kind of label" - }, - "label_title" : { - "type" : "string", - "description" : "Title/header of the Tweet label" - }, - "tweet" : { - "type" : "object", - "required" : [ - "id", - "author_id" - ], - "properties" : { - "author_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - } - } - }, - "TweetNoticeSchema" : { - "type" : "object", - "required" : [ - "public_tweet_notice" - ], - "properties" : { - "public_tweet_notice" : { - "$ref" : "#/components/schemas/TweetNotice" - } - } - }, - "TweetTakedownComplianceSchema" : { - "type" : "object", - "required" : [ - "tweet", - "withheld_in_countries", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "quote_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "tweet" : { - "type" : "object", - "required" : [ - "id", - "author_id" - ], - "properties" : { - "author_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - }, - "withheld_in_countries" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/CountryCode" - } - } - } - }, - "TweetText" : { - "type" : "string", - "description" : "The content of the Tweet.", - "example" : "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" - }, - "TweetUndropComplianceSchema" : { - "type" : "object", - "required" : [ - "undrop" - ], - "properties" : { - "undrop" : { - "$ref" : "#/components/schemas/TweetComplianceSchema" - } - } - }, - "TweetUnviewable" : { - "type" : "object", - "required" : [ - "tweet", - "event_at", - "application" - ], - "properties" : { - "application" : { - "type" : "string", - "description" : "If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’.", - "example" : "apply" - }, - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "tweet" : { - "type" : "object", - "required" : [ - "id", - "author_id" - ], - "properties" : { - "author_id" : { - "$ref" : "#/components/schemas/UserId" - }, - "id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - } - } - }, - "TweetUnviewableSchema" : { - "type" : "object", - "required" : [ - "public_tweet_unviewable" - ], - "properties" : { - "public_tweet_unviewable" : { - "$ref" : "#/components/schemas/TweetUnviewable" - } - } - }, - "TweetWithheld" : { - "type" : "object", - "description" : "Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country).", - "required" : [ - "copyright", - "country_codes" - ], - "properties" : { - "copyright" : { - "type" : "boolean", - "description" : "Indicates if the content is being withheld for on the basis of copyright infringement." - }, - "country_codes" : { - "type" : "array", - "description" : "Provides a list of countries where this content is not available.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "$ref" : "#/components/schemas/CountryCode" - } - }, - "scope" : { - "type" : "string", - "description" : "Indicates whether the content being withheld is the `tweet` or a `user`.", - "enum" : [ - "tweet", - "user" - ] - } - } - }, - "TweetWithheldComplianceSchema" : { - "type" : "object", - "required" : [ - "withheld" - ], - "properties" : { - "withheld" : { - "$ref" : "#/components/schemas/TweetTakedownComplianceSchema" - } - } - }, - "UnlikeComplianceSchema" : { - "type" : "object", - "required" : [ - "favorite", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "favorite" : { - "type" : "object", - "required" : [ - "id", - "user_id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "user_id" : { - "$ref" : "#/components/schemas/UserId" - } - } - } - } - }, - "UnsupportedAuthenticationProblem" : { - "description" : "A problem that indicates that the authentication used is not supported.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - } - ] - }, - "UploadExpiration" : { - "type" : "string", - "description" : "Expiration time of the upload URL.", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "UploadUrl" : { - "type" : "string", - "description" : "URL to which the user will upload their Tweet or user IDs.", - "format" : "uri" - }, - "Url" : { - "type" : "string", - "description" : "A validly formatted URL.", - "format" : "uri", - "example" : "https://developer.twitter.com/en/docs/twitter-api" - }, - "UrlEntity" : { - "description" : "Represent the portion of text recognized as a URL, and its start and end position within the text.", - "allOf" : [ - { - "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" - }, - { - "$ref" : "#/components/schemas/UrlFields" - } - ] - }, - "UrlEntityDm" : { - "description" : "Represent the portion of text recognized as a URL, and its start and end position within the text.", - "allOf" : [ - { - "$ref" : "#/components/schemas/EntityIndicesInclusiveExclusive" - }, - { - "$ref" : "#/components/schemas/UrlFields" - } - ] - }, - "UrlFields" : { - "type" : "object", - "description" : "Represent the portion of text recognized as a URL.", - "required" : [ - "url" - ], - "properties" : { - "description" : { - "type" : "string", - "description" : "Description of the URL landing page.", - "example" : "This is a description of the website." - }, - "display_url" : { - "type" : "string", - "description" : "The URL as displayed in the X client.", - "example" : "twittercommunity.com/t/introducing-…" - }, - "expanded_url" : { - "$ref" : "#/components/schemas/Url" - }, - "images" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UrlImage" - } - }, - "media_key" : { - "$ref" : "#/components/schemas/MediaKey" - }, - "status" : { - "$ref" : "#/components/schemas/HttpStatusCode" - }, - "title" : { - "type" : "string", - "description" : "Title of the page the URL points to.", - "example" : "Introducing the v2 follow lookup endpoints" - }, - "unwound_url" : { - "type" : "string", - "description" : "Fully resolved url.", - "format" : "uri", - "example" : "https://twittercommunity.com/t/introducing-the-v2-follow-lookup-endpoints/147118" - }, - "url" : { - "$ref" : "#/components/schemas/Url" - } - } - }, - "UrlImage" : { - "type" : "object", - "description" : "Represent the information for the URL image.", - "properties" : { - "height" : { - "$ref" : "#/components/schemas/MediaHeight" - }, - "url" : { - "$ref" : "#/components/schemas/Url" - }, - "width" : { - "$ref" : "#/components/schemas/MediaWidth" - } - } - }, - "Usage" : { - "type" : "object", - "description" : "Usage per client app", - "properties" : { - "cap_reset_day" : { - "type" : "integer", - "description" : "Number of days left for the Tweet cap to reset", - "format" : "int32" - }, - "daily_client_app_usage" : { - "type" : "array", - "description" : "The daily usage breakdown for each Client Application a project", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/ClientAppUsage" - } - }, - "daily_project_usage" : { - "type" : "object", - "description" : "The daily usage breakdown for a project", - "properties" : { - "project_id" : { - "type" : "integer", - "description" : "The unique identifier for this project", - "format" : "int32" - }, - "usage" : { - "type" : "array", - "description" : "The usage value", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UsageFields" - } - } - } - }, - "project_cap" : { - "type" : "integer", - "description" : "Total number of Posts that can be read in this project per month", - "format" : "int32" - }, - "project_id" : { - "type" : "string", - "description" : "The unique identifier for this project", - "format" : "^[0-9]{1,19}$" - }, - "project_usage" : { - "type" : "integer", - "description" : "The number of Posts read in this project", - "format" : "int32" - } - } - }, - "UsageCapExceededProblem" : { - "description" : "A problem that indicates that a usage cap has been exceeded.", - "allOf" : [ - { - "$ref" : "#/components/schemas/Problem" - }, - { - "type" : "object", - "properties" : { - "period" : { - "type" : "string", - "enum" : [ - "Daily", - "Monthly" - ] - }, - "scope" : { - "type" : "string", - "enum" : [ - "Account", - "Product" - ] - } - } - } - ] - }, - "UsageFields" : { - "type" : "object", - "description" : "Represents the data for Usage", - "properties" : { - "date" : { - "type" : "string", - "description" : "The time period for the usage", - "format" : "date-time", - "example" : "2021-01-06T18:40:40.000Z" - }, - "usage" : { - "type" : "integer", - "description" : "The usage value", - "format" : "int32" - } - } - }, - "User" : { - "type" : "object", - "description" : "The X User object.", - "required" : [ - "id", - "name", - "username" - ], - "properties" : { - "connection_status" : { - "type" : "array", - "description" : "Returns detailed information about the relationship between two users.", - "minItems" : 0, - "items" : { - "type" : "string", - "description" : "Type of connection between users.", - "enum" : [ - "follow_request_received", - "follow_request_sent", - "blocking", - "followed_by", - "following", - "muting" - ] - } - }, - "created_at" : { - "type" : "string", - "description" : "Creation time of this User.", - "format" : "date-time" - }, - "description" : { - "type" : "string", - "description" : "The text of this User's profile description (also known as bio), if the User provided one." - }, - "entities" : { - "type" : "object", - "description" : "A list of metadata found in the User's profile description.", - "properties" : { - "description" : { - "$ref" : "#/components/schemas/FullTextEntities" - }, - "url" : { - "type" : "object", - "description" : "Expanded details for the URL specified in the User's profile, with start and end indices.", - "properties" : { - "urls" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/UrlEntity" - } - } - } - } - } - }, - "id" : { - "$ref" : "#/components/schemas/UserId" - }, - "location" : { - "type" : "string", - "description" : "The location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries." - }, - "most_recent_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "name" : { - "type" : "string", - "description" : "The friendly name of this User, as shown on their profile." - }, - "pinned_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "profile_image_url" : { - "type" : "string", - "description" : "The URL to the profile image for this User.", - "format" : "uri" - }, - "protected" : { - "type" : "boolean", - "description" : "Indicates if this User has chosen to protect their Posts (in other words, if this User's Posts are private)." - }, - "public_metrics" : { - "type" : "object", - "description" : "A list of metrics for this User.", - "required" : [ - "followers_count", - "following_count", - "tweet_count", - "listed_count" - ], - "properties" : { - "followers_count" : { - "type" : "integer", - "description" : "Number of Users who are following this User." - }, - "following_count" : { - "type" : "integer", - "description" : "Number of Users this User is following." - }, - "like_count" : { - "type" : "integer", - "description" : "The number of likes created by this User." - }, - "listed_count" : { - "type" : "integer", - "description" : "The number of lists that include this User." - }, - "tweet_count" : { - "type" : "integer", - "description" : "The number of Posts (including Retweets) posted by this User." - } - } - }, - "receives_your_dm" : { - "type" : "boolean", - "description" : "Indicates if you can send a DM to this User" - }, - "subscription_type" : { - "type" : "string", - "description" : "The X Blue subscription type of the user, eg: Basic, Premium, PremiumPlus or None.", - "enum" : [ - "Basic", - "Premium", - "PremiumPlus", - "None" - ] - }, - "url" : { - "type" : "string", - "description" : "The URL specified in the User's profile." - }, - "username" : { - "$ref" : "#/components/schemas/UserName" - }, - "verified" : { - "type" : "boolean", - "description" : "Indicate if this User is a verified X User." - }, - "verified_type" : { - "type" : "string", - "description" : "The X Blue verified type of the user, eg: blue, government, business or none.", - "enum" : [ - "blue", - "government", - "business", - "none" - ] - }, - "withheld" : { - "$ref" : "#/components/schemas/UserWithheld" - } - }, - "example" : { - "created_at" : "2013-12-14T04:35:55Z", - "id" : "2244994945", - "name" : "X Dev", - "protected" : false, - "username" : "TwitterDev" - } - }, - "UserComplianceData" : { - "description" : "User compliance data.", - "oneOf" : [ - { - "$ref" : "#/components/schemas/UserProtectComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserUnprotectComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserDeleteComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserUndeleteComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserSuspendComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserUnsuspendComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserWithheldComplianceSchema" - }, - { - "$ref" : "#/components/schemas/UserScrubGeoSchema" - }, - { - "$ref" : "#/components/schemas/UserProfileModificationComplianceSchema" - } - ] - }, - "UserComplianceSchema" : { - "type" : "object", - "required" : [ - "user", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "user" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UserId" - } - } - } - } - }, - "UserComplianceStreamResponse" : { - "description" : "User compliance stream events.", - "oneOf" : [ - { - "type" : "object", - "description" : "User compliance event.", - "required" : [ - "data" - ], - "properties" : { - "data" : { - "$ref" : "#/components/schemas/UserComplianceData" - } - } - }, - { - "type" : "object", - "required" : [ - "errors" - ], - "properties" : { - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - ] - }, - "UserDeleteComplianceSchema" : { - "type" : "object", - "required" : [ - "user_delete" - ], - "properties" : { - "user_delete" : { - "$ref" : "#/components/schemas/UserComplianceSchema" - } - } - }, - "UserId" : { - "type" : "string", - "description" : "Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.", - "pattern" : "^[0-9]{1,19}$", - "example" : "2244994945" - }, - "UserIdMatchesAuthenticatedUser" : { - "type" : "string", - "description" : "Unique identifier of this User. The value must be the same as the authenticated user.", - "example" : "2244994945" - }, - "UserName" : { - "type" : "string", - "description" : "The X handle (screen name) of this user.", - "pattern" : "^[A-Za-z0-9_]{1,15}$" - }, - "UserProfileModificationComplianceSchema" : { - "type" : "object", - "required" : [ - "user_profile_modification" - ], - "properties" : { - "user_profile_modification" : { - "$ref" : "#/components/schemas/UserProfileModificationObjectSchema" - } - } - }, - "UserProfileModificationObjectSchema" : { - "type" : "object", - "required" : [ - "user", - "profile_field", - "new_value", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "new_value" : { - "type" : "string" - }, - "profile_field" : { - "type" : "string" - }, - "user" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UserId" - } - } - } - } - }, - "UserProtectComplianceSchema" : { - "type" : "object", - "required" : [ - "user_protect" - ], - "properties" : { - "user_protect" : { - "$ref" : "#/components/schemas/UserComplianceSchema" - } - } - }, - "UserScrubGeoObjectSchema" : { - "type" : "object", - "required" : [ - "user", - "up_to_tweet_id", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "up_to_tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "user" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UserId" - } - } - } - } - }, - "UserScrubGeoSchema" : { - "type" : "object", - "required" : [ - "scrub_geo" - ], - "properties" : { - "scrub_geo" : { - "$ref" : "#/components/schemas/UserScrubGeoObjectSchema" - } - } - }, - "UserSearchQuery" : { - "type" : "string", - "description" : "The the search string by which to query for users.", - "pattern" : "^[A-Za-z0-9_]{1,32}$" - }, - "UserSuspendComplianceSchema" : { - "type" : "object", - "required" : [ - "user_suspend" - ], - "properties" : { - "user_suspend" : { - "$ref" : "#/components/schemas/UserComplianceSchema" - } - } - }, - "UserTakedownComplianceSchema" : { - "type" : "object", - "required" : [ - "user", - "withheld_in_countries", - "event_at" - ], - "properties" : { - "event_at" : { - "type" : "string", - "description" : "Event time.", - "format" : "date-time", - "example" : "2021-07-06T18:40:40.000Z" - }, - "user" : { - "type" : "object", - "required" : [ - "id" - ], - "properties" : { - "id" : { - "$ref" : "#/components/schemas/UserId" - } - } - }, - "withheld_in_countries" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/CountryCode" - } - } - } - }, - "UserUndeleteComplianceSchema" : { - "type" : "object", - "required" : [ - "user_undelete" - ], - "properties" : { - "user_undelete" : { - "$ref" : "#/components/schemas/UserComplianceSchema" - } - } - }, - "UserUnprotectComplianceSchema" : { - "type" : "object", - "required" : [ - "user_unprotect" - ], - "properties" : { - "user_unprotect" : { - "$ref" : "#/components/schemas/UserComplianceSchema" - } - } - }, - "UserUnsuspendComplianceSchema" : { - "type" : "object", - "required" : [ - "user_unsuspend" - ], - "properties" : { - "user_unsuspend" : { - "$ref" : "#/components/schemas/UserComplianceSchema" - } - } - }, - "UserWithheld" : { - "type" : "object", - "description" : "Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country).", - "required" : [ - "country_codes" - ], - "properties" : { - "country_codes" : { - "type" : "array", - "description" : "Provides a list of countries where this content is not available.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "$ref" : "#/components/schemas/CountryCode" - } - }, - "scope" : { - "type" : "string", - "description" : "Indicates that the content being withheld is a `user`.", - "enum" : [ - "user" - ] - } - } - }, - "UserWithheldComplianceSchema" : { - "type" : "object", - "required" : [ - "user_withheld" - ], - "properties" : { - "user_withheld" : { - "$ref" : "#/components/schemas/UserTakedownComplianceSchema" - } - } - }, - "UsersFollowingCreateRequest" : { - "type" : "object", - "required" : [ - "target_user_id" - ], - "properties" : { - "target_user_id" : { - "$ref" : "#/components/schemas/UserId" - } - } - }, - "UsersFollowingCreateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "following" : { - "type" : "boolean" - }, - "pending_follow" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "UsersFollowingDeleteResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "following" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "UsersLikesCreateRequest" : { - "type" : "object", - "required" : [ - "tweet_id" - ], - "properties" : { - "tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - } - } - }, - "UsersLikesCreateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "liked" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "UsersLikesDeleteResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "liked" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "UsersRetweetsCreateRequest" : { - "type" : "object", - "required" : [ - "tweet_id" - ], - "properties" : { - "tweet_id" : { - "$ref" : "#/components/schemas/TweetId" - } - }, - "additionalProperties" : false - }, - "UsersRetweetsCreateResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "id" : { - "$ref" : "#/components/schemas/TweetId" - }, - "retweeted" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "UsersRetweetsDeleteResponse" : { - "type" : "object", - "properties" : { - "data" : { - "type" : "object", - "properties" : { - "retweeted" : { - "type" : "boolean" - } - } - }, - "errors" : { - "type" : "array", - "minItems" : 1, - "items" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "Variant" : { - "type" : "object", - "properties" : { - "bit_rate" : { - "type" : "integer", - "description" : "The bit rate of the media." - }, - "content_type" : { - "type" : "string", - "description" : "The content type of the media." - }, - "url" : { - "type" : "string", - "description" : "The url to the media.", - "format" : "uri" - } - } - }, - "Variants" : { - "type" : "array", - "description" : "An array of all available variants of the media.", - "items" : { - "$ref" : "#/components/schemas/Variant" - } - }, - "Video" : { - "allOf" : [ - { - "$ref" : "#/components/schemas/Media" - }, - { - "type" : "object", - "properties" : { - "duration_ms" : { - "type" : "integer" - }, - "non_public_metrics" : { - "type" : "object", - "description" : "Nonpublic engagement metrics for the Media at the time of the request.", - "properties" : { - "playback_0_count" : { - "type" : "integer", - "description" : "Number of users who made it through 0% of the video.", - "format" : "int32" - }, - "playback_100_count" : { - "type" : "integer", - "description" : "Number of users who made it through 100% of the video.", - "format" : "int32" - }, - "playback_25_count" : { - "type" : "integer", - "description" : "Number of users who made it through 25% of the video.", - "format" : "int32" - }, - "playback_50_count" : { - "type" : "integer", - "description" : "Number of users who made it through 50% of the video.", - "format" : "int32" - }, - "playback_75_count" : { - "type" : "integer", - "description" : "Number of users who made it through 75% of the video.", - "format" : "int32" - } - } - }, - "organic_metrics" : { - "type" : "object", - "description" : "Organic nonpublic engagement metrics for the Media at the time of the request.", - "properties" : { - "playback_0_count" : { - "type" : "integer", - "description" : "Number of users who made it through 0% of the video.", - "format" : "int32" - }, - "playback_100_count" : { - "type" : "integer", - "description" : "Number of users who made it through 100% of the video.", - "format" : "int32" - }, - "playback_25_count" : { - "type" : "integer", - "description" : "Number of users who made it through 25% of the video.", - "format" : "int32" - }, - "playback_50_count" : { - "type" : "integer", - "description" : "Number of users who made it through 50% of the video.", - "format" : "int32" - }, - "playback_75_count" : { - "type" : "integer", - "description" : "Number of users who made it through 75% of the video.", - "format" : "int32" - }, - "view_count" : { - "type" : "integer", - "description" : "Number of times this video has been viewed.", - "format" : "int32" - } - } - }, - "preview_image_url" : { - "type" : "string", - "format" : "uri" - }, - "promoted_metrics" : { - "type" : "object", - "description" : "Promoted nonpublic engagement metrics for the Media at the time of the request.", - "properties" : { - "playback_0_count" : { - "type" : "integer", - "description" : "Number of users who made it through 0% of the video.", - "format" : "int32" - }, - "playback_100_count" : { - "type" : "integer", - "description" : "Number of users who made it through 100% of the video.", - "format" : "int32" - }, - "playback_25_count" : { - "type" : "integer", - "description" : "Number of users who made it through 25% of the video.", - "format" : "int32" - }, - "playback_50_count" : { - "type" : "integer", - "description" : "Number of users who made it through 50% of the video.", - "format" : "int32" - }, - "playback_75_count" : { - "type" : "integer", - "description" : "Number of users who made it through 75% of the video.", - "format" : "int32" - }, - "view_count" : { - "type" : "integer", - "description" : "Number of times this video has been viewed.", - "format" : "int32" - } - } - }, - "public_metrics" : { - "type" : "object", - "description" : "Engagement metrics for the Media at the time of the request.", - "properties" : { - "view_count" : { - "type" : "integer", - "description" : "Number of times this video has been viewed.", - "format" : "int32" - } - } - }, - "variants" : { - "$ref" : "#/components/schemas/Variants" - } - } - } - ] - } - }, - "parameters" : { - "ComplianceJobFieldsParameter" : { - "name" : "compliance_job.fields", - "in" : "query", - "description" : "A comma separated list of ComplianceJob fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a ComplianceJob object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "created_at", - "download_expires_at", - "download_url", - "id", - "name", - "resumable", - "status", - "type", - "upload_expires_at", - "upload_url" - ] - }, - "example" : [ - "created_at", - "download_expires_at", - "download_url", - "id", - "name", - "resumable", - "status", - "type", - "upload_expires_at", - "upload_url" - ] - }, - "explode" : false, - "style" : "form" - }, - "DmConversationFieldsParameter" : { - "name" : "dm_conversation.fields", - "in" : "query", - "description" : "A comma separated list of DmConversation fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a DmConversation object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "id" - ] - }, - "example" : [ - "id" - ] - }, - "explode" : false, - "style" : "form" - }, - "DmEventExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [DmEvent](#DmEvent) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "attachments.media_keys", - "participant_ids", - "referenced_tweets.id", - "sender_id" - ] - }, - "example" : [ - "attachments.media_keys", - "participant_ids", - "referenced_tweets.id", - "sender_id" - ] - }, - "explode" : false, - "style" : "form" - }, - "DmEventFieldsParameter" : { - "name" : "dm_event.fields", - "in" : "query", - "description" : "A comma separated list of DmEvent fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a DmEvent object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "attachments", - "created_at", - "dm_conversation_id", - "entities", - "event_type", - "id", - "participant_ids", - "referenced_tweets", - "sender_id", - "text" - ] - }, - "example" : [ - "attachments", - "created_at", - "dm_conversation_id", - "entities", - "event_type", - "id", - "participant_ids", - "referenced_tweets", - "sender_id", - "text" - ] - }, - "explode" : false, - "style" : "form" - }, - "LikeExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [Like](#Like) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "liked_tweet_id" - ] - }, - "example" : [ - "liked_tweet_id" - ] - }, - "explode" : false, - "style" : "form" - }, - "LikeFieldsParameter" : { - "name" : "like.fields", - "in" : "query", - "description" : "A comma separated list of Like fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Like object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "created_at", - "id", - "liked_tweet_id", - "timestamp_ms" - ] - }, - "example" : [ - "created_at", - "id", - "liked_tweet_id", - "timestamp_ms" - ] - }, - "explode" : false, - "style" : "form" - }, - "LikeWithTweetAuthorExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [LikeWithTweetAuthor](#LikeWithTweetAuthor) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "liked_tweet_author_id", - "liked_tweet_id" - ] - }, - "example" : [ - "liked_tweet_author_id", - "liked_tweet_id" - ] - }, - "explode" : false, - "style" : "form" - }, - "LikeWithTweetAuthorFieldsParameter" : { - "name" : "like_with_tweet_author.fields", - "in" : "query", - "description" : "A comma separated list of LikeWithTweetAuthor fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a LikeWithTweetAuthor object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "created_at", - "id", - "liked_tweet_author_id", - "liked_tweet_id", - "timestamp_ms" - ] - }, - "example" : [ - "created_at", - "id", - "liked_tweet_author_id", - "liked_tweet_id", - "timestamp_ms" - ] - }, - "explode" : false, - "style" : "form" - }, - "ListExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [List](#List) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "owner_id" - ] - }, - "example" : [ - "owner_id" - ] - }, - "explode" : false, - "style" : "form" - }, - "ListFieldsParameter" : { - "name" : "list.fields", - "in" : "query", - "description" : "A comma separated list of List fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a List object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "created_at", - "description", - "follower_count", - "id", - "member_count", - "name", - "owner_id", - "private" - ] - }, - "example" : [ - "created_at", - "description", - "follower_count", - "id", - "member_count", - "name", - "owner_id", - "private" - ] - }, - "explode" : false, - "style" : "form" - }, - "MediaFieldsParameter" : { - "name" : "media.fields", - "in" : "query", - "description" : "A comma separated list of Media fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Media object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "alt_text", - "duration_ms", - "height", - "media_key", - "non_public_metrics", - "organic_metrics", - "preview_image_url", - "promoted_metrics", - "public_metrics", - "type", - "url", - "variants", - "width" - ] - }, - "example" : [ - "alt_text", - "duration_ms", - "height", - "media_key", - "non_public_metrics", - "organic_metrics", - "preview_image_url", - "promoted_metrics", - "public_metrics", - "type", - "url", - "variants", - "width" - ] - }, - "explode" : false, - "style" : "form" - }, - "PlaceFieldsParameter" : { - "name" : "place.fields", - "in" : "query", - "description" : "A comma separated list of Place fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Place object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "contained_within", - "country", - "country_code", - "full_name", - "geo", - "id", - "name", - "place_type" - ] - }, - "example" : [ - "contained_within", - "country", - "country_code", - "full_name", - "geo", - "id", - "name", - "place_type" - ] - }, - "explode" : false, - "style" : "form" - }, - "PollFieldsParameter" : { - "name" : "poll.fields", - "in" : "query", - "description" : "A comma separated list of Poll fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Poll object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "duration_minutes", - "end_datetime", - "id", - "options", - "voting_status" - ] - }, - "example" : [ - "duration_minutes", - "end_datetime", - "id", - "options", - "voting_status" - ] - }, - "explode" : false, - "style" : "form" - }, - "RulesCountFieldsParameter" : { - "name" : "rules_count.fields", - "in" : "query", - "description" : "A comma separated list of RulesCount fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a RulesCount object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "all_project_client_apps", - "cap_per_client_app", - "cap_per_project", - "client_app_rules_count", - "project_rules_count" - ] - }, - "example" : [ - "all_project_client_apps", - "cap_per_client_app", - "cap_per_project", - "client_app_rules_count", - "project_rules_count" - ] - }, - "explode" : false, - "style" : "form" - }, - "SearchCountFieldsParameter" : { - "name" : "search_count.fields", - "in" : "query", - "description" : "A comma separated list of SearchCount fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a SearchCount object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "end", - "start", - "tweet_count" - ] - }, - "example" : [ - "end", - "start", - "tweet_count" - ] - }, - "explode" : false, - "style" : "form" - }, - "SpaceExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [Space](#Space) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "creator_id", - "host_ids", - "invited_user_ids", - "speaker_ids", - "topic_ids" - ] - }, - "example" : [ - "creator_id", - "host_ids", - "invited_user_ids", - "speaker_ids", - "topic_ids" - ] - }, - "explode" : false, - "style" : "form" - }, - "SpaceFieldsParameter" : { - "name" : "space.fields", - "in" : "query", - "description" : "A comma separated list of Space fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Space object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "created_at", - "creator_id", - "ended_at", - "host_ids", - "id", - "invited_user_ids", - "is_ticketed", - "lang", - "participant_count", - "scheduled_start", - "speaker_ids", - "started_at", - "state", - "subscriber_count", - "title", - "topic_ids", - "updated_at" - ] - }, - "example" : [ - "created_at", - "creator_id", - "ended_at", - "host_ids", - "id", - "invited_user_ids", - "is_ticketed", - "lang", - "participant_count", - "scheduled_start", - "speaker_ids", - "started_at", - "state", - "subscriber_count", - "title", - "topic_ids", - "updated_at" - ] - }, - "explode" : false, - "style" : "form" - }, - "TopicFieldsParameter" : { - "name" : "topic.fields", - "in" : "query", - "description" : "A comma separated list of Topic fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Topic object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "description", - "id", - "name" - ] - }, - "example" : [ - "description", - "id", - "name" - ] - }, - "explode" : false, - "style" : "form" - }, - "TrendFieldsParameter" : { - "name" : "trend.fields", - "in" : "query", - "description" : "A comma separated list of Trend fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Trend object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "trend_name", - "tweet_count" - ] - }, - "example" : [ - "trend_name", - "tweet_count" - ] - }, - "explode" : false, - "style" : "form" - }, - "TweetExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [Tweet](#Tweet) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "attachments.media_keys", - "attachments.media_source_tweet", - "attachments.poll_ids", - "author_id", - "edit_history_tweet_ids", - "entities.mentions.username", - "geo.place_id", - "in_reply_to_user_id", - "entities.note.mentions.username", - "referenced_tweets.id", - "referenced_tweets.id.author_id", - "author_screen_name" - ] - }, - "example" : [ - "attachments.media_keys", - "attachments.media_source_tweet", - "attachments.poll_ids", - "author_id", - "edit_history_tweet_ids", - "entities.mentions.username", - "geo.place_id", - "in_reply_to_user_id", - "entities.note.mentions.username", - "referenced_tweets.id", - "referenced_tweets.id.author_id", - "author_screen_name" - ] - }, - "explode" : false, - "style" : "form" - }, - "TweetFieldsParameter" : { - "name" : "tweet.fields", - "in" : "query", - "description" : "A comma separated list of Tweet fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Tweet object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "attachments", - "author_id", - "card_uri", - "context_annotations", - "conversation_id", - "created_at", - "edit_controls", - "edit_history_tweet_ids", - "entities", - "geo", - "id", - "in_reply_to_user_id", - "lang", - "non_public_metrics", - "note_tweet", - "organic_metrics", - "possibly_sensitive", - "promoted_metrics", - "public_metrics", - "referenced_tweets", - "reply_settings", - "scopes", - "source", - "text", - "username", - "withheld" - ] - }, - "example" : [ - "attachments", - "author_id", - "card_uri", - "context_annotations", - "conversation_id", - "created_at", - "edit_controls", - "edit_history_tweet_ids", - "entities", - "geo", - "id", - "in_reply_to_user_id", - "lang", - "non_public_metrics", - "note_tweet", - "organic_metrics", - "possibly_sensitive", - "promoted_metrics", - "public_metrics", - "referenced_tweets", - "reply_settings", - "scopes", - "source", - "text", - "username", - "withheld" - ] - }, - "explode" : false, - "style" : "form" - }, - "UsageFieldsParameter" : { - "name" : "usage.fields", - "in" : "query", - "description" : "A comma separated list of Usage fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a Usage object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "cap_reset_day", - "daily_client_app_usage", - "daily_project_usage", - "project_cap", - "project_id", - "project_usage" - ] - }, - "example" : [ - "cap_reset_day", - "daily_client_app_usage", - "daily_project_usage", - "project_cap", - "project_id", - "project_usage" - ] - }, - "explode" : false, - "style" : "form" - }, - "UserExpansionsParameter" : { - "name" : "expansions", - "in" : "query", - "description" : "A comma separated list of fields to expand.", - "schema" : { - "type" : "array", - "description" : "The list of fields you can expand for a [User](#User) object. If the field has an ID, it can be expanded into a full object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "most_recent_tweet_id", - "pinned_tweet_id" - ] - }, - "example" : [ - "most_recent_tweet_id", - "pinned_tweet_id" - ] - }, - "explode" : false, - "style" : "form" - }, - "UserFieldsParameter" : { - "name" : "user.fields", - "in" : "query", - "description" : "A comma separated list of User fields to display.", - "required" : false, - "schema" : { - "type" : "array", - "description" : "The fields available for a User object.", - "minItems" : 1, - "uniqueItems" : true, - "items" : { - "type" : "string", - "enum" : [ - "connection_status", - "created_at", - "description", - "entities", - "id", - "location", - "most_recent_tweet_id", - "name", - "pinned_tweet_id", - "profile_banner_url", - "profile_image_url", - "protected", - "public_metrics", - "receives_your_dm", - "subscription_type", - "url", - "username", - "verified", - "verified_type", - "withheld" - ] - }, - "example" : [ - "connection_status", - "created_at", - "description", - "entities", - "id", - "location", - "most_recent_tweet_id", - "name", - "pinned_tweet_id", - "profile_banner_url", - "profile_image_url", - "protected", - "public_metrics", - "receives_your_dm", - "subscription_type", - "url", - "username", - "verified", - "verified_type", - "withheld" - ] - }, - "explode" : false, - "style" : "form" - } - } - } - } \ No newline at end of file From 030710ad06ab8cbff155fa30f0e43cb905c7e7dc Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:20:32 +0530 Subject: [PATCH 10/15] Update gradle.properties ballerina plugin version --- ballerina/tests/README.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/tests/README.md b/ballerina/tests/README.md index 23557ec..ffb4b37 100644 --- a/ballerina/tests/README.md +++ b/ballerina/tests/README.md @@ -78,7 +78,7 @@ If you are using Windows you can use following method: ```bash setx IS_LIVE_SERVER true setx TWITTER_TOKEN - setx TWITTER_USER_ID = + setx TWITTER_USER_ID ``` Then, run the following command to run the tests: diff --git a/gradle.properties b/gradle.properties index 6da8c1a..fa452de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,5 +9,5 @@ downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 testngVersion=7.6.1 eclipseLsp4jVersion=0.12.0 -ballerinaGradlePluginVersion=2.2.7-SNAPSHOT +ballerinaGradlePluginVersion=2.2.6 ballerinaLangVersion=2201.9.0 From 4956b62fd6409bd4d4ca9074b41e30124d3cdaa8 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:24:48 +0530 Subject: [PATCH 11/15] Remove Unnecessory exmples mistakenly commited --- example/DM-mentions/.github/README.md | 25 ----- example/DM-mentions/.gitignore | 11 --- example/DM-mentions/Ballerina.toml | 5 - example/DM-mentions/Config.toml.template | 1 - .../Direct Message Company Mentions.md | 25 ----- example/DM-mentions/main.bal | 88 ----------------- example/README.md | 52 ---------- example/build.sh | 63 ------------ .../.github/README.md | 25 ----- example/tweet-performance-tracker/.gitignore | 11 --- .../tweet-performance-tracker/Ballerina.toml | 5 - .../Config.toml.template | 1 - .../Tweet Performance Tracker.md | 25 ----- example/tweet-performance-tracker/main.bal | 97 ------------------- 14 files changed, 434 deletions(-) delete mode 100644 example/DM-mentions/.github/README.md delete mode 100644 example/DM-mentions/.gitignore delete mode 100644 example/DM-mentions/Ballerina.toml delete mode 100644 example/DM-mentions/Config.toml.template delete mode 100644 example/DM-mentions/Direct Message Company Mentions.md delete mode 100644 example/DM-mentions/main.bal delete mode 100644 example/README.md delete mode 100644 example/build.sh delete mode 100644 example/tweet-performance-tracker/.github/README.md delete mode 100644 example/tweet-performance-tracker/.gitignore delete mode 100644 example/tweet-performance-tracker/Ballerina.toml delete mode 100644 example/tweet-performance-tracker/Config.toml.template delete mode 100644 example/tweet-performance-tracker/Tweet Performance Tracker.md delete mode 100644 example/tweet-performance-tracker/main.bal diff --git a/example/DM-mentions/.github/README.md b/example/DM-mentions/.github/README.md deleted file mode 100644 index e941e51..0000000 --- a/example/DM-mentions/.github/README.md +++ /dev/null @@ -1,25 +0,0 @@ -## Customer Support tweets and Feedback Management - -This use case demonstrates how the Twitter API v2 can be utilized to enhance customer engagement by monitoring mentions of a company's support handle and providing timely responses through direct messages. The example involves a sequence of actions that leverage the Twitter API v2 to automate and streamline customer support efforts. - -## Prerequisites - -### 1. Obtain Access token - -Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one - -### 2. Configuration - -Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory - -```bash -accessToken = "" -``` - -## Run the example - -Execute the following command to run the example: - -```bash -bal run -``` \ No newline at end of file diff --git a/example/DM-mentions/.gitignore b/example/DM-mentions/.gitignore deleted file mode 100644 index d5fc29a..0000000 --- a/example/DM-mentions/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Ballerina generates this directory during the compilation of a package. -# It contains compiler-generated artifacts and the final executable if this is an application package. -target/ - -# Ballerina maintains the compiler-generated source code here. -# Remove this if you want to commit generated sources. -generated/ - -# Contains configuration values used during development time. -# See https://ballerina.io/learn/provide-values-to-configurable-variables/ for more details. -Config.toml diff --git a/example/DM-mentions/Ballerina.toml b/example/DM-mentions/Ballerina.toml deleted file mode 100644 index 214a276..0000000 --- a/example/DM-mentions/Ballerina.toml +++ /dev/null @@ -1,5 +0,0 @@ -[package] -org = "wso2" -name = "DM_mentions" -version = "0.1.0" -distribution = "2201.9.0" \ No newline at end of file diff --git a/example/DM-mentions/Config.toml.template b/example/DM-mentions/Config.toml.template deleted file mode 100644 index ce1465e..0000000 --- a/example/DM-mentions/Config.toml.template +++ /dev/null @@ -1 +0,0 @@ -accessToken = "" \ No newline at end of file diff --git a/example/DM-mentions/Direct Message Company Mentions.md b/example/DM-mentions/Direct Message Company Mentions.md deleted file mode 100644 index e941e51..0000000 --- a/example/DM-mentions/Direct Message Company Mentions.md +++ /dev/null @@ -1,25 +0,0 @@ -## Customer Support tweets and Feedback Management - -This use case demonstrates how the Twitter API v2 can be utilized to enhance customer engagement by monitoring mentions of a company's support handle and providing timely responses through direct messages. The example involves a sequence of actions that leverage the Twitter API v2 to automate and streamline customer support efforts. - -## Prerequisites - -### 1. Obtain Access token - -Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one - -### 2. Configuration - -Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory - -```bash -accessToken = "" -``` - -## Run the example - -Execute the following command to run the example: - -```bash -bal run -``` \ No newline at end of file diff --git a/example/DM-mentions/main.bal b/example/DM-mentions/main.bal deleted file mode 100644 index defc8f6..0000000 --- a/example/DM-mentions/main.bal +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/io; -import ballerinax/twitter; - -configurable string accessToken = ?; - -public function main() returns error? { - - // Initialize the client - twitter:Client twitter = check new ({ - auth: { - token: accessToken - } - }); - - // a search query to search for tweets - string searchQuery = "#ballerinaSupport"; - - // search for recent tweets - twitter:Get2TweetsSearchRecentResponse tweetList = check twitter->/tweets/search/recent( - query = searchQuery, - max_results = 10 - ); - - // Initialize tweetIdList and userIdList - twitter:TweetId[] tweetIdList = []; - twitter:UserId[] userIdList = []; - - // Extract tweets from the response - twitter:Tweet[] tweets = tweetList.data ?: []; - - // Iterate through the tweets and extract the tweet IDs - foreach twitter:Tweet tweet in tweets { - tweetIdList.push(tweet.id ?: ""); - } - - // Iterate through the tweet IDs and extract the user IDs - foreach twitter:TweetId tweetId in tweetIdList { - if (tweetId == "") { - continue; - } - - // Find the author ID of the tweet - twitter:FindTweetByIdQueries queries = { - tweet\.fields: ["author_id"] - }; - twitter:Get2TweetsIdResponse tweetResponse = check twitter->/tweets/[tweetId](queries = queries); - - userIdList.push(tweetResponse.data?.author_id ?: ""); - } - - // Iterate through the user IDs and send a DM to each user - foreach twitter:UserId userId in userIdList { - if (userId == "") { - continue; - } - - io:println("User ID: ", userId); - - // Send a DM to the user - twitter:CreateDmEventResponse DMResponse = check twitter->/dm_conversations/with/[userId]/messages.post( - payload = { - text: "Thank you for reaching us! We will reach you soon" - } - ); - - if (DMResponse.data != null) { - io:println("DM sent successfully"); - } else { - io:println("Failed to send DM", DMResponse); - } - } -} \ No newline at end of file diff --git a/example/README.md b/example/README.md deleted file mode 100644 index c464f65..0000000 --- a/example/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Examples - -The `ballerinax/twitter` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-twitter/tree/main/examples), covering use cases like Direct message company mentions, and tweet performance tracker. - -1. [Direct message company mentions](https://github.com/ballerina-platform/module-ballerinax-twitter/tree/main/examples/DM-mentions) - Integrate Twitter to send direct messages to users who mention the company in tweets. - -2. [Tweet performance tracker](https://github.com/ballerina-platform/module-ballerinax-twitter/tree/main/examples/tweet-performance-tracker) - Analyze the performance of tweets posted by a user over the past month. - - -## Prerequisites - -1. Generate Twitter credentials to authenticate the connector as described in the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide). - -2. For each example, create a `Config.toml` file the related configuration. Here's an example of how your `Config.toml` file should look: - - ```toml - accessToken="" - ``` - -## Running an Example - -Execute the following commands to build an example from the source: - -* To build an example: - - ```bash - bal build - ``` - -* To run an example: - - ```bash - bal run - ``` - -## Building the Examples with the Local Module - -**Warning**: Due to the absence of support for reading local repositories for single Ballerina files, the Bala of the module is manually written to the central repository as a workaround. Consequently, the bash script may modify your local Ballerina repositories. - -Execute the following commands to build all the examples against the changes you have made to the module locally: - -* To build all the examples: - - ```bash - ./build.sh build - ``` - -* To run all the examples: - - ```bash - ./build.sh run - ``` \ No newline at end of file diff --git a/example/build.sh b/example/build.sh deleted file mode 100644 index 1014d43..0000000 --- a/example/build.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -BAL_EXAMPLES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -BAL_CENTRAL_DIR="$HOME/.ballerina/repositories/central.ballerina.io" -BAL_HOME_DIR="$BAL_EXAMPLES_DIR/../ballerina" - -set -e - -case "$1" in -build) - BAL_CMD="build" - ;; -run) - BAL_CMD="run" - ;; -*) - echo "Invalid command provided: '$1'. Please provide 'build' or 'run' as the command." - exit 1 - ;; -esac - -# Read Ballerina package name -BAL_PACKAGE_NAME=$(awk -F'"' '/^name/ {print $2}' "$BAL_HOME_DIR/Ballerina.toml") - -# Push the package to the local repository -cd "$BAL_HOME_DIR" && - bal pack && - bal push --repository=local - -# Remove the cache directories in the repositories -cacheDirs=$(ls -d $BAL_CENTRAL_DIR/cache-* 2>/dev/null) || true -for dir in "${cacheDirs[@]}"; do - [ -d "$dir" ] && rm -r "$dir" -done -echo "Successfully cleaned the cache directories" - -# Create the package directory in the central repository, this will not be present if no modules are pulled -mkdir -p "$BAL_CENTRAL_DIR/bala/ballerinax/$BAL_PACKAGE_NAME" - -# Update the central repository -BAL_DESTINATION_DIR="$HOME/.ballerina/repositories/central.ballerina.io/bala/ballerinax/$BAL_PACKAGE_NAME" -BAL_SOURCE_DIR="$HOME/.ballerina/repositories/local/bala/ballerinax/$BAL_PACKAGE_NAME" -[ -d "$BAL_DESTINATION_DIR" ] && rm -r "$BAL_DESTINATION_DIR" -[ -d "$BAL_SOURCE_DIR" ] && cp -r "$BAL_SOURCE_DIR" "$BAL_DESTINATION_DIR" -echo "Successfully updated the local central repositories" - -echo "$BAL_DESTINATION_DIR" -echo "$BAL_SOURCE_DIR" - -# Loop through examples in the examples directory -cd "$BAL_EXAMPLES_DIR" -for dir in $(find "$BAL_EXAMPLES_DIR" -type d -maxdepth 1 -mindepth 1); do - # Skip the build directory - if [[ "$dir" == *build ]]; then - continue - fi - (cd "$dir" && bal "$BAL_CMD" --offline && cd ..); -done - -# Remove generated JAR files -find "$BAL_HOME_DIR" -maxdepth 1 -type f -name "*.jar" | while read -r JAR_FILE; do - rm "$JAR_FILE" -done \ No newline at end of file diff --git a/example/tweet-performance-tracker/.github/README.md b/example/tweet-performance-tracker/.github/README.md deleted file mode 100644 index a5be15e..0000000 --- a/example/tweet-performance-tracker/.github/README.md +++ /dev/null @@ -1,25 +0,0 @@ -## Analyzing One-Month Tweet Performance - -This use case demonstrates how the Twitter API v2 can be utilized to analyze the performance of tweets posted by a user over the past month. The example involves a sequence of actions that leverage the Twitter API v2 to automate the retrieval of tweets and their performance metrics (likes, retweets, replies), and then create a performance report. - -## Prerequisites - -### 1. Obtain Access token - -Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one - -### 2. Configuration - -Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory - -```bash -accessToken = "" -``` - -## Run the example - -Execute the following command to run the example: - -```bash -bal run -``` \ No newline at end of file diff --git a/example/tweet-performance-tracker/.gitignore b/example/tweet-performance-tracker/.gitignore deleted file mode 100644 index d5fc29a..0000000 --- a/example/tweet-performance-tracker/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Ballerina generates this directory during the compilation of a package. -# It contains compiler-generated artifacts and the final executable if this is an application package. -target/ - -# Ballerina maintains the compiler-generated source code here. -# Remove this if you want to commit generated sources. -generated/ - -# Contains configuration values used during development time. -# See https://ballerina.io/learn/provide-values-to-configurable-variables/ for more details. -Config.toml diff --git a/example/tweet-performance-tracker/Ballerina.toml b/example/tweet-performance-tracker/Ballerina.toml deleted file mode 100644 index 18fdcfe..0000000 --- a/example/tweet-performance-tracker/Ballerina.toml +++ /dev/null @@ -1,5 +0,0 @@ -[package] -org = "wso2" -name = "tweet_performance_tracker" -version = "0.1.0" -distribution = "2201.9.0" diff --git a/example/tweet-performance-tracker/Config.toml.template b/example/tweet-performance-tracker/Config.toml.template deleted file mode 100644 index ce1465e..0000000 --- a/example/tweet-performance-tracker/Config.toml.template +++ /dev/null @@ -1 +0,0 @@ -accessToken = "" \ No newline at end of file diff --git a/example/tweet-performance-tracker/Tweet Performance Tracker.md b/example/tweet-performance-tracker/Tweet Performance Tracker.md deleted file mode 100644 index a5be15e..0000000 --- a/example/tweet-performance-tracker/Tweet Performance Tracker.md +++ /dev/null @@ -1,25 +0,0 @@ -## Analyzing One-Month Tweet Performance - -This use case demonstrates how the Twitter API v2 can be utilized to analyze the performance of tweets posted by a user over the past month. The example involves a sequence of actions that leverage the Twitter API v2 to automate the retrieval of tweets and their performance metrics (likes, retweets, replies), and then create a performance report. - -## Prerequisites - -### 1. Obtain Access token - -Refer to the [Setup guide](https://central.ballerina.io/ballerinax/twitter/latest#setup-guide) to obtain access token, if you do not have one - -### 2. Configuration - -Configure Twitter API v2 related configurations in the `Config.toml` file in the example directory - -```bash -accessToken = "" -``` - -## Run the example - -Execute the following command to run the example: - -```bash -bal run -``` \ No newline at end of file diff --git a/example/tweet-performance-tracker/main.bal b/example/tweet-performance-tracker/main.bal deleted file mode 100644 index c2654e1..0000000 --- a/example/tweet-performance-tracker/main.bal +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/io; -import ballerina/time; -import ballerinax/twitter; - -configurable string accessToken = ?; - -public function main() returns error? { - - // Initialize the client - twitter:Client twitter = check new ({ - auth: { - token: accessToken - } - }); - - // Define the username to track and the time range - string username = ""; - time:Utc utcTimeNow = time:utcNow(); - time:Utc utcTimeBeforeMonth = time:utcAddSeconds(utcTimeNow, -2592000); - - // Initialize tweetsPerformingList - twitter:Tweet[] tweetsPerformingList = []; - - // Retrieve user by username - twitter:Get2UsersByUsernameUsernameResponse responseUser = check twitter->/users/'by/username/[username](); - twitter:User? user = responseUser.data; - - if (user is twitter:User) { - twitter:UserId userId = user.id; - - // Retrieve tweets posted by the user in the past month - twitter:Get2UsersIdTweetsResponse responseUserTweets = check twitter->/users/[userId]/tweets({ - start_time: time:utcToString(utcTimeBeforeMonth), - end_time: time:utcToString(utcTimeNow) - }); - twitter:Tweet[] tweets = responseUserTweets.data ?: []; - - // Define query parameters - twitter:FindTweetByIdQueries queries = { - tweet\.fields: ["public_metrics"] - }; - - // Retrieve detailed metrics for each tweet - foreach twitter:Tweet tweet in tweets { - twitter:TweetId tweetId = tweet.id ?: ""; - twitter:Get2TweetsIdResponse responseTweet = check twitter->/tweets/[tweetId](queries = queries); - twitter:Tweet? tweetData = responseTweet.data; - - if tweetData != null { - tweet.public_metrics = tweetData.public_metrics; - tweetsPerformingList.push(tweet); - } - } - } - - // Sort tweetsPerformingList by like_count using bubble sort - int n = tweetsPerformingList.length(); - boolean swapped = false; - foreach int i in 0 ... n - 2 { - swapped = false; - foreach int j in 1 ... n - 1 - i { - if (tweetsPerformingList[j - 1].public_metrics?.like_count < tweetsPerformingList[j].public_metrics?.like_count) { - twitter:Tweet temp = tweetsPerformingList[j - 1]; - tweetsPerformingList[j - 1] = tweetsPerformingList[j]; - tweetsPerformingList[j] = temp; - swapped = true; - } - } - if (!swapped) { - break; - } - } - - // Print the sorted tweets - io:println("Top Tweets by ", username, " in the last month: "); - foreach var tweet in tweetsPerformingList { - io:println("Tweet: ", tweet.text); - io:println("Likes: ", tweet.public_metrics?.like_count); - io:println("Retweet Count: ", tweet.public_metrics?.retweet_count); - } -} \ No newline at end of file From aa678835946ab9b1aefb3295bf1337a378417aee Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:42:09 +0530 Subject: [PATCH 12/15] Update test client name --- ballerina/tests/test.bal | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 8c9ab2f..148c7cf 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -24,7 +24,7 @@ configurable string token = isLiveServer ? os:getEnv("TWITTER_TOKEN") : "test"; configurable string serviceUrl = isLiveServer ? "https://api.twitter.com/2" : "http://localhost:9090/"; ConnectionConfig config = {auth: {token: token}}; -final Client baseClient = check new Client(config, serviceUrl); +final Client twitter = check new Client(config, serviceUrl); //Test Posting a Tweet @test:Config { @@ -32,7 +32,7 @@ final Client baseClient = check new Client(config, serviceUrl); isolated function testPostTweet() returns error? { time:Utc utc = time:utcNow(); string tweetText = "Twitter Test at " + utc.toString(); - TweetCreateResponse response = check baseClient->/tweets.post(payload = { + TweetCreateResponse response = check twitter->/tweets.post(payload = { text: tweetText }); test:assertTrue(response?.data !is ()); @@ -43,7 +43,7 @@ isolated function testPostTweet() returns error? { @test:Config { } isolated function testgetUserIdByUseName() returns error? { - Get2UsersByUsernameUsernameResponse response = check baseClient->/users/'by/username/["KumarSanga2"]; + Get2UsersByUsernameUsernameResponse response = check twitter->/users/'by/username/["KumarSanga2"]; test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -52,7 +52,7 @@ isolated function testgetUserIdByUseName() returns error? { @test:Config { } isolated function testUserLikeAPost() returns error? { - UsersLikesCreateResponse response = check baseClient->/users/[userId]/likes.post( + UsersLikesCreateResponse response = check twitter->/users/[userId]/likes.post( payload = { tweet_id:"1806286701704462623" } @@ -65,7 +65,7 @@ isolated function testUserLikeAPost() returns error? { @test:Config { } isolated function testUserUnlikeAPost() returns error? { - UsersLikesDeleteResponse response = check baseClient->/users/[userId]/likes/["1806286701704462623"].delete(); + UsersLikesDeleteResponse response = check twitter->/users/[userId]/likes/["1806286701704462623"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -74,7 +74,7 @@ isolated function testUserUnlikeAPost() returns error? { @test:Config { } isolated function testPostLookup() returns error? { - Get2TweetsIdResponse response = check baseClient->/tweets/["1806286701704462623"](); + Get2TweetsIdResponse response = check twitter->/tweets/["1806286701704462623"](); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -83,7 +83,7 @@ isolated function testPostLookup() returns error? { @test:Config { } isolated function testBookmarkPost() returns error? { - BookmarkMutationResponse response = check baseClient->/users/[userId]/bookmarks.post( + BookmarkMutationResponse response = check twitter->/users/[userId]/bookmarks.post( payload = {tweet_id: "1806286701704462623"} ); test:assertTrue(response?.data !is ()); @@ -94,7 +94,7 @@ isolated function testBookmarkPost() returns error? { @test:Config { } isolated function testBookmarkDelete() returns error? { - BookmarkMutationResponse response = check baseClient->/users/[userId]/bookmarks/["1806286701704462623"].delete(); + BookmarkMutationResponse response = check twitter->/users/[userId]/bookmarks/["1806286701704462623"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -104,7 +104,7 @@ isolated function testBookmarkDelete() returns error? { @test:Config { } isolated function testRetweet() returns error? { - UsersRetweetsCreateResponse response = check baseClient->/users/[userId]/retweets.post( + UsersRetweetsCreateResponse response = check twitter->/users/[userId]/retweets.post( payload = {tweet_id: "1806286701704462623"} ); test:assertTrue(response?.data !is ()); @@ -115,7 +115,7 @@ isolated function testRetweet() returns error? { @test:Config { } isolated function testDeleteRetweet() returns error? { - UsersRetweetsDeleteResponse response = check baseClient->/users/[userId]/retweets/["1806286701704462623"].delete(); + UsersRetweetsDeleteResponse response = check twitter->/users/[userId]/retweets/["1806286701704462623"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -124,7 +124,7 @@ isolated function testDeleteRetweet() returns error? { @test:Config { } isolated function testFollowSpecificUser() returns error? { - UsersFollowingCreateResponse response = check baseClient->/users/[userId]/following.post( + UsersFollowingCreateResponse response = check twitter->/users/[userId]/following.post( payload={ target_user_id:"1803011651249278976" } @@ -137,7 +137,7 @@ isolated function testFollowSpecificUser() returns error? { @test:Config { } isolated function testUnfollowSpecificUser() returns error? { - UsersFollowingDeleteResponse response = check baseClient->/users/[userId]/following/["1803011651249278976"].delete(); + UsersFollowingDeleteResponse response = check twitter->/users/[userId]/following/["1803011651249278976"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -146,7 +146,7 @@ isolated function testUnfollowSpecificUser() returns error? { @test:Config { } isolated function muteSpecificUser() returns error? { - MuteUserMutationResponse response = check baseClient->/users/[userId]/muting.post( + MuteUserMutationResponse response = check twitter->/users/[userId]/muting.post( payload={ target_user_id:"1803011651249278976" } @@ -159,7 +159,7 @@ isolated function muteSpecificUser() returns error? { @test:Config { } isolated function unmuteSpecificUser() returns error? { - MuteUserMutationResponse response = check baseClient->/users/[userId]/muting/["1803011651249278976"].delete(); + MuteUserMutationResponse response = check twitter->/users/[userId]/muting/["1803011651249278976"].delete(); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } @@ -168,7 +168,7 @@ isolated function unmuteSpecificUser() returns error? { @test:Config { } isolated function findSpecificUser() returns error? { - Get2UsersResponse response = check baseClient->/users(ids = ["1803011651249278976"]); + Get2UsersResponse response = check twitter->/users(ids = ["1803011651249278976"]); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); } From aa484ffa9cce3ffe931d44e1c0ecebc588938a67 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:56:01 +0530 Subject: [PATCH 13/15] Update mock_service and test bal files with by removing unnecessory comments and empty lines --- ballerina/tests/mock_service.bal | 9 +-------- ballerina/tests/test.bal | 19 ++----------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/ballerina/tests/mock_service.bal b/ballerina/tests/mock_service.bal index dac085c..894444a 100644 --- a/ballerina/tests/mock_service.bal +++ b/ballerina/tests/mock_service.bal @@ -37,8 +37,6 @@ http:Service mockService = service object { return response; } - - # Causes the User (in the path) to unlike the specified Post # # + id - The ID of the authenticated source User that is requesting to unlike the Post. @@ -121,7 +119,6 @@ http:Service mockService = service object { return response; } - # Creation of a Post # # + return - returns can be any of following types @@ -134,7 +131,6 @@ http:Service mockService = service object { return response; } - # Add Post to Bookmarks # # + id - The ID of the authenticated source User for whom to add bookmarks. @@ -148,7 +144,6 @@ http:Service mockService = service object { return response; } - # Follow User # # + id - The ID of the authenticated source User that is requesting to follow the target User. @@ -188,7 +183,6 @@ http:Service mockService = service object { return response; } - # Causes the User (in the path) to repost the specified Post. # # + id - The ID of the authenticated source User that is requesting to repost the Post. @@ -227,5 +221,4 @@ function init() returns error? { log:printInfo("Initiating mock server"); check httpListener.attach(mockService, "/"); check httpListener.'start(); -} - \ No newline at end of file +} \ No newline at end of file diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 148c7cf..8d335e3 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -21,12 +21,11 @@ import ballerina/os; configurable boolean isLiveServer = os:getEnv("IS_LIVE_SERVER") == "true"; configurable string userId = isLiveServer ? os:getEnv("TWITTER_USER_ID") : "test"; configurable string token = isLiveServer ? os:getEnv("TWITTER_TOKEN") : "test"; -configurable string serviceUrl = isLiveServer ? "https://api.twitter.com/2" : "http://localhost:9090/"; +configurable string serviceUrl = isLiveServer ? "https://api.twitter.com/2" : "http://localhost:9090"; ConnectionConfig config = {auth: {token: token}}; final Client twitter = check new Client(config, serviceUrl); -//Test Posting a Tweet @test:Config { } isolated function testPostTweet() returns error? { @@ -39,7 +38,6 @@ isolated function testPostTweet() returns error? { test:assertTrue(response?.errors is ()); } -//Test Get Twitter User Id of a user By Username @test:Config { } isolated function testgetUserIdByUseName() returns error? { @@ -48,7 +46,6 @@ isolated function testgetUserIdByUseName() returns error? { test:assertTrue(response?.errors is ()); } -//Test Like a Post via Post ID @test:Config { } isolated function testUserLikeAPost() returns error? { @@ -61,7 +58,6 @@ isolated function testUserLikeAPost() returns error? { test:assertTrue(response?.errors is ()); } -//Test Unlike a Post via Post ID @test:Config { } isolated function testUserUnlikeAPost() returns error? { @@ -70,7 +66,6 @@ isolated function testUserUnlikeAPost() returns error? { test:assertTrue(response?.errors is ()); } -//Test grab information of a specific post via Id @test:Config { } isolated function testPostLookup() returns error? { @@ -79,7 +74,6 @@ isolated function testPostLookup() returns error? { test:assertTrue(response?.errors is ()); } -//Test Bookmark a Post @test:Config { } isolated function testBookmarkPost() returns error? { @@ -90,7 +84,6 @@ isolated function testBookmarkPost() returns error? { test:assertTrue(response?.errors is ()); } -//Test Unbookmark a Post @test:Config { } isolated function testBookmarkDelete() returns error? { @@ -99,8 +92,6 @@ isolated function testBookmarkDelete() returns error? { test:assertTrue(response?.errors is ()); } - -//Test Retweet a Post via Post ID @test:Config { } isolated function testRetweet() returns error? { @@ -111,7 +102,6 @@ isolated function testRetweet() returns error? { test:assertTrue(response?.errors is ()); } -//Test Unretweet a Post via Post ID @test:Config { } isolated function testDeleteRetweet() returns error? { @@ -120,7 +110,6 @@ isolated function testDeleteRetweet() returns error? { test:assertTrue(response?.errors is ()); } -//Test Follow a Specific User @test:Config { } isolated function testFollowSpecificUser() returns error? { @@ -133,7 +122,6 @@ isolated function testFollowSpecificUser() returns error? { test:assertTrue(response?.errors is ()); } -//Test Unfollow a Specific User @test:Config { } isolated function testUnfollowSpecificUser() returns error? { @@ -142,7 +130,6 @@ isolated function testUnfollowSpecificUser() returns error? { test:assertTrue(response?.errors is ()); } -//Test Mute a Specific User @test:Config { } isolated function muteSpecificUser() returns error? { @@ -155,7 +142,6 @@ isolated function muteSpecificUser() returns error? { test:assertTrue(response?.errors is ()); } -//Test Unmute a Specific User @test:Config { } isolated function unmuteSpecificUser() returns error? { @@ -164,11 +150,10 @@ isolated function unmuteSpecificUser() returns error? { test:assertTrue(response?.errors is ()); } -//Test FInd User Via ID @test:Config { } isolated function findSpecificUser() returns error? { Get2UsersResponse response = check twitter->/users(ids = ["1803011651249278976"]); test:assertTrue(response?.data !is ()); test:assertTrue(response?.errors is ()); -} +} \ No newline at end of file From 22f461d825fe3e85dbd202c29aa16895feb7f68e Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:47:52 +0530 Subject: [PATCH 14/15] Update mock_service and test ballerina files --- ballerina/tests/README.md | 2 -- ballerina/tests/mock_service.bal | 44 ++++++++++---------------------- ballerina/tests/test.bal | 17 +++++++++++- 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/ballerina/tests/README.md b/ballerina/tests/README.md index ffb4b37..39fe177 100644 --- a/ballerina/tests/README.md +++ b/ballerina/tests/README.md @@ -8,8 +8,6 @@ To do this, refer to [Ballerina Twitter Connector](https://github.com/ballerina- And You need Find Your User ID For run some of the tests. Via This Website you can find it [Twitter ID Finder](https://twiteridfinder.com/). - - # Running Tests There are two test environments for running the Twitter(X) connector tests. The default test environment is the mock server for Twitter API. The other test environment is the actual Twitter (X) API. diff --git a/ballerina/tests/mock_service.bal b/ballerina/tests/mock_service.bal index 894444a..01184f3 100644 --- a/ballerina/tests/mock_service.bal +++ b/ballerina/tests/mock_service.bal @@ -14,7 +14,6 @@ // specific language governing permissions and limitations // under the License. - import ballerina/http; import ballerina/log; @@ -22,7 +21,6 @@ listener http:Listener httpListener = new (9090); http:Service mockService = service object { - # Remove a bookmarked Post # # + id - The ID of the authenticated source User whose bookmark is to be removed. @@ -31,10 +29,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function delete users/[UserIdMatchesAuthenticatedUser id]/bookmarks/[TweetId tweet_id]() returns BookmarkMutationResponse|http:Response { - BookmarkMutationResponse response = { + return { "data":{"bookmarked":false} }; - return response; } # Causes the User (in the path) to unlike the specified Post @@ -45,10 +42,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function delete users/[UserIdMatchesAuthenticatedUser id]/likes/[TweetId tweet_id]() returns UsersLikesDeleteResponse|http:Response { - UsersLikesDeleteResponse response = { + return { "data":{"liked":false} }; - return response; } # Causes the User (in the path) to unretweet the specified Post @@ -59,10 +55,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function delete users/[UserIdMatchesAuthenticatedUser id]/retweets/[TweetId source_tweet_id]() returns UsersRetweetsDeleteResponse|http:Response { - UsersRetweetsDeleteResponse response = { + return { "data":{"retweeted":false} }; - return response; } # Unfollow User @@ -73,10 +68,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function delete users/[UserIdMatchesAuthenticatedUser source_user_id]/following/[UserId target_user_id]() returns UsersFollowingDeleteResponse|http:Response { - UsersFollowingDeleteResponse response = { + return { "data":{"following":false} }; - return response; } # Unmute User by User ID @@ -87,10 +81,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function delete users/[UserIdMatchesAuthenticatedUser source_user_id]/muting/[UserId target_user_id]() returns MuteUserMutationResponse|http:Response { - MuteUserMutationResponse response = { + return { "data":{"muting":false} }; - return response; } # Post lookup by Post ID @@ -106,17 +99,15 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function get tweets/[TweetId id](("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields, ("attachments.media_keys"|"attachments.media_source_tweet"|"attachments.poll_ids"|"author_id"|"edit_history_tweet_ids"|"entities.mentions.username"|"geo.place_id"|"in_reply_to_user_id"|"entities.note.mentions.username"|"referenced_tweets.id"|"referenced_tweets.id.author_id"|"author_screen_name")[]? expansions, ("alt_text"|"duration_ms"|"height"|"media_key"|"non_public_metrics"|"organic_metrics"|"preview_image_url"|"promoted_metrics"|"public_metrics"|"type"|"url"|"variants"|"width")[]? media\.fields, ("duration_minutes"|"end_datetime"|"id"|"options"|"voting_status")[]? poll\.fields, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("contained_within"|"country"|"country_code"|"full_name"|"geo"|"id"|"name"|"place_type")[]? place\.fields) returns Get2TweetsIdResponse|http:Response { - Get2TweetsIdResponse response = { + return { "data":{"edit_history_tweet_ids":["1806286701704462623"],"id":"1806286701704462623","text":"aasbcascbasjbc"} }; - return response; } resource function get users/'by/username/[string username](("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersByUsernameUsernameResponse|http:Response { - Get2UsersByUsernameUsernameResponse response = { + return { "data":{"id":"350224247","name":"Kumar Sangakkara","username":"KumarSanga2"} }; - return response; } # Creation of a Post @@ -125,10 +116,9 @@ http:Service mockService = service object { # http:Created (The request has succeeded.) # http:Response (The request has failed.) resource function post tweets(@http:Payload TweetCreateRequest payload) returns TweetCreateResponse|http:Response { - TweetCreateResponse response = { + return { "data":{"id":"1807808193139204482","text":"Twitter Test at[1719850035,0.227505100]","edit_history_tweet_ids":["1807808193139204482"]} }; - return response; } # Add Post to Bookmarks @@ -138,10 +128,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function post users/[UserIdMatchesAuthenticatedUser id]/bookmarks(@http:Payload BookmarkAddRequest payload) returns BookmarkMutationResponse|http:Response { - BookmarkMutationResponse response ={ + return { "data":{"bookmarked":true} }; - return response; } # Follow User @@ -151,10 +140,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function post users/[UserIdMatchesAuthenticatedUser id]/following(@http:Payload UsersFollowingCreateRequest payload) returns UsersFollowingCreateResponse|http:Response { - UsersFollowingCreateResponse response = { + return { "data":{"following":true,"pending_follow":false} }; - return response; } # Causes the User (in the path) to like the specified Post @@ -164,10 +152,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function post users/[UserIdMatchesAuthenticatedUser id]/likes(@http:Payload UsersLikesCreateRequest payload) returns UsersLikesCreateResponse|http:Response { - UsersLikesCreateResponse response = { + return { "data":{"liked":true} }; - return response; } # Mute User by User ID. @@ -177,10 +164,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function post users/[UserIdMatchesAuthenticatedUser id]/muting(@http:Payload MuteUserRequest payload) returns MuteUserMutationResponse|http:Response { - MuteUserMutationResponse response = { + return { "data":{"muting":true} }; - return response; } # Causes the User (in the path) to repost the specified Post. @@ -190,10 +176,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function post users/[UserIdMatchesAuthenticatedUser id]/retweets(@http:Payload UsersRetweetsCreateRequest payload) returns UsersRetweetsCreateResponse|http:Response { - UsersRetweetsCreateResponse response ={ + return { "data":{"retweeted":true,"rest_id":"1807808194787590411"} }; - return response; } # User lookup by IDs @@ -206,10 +191,9 @@ http:Service mockService = service object { # http:Ok (The request has succeeded.) # http:Response (The request has failed.) resource function get users(UserId[] ids, ("connection_status"|"created_at"|"description"|"entities"|"id"|"location"|"most_recent_tweet_id"|"name"|"pinned_tweet_id"|"profile_image_url"|"protected"|"public_metrics"|"receives_your_dm"|"subscription_type"|"url"|"username"|"verified"|"verified_type"|"withheld")[]? user\.fields, ("most_recent_tweet_id"|"pinned_tweet_id")[]? expansions, ("attachments"|"author_id"|"card_uri"|"context_annotations"|"conversation_id"|"created_at"|"edit_controls"|"edit_history_tweet_ids"|"entities"|"geo"|"id"|"in_reply_to_user_id"|"lang"|"non_public_metrics"|"note_tweet"|"organic_metrics"|"possibly_sensitive"|"promoted_metrics"|"public_metrics"|"referenced_tweets"|"reply_settings"|"scopes"|"source"|"text"|"username"|"withheld")[]? tweet\.fields) returns Get2UsersResponse|http:Response { - Get2UsersResponse response = { + return { "data":[{"id":"350224247","name":"Kumar Sangakkara","username":"KumarSanga2"}] }; - return response; } }; diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 8d335e3..52a01d7 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -23,10 +23,11 @@ configurable string userId = isLiveServer ? os:getEnv("TWITTER_USER_ID") : "test configurable string token = isLiveServer ? os:getEnv("TWITTER_TOKEN") : "test"; configurable string serviceUrl = isLiveServer ? "https://api.twitter.com/2" : "http://localhost:9090"; -ConnectionConfig config = {auth: {token: token}}; +ConnectionConfig config = {auth: {token}}; final Client twitter = check new Client(config, serviceUrl); @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testPostTweet() returns error? { time:Utc utc = time:utcNow(); @@ -39,6 +40,7 @@ isolated function testPostTweet() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testgetUserIdByUseName() returns error? { Get2UsersByUsernameUsernameResponse response = check twitter->/users/'by/username/["KumarSanga2"]; @@ -47,6 +49,7 @@ isolated function testgetUserIdByUseName() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testUserLikeAPost() returns error? { UsersLikesCreateResponse response = check twitter->/users/[userId]/likes.post( @@ -59,6 +62,7 @@ isolated function testUserLikeAPost() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testUserUnlikeAPost() returns error? { UsersLikesDeleteResponse response = check twitter->/users/[userId]/likes/["1806286701704462623"].delete(); @@ -67,6 +71,7 @@ isolated function testUserUnlikeAPost() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testPostLookup() returns error? { Get2TweetsIdResponse response = check twitter->/tweets/["1806286701704462623"](); @@ -75,6 +80,7 @@ isolated function testPostLookup() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testBookmarkPost() returns error? { BookmarkMutationResponse response = check twitter->/users/[userId]/bookmarks.post( @@ -85,6 +91,7 @@ isolated function testBookmarkPost() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testBookmarkDelete() returns error? { BookmarkMutationResponse response = check twitter->/users/[userId]/bookmarks/["1806286701704462623"].delete(); @@ -93,6 +100,7 @@ isolated function testBookmarkDelete() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testRetweet() returns error? { UsersRetweetsCreateResponse response = check twitter->/users/[userId]/retweets.post( @@ -103,6 +111,7 @@ isolated function testRetweet() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testDeleteRetweet() returns error? { UsersRetweetsDeleteResponse response = check twitter->/users/[userId]/retweets/["1806286701704462623"].delete(); @@ -111,6 +120,7 @@ isolated function testDeleteRetweet() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testFollowSpecificUser() returns error? { UsersFollowingCreateResponse response = check twitter->/users/[userId]/following.post( @@ -123,6 +133,7 @@ isolated function testFollowSpecificUser() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function testUnfollowSpecificUser() returns error? { UsersFollowingDeleteResponse response = check twitter->/users/[userId]/following/["1803011651249278976"].delete(); @@ -131,6 +142,7 @@ isolated function testUnfollowSpecificUser() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function muteSpecificUser() returns error? { MuteUserMutationResponse response = check twitter->/users/[userId]/muting.post( @@ -143,7 +155,9 @@ isolated function muteSpecificUser() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } + isolated function unmuteSpecificUser() returns error? { MuteUserMutationResponse response = check twitter->/users/[userId]/muting/["1803011651249278976"].delete(); test:assertTrue(response?.data !is ()); @@ -151,6 +165,7 @@ isolated function unmuteSpecificUser() returns error? { } @test:Config { + groups: ["live_tests", "mock_tests"] } isolated function findSpecificUser() returns error? { Get2UsersResponse response = check twitter->/users(ids = ["1803011651249278976"]); From 8fe084c5712a8151da7a102c608ed591117c17a3 Mon Sep 17 00:00:00 2001 From: Visal Munasinghe <127712545+vish-mv@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:57:13 +0530 Subject: [PATCH 15/15] Remove Gradle.build from examples --- example/build.gradle | 54 -------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 example/build.gradle diff --git a/example/build.gradle b/example/build.gradle deleted file mode 100644 index 551424f..0000000 --- a/example/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -apply plugin: 'java-library' - -description = 'Ballerina - Twitter Examples' - -def filePath = project.fileTree("${project.projectDir}") -def examples = filePath.matching { - include("**/*.bal") - exclude("**/deprecated/**/*.bal") -} - -task testExamples { - dependsOn ":${project.packageName}-ballerina:build" - - doLast { - examples.each { example -> executeBalCommand ("run ${example}", "${project.rootDir}") } - } -} - -task buildExamples { - dependsOn ":${project.packageName}-ballerina:build" - - gradle.taskGraph.whenReady { graph -> - if (graph.hasTask(":${project.packageName}-examples:test")) { - buildExamples.enabled = false - } else { - testExamples.enabled = false - } - } - doLast { - // TODO: Enabled --offline due to a bug in pulling incorrect versions from the central repository. - examples.each { example -> executeBalCommand ("build --offline ${example}", "${project.rootDir}") } - } -} - -test.dependsOn testExamples -build.dependsOn buildExamples