diff --git a/README.md b/README.md index eb36a7c..7b1b1d5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ You can find examples of using the SDK under the [examples/](examples/) director **Note: Only Twitter API V2 is supported** -- API version: 2.45 +- API version: 2.51 Twitter API v2 available endpoints @@ -61,7 +61,7 @@ Add this dependency to your project's POM: com.twitter twitter-api-java-sdk - 2.0.2 + 2.0.3 ``` @@ -76,7 +76,7 @@ mavenLocal() // Needed if the 'twitter-api-java-sdk' jar has been publishe } dependencies { -implementation "com.twitter:twitter-api-java-sdk:2.0.2" +implementation "com.twitter:twitter-api-java-sdk:2.0.3" } ``` @@ -90,7 +90,7 @@ mvn clean package Then manually install the following JARs: -* `target/twitter-api-java-sdk-2.0.2.jar` +* `target/twitter-api-java-sdk-2.0.3.jar` * `target/lib/*.jar` ## Twitter Credentials @@ -277,6 +277,8 @@ Class | Method | HTTP request | Description *BookmarksApi* | [**usersIdBookmarksDelete**](docs/BookmarksApi.md#usersIdBookmarksDelete) | **DELETE** /2/users/{id}/bookmarks/{tweet_id} | Remove a bookmarked Tweet *ComplianceApi* | [**createBatchComplianceJob**](docs/ComplianceApi.md#createBatchComplianceJob) | **POST** /2/compliance/jobs | Create compliance job *ComplianceApi* | [**getBatchComplianceJob**](docs/ComplianceApi.md#getBatchComplianceJob) | **GET** /2/compliance/jobs/{id} | Get Compliance Job +*ComplianceApi* | [**getTweetsComplianceStream**](docs/ComplianceApi.md#getTweetsComplianceStream) | **GET** /2/tweets/compliance/stream | Tweets Compliance stream +*ComplianceApi* | [**getUsersComplianceStream**](docs/ComplianceApi.md#getUsersComplianceStream) | **GET** /2/users/compliance/stream | Users Compliance stream *ComplianceApi* | [**listBatchComplianceJobs**](docs/ComplianceApi.md#listBatchComplianceJobs) | **GET** /2/compliance/jobs | List Compliance Jobs *GeneralApi* | [**getOpenApiSpec**](docs/GeneralApi.md#getOpenApiSpec) | **GET** /2/openapi.json | Returns the OpenAPI Specification document. *ListsApi* | [**getUserListMemberships**](docs/ListsApi.md#getUserListMemberships) | **GET** /2/users/{id}/list_memberships | Get a User's List Memberships @@ -306,6 +308,8 @@ Class | Method | HTTP request | Description *TweetsApi* | [**findTweetsById**](docs/TweetsApi.md#findTweetsById) | **GET** /2/tweets | Tweet lookup by Tweet IDs *TweetsApi* | [**findTweetsThatQuoteATweet**](docs/TweetsApi.md#findTweetsThatQuoteATweet) | **GET** /2/tweets/{id}/quote_tweets | Retrieve Tweets that quote a Tweet. *TweetsApi* | [**getRules**](docs/TweetsApi.md#getRules) | **GET** /2/tweets/search/stream/rules | Rules lookup +*TweetsApi* | [**getTweetsFirehoseStream**](docs/TweetsApi.md#getTweetsFirehoseStream) | **GET** /2/tweets/firehose/stream | Firehose stream +*TweetsApi* | [**getTweetsSample10Stream**](docs/TweetsApi.md#getTweetsSample10Stream) | **GET** /2/tweets/sample10/stream | Sample 10% stream *TweetsApi* | [**hideReplyById**](docs/TweetsApi.md#hideReplyById) | **PUT** /2/tweets/{tweet_id}/hidden | Hide replies *TweetsApi* | [**listsIdTweets**](docs/TweetsApi.md#listsIdTweets) | **GET** /2/lists/{id}/tweets | List Tweets timeline by List ID. *TweetsApi* | [**sampleStream**](docs/TweetsApi.md#sampleStream) | **GET** /2/tweets/sample/stream | Sample stream @@ -336,7 +340,7 @@ Class | Method | HTTP request | Description *UsersApi* | [**usersIdBlock**](docs/UsersApi.md#usersIdBlock) | **POST** /2/users/{id}/blocking | Block User by User ID *UsersApi* | [**usersIdBlocking**](docs/UsersApi.md#usersIdBlocking) | **GET** /2/users/{id}/blocking | Returns User objects that are blocked by provided User ID *UsersApi* | [**usersIdFollow**](docs/UsersApi.md#usersIdFollow) | **POST** /2/users/{id}/following | Follow User -*UsersApi* | [**usersIdFollowers**](docs/UsersApi.md#usersIdFollowers) | **GET** /2/users/{id}/followers | Returns User objects that follow a List by the provided User ID +*UsersApi* | [**usersIdFollowers**](docs/UsersApi.md#usersIdFollowers) | **GET** /2/users/{id}/followers | Followers by User ID *UsersApi* | [**usersIdFollowing**](docs/UsersApi.md#usersIdFollowing) | **GET** /2/users/{id}/following | Following by User ID *UsersApi* | [**usersIdMute**](docs/UsersApi.md#usersIdMute) | **POST** /2/users/{id}/muting | Mute User by User ID. *UsersApi* | [**usersIdMuting**](docs/UsersApi.md#usersIdMuting) | **GET** /2/users/{id}/muting | Returns User objects that are muted by the provided User ID @@ -410,12 +414,14 @@ Class | Method | HTTP request | Description - [Get2TweetsCountsAllResponse](docs/Get2TweetsCountsAllResponse.md) - [Get2TweetsCountsAllResponseMeta](docs/Get2TweetsCountsAllResponseMeta.md) - [Get2TweetsCountsRecentResponse](docs/Get2TweetsCountsRecentResponse.md) + - [Get2TweetsFirehoseStreamResponse](docs/Get2TweetsFirehoseStreamResponse.md) - [Get2TweetsIdLikingUsersResponse](docs/Get2TweetsIdLikingUsersResponse.md) - [Get2TweetsIdQuoteTweetsResponse](docs/Get2TweetsIdQuoteTweetsResponse.md) - [Get2TweetsIdQuoteTweetsResponseMeta](docs/Get2TweetsIdQuoteTweetsResponseMeta.md) - [Get2TweetsIdResponse](docs/Get2TweetsIdResponse.md) - [Get2TweetsIdRetweetedByResponse](docs/Get2TweetsIdRetweetedByResponse.md) - [Get2TweetsResponse](docs/Get2TweetsResponse.md) + - [Get2TweetsSample10StreamResponse](docs/Get2TweetsSample10StreamResponse.md) - [Get2TweetsSampleStreamResponse](docs/Get2TweetsSampleStreamResponse.md) - [Get2TweetsSearchAllResponse](docs/Get2TweetsSearchAllResponse.md) - [Get2TweetsSearchAllResponseMeta](docs/Get2TweetsSearchAllResponseMeta.md) @@ -509,6 +515,12 @@ Class | Method | HTTP request | Description - [Topic](docs/Topic.md) - [Tweet](docs/Tweet.md) - [TweetAttachments](docs/TweetAttachments.md) + - [TweetComplianceData](docs/TweetComplianceData.md) + - [TweetComplianceSchema](docs/TweetComplianceSchema.md) + - [TweetComplianceSchemaTweet](docs/TweetComplianceSchemaTweet.md) + - [TweetComplianceStreamResponse](docs/TweetComplianceStreamResponse.md) + - [TweetComplianceStreamResponseOneOf](docs/TweetComplianceStreamResponseOneOf.md) + - [TweetComplianceStreamResponseOneOf1](docs/TweetComplianceStreamResponseOneOf1.md) - [TweetCreateRequest](docs/TweetCreateRequest.md) - [TweetCreateRequestGeo](docs/TweetCreateRequestGeo.md) - [TweetCreateRequestMedia](docs/TweetCreateRequestMedia.md) @@ -516,8 +528,14 @@ Class | Method | HTTP request | Description - [TweetCreateRequestReply](docs/TweetCreateRequestReply.md) - [TweetCreateResponse](docs/TweetCreateResponse.md) - [TweetCreateResponseData](docs/TweetCreateResponseData.md) + - [TweetDeleteComplianceSchema](docs/TweetDeleteComplianceSchema.md) - [TweetDeleteResponse](docs/TweetDeleteResponse.md) - [TweetDeleteResponseData](docs/TweetDeleteResponseData.md) + - [TweetDropComplianceSchema](docs/TweetDropComplianceSchema.md) + - [TweetEditComplianceObjectSchema](docs/TweetEditComplianceObjectSchema.md) + - [TweetEditComplianceObjectSchemaTweet](docs/TweetEditComplianceObjectSchemaTweet.md) + - [TweetEditComplianceSchema](docs/TweetEditComplianceSchema.md) + - [TweetEditControls](docs/TweetEditControls.md) - [TweetGeo](docs/TweetGeo.md) - [TweetHideRequest](docs/TweetHideRequest.md) - [TweetHideResponse](docs/TweetHideResponse.md) @@ -527,7 +545,10 @@ Class | Method | HTTP request | Description - [TweetPromotedMetrics](docs/TweetPromotedMetrics.md) - [TweetPublicMetrics](docs/TweetPublicMetrics.md) - [TweetReferencedTweets](docs/TweetReferencedTweets.md) + - [TweetTakedownComplianceSchema](docs/TweetTakedownComplianceSchema.md) + - [TweetUndropComplianceSchema](docs/TweetUndropComplianceSchema.md) - [TweetWithheld](docs/TweetWithheld.md) + - [TweetWithheldComplianceSchema](docs/TweetWithheldComplianceSchema.md) - [UnsupportedAuthenticationProblem](docs/UnsupportedAuthenticationProblem.md) - [UrlEntity](docs/UrlEntity.md) - [UrlFields](docs/UrlFields.md) @@ -535,10 +556,27 @@ Class | Method | HTTP request | Description - [UsageCapExceededProblem](docs/UsageCapExceededProblem.md) - [UsageCapExceededProblemAllOf](docs/UsageCapExceededProblemAllOf.md) - [User](docs/User.md) + - [UserComplianceData](docs/UserComplianceData.md) + - [UserComplianceSchema](docs/UserComplianceSchema.md) + - [UserComplianceSchemaUser](docs/UserComplianceSchemaUser.md) + - [UserComplianceStreamResponse](docs/UserComplianceStreamResponse.md) + - [UserComplianceStreamResponseOneOf](docs/UserComplianceStreamResponseOneOf.md) + - [UserDeleteComplianceSchema](docs/UserDeleteComplianceSchema.md) - [UserEntities](docs/UserEntities.md) - [UserEntitiesUrl](docs/UserEntitiesUrl.md) + - [UserProfileModificationComplianceSchema](docs/UserProfileModificationComplianceSchema.md) + - [UserProfileModificationObjectSchema](docs/UserProfileModificationObjectSchema.md) + - [UserProtectComplianceSchema](docs/UserProtectComplianceSchema.md) - [UserPublicMetrics](docs/UserPublicMetrics.md) + - [UserScrubGeoObjectSchema](docs/UserScrubGeoObjectSchema.md) + - [UserScrubGeoSchema](docs/UserScrubGeoSchema.md) + - [UserSuspendComplianceSchema](docs/UserSuspendComplianceSchema.md) + - [UserTakedownComplianceSchema](docs/UserTakedownComplianceSchema.md) + - [UserUndeleteComplianceSchema](docs/UserUndeleteComplianceSchema.md) + - [UserUnprotectComplianceSchema](docs/UserUnprotectComplianceSchema.md) + - [UserUnsuspendComplianceSchema](docs/UserUnsuspendComplianceSchema.md) - [UserWithheld](docs/UserWithheld.md) + - [UserWithheldComplianceSchema](docs/UserWithheldComplianceSchema.md) - [UsersFollowingCreateRequest](docs/UsersFollowingCreateRequest.md) - [UsersFollowingCreateResponse](docs/UsersFollowingCreateResponse.md) - [UsersFollowingCreateResponseData](docs/UsersFollowingCreateResponseData.md) diff --git a/docs/BookmarksApi.md b/docs/BookmarksApi.md index c448260..dd7a9f5 100644 --- a/docs/BookmarksApi.md +++ b/docs/BookmarksApi.md @@ -91,8 +91,8 @@ public class Example { | **id** | **String**| The ID of the authenticated source User for whom to return results. | | | **maxResults** | **Integer**| The maximum number of results. | [optional] | | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | diff --git a/docs/ComplianceApi.md b/docs/ComplianceApi.md index 220dffb..0d2386a 100644 --- a/docs/ComplianceApi.md +++ b/docs/ComplianceApi.md @@ -6,6 +6,8 @@ All URIs are relative to *https://api.twitter.com* |------------- | ------------- | -------------| | [**createBatchComplianceJob**](ComplianceApi.md#createBatchComplianceJob) | **POST** /2/compliance/jobs | Create compliance job | | [**getBatchComplianceJob**](ComplianceApi.md#getBatchComplianceJob) | **GET** /2/compliance/jobs/{id} | Get Compliance Job | +| [**getTweetsComplianceStream**](ComplianceApi.md#getTweetsComplianceStream) | **GET** /2/tweets/compliance/stream | Tweets Compliance stream | +| [**getUsersComplianceStream**](ComplianceApi.md#getUsersComplianceStream) | **GET** /2/users/compliance/stream | Users Compliance stream | | [**listBatchComplianceJobs**](ComplianceApi.md#listBatchComplianceJobs) | **GET** /2/compliance/jobs | List Compliance Jobs | @@ -174,6 +176,232 @@ public class Example { | **200** | The request has succeeded. | - | | **0** | The request has failed. | - | + +# **getTweetsComplianceStream** +> TweetComplianceStreamResponse getTweetsComplianceStream(partition).backfillMinutes(backfillMinutes).startTime(startTime).endTime(endTime).execute(); + +Tweets Compliance stream + +Streams 100% of compliance data for Tweets + +### Example +```java +// Import classes: +import com.twitter.clientlib.ApiClient; +import com.twitter.clientlib.ApiException; +import com.twitter.clientlib.Configuration; +import com.twitter.clientlib.auth.*; +import com.twitter.clientlib.model.*; +import com.twitter.clientlib.TwitterCredentialsOAuth2; +import com.twitter.clientlib.TwitterCredentialsBearer; +import com.twitter.clientlib.api.TwitterApi; + +import com.twitter.clientlib.api.ComplianceApi; +import java.io.InputStream; +import com.google.common.reflect.TypeToken; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Set; +import java.util.Arrays; +import java.util.HashSet; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + // Set the credentials based on the API's "security" tag values. + // Check the API definition in https://api.twitter.com/2/openapi.json + // When multiple options exist, the SDK supports only "OAuth2UserToken" or "BearerToken" + + // Uncomment and set the credentials configuration + + // Configure HTTP bearer authorization: + // TwitterCredentialsBearer credentials = new TwitterCredentialsBearer(System.getenv("TWITTER_BEARER_TOKEN")); + TwitterApi apiInstance = new TwitterApi(credentials); + + // Set the params values + Integer backfillMinutes = 56; // Integer | The number of minutes of backfill requested. + Integer partition = 56; // Integer | The partition number. + OffsetDateTime startTime = OffsetDateTime.parse("2021-02-01T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided. + OffsetDateTime endTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided. + try { + InputStream result = apiInstance.compliance().getTweetsComplianceStream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .execute(); + try{ + JSON json = new JSON(); + Type localVarReturnType = new TypeToken(){}.getType(); + BufferedReader reader = new BufferedReader(new InputStreamReader(result)); + String line = reader.readLine(); + while (line != null) { + if(line.isEmpty()) { + System.out.println("==> Empty line"); + line = reader.readLine(); + continue; + } + Object jsonObject = json.getGson().fromJson(line, localVarReturnType); + System.out.println(jsonObject != null ? jsonObject.toString() : "Null object"); + line = reader.readLine(); + } + }catch (Exception e) { + e.printStackTrace(); + System.out.println(e); + } + } catch (ApiException e) { + System.err.println("Exception when calling ComplianceApi#getTweetsComplianceStream"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **backfillMinutes** | **Integer**| The number of minutes of backfill requested. | [optional] | +| **partition** | **Integer**| The partition number. | | +| **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided. | [optional] | +| **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided. | [optional] | + +### Return type + +[**TweetComplianceStreamResponse**](TweetComplianceStreamResponse.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **0** | The request has failed. | - | + + +# **getUsersComplianceStream** +> UserComplianceStreamResponse getUsersComplianceStream(partition).backfillMinutes(backfillMinutes).startTime(startTime).endTime(endTime).execute(); + +Users Compliance stream + +Streams 100% of compliance data for Users + +### Example +```java +// Import classes: +import com.twitter.clientlib.ApiClient; +import com.twitter.clientlib.ApiException; +import com.twitter.clientlib.Configuration; +import com.twitter.clientlib.auth.*; +import com.twitter.clientlib.model.*; +import com.twitter.clientlib.TwitterCredentialsOAuth2; +import com.twitter.clientlib.TwitterCredentialsBearer; +import com.twitter.clientlib.api.TwitterApi; + +import com.twitter.clientlib.api.ComplianceApi; +import java.io.InputStream; +import com.google.common.reflect.TypeToken; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Set; +import java.util.Arrays; +import java.util.HashSet; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + // Set the credentials based on the API's "security" tag values. + // Check the API definition in https://api.twitter.com/2/openapi.json + // When multiple options exist, the SDK supports only "OAuth2UserToken" or "BearerToken" + + // Uncomment and set the credentials configuration + + // Configure HTTP bearer authorization: + // TwitterCredentialsBearer credentials = new TwitterCredentialsBearer(System.getenv("TWITTER_BEARER_TOKEN")); + TwitterApi apiInstance = new TwitterApi(credentials); + + // Set the params values + Integer backfillMinutes = 56; // Integer | The number of minutes of backfill requested. + Integer partition = 56; // Integer | The partition number. + OffsetDateTime startTime = OffsetDateTime.parse("2021-02-01T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided. + OffsetDateTime endTime = OffsetDateTime.parse("2021-02-01T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided. + try { + InputStream result = apiInstance.compliance().getUsersComplianceStream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .execute(); + try{ + JSON json = new JSON(); + Type localVarReturnType = new TypeToken(){}.getType(); + BufferedReader reader = new BufferedReader(new InputStreamReader(result)); + String line = reader.readLine(); + while (line != null) { + if(line.isEmpty()) { + System.out.println("==> Empty line"); + line = reader.readLine(); + continue; + } + Object jsonObject = json.getGson().fromJson(line, localVarReturnType); + System.out.println(jsonObject != null ? jsonObject.toString() : "Null object"); + line = reader.readLine(); + } + }catch (Exception e) { + e.printStackTrace(); + System.out.println(e); + } + } catch (ApiException e) { + System.err.println("Exception when calling ComplianceApi#getUsersComplianceStream"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **backfillMinutes** | **Integer**| The number of minutes of backfill requested. | [optional] | +| **partition** | **Integer**| The partition number. | | +| **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided. | [optional] | +| **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided. | [optional] | + +### Return type + +[**UserComplianceStreamResponse**](UserComplianceStreamResponse.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **0** | The request has failed. | - | + # **listBatchComplianceJobs** > Get2ComplianceJobsResponse listBatchComplianceJobs(type).status(status).complianceJobFields(complianceJobFields).execute(); diff --git a/docs/ComplianceJobStatus.md b/docs/ComplianceJobStatus.md index 26b4f59..6c617dc 100644 --- a/docs/ComplianceJobStatus.md +++ b/docs/ComplianceJobStatus.md @@ -13,5 +13,7 @@ * `COMPLETE` (value: `"complete"`) +* `EXPIRED` (value: `"expired"`) + diff --git a/docs/Get2TweetsFirehoseStreamResponse.md b/docs/Get2TweetsFirehoseStreamResponse.md new file mode 100644 index 0000000..958af72 --- /dev/null +++ b/docs/Get2TweetsFirehoseStreamResponse.md @@ -0,0 +1,15 @@ + + +# Get2TweetsFirehoseStreamResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Tweet**](Tweet.md) | | [optional] | +|**errors** | [**List<Problem>**](Problem.md) | | [optional] | +|**includes** | [**Expansions**](Expansions.md) | | [optional] | + + + diff --git a/docs/Get2TweetsSample10StreamResponse.md b/docs/Get2TweetsSample10StreamResponse.md new file mode 100644 index 0000000..882cdb6 --- /dev/null +++ b/docs/Get2TweetsSample10StreamResponse.md @@ -0,0 +1,15 @@ + + +# Get2TweetsSample10StreamResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**Tweet**](Tweet.md) | | [optional] | +|**errors** | [**List<Problem>**](Problem.md) | | [optional] | +|**includes** | [**Expansions**](Expansions.md) | | [optional] | + + + diff --git a/docs/SpacesApi.md b/docs/SpacesApi.md index 92fa8ff..e335265 100644 --- a/docs/SpacesApi.md +++ b/docs/SpacesApi.md @@ -492,7 +492,7 @@ public class Example { | **maxResults** | **Integer**| The maximum number of results. | [optional] [default to 100] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -595,8 +595,8 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **id** | **String**| The ID of the Space to be retrieved. | | | **maxResults** | **Integer**| The number of Tweets to fetch from the provided space. If not provided, the value will default to the maximum of 100. | [optional] [default to 100] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | diff --git a/docs/Tweet.md b/docs/Tweet.md index 8135713..3756e43 100644 --- a/docs/Tweet.md +++ b/docs/Tweet.md @@ -12,6 +12,8 @@ |**contextAnnotations** | [**List<ContextAnnotation>**](ContextAnnotation.md) | | [optional] | |**conversationId** | **String** | 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. | [optional] | |**createdAt** | **OffsetDateTime** | Creation time of the Tweet. | [optional] | +|**editControls** | [**TweetEditControls**](TweetEditControls.md) | | [optional] | +|**editHistoryTweetIds** | **List<String>** | A list of Tweet Ids in this Tweet chain. | | |**entities** | [**FullTextEntities**](FullTextEntities.md) | | [optional] | |**geo** | [**TweetGeo**](TweetGeo.md) | | [optional] | |**id** | **String** | 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. | | diff --git a/docs/TweetComplianceData.md b/docs/TweetComplianceData.md new file mode 100644 index 0000000..8c08330 --- /dev/null +++ b/docs/TweetComplianceData.md @@ -0,0 +1,18 @@ + + +# TweetComplianceData + +Tweet compliance data. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**delete** | [**TweetComplianceSchema**](TweetComplianceSchema.md) | | | +|**withheld** | [**TweetTakedownComplianceSchema**](TweetTakedownComplianceSchema.md) | | | +|**drop** | [**TweetComplianceSchema**](TweetComplianceSchema.md) | | | +|**undrop** | [**TweetComplianceSchema**](TweetComplianceSchema.md) | | | +|**tweetEdit** | [**TweetEditComplianceObjectSchema**](TweetEditComplianceObjectSchema.md) | | | + + + diff --git a/docs/TweetComplianceSchema.md b/docs/TweetComplianceSchema.md new file mode 100644 index 0000000..10a4647 --- /dev/null +++ b/docs/TweetComplianceSchema.md @@ -0,0 +1,15 @@ + + +# TweetComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventAt** | **OffsetDateTime** | Event time. | | +|**quoteTweetId** | **String** | 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. | [optional] | +|**tweet** | [**TweetComplianceSchemaTweet**](TweetComplianceSchemaTweet.md) | | | + + + diff --git a/docs/TweetComplianceSchemaTweet.md b/docs/TweetComplianceSchemaTweet.md new file mode 100644 index 0000000..c683198 --- /dev/null +++ b/docs/TweetComplianceSchemaTweet.md @@ -0,0 +1,14 @@ + + +# TweetComplianceSchemaTweet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**authorId** | **String** | 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. | | +|**id** | **String** | 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. | | + + + diff --git a/docs/TweetComplianceStreamResponse.md b/docs/TweetComplianceStreamResponse.md new file mode 100644 index 0000000..4a42c05 --- /dev/null +++ b/docs/TweetComplianceStreamResponse.md @@ -0,0 +1,15 @@ + + +# TweetComplianceStreamResponse + +Tweet compliance stream events. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**TweetComplianceData**](TweetComplianceData.md) | | | +|**errors** | [**List<Problem>**](Problem.md) | | | + + + diff --git a/docs/TweetComplianceStreamResponseOneOf.md b/docs/TweetComplianceStreamResponseOneOf.md new file mode 100644 index 0000000..b27277e --- /dev/null +++ b/docs/TweetComplianceStreamResponseOneOf.md @@ -0,0 +1,14 @@ + + +# TweetComplianceStreamResponseOneOf + +Compliance event. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**TweetComplianceData**](TweetComplianceData.md) | | | + + + diff --git a/docs/TweetComplianceStreamResponseOneOf1.md b/docs/TweetComplianceStreamResponseOneOf1.md new file mode 100644 index 0000000..ac8d901 --- /dev/null +++ b/docs/TweetComplianceStreamResponseOneOf1.md @@ -0,0 +1,13 @@ + + +# TweetComplianceStreamResponseOneOf1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**errors** | [**List<Problem>**](Problem.md) | | | + + + diff --git a/docs/TweetDeleteComplianceSchema.md b/docs/TweetDeleteComplianceSchema.md new file mode 100644 index 0000000..be5c56b --- /dev/null +++ b/docs/TweetDeleteComplianceSchema.md @@ -0,0 +1,13 @@ + + +# TweetDeleteComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**delete** | [**TweetComplianceSchema**](TweetComplianceSchema.md) | | | + + + diff --git a/docs/TweetDropComplianceSchema.md b/docs/TweetDropComplianceSchema.md new file mode 100644 index 0000000..828eabd --- /dev/null +++ b/docs/TweetDropComplianceSchema.md @@ -0,0 +1,13 @@ + + +# TweetDropComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**drop** | [**TweetComplianceSchema**](TweetComplianceSchema.md) | | | + + + diff --git a/docs/TweetEditComplianceObjectSchema.md b/docs/TweetEditComplianceObjectSchema.md new file mode 100644 index 0000000..dc34772 --- /dev/null +++ b/docs/TweetEditComplianceObjectSchema.md @@ -0,0 +1,16 @@ + + +# TweetEditComplianceObjectSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**editTweetIds** | **List<String>** | | | +|**eventAt** | **OffsetDateTime** | Event time. | | +|**initialTweetId** | **String** | 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. | | +|**tweet** | [**TweetEditComplianceObjectSchemaTweet**](TweetEditComplianceObjectSchemaTweet.md) | | | + + + diff --git a/docs/TweetEditComplianceObjectSchemaTweet.md b/docs/TweetEditComplianceObjectSchemaTweet.md new file mode 100644 index 0000000..373b42a --- /dev/null +++ b/docs/TweetEditComplianceObjectSchemaTweet.md @@ -0,0 +1,13 @@ + + +# TweetEditComplianceObjectSchemaTweet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | 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. | | + + + diff --git a/docs/TweetEditComplianceSchema.md b/docs/TweetEditComplianceSchema.md new file mode 100644 index 0000000..e75ba5c --- /dev/null +++ b/docs/TweetEditComplianceSchema.md @@ -0,0 +1,13 @@ + + +# TweetEditComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tweetEdit** | [**TweetEditComplianceObjectSchema**](TweetEditComplianceObjectSchema.md) | | | + + + diff --git a/docs/TweetEditControls.md b/docs/TweetEditControls.md new file mode 100644 index 0000000..b25c92c --- /dev/null +++ b/docs/TweetEditControls.md @@ -0,0 +1,15 @@ + + +# TweetEditControls + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**editableUntil** | **OffsetDateTime** | Time when Tweet is no longer editable. | | +|**editsRemaining** | **Integer** | Number of times this Tweet can be edited. | | +|**isEditEligible** | **Boolean** | Indicates if this Tweet is eligible to be edited. | | + + + diff --git a/docs/TweetTakedownComplianceSchema.md b/docs/TweetTakedownComplianceSchema.md new file mode 100644 index 0000000..0ea0649 --- /dev/null +++ b/docs/TweetTakedownComplianceSchema.md @@ -0,0 +1,16 @@ + + +# TweetTakedownComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventAt** | **OffsetDateTime** | Event time. | | +|**quoteTweetId** | **String** | 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. | [optional] | +|**tweet** | [**TweetComplianceSchemaTweet**](TweetComplianceSchemaTweet.md) | | | +|**withheldInCountries** | **List<String>** | | | + + + diff --git a/docs/TweetUndropComplianceSchema.md b/docs/TweetUndropComplianceSchema.md new file mode 100644 index 0000000..dcd45d0 --- /dev/null +++ b/docs/TweetUndropComplianceSchema.md @@ -0,0 +1,13 @@ + + +# TweetUndropComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**undrop** | [**TweetComplianceSchema**](TweetComplianceSchema.md) | | | + + + diff --git a/docs/TweetWithheldComplianceSchema.md b/docs/TweetWithheldComplianceSchema.md new file mode 100644 index 0000000..b8a761a --- /dev/null +++ b/docs/TweetWithheldComplianceSchema.md @@ -0,0 +1,13 @@ + + +# TweetWithheldComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**withheld** | [**TweetTakedownComplianceSchema**](TweetTakedownComplianceSchema.md) | | | + + + diff --git a/docs/TweetsApi.md b/docs/TweetsApi.md index bfec075..7605348 100644 --- a/docs/TweetsApi.md +++ b/docs/TweetsApi.md @@ -11,6 +11,8 @@ All URIs are relative to *https://api.twitter.com* | [**findTweetsById**](TweetsApi.md#findTweetsById) | **GET** /2/tweets | Tweet lookup by Tweet IDs | | [**findTweetsThatQuoteATweet**](TweetsApi.md#findTweetsThatQuoteATweet) | **GET** /2/tweets/{id}/quote_tweets | Retrieve Tweets that quote a Tweet. | | [**getRules**](TweetsApi.md#getRules) | **GET** /2/tweets/search/stream/rules | Rules lookup | +| [**getTweetsFirehoseStream**](TweetsApi.md#getTweetsFirehoseStream) | **GET** /2/tweets/firehose/stream | Firehose stream | +| [**getTweetsSample10Stream**](TweetsApi.md#getTweetsSample10Stream) | **GET** /2/tweets/sample10/stream | Sample 10% stream | | [**hideReplyById**](TweetsApi.md#hideReplyById) | **PUT** /2/tweets/{tweet_id}/hidden | Hide replies | | [**listsIdTweets**](TweetsApi.md#listsIdTweets) | **GET** /2/lists/{id}/tweets | List Tweets timeline by List ID. | | [**sampleStream**](TweetsApi.md#sampleStream) | **GET** /2/tweets/sample/stream | Sample stream | @@ -362,8 +364,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **id** | **String**| A single Tweet ID. | | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -467,8 +469,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **ids** | [**List<String>**](String.md)| A comma separated list of Tweet IDs. Up to 100 are allowed in a single request. | | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -581,8 +583,8 @@ public class Example { | **maxResults** | **Integer**| The maximum number of results to be returned. | [optional] [default to 10] | | **paginationToken** | **String**| This parameter is used to get a specified 'page' of results. | [optional] | | **exclude** | [**Set<String>**](String.md)| The set of entities to exclude (e.g. 'replies' or 'retweets'). | [optional] [enum: replies, retweets] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -695,6 +697,268 @@ public class Example { | **200** | The request has succeeded. | - | | **0** | The request has failed. | - | + +# **getTweetsFirehoseStream** +> StreamingTweetResponse getTweetsFirehoseStream(partition).backfillMinutes(backfillMinutes).startTime(startTime).endTime(endTime).tweetFields(tweetFields).expansions(expansions).mediaFields(mediaFields).pollFields(pollFields).userFields(userFields).placeFields(placeFields).execute(); + +Firehose stream + +Streams 100% of public Tweets. + +### Example +```java +// Import classes: +import com.twitter.clientlib.ApiClient; +import com.twitter.clientlib.ApiException; +import com.twitter.clientlib.Configuration; +import com.twitter.clientlib.auth.*; +import com.twitter.clientlib.model.*; +import com.twitter.clientlib.TwitterCredentialsOAuth2; +import com.twitter.clientlib.TwitterCredentialsBearer; +import com.twitter.clientlib.api.TwitterApi; + +import com.twitter.clientlib.api.TweetsApi; +import java.io.InputStream; +import com.google.common.reflect.TypeToken; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Set; +import java.util.Arrays; +import java.util.HashSet; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + // Set the credentials based on the API's "security" tag values. + // Check the API definition in https://api.twitter.com/2/openapi.json + // When multiple options exist, the SDK supports only "OAuth2UserToken" or "BearerToken" + + // Uncomment and set the credentials configuration + + // Configure HTTP bearer authorization: + // TwitterCredentialsBearer credentials = new TwitterCredentialsBearer(System.getenv("TWITTER_BEARER_TOKEN")); + TwitterApi apiInstance = new TwitterApi(credentials); + + // Set the params values + Integer backfillMinutes = 56; // Integer | The number of minutes of backfill requested. + Integer partition = 56; // Integer | The partition number. + OffsetDateTime startTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. + OffsetDateTime endTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. + Set tweetFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Tweet fields to display. + Set expansions = new HashSet<>(Arrays.asList()); // Set | A comma separated list of fields to expand. + Set mediaFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Media fields to display. + Set pollFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Poll fields to display. + Set userFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of User fields to display. + Set placeFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Place fields to display. + try { + InputStream result = apiInstance.tweets().getTweetsFirehoseStream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .tweetFields(tweetFields) + .expansions(expansions) + .mediaFields(mediaFields) + .pollFields(pollFields) + .userFields(userFields) + .placeFields(placeFields) + .execute(); + try{ + JSON json = new JSON(); + Type localVarReturnType = new TypeToken(){}.getType(); + BufferedReader reader = new BufferedReader(new InputStreamReader(result)); + String line = reader.readLine(); + while (line != null) { + if(line.isEmpty()) { + System.out.println("==> Empty line"); + line = reader.readLine(); + continue; + } + Object jsonObject = json.getGson().fromJson(line, localVarReturnType); + System.out.println(jsonObject != null ? jsonObject.toString() : "Null object"); + line = reader.readLine(); + } + }catch (Exception e) { + e.printStackTrace(); + System.out.println(e); + } + } catch (ApiException e) { + System.err.println("Exception when calling TweetsApi#getTweetsFirehoseStream"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **backfillMinutes** | **Integer**| The number of minutes of backfill requested. | [optional] | +| **partition** | **Integer**| The partition number. | | +| **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. | [optional] | +| **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. | [optional] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | +| **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | +| **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | +| **placeFields** | [**Set<String>**](String.md)| A comma separated list of Place fields to display. | [optional] [enum: contained_within, country, country_code, full_name, geo, id, name, place_type] | + +### Return type + +[**StreamingTweetResponse**](StreamingTweetResponse.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **0** | The request has failed. | - | + + +# **getTweetsSample10Stream** +> Get2TweetsSample10StreamResponse getTweetsSample10Stream(partition).backfillMinutes(backfillMinutes).startTime(startTime).endTime(endTime).tweetFields(tweetFields).expansions(expansions).mediaFields(mediaFields).pollFields(pollFields).userFields(userFields).placeFields(placeFields).execute(); + +Sample 10% stream + +Streams a deterministic 10% of public Tweets. + +### Example +```java +// Import classes: +import com.twitter.clientlib.ApiClient; +import com.twitter.clientlib.ApiException; +import com.twitter.clientlib.Configuration; +import com.twitter.clientlib.auth.*; +import com.twitter.clientlib.model.*; +import com.twitter.clientlib.TwitterCredentialsOAuth2; +import com.twitter.clientlib.TwitterCredentialsBearer; +import com.twitter.clientlib.api.TwitterApi; + +import com.twitter.clientlib.api.TweetsApi; +import java.io.InputStream; +import com.google.common.reflect.TypeToken; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Set; +import java.util.Arrays; +import java.util.HashSet; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + // Set the credentials based on the API's "security" tag values. + // Check the API definition in https://api.twitter.com/2/openapi.json + // When multiple options exist, the SDK supports only "OAuth2UserToken" or "BearerToken" + + // Uncomment and set the credentials configuration + + // Configure HTTP bearer authorization: + // TwitterCredentialsBearer credentials = new TwitterCredentialsBearer(System.getenv("TWITTER_BEARER_TOKEN")); + TwitterApi apiInstance = new TwitterApi(credentials); + + // Set the params values + Integer backfillMinutes = 56; // Integer | The number of minutes of backfill requested. + Integer partition = 56; // Integer | The partition number. + OffsetDateTime startTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. + OffsetDateTime endTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. + Set tweetFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Tweet fields to display. + Set expansions = new HashSet<>(Arrays.asList()); // Set | A comma separated list of fields to expand. + Set mediaFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Media fields to display. + Set pollFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Poll fields to display. + Set userFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of User fields to display. + Set placeFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Place fields to display. + try { + InputStream result = apiInstance.tweets().getTweetsSample10Stream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .tweetFields(tweetFields) + .expansions(expansions) + .mediaFields(mediaFields) + .pollFields(pollFields) + .userFields(userFields) + .placeFields(placeFields) + .execute(); + try{ + JSON json = new JSON(); + Type localVarReturnType = new TypeToken(){}.getType(); + BufferedReader reader = new BufferedReader(new InputStreamReader(result)); + String line = reader.readLine(); + while (line != null) { + if(line.isEmpty()) { + System.out.println("==> Empty line"); + line = reader.readLine(); + continue; + } + Object jsonObject = json.getGson().fromJson(line, localVarReturnType); + System.out.println(jsonObject != null ? jsonObject.toString() : "Null object"); + line = reader.readLine(); + } + }catch (Exception e) { + e.printStackTrace(); + System.out.println(e); + } + } catch (ApiException e) { + System.err.println("Exception when calling TweetsApi#getTweetsSample10Stream"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **backfillMinutes** | **Integer**| The number of minutes of backfill requested. | [optional] | +| **partition** | **Integer**| The partition number. | | +| **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. | [optional] | +| **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. | [optional] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | +| **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | +| **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | +| **placeFields** | [**Set<String>**](String.md)| A comma separated list of Place fields to display. | [optional] [enum: contained_within, country, country_code, full_name, geo, id, name, place_type] | + +### Return type + +[**Get2TweetsSample10StreamResponse**](Get2TweetsSample10StreamResponse.md) + +### Authorization + +[BearerToken](../README.md#BearerToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The request has succeeded. | - | +| **0** | The request has failed. | - | + # **hideReplyById** > TweetHideResponse hideReplyById(tweetId).tweetHideRequest(tweetHideRequest).execute(); @@ -867,8 +1131,8 @@ public class Example { | **id** | **String**| The ID of the List. | | | **maxResults** | **Integer**| The maximum number of results. | [optional] [default to 100] | | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -990,8 +1254,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **backfillMinutes** | **Integer**| The number of minutes of backfill requested. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -1018,7 +1282,7 @@ public class Example { # **searchStream** -> FilteredStreamingTweetResponse searchStream().backfillMinutes(backfillMinutes).tweetFields(tweetFields).expansions(expansions).mediaFields(mediaFields).pollFields(pollFields).userFields(userFields).placeFields(placeFields).execute(); +> FilteredStreamingTweetResponse searchStream().backfillMinutes(backfillMinutes).startTime(startTime).endTime(endTime).tweetFields(tweetFields).expansions(expansions).mediaFields(mediaFields).pollFields(pollFields).userFields(userFields).placeFields(placeFields).execute(); Filtered stream @@ -1062,6 +1326,8 @@ public class Example { // Set the params values Integer backfillMinutes = 56; // Integer | The number of minutes of backfill requested. + OffsetDateTime startTime = OffsetDateTime.parse("2021-02-01T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. + OffsetDateTime endTime = OffsetDateTime.parse("2021-02-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. Set tweetFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Tweet fields to display. Set expansions = new HashSet<>(Arrays.asList()); // Set | A comma separated list of fields to expand. Set mediaFields = new HashSet<>(Arrays.asList()); // Set | A comma separated list of Media fields to display. @@ -1071,6 +1337,8 @@ public class Example { try { InputStream result = apiInstance.tweets().searchStream() .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) .tweetFields(tweetFields) .expansions(expansions) .mediaFields(mediaFields) @@ -1113,8 +1381,10 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **backfillMinutes** | **Integer**| The number of minutes of backfill requested. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. | [optional] | +| **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. | [optional] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -1217,7 +1487,7 @@ public class Example { | **maxResults** | **Integer**| The maximum number of results. | [optional] [default to 100] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -1320,8 +1590,8 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **id** | **String**| The ID of the Space to be retrieved. | | | **maxResults** | **Integer**| The number of Tweets to fetch from the provided space. If not provided, the value will default to the maximum of 100. | [optional] [default to 100] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -1653,8 +1923,8 @@ public class Example { | **nextToken** | **String**| 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. | [optional] | | **paginationToken** | **String**| 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. | [optional] | | **sortOrder** | **String**| This order in which to return results. | [optional] [enum: recency, relevancy] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -1782,8 +2052,8 @@ public class Example { | **nextToken** | **String**| 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. | [optional] | | **paginationToken** | **String**| 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. | [optional] | | **sortOrder** | **String**| This order in which to return results. | [optional] [enum: recency, relevancy] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -1980,8 +2250,8 @@ public class Example { | **id** | **String**| The ID of the User to lookup. | | | **maxResults** | **Integer**| The maximum number of results. | [optional] | | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -2103,8 +2373,8 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | | **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. | [optional] | | **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -2313,8 +2583,8 @@ public class Example { | **exclude** | [**Set<String>**](String.md)| The set of entities to exclude (e.g. 'replies' or 'retweets'). | [optional] [enum: replies, retweets] | | **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. | [optional] | | **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | @@ -2439,8 +2709,8 @@ public class Example { | **exclude** | [**Set<String>**](String.md)| The set of entities to exclude (e.g. 'replies' or 'retweets'). | [optional] [enum: replies, retweets] | | **startTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. | [optional] | | **endTime** | **OffsetDateTime**| YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. | [optional] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | -| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: attachments.media_keys, attachments.poll_ids, author_id, edit_history_tweet_ids, entities.mentions.username, geo.place_id, in_reply_to_user_id, referenced_tweets.id, referenced_tweets.id.author_id] | | **mediaFields** | [**Set<String>**](String.md)| A comma separated list of Media fields to display. | [optional] [enum: alt_text, duration_ms, height, media_key, non_public_metrics, organic_metrics, preview_image_url, promoted_metrics, public_metrics, type, url, variants, width] | | **pollFields** | [**Set<String>**](String.md)| A comma separated list of Poll fields to display. | [optional] [enum: duration_minutes, end_datetime, id, options, voting_status] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | diff --git a/docs/UserComplianceData.md b/docs/UserComplianceData.md new file mode 100644 index 0000000..5f83898 --- /dev/null +++ b/docs/UserComplianceData.md @@ -0,0 +1,22 @@ + + +# UserComplianceData + +User compliance data. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userProtect** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | +|**userUnprotect** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | +|**userDelete** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | +|**userUndelete** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | +|**userSuspend** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | +|**userUnsuspend** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | +|**userWithheld** | [**UserTakedownComplianceSchema**](UserTakedownComplianceSchema.md) | | | +|**scrubGeo** | [**UserScrubGeoObjectSchema**](UserScrubGeoObjectSchema.md) | | | +|**userProfileModification** | [**UserProfileModificationObjectSchema**](UserProfileModificationObjectSchema.md) | | | + + + diff --git a/docs/UserComplianceSchema.md b/docs/UserComplianceSchema.md new file mode 100644 index 0000000..a716084 --- /dev/null +++ b/docs/UserComplianceSchema.md @@ -0,0 +1,14 @@ + + +# UserComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventAt** | **OffsetDateTime** | Event time. | | +|**user** | [**UserComplianceSchemaUser**](UserComplianceSchemaUser.md) | | | + + + diff --git a/docs/UserComplianceSchemaUser.md b/docs/UserComplianceSchemaUser.md new file mode 100644 index 0000000..2820ebf --- /dev/null +++ b/docs/UserComplianceSchemaUser.md @@ -0,0 +1,13 @@ + + +# UserComplianceSchemaUser + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | 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. | | + + + diff --git a/docs/UserComplianceStreamResponse.md b/docs/UserComplianceStreamResponse.md new file mode 100644 index 0000000..e74f668 --- /dev/null +++ b/docs/UserComplianceStreamResponse.md @@ -0,0 +1,15 @@ + + +# UserComplianceStreamResponse + +User compliance stream events. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UserComplianceData**](UserComplianceData.md) | | | +|**errors** | [**List<Problem>**](Problem.md) | | | + + + diff --git a/docs/UserComplianceStreamResponseOneOf.md b/docs/UserComplianceStreamResponseOneOf.md new file mode 100644 index 0000000..dbe12a2 --- /dev/null +++ b/docs/UserComplianceStreamResponseOneOf.md @@ -0,0 +1,14 @@ + + +# UserComplianceStreamResponseOneOf + +User compliance event. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UserComplianceData**](UserComplianceData.md) | | | + + + diff --git a/docs/UserDeleteComplianceSchema.md b/docs/UserDeleteComplianceSchema.md new file mode 100644 index 0000000..749e76b --- /dev/null +++ b/docs/UserDeleteComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserDeleteComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userDelete** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | + + + diff --git a/docs/UserProfileModificationComplianceSchema.md b/docs/UserProfileModificationComplianceSchema.md new file mode 100644 index 0000000..75d1ffb --- /dev/null +++ b/docs/UserProfileModificationComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserProfileModificationComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userProfileModification** | [**UserProfileModificationObjectSchema**](UserProfileModificationObjectSchema.md) | | | + + + diff --git a/docs/UserProfileModificationObjectSchema.md b/docs/UserProfileModificationObjectSchema.md new file mode 100644 index 0000000..64ca6ea --- /dev/null +++ b/docs/UserProfileModificationObjectSchema.md @@ -0,0 +1,16 @@ + + +# UserProfileModificationObjectSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventAt** | **OffsetDateTime** | Event time. | | +|**newValue** | **String** | | | +|**profileField** | **String** | | | +|**user** | [**UserComplianceSchemaUser**](UserComplianceSchemaUser.md) | | | + + + diff --git a/docs/UserProtectComplianceSchema.md b/docs/UserProtectComplianceSchema.md new file mode 100644 index 0000000..44e8979 --- /dev/null +++ b/docs/UserProtectComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserProtectComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userProtect** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | + + + diff --git a/docs/UserScrubGeoObjectSchema.md b/docs/UserScrubGeoObjectSchema.md new file mode 100644 index 0000000..0835471 --- /dev/null +++ b/docs/UserScrubGeoObjectSchema.md @@ -0,0 +1,15 @@ + + +# UserScrubGeoObjectSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventAt** | **OffsetDateTime** | Event time. | | +|**upToTweetId** | **String** | 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. | | +|**user** | [**UserComplianceSchemaUser**](UserComplianceSchemaUser.md) | | | + + + diff --git a/docs/UserScrubGeoSchema.md b/docs/UserScrubGeoSchema.md new file mode 100644 index 0000000..06e62ee --- /dev/null +++ b/docs/UserScrubGeoSchema.md @@ -0,0 +1,13 @@ + + +# UserScrubGeoSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**scrubGeo** | [**UserScrubGeoObjectSchema**](UserScrubGeoObjectSchema.md) | | | + + + diff --git a/docs/UserSuspendComplianceSchema.md b/docs/UserSuspendComplianceSchema.md new file mode 100644 index 0000000..1c7b01d --- /dev/null +++ b/docs/UserSuspendComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserSuspendComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userSuspend** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | + + + diff --git a/docs/UserTakedownComplianceSchema.md b/docs/UserTakedownComplianceSchema.md new file mode 100644 index 0000000..36d2522 --- /dev/null +++ b/docs/UserTakedownComplianceSchema.md @@ -0,0 +1,15 @@ + + +# UserTakedownComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventAt** | **OffsetDateTime** | Event time. | | +|**user** | [**UserComplianceSchemaUser**](UserComplianceSchemaUser.md) | | | +|**withheldInCountries** | **List<String>** | | | + + + diff --git a/docs/UserUndeleteComplianceSchema.md b/docs/UserUndeleteComplianceSchema.md new file mode 100644 index 0000000..17066af --- /dev/null +++ b/docs/UserUndeleteComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserUndeleteComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userUndelete** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | + + + diff --git a/docs/UserUnprotectComplianceSchema.md b/docs/UserUnprotectComplianceSchema.md new file mode 100644 index 0000000..8425938 --- /dev/null +++ b/docs/UserUnprotectComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserUnprotectComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userUnprotect** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | + + + diff --git a/docs/UserUnsuspendComplianceSchema.md b/docs/UserUnsuspendComplianceSchema.md new file mode 100644 index 0000000..924f1fe --- /dev/null +++ b/docs/UserUnsuspendComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserUnsuspendComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userUnsuspend** | [**UserComplianceSchema**](UserComplianceSchema.md) | | | + + + diff --git a/docs/UserWithheldComplianceSchema.md b/docs/UserWithheldComplianceSchema.md new file mode 100644 index 0000000..a8f6b24 --- /dev/null +++ b/docs/UserWithheldComplianceSchema.md @@ -0,0 +1,13 @@ + + +# UserWithheldComplianceSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userWithheld** | [**UserTakedownComplianceSchema**](UserTakedownComplianceSchema.md) | | | + + + diff --git a/docs/UsersApi.md b/docs/UsersApi.md index 0e3f840..b80a2d2 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -16,7 +16,7 @@ All URIs are relative to *https://api.twitter.com* | [**usersIdBlock**](UsersApi.md#usersIdBlock) | **POST** /2/users/{id}/blocking | Block User by User ID | | [**usersIdBlocking**](UsersApi.md#usersIdBlocking) | **GET** /2/users/{id}/blocking | Returns User objects that are blocked by provided User ID | | [**usersIdFollow**](UsersApi.md#usersIdFollow) | **POST** /2/users/{id}/following | Follow User | -| [**usersIdFollowers**](UsersApi.md#usersIdFollowers) | **GET** /2/users/{id}/followers | Returns User objects that follow a List by the provided User ID | +| [**usersIdFollowers**](UsersApi.md#usersIdFollowers) | **GET** /2/users/{id}/followers | Followers by User ID | | [**usersIdFollowing**](UsersApi.md#usersIdFollowing) | **GET** /2/users/{id}/following | Following by User ID | | [**usersIdMute**](UsersApi.md#usersIdMute) | **POST** /2/users/{id}/muting | Mute User by User ID. | | [**usersIdMuting**](UsersApi.md#usersIdMuting) | **GET** /2/users/{id}/muting | Returns User objects that are muted by the provided User ID | @@ -95,7 +95,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -191,7 +191,7 @@ public class Example { | **id** | **String**| The ID of the User to lookup. | | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -287,7 +287,7 @@ public class Example { | **username** | **String**| A username. | | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -383,7 +383,7 @@ public class Example { | **ids** | [**List<String>**](String.md)| A list of User IDs, comma-separated. You can specify up to 100 IDs. | | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -479,7 +479,7 @@ public class Example { | **usernames** | [**List<String>**](String.md)| A list of usernames, comma-separated. | | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -581,7 +581,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get a specified 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -683,7 +683,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get a specified 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -785,7 +785,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -887,7 +887,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -1072,7 +1072,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get a specified 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -1184,9 +1184,9 @@ public class Example { # **usersIdFollowers** > Get2UsersIdFollowersResponse usersIdFollowers(id).maxResults(maxResults).paginationToken(paginationToken).userFields(userFields).expansions(expansions).tweetFields(tweetFields).execute(); -Returns User objects that follow a List by the provided User ID +Followers by User ID -Returns a list of Users that follow the provided User ID +Returns a list of Users who are followers of the specified User ID. ### Example ```java @@ -1261,7 +1261,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get a specified 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -1363,7 +1363,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get a specified 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type @@ -1549,7 +1549,7 @@ public class Example { | **paginationToken** | **String**| This parameter is used to get the next 'page' of results. | [optional] | | **userFields** | [**Set<String>**](String.md)| A comma separated list of User fields to display. | [optional] [enum: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld] | | **expansions** | [**Set<String>**](String.md)| A comma separated list of fields to expand. | [optional] [enum: pinned_tweet_id] | -| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | +| **tweetFields** | [**Set<String>**](String.md)| A comma separated list of Tweet fields to display. | [optional] [enum: attachments, author_id, context_annotations, conversation_id, created_at, edit_controls, edit_history_tweet_ids, entities, geo, id, in_reply_to_user_id, lang, non_public_metrics, organic_metrics, possibly_sensitive, promoted_metrics, public_metrics, referenced_tweets, reply_settings, source, text, withheld] | ### Return type diff --git a/examples/pom.xml b/examples/pom.xml index 3716c2c..c954b60 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -16,7 +16,7 @@ com.twitter twitter-api-java-sdk - 2.0.2 + 2.0.3 compile diff --git a/examples/src/main/java/com/twitter/clientlib/StreamingTweetHandler.java b/examples/src/main/java/com/twitter/clientlib/StreamingTweetHandler.java index e437054..0a4913b 100644 --- a/examples/src/main/java/com/twitter/clientlib/StreamingTweetHandler.java +++ b/examples/src/main/java/com/twitter/clientlib/StreamingTweetHandler.java @@ -22,7 +22,6 @@ package com.twitter.clientlib; - import com.twitter.clientlib.api.TwitterApi; import com.twitter.clientlib.model.*; diff --git a/pom.xml b/pom.xml index 334286d..348f7f3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ twitter-api-java-sdk jar twitter-api-java-sdk - 2.0.2 + 2.0.3 https://github.com/twitterdev/twitter-api-java-sdk Twitter API v2 available endpoints diff --git a/src/main/java/com/twitter/clientlib/ApiClient.java b/src/main/java/com/twitter/clientlib/ApiClient.java index 0921fde..0a8f083 100644 --- a/src/main/java/com/twitter/clientlib/ApiClient.java +++ b/src/main/java/com/twitter/clientlib/ApiClient.java @@ -225,7 +225,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("twitter-api-java-sdk/2.0.2"); + setUserAgent("twitter-api-java-sdk/2.0.3"); authentications = new HashMap(); } diff --git a/src/main/java/com/twitter/clientlib/JSON.java b/src/main/java/com/twitter/clientlib/JSON.java index 9602c81..05234e9 100644 --- a/src/main/java/com/twitter/clientlib/JSON.java +++ b/src/main/java/com/twitter/clientlib/JSON.java @@ -745,12 +745,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsCountsAllResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsCountsAllResponseMeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsCountsRecentResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsFirehoseStreamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsIdLikingUsersResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsIdQuoteTweetsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsIdQuoteTweetsResponseMeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsIdResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsIdRetweetedByResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsSample10StreamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsSampleStreamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsSearchAllResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Get2TweetsSearchAllResponseMeta.CustomTypeAdapterFactory()); @@ -840,6 +842,12 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Topic.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.Tweet.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetAttachments.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetComplianceData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetComplianceSchemaTweet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetComplianceStreamResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetCreateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetCreateRequestGeo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetCreateRequestMedia.CustomTypeAdapterFactory()); @@ -847,8 +855,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetCreateRequestReply.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetCreateResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetCreateResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetDeleteComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetDeleteResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetDeleteResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetDropComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetEditComplianceObjectSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetEditComplianceObjectSchemaTweet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetEditComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetEditControls.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetGeo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetHideRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetHideResponse.CustomTypeAdapterFactory()); @@ -858,7 +872,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetPromotedMetrics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetPublicMetrics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetReferencedTweets.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetTakedownComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetUndropComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetWithheld.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.TweetWithheldComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UnsupportedAuthenticationProblem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UrlEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UrlFields.CustomTypeAdapterFactory()); @@ -866,10 +883,27 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UsageCapExceededProblem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UsageCapExceededProblemAllOf.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.User.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserComplianceData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserComplianceSchemaUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserComplianceStreamResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserComplianceStreamResponseOneOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserDeleteComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserEntities.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserEntitiesUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserProfileModificationComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserProfileModificationObjectSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserProtectComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserPublicMetrics.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserScrubGeoObjectSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserScrubGeoSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserSuspendComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserTakedownComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserUndeleteComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserUnprotectComplianceSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserUnsuspendComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserWithheld.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UserWithheldComplianceSchema.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UsersFollowingCreateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UsersFollowingCreateResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.twitter.clientlib.model.UsersFollowingCreateResponseData.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/twitter/clientlib/api/BookmarksApi.java b/src/main/java/com/twitter/clientlib/api/BookmarksApi.java index 9619e78..0c0d665 100644 --- a/src/main/java/com/twitter/clientlib/api/BookmarksApi.java +++ b/src/main/java/com/twitter/clientlib/api/BookmarksApi.java @@ -168,8 +168,8 @@ public class APIgetUsersIdBookmarksRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -364,6 +364,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Bookmarks by User Documentation */ public APIgetUsersIdBookmarksRequest getUsersIdBookmarks(String id) { return new APIgetUsersIdBookmarksRequest(id); @@ -544,6 +546,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Add Tweet to Bookmarks Documentation */ public APIpostUsersIdBookmarksRequest postUsersIdBookmarks(BookmarkAddRequest bookmarkAddRequest, String id) { return new APIpostUsersIdBookmarksRequest(bookmarkAddRequest, id); @@ -725,6 +729,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Remove a bookmarked Tweet Documentation */ public APIusersIdBookmarksDeleteRequest usersIdBookmarksDelete(String id, String tweetId) { return new APIusersIdBookmarksDeleteRequest(id, tweetId); diff --git a/src/main/java/com/twitter/clientlib/api/ComplianceApi.java b/src/main/java/com/twitter/clientlib/api/ComplianceApi.java index e891bb4..f199ab0 100644 --- a/src/main/java/com/twitter/clientlib/api/ComplianceApi.java +++ b/src/main/java/com/twitter/clientlib/api/ComplianceApi.java @@ -44,8 +44,11 @@ import com.twitter.clientlib.model.Error; import com.twitter.clientlib.model.Get2ComplianceJobsIdResponse; import com.twitter.clientlib.model.Get2ComplianceJobsResponse; +import java.time.OffsetDateTime; import com.twitter.clientlib.model.Problem; import java.util.Set; +import com.twitter.clientlib.model.TweetComplianceStreamResponse; +import com.twitter.clientlib.model.UserComplianceStreamResponse; import java.lang.reflect.Type; import java.util.ArrayList; @@ -227,6 +230,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Create compliance job Documentation */ public APIcreateBatchComplianceJobRequest createBatchComplianceJob(CreateComplianceJobRequest createComplianceJobRequest) { return new APIcreateBatchComplianceJobRequest(createComplianceJobRequest); @@ -421,10 +426,452 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Get Compliance Job Documentation */ public APIgetBatchComplianceJobRequest getBatchComplianceJob(String id) { return new APIgetBatchComplianceJobRequest(id); } + private okhttp3.Call getTweetsComplianceStreamCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/2/tweets/compliance/stream"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (backfillMinutes != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("backfill_minutes", backfillMinutes)); + } + + if (partition != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("partition", partition)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_time", endTime)); + } + + final String[] localVarAccepts = { + "application/json", "application/problem+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTweetsComplianceStreamValidateBeforeCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'partition' is set + if (partition == null) { + throw new ApiException("Missing the required parameter 'partition' when calling getTweetsComplianceStream(Async)"); + } + + + okhttp3.Call localVarCall = getTweetsComplianceStreamCall(backfillMinutes, partition, startTime, endTime, _callback); + return localVarCall; + + } + + + private InputStream getTweetsComplianceStreamWithHttpInfo(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime) throws ApiException { + okhttp3.Call localVarCall = getTweetsComplianceStreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + throw e; + } + } + + private okhttp3.Call getTweetsComplianceStreamAsync(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTweetsComplianceStreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTweetsComplianceStreamRequest { + private final Integer partition; + private Integer backfillMinutes; + private OffsetDateTime startTime; + private OffsetDateTime endTime; + + + + private APIgetTweetsComplianceStreamRequest(Integer partition) { + this.partition = partition; + } + + /** + * Set backfillMinutes + * @param backfillMinutes The number of minutes of backfill requested. (optional) + * @return APIgetTweetsComplianceStreamRequest + */ + public APIgetTweetsComplianceStreamRequest backfillMinutes(Integer backfillMinutes) { + this.backfillMinutes = backfillMinutes; + return this; + } + + /** + * Set startTime + * @param startTime YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided. (optional) + * @return APIgetTweetsComplianceStreamRequest + */ + public APIgetTweetsComplianceStreamRequest startTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Set endTime + * @param endTime YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided. (optional) + * @return APIgetTweetsComplianceStreamRequest + */ + public APIgetTweetsComplianceStreamRequest endTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Build call for getTweetsComplianceStream + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTweetsComplianceStreamCall(backfillMinutes, partition, startTime, endTime, _callback); + } + + /** + * Execute getTweetsComplianceStream request + * @return TweetComplianceStreamResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public InputStream execute() throws ApiException { + return getTweetsComplianceStreamWithHttpInfo(backfillMinutes, partition, startTime, endTime); + } + + /** + * Calls the API using a retry mechanism to handle rate limits errors. + * + */ + public InputStream execute(Integer retries) throws ApiException { + InputStream localVarResp; + try{ + localVarResp = execute(); + } + catch (ApiException e) { + if(handleRateLimit(e, retries)) { + return execute(retries - 1); + } else { + throw e; + } + } + return localVarResp; + } + /** + * Execute getTweetsComplianceStream request with HTTP info returned + * @return ApiResponse<TweetComplianceStreamResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + + public InputStream executeWithHttpInfo() throws ApiException { + return getTweetsComplianceStreamWithHttpInfo(backfillMinutes, partition, startTime, endTime); + } + /** + * Execute getTweetsComplianceStream request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTweetsComplianceStreamAsync(backfillMinutes, partition, startTime, endTime, _callback); + } + } + + /** + * Tweets Compliance stream + * Streams 100% of compliance data for Tweets + * @param partition The partition number. (required) + * @return APIgetTweetsComplianceStreamRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public APIgetTweetsComplianceStreamRequest getTweetsComplianceStream(Integer partition) { + return new APIgetTweetsComplianceStreamRequest(partition); + } + private okhttp3.Call getUsersComplianceStreamCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/2/users/compliance/stream"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (backfillMinutes != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("backfill_minutes", backfillMinutes)); + } + + if (partition != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("partition", partition)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_time", endTime)); + } + + final String[] localVarAccepts = { + "application/json", "application/problem+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUsersComplianceStreamValidateBeforeCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'partition' is set + if (partition == null) { + throw new ApiException("Missing the required parameter 'partition' when calling getUsersComplianceStream(Async)"); + } + + + okhttp3.Call localVarCall = getUsersComplianceStreamCall(backfillMinutes, partition, startTime, endTime, _callback); + return localVarCall; + + } + + + private InputStream getUsersComplianceStreamWithHttpInfo(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime) throws ApiException { + okhttp3.Call localVarCall = getUsersComplianceStreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + throw e; + } + } + + private okhttp3.Call getUsersComplianceStreamAsync(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUsersComplianceStreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetUsersComplianceStreamRequest { + private final Integer partition; + private Integer backfillMinutes; + private OffsetDateTime startTime; + private OffsetDateTime endTime; + + + + private APIgetUsersComplianceStreamRequest(Integer partition) { + this.partition = partition; + } + + /** + * Set backfillMinutes + * @param backfillMinutes The number of minutes of backfill requested. (optional) + * @return APIgetUsersComplianceStreamRequest + */ + public APIgetUsersComplianceStreamRequest backfillMinutes(Integer backfillMinutes) { + this.backfillMinutes = backfillMinutes; + return this; + } + + /** + * Set startTime + * @param startTime YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided. (optional) + * @return APIgetUsersComplianceStreamRequest + */ + public APIgetUsersComplianceStreamRequest startTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Set endTime + * @param endTime YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided. (optional) + * @return APIgetUsersComplianceStreamRequest + */ + public APIgetUsersComplianceStreamRequest endTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Build call for getUsersComplianceStream + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getUsersComplianceStreamCall(backfillMinutes, partition, startTime, endTime, _callback); + } + + /** + * Execute getUsersComplianceStream request + * @return UserComplianceStreamResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public InputStream execute() throws ApiException { + return getUsersComplianceStreamWithHttpInfo(backfillMinutes, partition, startTime, endTime); + } + + /** + * Calls the API using a retry mechanism to handle rate limits errors. + * + */ + public InputStream execute(Integer retries) throws ApiException { + InputStream localVarResp; + try{ + localVarResp = execute(); + } + catch (ApiException e) { + if(handleRateLimit(e, retries)) { + return execute(retries - 1); + } else { + throw e; + } + } + return localVarResp; + } + /** + * Execute getUsersComplianceStream request with HTTP info returned + * @return ApiResponse<UserComplianceStreamResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + + public InputStream executeWithHttpInfo() throws ApiException { + return getUsersComplianceStreamWithHttpInfo(backfillMinutes, partition, startTime, endTime); + } + /** + * Execute getUsersComplianceStream request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getUsersComplianceStreamAsync(backfillMinutes, partition, startTime, endTime, _callback); + } + } + + /** + * Users Compliance stream + * Streams 100% of compliance data for Users + * @param partition The partition number. (required) + * @return APIgetUsersComplianceStreamRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public APIgetUsersComplianceStreamRequest getUsersComplianceStream(Integer partition) { + return new APIgetUsersComplianceStreamRequest(partition); + } private okhttp3.Call listBatchComplianceJobsCall(String type, String status, Set complianceJobFields, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -633,6 +1080,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ 200 The request has succeeded. - 0 The request has failed. - + * + * @see List Compliance Jobs Documentation */ public APIlistBatchComplianceJobsRequest listBatchComplianceJobs(String type) { return new APIlistBatchComplianceJobsRequest(type); diff --git a/src/main/java/com/twitter/clientlib/api/ListsApi.java b/src/main/java/com/twitter/clientlib/api/ListsApi.java index 0308ae3..19ea1b3 100644 --- a/src/main/java/com/twitter/clientlib/api/ListsApi.java +++ b/src/main/java/com/twitter/clientlib/api/ListsApi.java @@ -327,6 +327,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Get a User's List Memberships Documentation */ public APIgetUserListMembershipsRequest getUserListMemberships(String id) { return new APIgetUserListMembershipsRequest(id); @@ -510,6 +512,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Add a List member Documentation */ public APIlistAddMemberRequest listAddMember(String id) { return new APIlistAddMemberRequest(id); @@ -684,6 +688,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Create List Documentation */ public APIlistIdCreateRequest listIdCreate() { return new APIlistIdCreateRequest(); @@ -856,6 +862,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Delete List Documentation */ public APIlistIdDeleteRequest listIdDelete(String id) { return new APIlistIdDeleteRequest(id); @@ -1084,6 +1092,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 200 The request has succeeded. - 0 The request has failed. - + * + * @see List lookup by List ID. Documentation */ public APIlistIdGetRequest listIdGet(String id) { return new APIlistIdGetRequest(id); @@ -1267,6 +1277,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Update List. Documentation */ public APIlistIdUpdateRequest listIdUpdate(String id) { return new APIlistIdUpdateRequest(id); @@ -1448,6 +1460,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Remove a List member Documentation */ public APIlistRemoveMemberRequest listRemoveMember(String id, String userId) { return new APIlistRemoveMemberRequest(id, userId); @@ -1631,6 +1645,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callba 200 The request has succeeded. - 0 The request has failed. - + * + * @see Follow a List Documentation */ public APIlistUserFollowRequest listUserFollow(String id) { return new APIlistUserFollowRequest(id); @@ -1889,6 +1905,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Get a User's Owned Lists. Documentation */ public APIlistUserOwnedListsRequest listUserOwnedLists(String id) { return new APIlistUserOwnedListsRequest(id); @@ -2069,6 +2087,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Pin a List Documentation */ public APIlistUserPinRequest listUserPin(ListPinnedRequest listPinnedRequest, String id) { return new APIlistUserPinRequest(listPinnedRequest, id); @@ -2297,6 +2317,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Get a User's Pinned Lists Documentation */ public APIlistUserPinnedListsRequest listUserPinnedLists(String id) { return new APIlistUserPinnedListsRequest(id); @@ -2478,6 +2500,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callba 200 The request has succeeded. - 0 The request has failed. - + * + * @see Unfollow a List Documentation */ public APIlistUserUnfollowRequest listUserUnfollow(String id, String listId) { return new APIlistUserUnfollowRequest(id, listId); @@ -2659,6 +2683,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) 200 The request has succeeded. - 0 The request has failed. - + * + * @see Unpin a List Documentation */ public APIlistUserUnpinRequest listUserUnpin(String id, String listId) { return new APIlistUserUnpinRequest(id, listId); @@ -2917,6 +2943,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Get User's Followed Lists Documentation */ public APIuserFollowedListsRequest userFollowedLists(String id) { return new APIuserFollowedListsRequest(id); diff --git a/src/main/java/com/twitter/clientlib/api/SpacesApi.java b/src/main/java/com/twitter/clientlib/api/SpacesApi.java index 0de7759..68de65a 100644 --- a/src/main/java/com/twitter/clientlib/api/SpacesApi.java +++ b/src/main/java/com/twitter/clientlib/api/SpacesApi.java @@ -303,6 +303,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callba 200 The request has succeeded. - 0 The request has failed. - + * + * @see Space lookup by Space ID Documentation */ public APIfindSpaceByIdRequest findSpaceById(String id) { return new APIfindSpaceByIdRequest(id); @@ -551,6 +553,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Space lookup by their creators Documentation */ public APIfindSpacesByCreatorIdsRequest findSpacesByCreatorIds(List userIds) { return new APIfindSpacesByCreatorIdsRequest(userIds); @@ -799,6 +803,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Space lookup up Space IDs Documentation */ public APIfindSpacesByIdsRequest findSpacesByIds(List ids) { return new APIfindSpacesByIdsRequest(ids); @@ -1077,6 +1083,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Search for Spaces Documentation */ public APIsearchSpacesRequest searchSpaces(String query) { return new APIsearchSpacesRequest(query); @@ -1177,7 +1185,7 @@ public class APIspaceBuyersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -1335,6 +1343,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ 200 The request has succeeded. - 0 The request has failed. - + * + * @see Retrieve the list of Users who purchased a ticket to the given space Documentation */ public APIspaceBuyersRequest spaceBuyers(String id) { return new APIspaceBuyersRequest(id); @@ -1443,8 +1453,8 @@ public class APIspaceTweetsRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -1629,6 +1639,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ 200 The request has succeeded. - 0 The request has failed. - + * + * @see Retrieve Tweets from a Space. Documentation */ public APIspaceTweetsRequest spaceTweets(String id) { return new APIspaceTweetsRequest(id); diff --git a/src/main/java/com/twitter/clientlib/api/TweetsApi.java b/src/main/java/com/twitter/clientlib/api/TweetsApi.java index 3b29ad9..f726eb7 100644 --- a/src/main/java/com/twitter/clientlib/api/TweetsApi.java +++ b/src/main/java/com/twitter/clientlib/api/TweetsApi.java @@ -51,6 +51,7 @@ import com.twitter.clientlib.model.Get2TweetsIdQuoteTweetsResponse; import com.twitter.clientlib.model.Get2TweetsIdResponse; import com.twitter.clientlib.model.Get2TweetsResponse; +import com.twitter.clientlib.model.Get2TweetsSample10StreamResponse; import com.twitter.clientlib.model.Get2TweetsSearchAllResponse; import com.twitter.clientlib.model.Get2TweetsSearchRecentResponse; import com.twitter.clientlib.model.Get2UsersIdLikedTweetsResponse; @@ -269,6 +270,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Add/Delete rules Documentation */ public APIaddOrDeleteRulesRequest addOrDeleteRules(AddOrDeleteRulesRequest addOrDeleteRulesRequest) { return new APIaddOrDeleteRulesRequest(addOrDeleteRulesRequest); @@ -440,6 +443,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 201 The request has succeeded. - 0 The request has failed. - + * + * @see Creation of a Tweet Documentation */ public APIcreateTweetRequest createTweet(TweetCreateRequest tweetCreateRequest) { return new APIcreateTweetRequest(tweetCreateRequest); @@ -612,6 +617,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 200 The request has succeeded. - 0 The request has failed. - + * + * @see Tweet delete by Tweet ID Documentation */ public APIdeleteTweetByIdRequest deleteTweetById(String id) { return new APIdeleteTweetByIdRequest(id); @@ -715,8 +722,8 @@ public class APIfindTweetByIdRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -891,6 +898,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callba 200 The request has succeeded. - 0 The request has failed. - + * + * @see Tweet lookup by Tweet ID Documentation */ public APIfindTweetByIdRequest findTweetById(String id) { return new APIfindTweetByIdRequest(id); @@ -997,8 +1006,8 @@ public class APIfindTweetsByIdRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -1173,6 +1182,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Tweet lookup by Tweet IDs Documentation */ public APIfindTweetsByIdRequest findTweetsById(List ids) { return new APIfindTweetsByIdRequest(ids); @@ -1292,8 +1303,8 @@ public class APIfindTweetsThatQuoteATweetRequest { private Set userFields; private Set placeFields; private final Set excludeAll = new HashSet<>(Arrays.asList("replies", "retweets")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -1499,6 +1510,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Retrieve Tweets that quote a Tweet. Documentation */ public APIfindTweetsThatQuoteATweetRequest findTweetsThatQuoteATweet(String id) { return new APIfindTweetsThatQuoteATweetRequest(id); @@ -1707,10 +1720,654 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 200 The request has succeeded. - 0 The request has failed. - + * + * @see Rules lookup Documentation */ public APIgetRulesRequest getRules() { return new APIgetRulesRequest(); } + private okhttp3.Call getTweetsFirehoseStreamCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/2/tweets/firehose/stream"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (backfillMinutes != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("backfill_minutes", backfillMinutes)); + } + + if (partition != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("partition", partition)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_time", endTime)); + } + + if (tweetFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tweet.fields", tweetFields)); + } + + if (expansions != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "expansions", expansions)); + } + + if (mediaFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "media.fields", mediaFields)); + } + + if (pollFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "poll.fields", pollFields)); + } + + if (userFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "user.fields", userFields)); + } + + if (placeFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "place.fields", placeFields)); + } + + final String[] localVarAccepts = { + "application/json", "application/problem+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTweetsFirehoseStreamValidateBeforeCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'partition' is set + if (partition == null) { + throw new ApiException("Missing the required parameter 'partition' when calling getTweetsFirehoseStream(Async)"); + } + + + okhttp3.Call localVarCall = getTweetsFirehoseStreamCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + return localVarCall; + + } + + + private InputStream getTweetsFirehoseStreamWithHttpInfo(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException { + okhttp3.Call localVarCall = getTweetsFirehoseStreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + throw e; + } + } + + private okhttp3.Call getTweetsFirehoseStreamAsync(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTweetsFirehoseStreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTweetsFirehoseStreamRequest { + private final Integer partition; + private Integer backfillMinutes; + private OffsetDateTime startTime; + private OffsetDateTime endTime; + private Set tweetFields; + private Set expansions; + private Set mediaFields; + private Set pollFields; + private Set userFields; + private Set placeFields; + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); + private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); + private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); + private final Set placeFieldsAll = new HashSet<>(Arrays.asList("contained_within", "country", "country_code", "full_name", "geo", "id", "name", "place_type")); + + private boolean isExclude = false; + + public APIgetTweetsFirehoseStreamRequest excludeInputFields() { + isExclude = true; + return this; + } + + private APIgetTweetsFirehoseStreamRequest(Integer partition) { + this.partition = partition; + } + + /** + * Set backfillMinutes + * @param backfillMinutes The number of minutes of backfill requested. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest backfillMinutes(Integer backfillMinutes) { + this.backfillMinutes = backfillMinutes; + return this; + } + + /** + * Set startTime + * @param startTime YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest startTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Set endTime + * @param endTime YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest endTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Set tweetFields + * @param tweetFields A comma separated list of Tweet fields to display. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest tweetFields(Set tweetFields) { + this.tweetFields = tweetFields; + return this; + } + + /** + * Set expansions + * @param expansions A comma separated list of fields to expand. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest expansions(Set expansions) { + this.expansions = expansions; + return this; + } + + /** + * Set mediaFields + * @param mediaFields A comma separated list of Media fields to display. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest mediaFields(Set mediaFields) { + this.mediaFields = mediaFields; + return this; + } + + /** + * Set pollFields + * @param pollFields A comma separated list of Poll fields to display. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest pollFields(Set pollFields) { + this.pollFields = pollFields; + return this; + } + + /** + * Set userFields + * @param userFields A comma separated list of User fields to display. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest userFields(Set userFields) { + this.userFields = userFields; + return this; + } + + /** + * Set placeFields + * @param placeFields A comma separated list of Place fields to display. (optional) + * @return APIgetTweetsFirehoseStreamRequest + */ + public APIgetTweetsFirehoseStreamRequest placeFields(Set placeFields) { + this.placeFields = placeFields; + return this; + } + + /** + * Build call for getTweetsFirehoseStream + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTweetsFirehoseStreamCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + } + + /** + * Execute getTweetsFirehoseStream request + * @return StreamingTweetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public InputStream execute() throws ApiException { + return getTweetsFirehoseStreamWithHttpInfo(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); + } + + /** + * Calls the API using a retry mechanism to handle rate limits errors. + * + */ + public InputStream execute(Integer retries) throws ApiException { + InputStream localVarResp; + try{ + localVarResp = execute(); + } + catch (ApiException e) { + if(handleRateLimit(e, retries)) { + return execute(retries - 1); + } else { + throw e; + } + } + return localVarResp; + } + /** + * Execute getTweetsFirehoseStream request with HTTP info returned + * @return ApiResponse<StreamingTweetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + + public InputStream executeWithHttpInfo() throws ApiException { + return getTweetsFirehoseStreamWithHttpInfo(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); + } + /** + * Execute getTweetsFirehoseStream request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTweetsFirehoseStreamAsync(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + } + } + + /** + * Firehose stream + * Streams 100% of public Tweets. + * @param partition The partition number. (required) + * @return APIgetTweetsFirehoseStreamRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public APIgetTweetsFirehoseStreamRequest getTweetsFirehoseStream(Integer partition) { + return new APIgetTweetsFirehoseStreamRequest(partition); + } + private okhttp3.Call getTweetsSample10StreamCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/2/tweets/sample10/stream"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (backfillMinutes != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("backfill_minutes", backfillMinutes)); + } + + if (partition != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("partition", partition)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_time", endTime)); + } + + if (tweetFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tweet.fields", tweetFields)); + } + + if (expansions != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "expansions", expansions)); + } + + if (mediaFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "media.fields", mediaFields)); + } + + if (pollFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "poll.fields", pollFields)); + } + + if (userFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "user.fields", userFields)); + } + + if (placeFields != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "place.fields", placeFields)); + } + + final String[] localVarAccepts = { + "application/json", "application/problem+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerToken" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, reduceAuthNames(localVarAuthNames), _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTweetsSample10StreamValidateBeforeCall(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'partition' is set + if (partition == null) { + throw new ApiException("Missing the required parameter 'partition' when calling getTweetsSample10Stream(Async)"); + } + + + okhttp3.Call localVarCall = getTweetsSample10StreamCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + return localVarCall; + + } + + + private InputStream getTweetsSample10StreamWithHttpInfo(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException { + okhttp3.Call localVarCall = getTweetsSample10StreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + throw e; + } + } + + private okhttp3.Call getTweetsSample10StreamAsync(Integer backfillMinutes, Integer partition, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTweetsSample10StreamValidateBeforeCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIgetTweetsSample10StreamRequest { + private final Integer partition; + private Integer backfillMinutes; + private OffsetDateTime startTime; + private OffsetDateTime endTime; + private Set tweetFields; + private Set expansions; + private Set mediaFields; + private Set pollFields; + private Set userFields; + private Set placeFields; + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); + private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); + private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); + private final Set placeFieldsAll = new HashSet<>(Arrays.asList("contained_within", "country", "country_code", "full_name", "geo", "id", "name", "place_type")); + + private boolean isExclude = false; + + public APIgetTweetsSample10StreamRequest excludeInputFields() { + isExclude = true; + return this; + } + + private APIgetTweetsSample10StreamRequest(Integer partition) { + this.partition = partition; + } + + /** + * Set backfillMinutes + * @param backfillMinutes The number of minutes of backfill requested. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest backfillMinutes(Integer backfillMinutes) { + this.backfillMinutes = backfillMinutes; + return this; + } + + /** + * Set startTime + * @param startTime YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest startTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Set endTime + * @param endTime YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest endTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Set tweetFields + * @param tweetFields A comma separated list of Tweet fields to display. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest tweetFields(Set tweetFields) { + this.tweetFields = tweetFields; + return this; + } + + /** + * Set expansions + * @param expansions A comma separated list of fields to expand. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest expansions(Set expansions) { + this.expansions = expansions; + return this; + } + + /** + * Set mediaFields + * @param mediaFields A comma separated list of Media fields to display. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest mediaFields(Set mediaFields) { + this.mediaFields = mediaFields; + return this; + } + + /** + * Set pollFields + * @param pollFields A comma separated list of Poll fields to display. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest pollFields(Set pollFields) { + this.pollFields = pollFields; + return this; + } + + /** + * Set userFields + * @param userFields A comma separated list of User fields to display. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest userFields(Set userFields) { + this.userFields = userFields; + return this; + } + + /** + * Set placeFields + * @param placeFields A comma separated list of Place fields to display. (optional) + * @return APIgetTweetsSample10StreamRequest + */ + public APIgetTweetsSample10StreamRequest placeFields(Set placeFields) { + this.placeFields = placeFields; + return this; + } + + /** + * Build call for getTweetsSample10Stream + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return getTweetsSample10StreamCall(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + } + + /** + * Execute getTweetsSample10Stream request + * @return Get2TweetsSample10StreamResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public InputStream execute() throws ApiException { + return getTweetsSample10StreamWithHttpInfo(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); + } + + /** + * Calls the API using a retry mechanism to handle rate limits errors. + * + */ + public InputStream execute(Integer retries) throws ApiException { + InputStream localVarResp; + try{ + localVarResp = execute(); + } + catch (ApiException e) { + if(handleRateLimit(e, retries)) { + return execute(retries - 1); + } else { + throw e; + } + } + return localVarResp; + } + /** + * Execute getTweetsSample10Stream request with HTTP info returned + * @return ApiResponse<Get2TweetsSample10StreamResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + + public InputStream executeWithHttpInfo() throws ApiException { + return getTweetsSample10StreamWithHttpInfo(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); + } + /** + * Execute getTweetsSample10Stream request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return getTweetsSample10StreamAsync(backfillMinutes, partition, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + } + } + + /** + * Sample 10% stream + * Streams a deterministic 10% of public Tweets. + * @param partition The partition number. (required) + * @return APIgetTweetsSample10StreamRequest + * @http.response.details + + + + +
Status Code Description Response Headers
200 The request has succeeded. -
0 The request has failed. -
+ */ + public APIgetTweetsSample10StreamRequest getTweetsSample10Stream(Integer partition) { + return new APIgetTweetsSample10StreamRequest(partition); + } private okhttp3.Call hideReplyByIdCall(TweetHideRequest tweetHideRequest, String tweetId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = tweetHideRequest; @@ -1890,6 +2547,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) 200 The request has succeeded. - 0 The request has failed. - + * + * @see Hide replies Documentation */ public APIhideReplyByIdRequest hideReplyById(String tweetId) { return new APIhideReplyByIdRequest(tweetId); @@ -2003,8 +2662,8 @@ public class APIlistsIdTweetsRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -2199,6 +2858,8 @@ public okhttp3.Call executeAsync(final ApiCallback _c 200 The request has succeeded. - 0 The request has failed. - + * + * @see List Tweets timeline by List ID. Documentation */ public APIlistsIdTweetsRequest listsIdTweets(String id) { return new APIlistsIdTweetsRequest(id); @@ -2300,8 +2961,8 @@ public class APIsampleStreamRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -2478,11 +3139,13 @@ public okhttp3.Call executeAsync(final ApiCallback _call 200 The request has succeeded. - 0 The request has failed. - + * + * @see Sample stream Documentation */ public APIsampleStreamRequest sampleStream() { return new APIsampleStreamRequest(); } - private okhttp3.Call searchStreamCall(Integer backfillMinutes, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + private okhttp3.Call searchStreamCall(Integer backfillMinutes, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2498,6 +3161,14 @@ private okhttp3.Call searchStreamCall(Integer backfillMinutes, Set tweet localVarQueryParams.addAll(localVarApiClient.parameterToPair("backfill_minutes", backfillMinutes)); } + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_time", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_time", endTime)); + } + if (tweetFields != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tweet.fields", tweetFields)); } @@ -2543,17 +3214,17 @@ private okhttp3.Call searchStreamCall(Integer backfillMinutes, Set tweet } @SuppressWarnings("rawtypes") - private okhttp3.Call searchStreamValidateBeforeCall(Integer backfillMinutes, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + private okhttp3.Call searchStreamValidateBeforeCall(Integer backfillMinutes, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = searchStreamCall(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + okhttp3.Call localVarCall = searchStreamCall(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); return localVarCall; } - private InputStream searchStreamWithHttpInfo(Integer backfillMinutes, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException { - okhttp3.Call localVarCall = searchStreamValidateBeforeCall(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null); + private InputStream searchStreamWithHttpInfo(Integer backfillMinutes, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields) throws ApiException { + okhttp3.Call localVarCall = searchStreamValidateBeforeCall(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, null); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.executeStream(localVarCall, localVarReturnType); @@ -2563,9 +3234,9 @@ private InputStream searchStreamWithHttpInfo(Integer backfillMinutes, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { + private okhttp3.Call searchStreamAsync(Integer backfillMinutes, OffsetDateTime startTime, OffsetDateTime endTime, Set tweetFields, Set expansions, Set mediaFields, Set pollFields, Set userFields, Set placeFields, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = searchStreamValidateBeforeCall(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + okhttp3.Call localVarCall = searchStreamValidateBeforeCall(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -2573,14 +3244,16 @@ private okhttp3.Call searchStreamAsync(Integer backfillMinutes, Set twee public class APIsearchStreamRequest { private Integer backfillMinutes; + private OffsetDateTime startTime; + private OffsetDateTime endTime; private Set tweetFields; private Set expansions; private Set mediaFields; private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -2606,6 +3279,26 @@ public APIsearchStreamRequest backfillMinutes(Integer backfillMinutes) { return this; } + /** + * Set startTime + * @param startTime YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. (optional) + * @return APIsearchStreamRequest + */ + public APIsearchStreamRequest startTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Set endTime + * @param endTime YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. (optional) + * @return APIsearchStreamRequest + */ + public APIsearchStreamRequest endTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + /** * Set tweetFields * @param tweetFields A comma separated list of Tweet fields to display. (optional) @@ -2679,7 +3372,7 @@ public APIsearchStreamRequest placeFields(Set placeFields) { */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return searchStreamCall(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + return searchStreamCall(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); } /** @@ -2694,7 +3387,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { */ public InputStream execute() throws ApiException { - return searchStreamWithHttpInfo(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); + return searchStreamWithHttpInfo(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); } /** @@ -2728,7 +3421,7 @@ public InputStream execute(Integer retries) throws ApiException { */ public InputStream executeWithHttpInfo() throws ApiException { - return searchStreamWithHttpInfo(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); + return searchStreamWithHttpInfo(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields); } /** * Execute searchStream request (asynchronously) @@ -2743,7 +3436,7 @@ public InputStream executeWithHttpInfo() throws ApiException { */ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return searchStreamAsync(backfillMinutes, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); + return searchStreamAsync(backfillMinutes, startTime, endTime, tweetFields, expansions, mediaFields, pollFields, userFields, placeFields, _callback); } } @@ -2757,6 +3450,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Filtered stream Documentation */ public APIsearchStreamRequest searchStream() { return new APIsearchStreamRequest(); @@ -2857,7 +3552,7 @@ public class APIspaceBuyersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -3015,6 +3710,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ 200 The request has succeeded. - 0 The request has failed. - + * + * @see Retrieve the list of Users who purchased a ticket to the given space Documentation */ public APIspaceBuyersRequest spaceBuyers(String id) { return new APIspaceBuyersRequest(id); @@ -3123,8 +3820,8 @@ public class APIspaceTweetsRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -3309,6 +4006,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ 200 The request has succeeded. - 0 The request has failed. - + * + * @see Retrieve Tweets from a Space. Documentation */ public APIspaceTweetsRequest spaceTweets(String id) { return new APIspaceTweetsRequest(id); @@ -3611,6 +4310,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Full archive search counts Documentation */ public APItweetCountsFullArchiveSearchRequest tweetCountsFullArchiveSearch(String query) { return new APItweetCountsFullArchiveSearchRequest(query); @@ -3913,6 +4614,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Recent search counts Documentation */ public APItweetCountsRecentSearchRequest tweetCountsRecentSearch(String query) { return new APItweetCountsRecentSearchRequest(query); @@ -4059,8 +4762,8 @@ public class APItweetsFullarchiveSearchRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -4315,6 +5018,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Full-archive search Documentation */ public APItweetsFullarchiveSearchRequest tweetsFullarchiveSearch(String query) { return new APItweetsFullarchiveSearchRequest(query); @@ -4461,8 +5166,8 @@ public class APItweetsRecentSearchRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -4717,6 +5422,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Recent search Documentation */ public APItweetsRecentSearchRequest tweetsRecentSearch(String query) { return new APItweetsRecentSearchRequest(query); @@ -4900,6 +5607,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Causes the User (in the path) to like the specified Tweet Documentation */ public APIusersIdLikeRequest usersIdLike(String id) { return new APIusersIdLikeRequest(id); @@ -5013,8 +5722,8 @@ public class APIusersIdLikedTweetsRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -5209,6 +5918,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns Tweet objects liked by the provided User ID Documentation */ public APIusersIdLikedTweetsRequest usersIdLikedTweets(String id) { return new APIusersIdLikedTweetsRequest(id); @@ -5342,8 +6053,8 @@ public class APIusersIdMentionsRequest { private Set pollFields; private Set userFields; private Set placeFields; - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -5578,6 +6289,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see User mention timeline by User ID Documentation */ public APIusersIdMentionsRequest usersIdMentions(String id) { return new APIusersIdMentionsRequest(id); @@ -5761,6 +6474,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Causes the User (in the path) to retweet the specified Tweet. Documentation */ public APIusersIdRetweetsRequest usersIdRetweets(String id) { return new APIusersIdRetweetsRequest(id); @@ -5900,8 +6615,8 @@ public class APIusersIdTimelineRequest { private Set userFields; private Set placeFields; private final Set excludeAll = new HashSet<>(Arrays.asList("replies", "retweets")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -6147,6 +6862,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see User home timeline by User ID Documentation */ public APIusersIdTimelineRequest usersIdTimeline(String id) { return new APIusersIdTimelineRequest(id); @@ -6286,8 +7003,8 @@ public class APIusersIdTweetsRequest { private Set userFields; private Set placeFields; private final Set excludeAll = new HashSet<>(Arrays.asList("replies", "retweets")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); - private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set expansionsAll = new HashSet<>(Arrays.asList("attachments.media_keys", "attachments.poll_ids", "author_id", "edit_history_tweet_ids", "entities.mentions.username", "geo.place_id", "in_reply_to_user_id", "referenced_tweets.id", "referenced_tweets.id.author_id")); private final Set mediaFieldsAll = new HashSet<>(Arrays.asList("alt_text", "duration_ms", "height", "media_key", "non_public_metrics", "organic_metrics", "preview_image_url", "promoted_metrics", "public_metrics", "type", "url", "variants", "width")); private final Set pollFieldsAll = new HashSet<>(Arrays.asList("duration_minutes", "end_datetime", "id", "options", "voting_status")); private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); @@ -6533,6 +7250,8 @@ public okhttp3.Call executeAsync(final ApiCallback _c 200 The request has succeeded. - 0 The request has failed. - + * + * @see User Tweets timeline by User ID Documentation */ public APIusersIdTweetsRequest usersIdTweets(String id) { return new APIusersIdTweetsRequest(id); @@ -6714,6 +7433,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Causes the User (in the path) to unlike the specified Tweet Documentation */ public APIusersIdUnlikeRequest usersIdUnlike(String id, String tweetId) { return new APIusersIdUnlikeRequest(id, tweetId); @@ -6895,6 +7616,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Causes the User (in the path) to unretweet the specified Tweet Documentation */ public APIusersIdUnretweetsRequest usersIdUnretweets(String id, String sourceTweetId) { return new APIusersIdUnretweetsRequest(id, sourceTweetId); diff --git a/src/main/java/com/twitter/clientlib/api/UsersApi.java b/src/main/java/com/twitter/clientlib/api/UsersApi.java index ef90a04..4f30635 100644 --- a/src/main/java/com/twitter/clientlib/api/UsersApi.java +++ b/src/main/java/com/twitter/clientlib/api/UsersApi.java @@ -155,7 +155,7 @@ public class APIfindMyUserRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -291,6 +291,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 200 The request has succeeded. - 0 The request has failed. - + * + * @see User lookup me Documentation */ public APIfindMyUserRequest findMyUser() { return new APIfindMyUserRequest(); @@ -381,7 +383,7 @@ public class APIfindUserByIdRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -519,6 +521,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 200 The request has succeeded. - 0 The request has failed. - + * + * @see User lookup by ID Documentation */ public APIfindUserByIdRequest findUserById(String id) { return new APIfindUserByIdRequest(id); @@ -609,7 +613,7 @@ public class APIfindUserByUsernameRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -747,6 +751,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see User lookup by username Documentation */ public APIfindUserByUsernameRequest findUserByUsername(String username) { return new APIfindUserByUsernameRequest(username); @@ -840,7 +846,7 @@ public class APIfindUsersByIdRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -978,6 +984,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) 200 The request has succeeded. - 0 The request has failed. - + * + * @see User lookup by IDs Documentation */ public APIfindUsersByIdRequest findUsersById(List ids) { return new APIfindUsersByIdRequest(ids); @@ -1071,7 +1079,7 @@ public class APIfindUsersByUsernameRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -1209,6 +1217,8 @@ public okhttp3.Call executeAsync(final ApiCallback _callbac 200 The request has succeeded. - 0 The request has failed. - + * + * @see User lookup by usernames Documentation */ public APIfindUsersByUsernameRequest findUsersByUsername(List usernames) { return new APIfindUsersByUsernameRequest(usernames); @@ -1309,7 +1319,7 @@ public class APIlistGetFollowersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -1467,6 +1477,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns User objects that follow a List by the provided List ID Documentation */ public APIlistGetFollowersRequest listGetFollowers(String id) { return new APIlistGetFollowersRequest(id); @@ -1567,7 +1579,7 @@ public class APIlistGetMembersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -1725,6 +1737,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns User objects that are members of a List by the provided List ID. Documentation */ public APIlistGetMembersRequest listGetMembers(String id) { return new APIlistGetMembersRequest(id); @@ -1825,7 +1839,7 @@ public class APItweetsIdLikingUsersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -1983,6 +1997,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns User objects that have liked the provided Tweet ID Documentation */ public APItweetsIdLikingUsersRequest tweetsIdLikingUsers(String id) { return new APItweetsIdLikingUsersRequest(id); @@ -2083,7 +2099,7 @@ public class APItweetsIdRetweetingUsersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -2241,6 +2257,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns User objects that have retweeted the provided Tweet ID Documentation */ public APItweetsIdRetweetingUsersRequest tweetsIdRetweetingUsers(String id) { return new APItweetsIdRetweetingUsersRequest(id); @@ -2421,6 +2439,8 @@ public okhttp3.Call executeAsync(final ApiCallback _c 200 The request has succeeded. - 0 The request has failed. - + * + * @see Block User by User ID Documentation */ public APIusersIdBlockRequest usersIdBlock(BlockUserRequest blockUserRequest, String id) { return new APIusersIdBlockRequest(blockUserRequest, id); @@ -2521,7 +2541,7 @@ public class APIusersIdBlockingRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -2679,6 +2699,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns User objects that are blocked by provided User ID Documentation */ public APIusersIdBlockingRequest usersIdBlocking(String id) { return new APIusersIdBlockingRequest(id); @@ -2862,6 +2884,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Follow User Documentation */ public APIusersIdFollowRequest usersIdFollow(String id) { return new APIusersIdFollowRequest(id); @@ -2962,7 +2986,7 @@ public class APIusersIdFollowersRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -3110,8 +3134,8 @@ public okhttp3.Call executeAsync(final ApiCallback } /** - * Returns User objects that follow a List by the provided User ID - * Returns a list of Users that follow the provided User ID + * Followers by User ID + * Returns a list of Users who are followers of the specified User ID. * @param id The ID of the User to lookup. (required) * @return APIusersIdFollowersRequest * @http.response.details @@ -3120,6 +3144,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Followers by User ID Documentation */ public APIusersIdFollowersRequest usersIdFollowers(String id) { return new APIusersIdFollowersRequest(id); @@ -3220,7 +3246,7 @@ public class APIusersIdFollowingRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -3378,6 +3404,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Following by User ID Documentation */ public APIusersIdFollowingRequest usersIdFollowing(String id) { return new APIusersIdFollowingRequest(id); @@ -3561,6 +3589,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Mute User by User ID. Documentation */ public APIusersIdMuteRequest usersIdMute(String id) { return new APIusersIdMuteRequest(id); @@ -3661,7 +3691,7 @@ public class APIusersIdMutingRequest { private Set tweetFields; private final Set userFieldsAll = new HashSet<>(Arrays.asList("created_at", "description", "entities", "id", "location", "name", "pinned_tweet_id", "profile_image_url", "protected", "public_metrics", "url", "username", "verified", "withheld")); private final Set expansionsAll = new HashSet<>(Arrays.asList("pinned_tweet_id")); - private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); + private final Set tweetFieldsAll = new HashSet<>(Arrays.asList("attachments", "author_id", "context_annotations", "conversation_id", "created_at", "edit_controls", "edit_history_tweet_ids", "entities", "geo", "id", "in_reply_to_user_id", "lang", "non_public_metrics", "organic_metrics", "possibly_sensitive", "promoted_metrics", "public_metrics", "referenced_tweets", "reply_settings", "source", "text", "withheld")); private boolean isExclude = false; @@ -3819,6 +3849,8 @@ public okhttp3.Call executeAsync(final ApiCallback _c 200 The request has succeeded. - 0 The request has failed. - + * + * @see Returns User objects that are muted by the provided User ID Documentation */ public APIusersIdMutingRequest usersIdMuting(String id) { return new APIusersIdMutingRequest(id); @@ -4000,6 +4032,8 @@ public okhttp3.Call executeAsync(final ApiCallback _c 200 The request has succeeded. - 0 The request has failed. - + * + * @see Unblock User by User ID Documentation */ public APIusersIdUnblockRequest usersIdUnblock(String sourceUserId, String targetUserId) { return new APIusersIdUnblockRequest(sourceUserId, targetUserId); @@ -4181,6 +4215,8 @@ public okhttp3.Call executeAsync(final ApiCallback 200 The request has succeeded. - 0 The request has failed. - + * + * @see Unfollow User Documentation */ public APIusersIdUnfollowRequest usersIdUnfollow(String sourceUserId, String targetUserId) { return new APIusersIdUnfollowRequest(sourceUserId, targetUserId); @@ -4362,6 +4398,8 @@ public okhttp3.Call executeAsync(final ApiCallback _ca 200 The request has succeeded. - 0 The request has failed. - + * + * @see Unmute User by User ID Documentation */ public APIusersIdUnmuteRequest usersIdUnmute(String sourceUserId, String targetUserId) { return new APIusersIdUnmuteRequest(sourceUserId, targetUserId); diff --git a/src/main/java/com/twitter/clientlib/model/ComplianceJobStatus.java b/src/main/java/com/twitter/clientlib/model/ComplianceJobStatus.java index d62e7da..749bffc 100644 --- a/src/main/java/com/twitter/clientlib/model/ComplianceJobStatus.java +++ b/src/main/java/com/twitter/clientlib/model/ComplianceJobStatus.java @@ -45,7 +45,9 @@ public enum ComplianceJobStatus { FAILED("failed"), - COMPLETE("complete"); + COMPLETE("complete"), + + EXPIRED("expired"); private String value; diff --git a/src/main/java/com/twitter/clientlib/model/Get2TweetsFirehoseStreamResponse.java b/src/main/java/com/twitter/clientlib/model/Get2TweetsFirehoseStreamResponse.java new file mode 100644 index 0000000..0b45f94 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/Get2TweetsFirehoseStreamResponse.java @@ -0,0 +1,301 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Expansions; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.Tweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * Get2TweetsFirehoseStreamResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Get2TweetsFirehoseStreamResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Tweet data; + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = null; + + public static final String SERIALIZED_NAME_INCLUDES = "includes"; + @SerializedName(SERIALIZED_NAME_INCLUDES) + private Expansions includes; + + public Get2TweetsFirehoseStreamResponse() { + } + + public Get2TweetsFirehoseStreamResponse data(Tweet data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Tweet getData() { + return data; + } + + + public void setData(Tweet data) { + this.data = data; + } + + + public Get2TweetsFirehoseStreamResponse errors(List errors) { + + this.errors = errors; + return this; + } + + public Get2TweetsFirehoseStreamResponse addErrorsItem(Problem errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getErrors() { + return errors; + } + + + public void setErrors(List errors) { + this.errors = errors; + } + + + public Get2TweetsFirehoseStreamResponse includes(Expansions includes) { + + this.includes = includes; + return this; + } + + /** + * Get includes + * @return includes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Expansions getIncludes() { + return includes; + } + + + public void setIncludes(Expansions includes) { + this.includes = includes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Get2TweetsFirehoseStreamResponse get2TweetsFirehoseStreamResponse = (Get2TweetsFirehoseStreamResponse) o; + return Objects.equals(this.data, get2TweetsFirehoseStreamResponse.data) && + Objects.equals(this.errors, get2TweetsFirehoseStreamResponse.errors) && + Objects.equals(this.includes, get2TweetsFirehoseStreamResponse.includes); + } + + @Override + public int hashCode() { + return Objects.hash(data, errors, includes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Get2TweetsFirehoseStreamResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" includes: ").append(toIndentedString(includes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("errors"); + openapiFields.add("includes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Get2TweetsFirehoseStreamResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (Get2TweetsFirehoseStreamResponse.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in Get2TweetsFirehoseStreamResponse is not found in the empty JSON string", Get2TweetsFirehoseStreamResponse.openapiRequiredFields.toString())); + // } + // } + + // validate the optional field `data` + if (jsonObj.getAsJsonObject("data") != null) { + Tweet.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + if (jsonArrayerrors != null) { + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + // validate the optional field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Problem.validateJsonObject(jsonArrayerrors.get(i).getAsJsonObject()); + }; + } + // validate the optional field `includes` + if (jsonObj.getAsJsonObject("includes") != null) { + Expansions.validateJsonObject(jsonObj.getAsJsonObject("includes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Get2TweetsFirehoseStreamResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Get2TweetsFirehoseStreamResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Get2TweetsFirehoseStreamResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Get2TweetsFirehoseStreamResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Get2TweetsFirehoseStreamResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Get2TweetsFirehoseStreamResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of Get2TweetsFirehoseStreamResponse + * @throws IOException if the JSON string is invalid with respect to Get2TweetsFirehoseStreamResponse + */ + public static Get2TweetsFirehoseStreamResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Get2TweetsFirehoseStreamResponse.class); + } + + /** + * Convert an instance of Get2TweetsFirehoseStreamResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/Get2TweetsSample10StreamResponse.java b/src/main/java/com/twitter/clientlib/model/Get2TweetsSample10StreamResponse.java new file mode 100644 index 0000000..80aef0b --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/Get2TweetsSample10StreamResponse.java @@ -0,0 +1,301 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Expansions; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.Tweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * Get2TweetsSample10StreamResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Get2TweetsSample10StreamResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Tweet data; + + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = null; + + public static final String SERIALIZED_NAME_INCLUDES = "includes"; + @SerializedName(SERIALIZED_NAME_INCLUDES) + private Expansions includes; + + public Get2TweetsSample10StreamResponse() { + } + + public Get2TweetsSample10StreamResponse data(Tweet data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Tweet getData() { + return data; + } + + + public void setData(Tweet data) { + this.data = data; + } + + + public Get2TweetsSample10StreamResponse errors(List errors) { + + this.errors = errors; + return this; + } + + public Get2TweetsSample10StreamResponse addErrorsItem(Problem errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getErrors() { + return errors; + } + + + public void setErrors(List errors) { + this.errors = errors; + } + + + public Get2TweetsSample10StreamResponse includes(Expansions includes) { + + this.includes = includes; + return this; + } + + /** + * Get includes + * @return includes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Expansions getIncludes() { + return includes; + } + + + public void setIncludes(Expansions includes) { + this.includes = includes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Get2TweetsSample10StreamResponse get2TweetsSample10StreamResponse = (Get2TweetsSample10StreamResponse) o; + return Objects.equals(this.data, get2TweetsSample10StreamResponse.data) && + Objects.equals(this.errors, get2TweetsSample10StreamResponse.errors) && + Objects.equals(this.includes, get2TweetsSample10StreamResponse.includes); + } + + @Override + public int hashCode() { + return Objects.hash(data, errors, includes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Get2TweetsSample10StreamResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" includes: ").append(toIndentedString(includes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("errors"); + openapiFields.add("includes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Get2TweetsSample10StreamResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (Get2TweetsSample10StreamResponse.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in Get2TweetsSample10StreamResponse is not found in the empty JSON string", Get2TweetsSample10StreamResponse.openapiRequiredFields.toString())); + // } + // } + + // validate the optional field `data` + if (jsonObj.getAsJsonObject("data") != null) { + Tweet.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + if (jsonArrayerrors != null) { + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + // validate the optional field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Problem.validateJsonObject(jsonArrayerrors.get(i).getAsJsonObject()); + }; + } + // validate the optional field `includes` + if (jsonObj.getAsJsonObject("includes") != null) { + Expansions.validateJsonObject(jsonObj.getAsJsonObject("includes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Get2TweetsSample10StreamResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Get2TweetsSample10StreamResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Get2TweetsSample10StreamResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Get2TweetsSample10StreamResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Get2TweetsSample10StreamResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Get2TweetsSample10StreamResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of Get2TweetsSample10StreamResponse + * @throws IOException if the JSON string is invalid with respect to Get2TweetsSample10StreamResponse + */ + public static Get2TweetsSample10StreamResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Get2TweetsSample10StreamResponse.class); + } + + /** + * Convert an instance of Get2TweetsSample10StreamResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/Tweet.java b/src/main/java/com/twitter/clientlib/model/Tweet.java index 89535ac..7c0a1e2 100644 --- a/src/main/java/com/twitter/clientlib/model/Tweet.java +++ b/src/main/java/com/twitter/clientlib/model/Tweet.java @@ -33,6 +33,7 @@ import com.twitter.clientlib.model.FullTextEntities; import com.twitter.clientlib.model.ReplySettings; import com.twitter.clientlib.model.TweetAttachments; +import com.twitter.clientlib.model.TweetEditControls; import com.twitter.clientlib.model.TweetGeo; import com.twitter.clientlib.model.TweetNonPublicMetrics; import com.twitter.clientlib.model.TweetOrganicMetrics; @@ -92,6 +93,14 @@ public class Tweet { @SerializedName(SERIALIZED_NAME_CREATED_AT) private OffsetDateTime createdAt; + public static final String SERIALIZED_NAME_EDIT_CONTROLS = "edit_controls"; + @SerializedName(SERIALIZED_NAME_EDIT_CONTROLS) + private TweetEditControls editControls; + + public static final String SERIALIZED_NAME_EDIT_HISTORY_TWEET_IDS = "edit_history_tweet_ids"; + @SerializedName(SERIALIZED_NAME_EDIT_HISTORY_TWEET_IDS) + private List editHistoryTweetIds = new ArrayList<>(); + public static final String SERIALIZED_NAME_ENTITIES = "entities"; @SerializedName(SERIALIZED_NAME_ENTITIES) private FullTextEntities entities; @@ -278,6 +287,57 @@ public void setCreatedAt(OffsetDateTime createdAt) { } + public Tweet editControls(TweetEditControls editControls) { + + this.editControls = editControls; + return this; + } + + /** + * Get editControls + * @return editControls + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TweetEditControls getEditControls() { + return editControls; + } + + + public void setEditControls(TweetEditControls editControls) { + this.editControls = editControls; + } + + + public Tweet editHistoryTweetIds(List editHistoryTweetIds) { + + this.editHistoryTweetIds = editHistoryTweetIds; + return this; + } + + public Tweet addEditHistoryTweetIdsItem(String editHistoryTweetIdsItem) { + this.editHistoryTweetIds.add(editHistoryTweetIdsItem); + return this; + } + + /** + * A list of Tweet Ids in this Tweet chain. + * @return editHistoryTweetIds + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of Tweet Ids in this Tweet chain.") + + public List getEditHistoryTweetIds() { + return editHistoryTweetIds; + } + + + public void setEditHistoryTweetIds(List editHistoryTweetIds) { + this.editHistoryTweetIds = editHistoryTweetIds; + } + + public Tweet entities(FullTextEntities entities) { this.entities = entities; @@ -646,6 +706,8 @@ public boolean equals(Object o) { Objects.equals(this.contextAnnotations, tweet.contextAnnotations) && Objects.equals(this.conversationId, tweet.conversationId) && Objects.equals(this.createdAt, tweet.createdAt) && + Objects.equals(this.editControls, tweet.editControls) && + Objects.equals(this.editHistoryTweetIds, tweet.editHistoryTweetIds) && Objects.equals(this.entities, tweet.entities) && Objects.equals(this.geo, tweet.geo) && Objects.equals(this.id, tweet.id) && @@ -665,7 +727,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(attachments, authorId, contextAnnotations, conversationId, createdAt, entities, geo, id, inReplyToUserId, lang, nonPublicMetrics, organicMetrics, possiblySensitive, promotedMetrics, publicMetrics, referencedTweets, replySettings, source, text, withheld); + return Objects.hash(attachments, authorId, contextAnnotations, conversationId, createdAt, editControls, editHistoryTweetIds, entities, geo, id, inReplyToUserId, lang, nonPublicMetrics, organicMetrics, possiblySensitive, promotedMetrics, publicMetrics, referencedTweets, replySettings, source, text, withheld); } @Override @@ -677,6 +739,8 @@ public String toString() { sb.append(" contextAnnotations: ").append(toIndentedString(contextAnnotations)).append("\n"); sb.append(" conversationId: ").append(toIndentedString(conversationId)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" editControls: ").append(toIndentedString(editControls)).append("\n"); + sb.append(" editHistoryTweetIds: ").append(toIndentedString(editHistoryTweetIds)).append("\n"); sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); sb.append(" geo: ").append(toIndentedString(geo)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -719,6 +783,8 @@ private String toIndentedString(Object o) { openapiFields.add("context_annotations"); openapiFields.add("conversation_id"); openapiFields.add("created_at"); + openapiFields.add("edit_controls"); + openapiFields.add("edit_history_tweet_ids"); openapiFields.add("entities"); openapiFields.add("geo"); openapiFields.add("id"); @@ -737,6 +803,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("edit_history_tweet_ids"); openapiRequiredFields.add("id"); openapiRequiredFields.add("text"); } @@ -785,6 +852,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("conversation_id") != null && !jsonObj.get("conversation_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `conversation_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversation_id").toString())); } + // validate the optional field `edit_controls` + if (jsonObj.getAsJsonObject("edit_controls") != null) { + TweetEditControls.validateJsonObject(jsonObj.getAsJsonObject("edit_controls")); + } + // ensure the json data is an array + if (jsonObj.get("edit_history_tweet_ids") != null && !jsonObj.get("edit_history_tweet_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `edit_history_tweet_ids` to be an array in the JSON string but got `%s`", jsonObj.get("edit_history_tweet_ids").toString())); + } // validate the optional field `entities` if (jsonObj.getAsJsonObject("entities") != null) { FullTextEntities.validateJsonObject(jsonObj.getAsJsonObject("entities")); diff --git a/src/main/java/com/twitter/clientlib/model/TweetComplianceData.java b/src/main/java/com/twitter/clientlib/model/TweetComplianceData.java new file mode 100644 index 0000000..d35a514 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetComplianceData.java @@ -0,0 +1,457 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import com.twitter.clientlib.model.TweetDeleteComplianceSchema; +import com.twitter.clientlib.model.TweetDropComplianceSchema; +import com.twitter.clientlib.model.TweetEditComplianceObjectSchema; +import com.twitter.clientlib.model.TweetEditComplianceSchema; +import com.twitter.clientlib.model.TweetTakedownComplianceSchema; +import com.twitter.clientlib.model.TweetUndropComplianceSchema; +import com.twitter.clientlib.model.TweetWithheldComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.twitter.clientlib.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetComplianceData extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TweetComplianceData.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetComplianceData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetComplianceData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterTweetDeleteComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(TweetDeleteComplianceSchema.class)); + final TypeAdapter adapterTweetDropComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(TweetDropComplianceSchema.class)); + final TypeAdapter adapterTweetEditComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(TweetEditComplianceSchema.class)); + final TypeAdapter adapterTweetUndropComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(TweetUndropComplianceSchema.class)); + final TypeAdapter adapterTweetWithheldComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(TweetWithheldComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetComplianceData value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `TweetDeleteComplianceSchema` + if (value.getActualInstance() instanceof TweetDeleteComplianceSchema) { + JsonObject obj = adapterTweetDeleteComplianceSchema.toJsonTree((TweetDeleteComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TweetDropComplianceSchema` + if (value.getActualInstance() instanceof TweetDropComplianceSchema) { + JsonObject obj = adapterTweetDropComplianceSchema.toJsonTree((TweetDropComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TweetEditComplianceSchema` + if (value.getActualInstance() instanceof TweetEditComplianceSchema) { + JsonObject obj = adapterTweetEditComplianceSchema.toJsonTree((TweetEditComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TweetUndropComplianceSchema` + if (value.getActualInstance() instanceof TweetUndropComplianceSchema) { + JsonObject obj = adapterTweetUndropComplianceSchema.toJsonTree((TweetUndropComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TweetWithheldComplianceSchema` + if (value.getActualInstance() instanceof TweetWithheldComplianceSchema) { + JsonObject obj = adapterTweetWithheldComplianceSchema.toJsonTree((TweetWithheldComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: TweetDeleteComplianceSchema, TweetDropComplianceSchema, TweetEditComplianceSchema, TweetUndropComplianceSchema, TweetWithheldComplianceSchema"); + } + + @Override + public TweetComplianceData read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize TweetDeleteComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + TweetDeleteComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterTweetDeleteComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetDeleteComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetDeleteComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetDeleteComplianceSchema'", e); + } + + // deserialize TweetDropComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + TweetDropComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterTweetDropComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetDropComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetDropComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetDropComplianceSchema'", e); + } + + // deserialize TweetEditComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + TweetEditComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterTweetEditComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetEditComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetEditComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetEditComplianceSchema'", e); + } + + // deserialize TweetUndropComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + TweetUndropComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterTweetUndropComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetUndropComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetUndropComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetUndropComplianceSchema'", e); + } + + // deserialize TweetWithheldComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + TweetWithheldComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterTweetWithheldComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetWithheldComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetWithheldComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetWithheldComplianceSchema'", e); + } + + if (match == 1) { + TweetComplianceData ret = new TweetComplianceData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for TweetComplianceData: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public TweetComplianceData() { + super("oneOf", Boolean.FALSE); + } + + public TweetComplianceData(TweetDeleteComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TweetComplianceData(TweetDropComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TweetComplianceData(TweetEditComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TweetComplianceData(TweetUndropComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TweetComplianceData(TweetWithheldComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("TweetDeleteComplianceSchema", new GenericType() { + }); + schemas.put("TweetDropComplianceSchema", new GenericType() { + }); + schemas.put("TweetEditComplianceSchema", new GenericType() { + }); + schemas.put("TweetUndropComplianceSchema", new GenericType() { + }); + schemas.put("TweetWithheldComplianceSchema", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return TweetComplianceData.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * TweetDeleteComplianceSchema, TweetDropComplianceSchema, TweetEditComplianceSchema, TweetUndropComplianceSchema, TweetWithheldComplianceSchema + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof TweetDeleteComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TweetDropComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TweetEditComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TweetUndropComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TweetWithheldComplianceSchema) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be TweetDeleteComplianceSchema, TweetDropComplianceSchema, TweetEditComplianceSchema, TweetUndropComplianceSchema, TweetWithheldComplianceSchema"); + } + + /** + * Get the actual instance, which can be the following: + * TweetDeleteComplianceSchema, TweetDropComplianceSchema, TweetEditComplianceSchema, TweetUndropComplianceSchema, TweetWithheldComplianceSchema + * + * @return The actual instance (TweetDeleteComplianceSchema, TweetDropComplianceSchema, TweetEditComplianceSchema, TweetUndropComplianceSchema, TweetWithheldComplianceSchema) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetDeleteComplianceSchema`. If the actual instance is not `TweetDeleteComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetDeleteComplianceSchema` + * @throws ClassCastException if the instance is not `TweetDeleteComplianceSchema` + */ + public TweetDeleteComplianceSchema getTweetDeleteComplianceSchema() throws ClassCastException { + return (TweetDeleteComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetDropComplianceSchema`. If the actual instance is not `TweetDropComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetDropComplianceSchema` + * @throws ClassCastException if the instance is not `TweetDropComplianceSchema` + */ + public TweetDropComplianceSchema getTweetDropComplianceSchema() throws ClassCastException { + return (TweetDropComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetEditComplianceSchema`. If the actual instance is not `TweetEditComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetEditComplianceSchema` + * @throws ClassCastException if the instance is not `TweetEditComplianceSchema` + */ + public TweetEditComplianceSchema getTweetEditComplianceSchema() throws ClassCastException { + return (TweetEditComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetUndropComplianceSchema`. If the actual instance is not `TweetUndropComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetUndropComplianceSchema` + * @throws ClassCastException if the instance is not `TweetUndropComplianceSchema` + */ + public TweetUndropComplianceSchema getTweetUndropComplianceSchema() throws ClassCastException { + return (TweetUndropComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetWithheldComplianceSchema`. If the actual instance is not `TweetWithheldComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetWithheldComplianceSchema` + * @throws ClassCastException if the instance is not `TweetWithheldComplianceSchema` + */ + public TweetWithheldComplianceSchema getTweetWithheldComplianceSchema() throws ClassCastException { + return (TweetWithheldComplianceSchema)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetComplianceData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with TweetDeleteComplianceSchema + try { + TweetDeleteComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetDeleteComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TweetDropComplianceSchema + try { + TweetDropComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetDropComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TweetEditComplianceSchema + try { + TweetEditComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetEditComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TweetUndropComplianceSchema + try { + TweetUndropComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetUndropComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TweetWithheldComplianceSchema + try { + TweetWithheldComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetWithheldComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for TweetComplianceData with oneOf schemas: TweetDeleteComplianceSchema, TweetDropComplianceSchema, TweetEditComplianceSchema, TweetUndropComplianceSchema, TweetWithheldComplianceSchema. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of TweetComplianceData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetComplianceData + * @throws IOException if the JSON string is invalid with respect to TweetComplianceData + */ + public static TweetComplianceData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetComplianceData.class); + } + + /** + * Convert an instance of TweetComplianceData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetComplianceSchema.java new file mode 100644 index 0000000..c93dfb0 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetComplianceSchema.java @@ -0,0 +1,286 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchemaTweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetComplianceSchema { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_QUOTE_TWEET_ID = "quote_tweet_id"; + @SerializedName(SERIALIZED_NAME_QUOTE_TWEET_ID) + private String quoteTweetId; + + public static final String SERIALIZED_NAME_TWEET = "tweet"; + @SerializedName(SERIALIZED_NAME_TWEET) + private TweetComplianceSchemaTweet tweet; + + public TweetComplianceSchema() { + } + + public TweetComplianceSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public TweetComplianceSchema quoteTweetId(String quoteTweetId) { + + this.quoteTweetId = quoteTweetId; + return this; + } + + /** + * 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. + * @return quoteTweetId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1346889436626259968", value = "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.") + + public String getQuoteTweetId() { + return quoteTweetId; + } + + + public void setQuoteTweetId(String quoteTweetId) { + this.quoteTweetId = quoteTweetId; + } + + + public TweetComplianceSchema tweet(TweetComplianceSchemaTweet tweet) { + + this.tweet = tweet; + return this; + } + + /** + * Get tweet + * @return tweet + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetComplianceSchemaTweet getTweet() { + return tweet; + } + + + public void setTweet(TweetComplianceSchemaTweet tweet) { + this.tweet = tweet; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetComplianceSchema tweetComplianceSchema = (TweetComplianceSchema) o; + return Objects.equals(this.eventAt, tweetComplianceSchema.eventAt) && + Objects.equals(this.quoteTweetId, tweetComplianceSchema.quoteTweetId) && + Objects.equals(this.tweet, tweetComplianceSchema.tweet); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, quoteTweetId, tweet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetComplianceSchema {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" quoteTweetId: ").append(toIndentedString(quoteTweetId)).append("\n"); + sb.append(" tweet: ").append(toIndentedString(tweet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("quote_tweet_id"); + openapiFields.add("tweet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("tweet"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetComplianceSchema is not found in the empty JSON string", TweetComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("quote_tweet_id") != null && !jsonObj.get("quote_tweet_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `quote_tweet_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("quote_tweet_id").toString())); + } + // validate the optional field `tweet` + if (jsonObj.getAsJsonObject("tweet") != null) { + TweetComplianceSchemaTweet.validateJsonObject(jsonObj.getAsJsonObject("tweet")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetComplianceSchema + */ + public static TweetComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetComplianceSchema.class); + } + + /** + * Convert an instance of TweetComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetComplianceSchemaTweet.java b/src/main/java/com/twitter/clientlib/model/TweetComplianceSchemaTweet.java new file mode 100644 index 0000000..ae15cbe --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetComplianceSchemaTweet.java @@ -0,0 +1,253 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetComplianceSchemaTweet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetComplianceSchemaTweet { + public static final String SERIALIZED_NAME_AUTHOR_ID = "author_id"; + @SerializedName(SERIALIZED_NAME_AUTHOR_ID) + private String authorId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public TweetComplianceSchemaTweet() { + } + + public TweetComplianceSchemaTweet authorId(String authorId) { + + this.authorId = authorId; + return this; + } + + /** + * 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. + * @return authorId + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2244994945", required = true, value = "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.") + + public String getAuthorId() { + return authorId; + } + + + public void setAuthorId(String authorId) { + this.authorId = authorId; + } + + + public TweetComplianceSchemaTweet id(String id) { + + this.id = id; + return this; + } + + /** + * 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. + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "1346889436626259968", required = true, value = "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.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetComplianceSchemaTweet tweetComplianceSchemaTweet = (TweetComplianceSchemaTweet) o; + return Objects.equals(this.authorId, tweetComplianceSchemaTweet.authorId) && + Objects.equals(this.id, tweetComplianceSchemaTweet.id); + } + + @Override + public int hashCode() { + return Objects.hash(authorId, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetComplianceSchemaTweet {\n"); + sb.append(" authorId: ").append(toIndentedString(authorId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("author_id"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("author_id"); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetComplianceSchemaTweet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetComplianceSchemaTweet.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetComplianceSchemaTweet is not found in the empty JSON string", TweetComplianceSchemaTweet.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetComplianceSchemaTweet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("author_id") != null && !jsonObj.get("author_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `author_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("author_id").toString())); + } + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetComplianceSchemaTweet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetComplianceSchemaTweet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceSchemaTweet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetComplianceSchemaTweet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetComplianceSchemaTweet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetComplianceSchemaTweet given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetComplianceSchemaTweet + * @throws IOException if the JSON string is invalid with respect to TweetComplianceSchemaTweet + */ + public static TweetComplianceSchemaTweet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetComplianceSchemaTweet.class); + } + + /** + * Convert an instance of TweetComplianceSchemaTweet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponse.java b/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponse.java new file mode 100644 index 0000000..9344497 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponse.java @@ -0,0 +1,299 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.TweetComplianceData; +import com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf; +import com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf1; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.twitter.clientlib.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetComplianceStreamResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TweetComplianceStreamResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetComplianceStreamResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetComplianceStreamResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterTweetComplianceStreamResponseOneOf = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceStreamResponseOneOf.class)); + final TypeAdapter adapterTweetComplianceStreamResponseOneOf1 = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceStreamResponseOneOf1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetComplianceStreamResponse value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `TweetComplianceStreamResponseOneOf` + if (value.getActualInstance() instanceof TweetComplianceStreamResponseOneOf) { + JsonObject obj = adapterTweetComplianceStreamResponseOneOf.toJsonTree((TweetComplianceStreamResponseOneOf)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TweetComplianceStreamResponseOneOf1` + if (value.getActualInstance() instanceof TweetComplianceStreamResponseOneOf1) { + JsonObject obj = adapterTweetComplianceStreamResponseOneOf1.toJsonTree((TweetComplianceStreamResponseOneOf1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: TweetComplianceStreamResponseOneOf, TweetComplianceStreamResponseOneOf1"); + } + + @Override + public TweetComplianceStreamResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize TweetComplianceStreamResponseOneOf + try { + // validate the JSON object to see if any exception is thrown + TweetComplianceStreamResponseOneOf.validateJsonObject(jsonObject); + actualAdapter = adapterTweetComplianceStreamResponseOneOf; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetComplianceStreamResponseOneOf'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetComplianceStreamResponseOneOf failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetComplianceStreamResponseOneOf'", e); + } + + // deserialize TweetComplianceStreamResponseOneOf1 + try { + // validate the JSON object to see if any exception is thrown + TweetComplianceStreamResponseOneOf1.validateJsonObject(jsonObject); + actualAdapter = adapterTweetComplianceStreamResponseOneOf1; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetComplianceStreamResponseOneOf1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetComplianceStreamResponseOneOf1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetComplianceStreamResponseOneOf1'", e); + } + + if (match == 1) { + TweetComplianceStreamResponse ret = new TweetComplianceStreamResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for TweetComplianceStreamResponse: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public TweetComplianceStreamResponse() { + super("oneOf", Boolean.FALSE); + } + + public TweetComplianceStreamResponse(TweetComplianceStreamResponseOneOf o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TweetComplianceStreamResponse(TweetComplianceStreamResponseOneOf1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("TweetComplianceStreamResponseOneOf", new GenericType() { + }); + schemas.put("TweetComplianceStreamResponseOneOf1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return TweetComplianceStreamResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * TweetComplianceStreamResponseOneOf, TweetComplianceStreamResponseOneOf1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof TweetComplianceStreamResponseOneOf) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TweetComplianceStreamResponseOneOf1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be TweetComplianceStreamResponseOneOf, TweetComplianceStreamResponseOneOf1"); + } + + /** + * Get the actual instance, which can be the following: + * TweetComplianceStreamResponseOneOf, TweetComplianceStreamResponseOneOf1 + * + * @return The actual instance (TweetComplianceStreamResponseOneOf, TweetComplianceStreamResponseOneOf1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetComplianceStreamResponseOneOf`. If the actual instance is not `TweetComplianceStreamResponseOneOf`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetComplianceStreamResponseOneOf` + * @throws ClassCastException if the instance is not `TweetComplianceStreamResponseOneOf` + */ + public TweetComplianceStreamResponseOneOf getTweetComplianceStreamResponseOneOf() throws ClassCastException { + return (TweetComplianceStreamResponseOneOf)super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetComplianceStreamResponseOneOf1`. If the actual instance is not `TweetComplianceStreamResponseOneOf1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetComplianceStreamResponseOneOf1` + * @throws ClassCastException if the instance is not `TweetComplianceStreamResponseOneOf1` + */ + public TweetComplianceStreamResponseOneOf1 getTweetComplianceStreamResponseOneOf1() throws ClassCastException { + return (TweetComplianceStreamResponseOneOf1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetComplianceStreamResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with TweetComplianceStreamResponseOneOf + try { + TweetComplianceStreamResponseOneOf.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetComplianceStreamResponseOneOf failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TweetComplianceStreamResponseOneOf1 + try { + TweetComplianceStreamResponseOneOf1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetComplianceStreamResponseOneOf1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for TweetComplianceStreamResponse with oneOf schemas: TweetComplianceStreamResponseOneOf, TweetComplianceStreamResponseOneOf1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of TweetComplianceStreamResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetComplianceStreamResponse + * @throws IOException if the JSON string is invalid with respect to TweetComplianceStreamResponse + */ + public static TweetComplianceStreamResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetComplianceStreamResponse.class); + } + + /** + * Convert an instance of TweetComplianceStreamResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf.java b/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf.java new file mode 100644 index 0000000..e4df08c --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf.java @@ -0,0 +1,222 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceData; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * Compliance event. + */ +@ApiModel(description = "Compliance event.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetComplianceStreamResponseOneOf { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TweetComplianceData data; + + public TweetComplianceStreamResponseOneOf() { + } + + public TweetComplianceStreamResponseOneOf data(TweetComplianceData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetComplianceData getData() { + return data; + } + + + public void setData(TweetComplianceData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetComplianceStreamResponseOneOf tweetComplianceStreamResponseOneOf = (TweetComplianceStreamResponseOneOf) o; + return Objects.equals(this.data, tweetComplianceStreamResponseOneOf.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetComplianceStreamResponseOneOf {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetComplianceStreamResponseOneOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetComplianceStreamResponseOneOf.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetComplianceStreamResponseOneOf is not found in the empty JSON string", TweetComplianceStreamResponseOneOf.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetComplianceStreamResponseOneOf.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `data` + if (jsonObj.getAsJsonObject("data") != null) { + TweetComplianceData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetComplianceStreamResponseOneOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetComplianceStreamResponseOneOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceStreamResponseOneOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetComplianceStreamResponseOneOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetComplianceStreamResponseOneOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetComplianceStreamResponseOneOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetComplianceStreamResponseOneOf + * @throws IOException if the JSON string is invalid with respect to TweetComplianceStreamResponseOneOf + */ + public static TweetComplianceStreamResponseOneOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetComplianceStreamResponseOneOf.class); + } + + /** + * Convert an instance of TweetComplianceStreamResponseOneOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf1.java b/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf1.java new file mode 100644 index 0000000..b511f78 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf1.java @@ -0,0 +1,236 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Problem; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetComplianceStreamResponseOneOf1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetComplianceStreamResponseOneOf1 { + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = new ArrayList<>(); + + public TweetComplianceStreamResponseOneOf1() { + } + + public TweetComplianceStreamResponseOneOf1 errors(List errors) { + + this.errors = errors; + return this; + } + + public TweetComplianceStreamResponseOneOf1 addErrorsItem(Problem errorsItem) { + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getErrors() { + return errors; + } + + + public void setErrors(List errors) { + this.errors = errors; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetComplianceStreamResponseOneOf1 tweetComplianceStreamResponseOneOf1 = (TweetComplianceStreamResponseOneOf1) o; + return Objects.equals(this.errors, tweetComplianceStreamResponseOneOf1.errors); + } + + @Override + public int hashCode() { + return Objects.hash(errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetComplianceStreamResponseOneOf1 {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("errors"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetComplianceStreamResponseOneOf1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetComplianceStreamResponseOneOf1.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetComplianceStreamResponseOneOf1 is not found in the empty JSON string", TweetComplianceStreamResponseOneOf1.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetComplianceStreamResponseOneOf1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + if (jsonArrayerrors != null) { + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + + // validate the optional field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + Problem.validateJsonObject(jsonArrayerrors.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetComplianceStreamResponseOneOf1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetComplianceStreamResponseOneOf1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceStreamResponseOneOf1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetComplianceStreamResponseOneOf1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetComplianceStreamResponseOneOf1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetComplianceStreamResponseOneOf1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetComplianceStreamResponseOneOf1 + * @throws IOException if the JSON string is invalid with respect to TweetComplianceStreamResponseOneOf1 + */ + public static TweetComplianceStreamResponseOneOf1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetComplianceStreamResponseOneOf1.class); + } + + /** + * Convert an instance of TweetComplianceStreamResponseOneOf1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetDeleteComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetDeleteComplianceSchema.java new file mode 100644 index 0000000..7220979 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetDeleteComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetDeleteComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetDeleteComplianceSchema { + public static final String SERIALIZED_NAME_DELETE = "delete"; + @SerializedName(SERIALIZED_NAME_DELETE) + private TweetComplianceSchema delete; + + public TweetDeleteComplianceSchema() { + } + + public TweetDeleteComplianceSchema delete(TweetComplianceSchema delete) { + + this.delete = delete; + return this; + } + + /** + * Get delete + * @return delete + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetComplianceSchema getDelete() { + return delete; + } + + + public void setDelete(TweetComplianceSchema delete) { + this.delete = delete; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetDeleteComplianceSchema tweetDeleteComplianceSchema = (TweetDeleteComplianceSchema) o; + return Objects.equals(this.delete, tweetDeleteComplianceSchema.delete); + } + + @Override + public int hashCode() { + return Objects.hash(delete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetDeleteComplianceSchema {\n"); + sb.append(" delete: ").append(toIndentedString(delete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("delete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("delete"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetDeleteComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetDeleteComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetDeleteComplianceSchema is not found in the empty JSON string", TweetDeleteComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetDeleteComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `delete` + if (jsonObj.getAsJsonObject("delete") != null) { + TweetComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("delete")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetDeleteComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetDeleteComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetDeleteComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetDeleteComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetDeleteComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetDeleteComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetDeleteComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetDeleteComplianceSchema + */ + public static TweetDeleteComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetDeleteComplianceSchema.class); + } + + /** + * Convert an instance of TweetDeleteComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetDropComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetDropComplianceSchema.java new file mode 100644 index 0000000..71ba0c8 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetDropComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetDropComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetDropComplianceSchema { + public static final String SERIALIZED_NAME_DROP = "drop"; + @SerializedName(SERIALIZED_NAME_DROP) + private TweetComplianceSchema drop; + + public TweetDropComplianceSchema() { + } + + public TweetDropComplianceSchema drop(TweetComplianceSchema drop) { + + this.drop = drop; + return this; + } + + /** + * Get drop + * @return drop + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetComplianceSchema getDrop() { + return drop; + } + + + public void setDrop(TweetComplianceSchema drop) { + this.drop = drop; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetDropComplianceSchema tweetDropComplianceSchema = (TweetDropComplianceSchema) o; + return Objects.equals(this.drop, tweetDropComplianceSchema.drop); + } + + @Override + public int hashCode() { + return Objects.hash(drop); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetDropComplianceSchema {\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("drop"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("drop"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetDropComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetDropComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetDropComplianceSchema is not found in the empty JSON string", TweetDropComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetDropComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `drop` + if (jsonObj.getAsJsonObject("drop") != null) { + TweetComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("drop")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetDropComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetDropComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetDropComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetDropComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetDropComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetDropComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetDropComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetDropComplianceSchema + */ + public static TweetDropComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetDropComplianceSchema.class); + } + + /** + * Convert an instance of TweetDropComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchema.java b/src/main/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchema.java new file mode 100644 index 0000000..740deda --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchema.java @@ -0,0 +1,329 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetEditComplianceObjectSchemaTweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetEditComplianceObjectSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetEditComplianceObjectSchema { + public static final String SERIALIZED_NAME_EDIT_TWEET_IDS = "edit_tweet_ids"; + @SerializedName(SERIALIZED_NAME_EDIT_TWEET_IDS) + private List editTweetIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_INITIAL_TWEET_ID = "initial_tweet_id"; + @SerializedName(SERIALIZED_NAME_INITIAL_TWEET_ID) + private String initialTweetId; + + public static final String SERIALIZED_NAME_TWEET = "tweet"; + @SerializedName(SERIALIZED_NAME_TWEET) + private TweetEditComplianceObjectSchemaTweet tweet; + + public TweetEditComplianceObjectSchema() { + } + + public TweetEditComplianceObjectSchema editTweetIds(List editTweetIds) { + + this.editTweetIds = editTweetIds; + return this; + } + + public TweetEditComplianceObjectSchema addEditTweetIdsItem(String editTweetIdsItem) { + this.editTweetIds.add(editTweetIdsItem); + return this; + } + + /** + * Get editTweetIds + * @return editTweetIds + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getEditTweetIds() { + return editTweetIds; + } + + + public void setEditTweetIds(List editTweetIds) { + this.editTweetIds = editTweetIds; + } + + + public TweetEditComplianceObjectSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public TweetEditComplianceObjectSchema initialTweetId(String initialTweetId) { + + this.initialTweetId = initialTweetId; + return this; + } + + /** + * 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. + * @return initialTweetId + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "1346889436626259968", required = true, value = "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.") + + public String getInitialTweetId() { + return initialTweetId; + } + + + public void setInitialTweetId(String initialTweetId) { + this.initialTweetId = initialTweetId; + } + + + public TweetEditComplianceObjectSchema tweet(TweetEditComplianceObjectSchemaTweet tweet) { + + this.tweet = tweet; + return this; + } + + /** + * Get tweet + * @return tweet + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetEditComplianceObjectSchemaTweet getTweet() { + return tweet; + } + + + public void setTweet(TweetEditComplianceObjectSchemaTweet tweet) { + this.tweet = tweet; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetEditComplianceObjectSchema tweetEditComplianceObjectSchema = (TweetEditComplianceObjectSchema) o; + return Objects.equals(this.editTweetIds, tweetEditComplianceObjectSchema.editTweetIds) && + Objects.equals(this.eventAt, tweetEditComplianceObjectSchema.eventAt) && + Objects.equals(this.initialTweetId, tweetEditComplianceObjectSchema.initialTweetId) && + Objects.equals(this.tweet, tweetEditComplianceObjectSchema.tweet); + } + + @Override + public int hashCode() { + return Objects.hash(editTweetIds, eventAt, initialTweetId, tweet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetEditComplianceObjectSchema {\n"); + sb.append(" editTweetIds: ").append(toIndentedString(editTweetIds)).append("\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" initialTweetId: ").append(toIndentedString(initialTweetId)).append("\n"); + sb.append(" tweet: ").append(toIndentedString(tweet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("edit_tweet_ids"); + openapiFields.add("event_at"); + openapiFields.add("initial_tweet_id"); + openapiFields.add("tweet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("edit_tweet_ids"); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("initial_tweet_id"); + openapiRequiredFields.add("tweet"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetEditComplianceObjectSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetEditComplianceObjectSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetEditComplianceObjectSchema is not found in the empty JSON string", TweetEditComplianceObjectSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetEditComplianceObjectSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("edit_tweet_ids") != null && !jsonObj.get("edit_tweet_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `edit_tweet_ids` to be an array in the JSON string but got `%s`", jsonObj.get("edit_tweet_ids").toString())); + } + if (jsonObj.get("initial_tweet_id") != null && !jsonObj.get("initial_tweet_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initial_tweet_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initial_tweet_id").toString())); + } + // validate the optional field `tweet` + if (jsonObj.getAsJsonObject("tweet") != null) { + TweetEditComplianceObjectSchemaTweet.validateJsonObject(jsonObj.getAsJsonObject("tweet")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetEditComplianceObjectSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetEditComplianceObjectSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetEditComplianceObjectSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetEditComplianceObjectSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetEditComplianceObjectSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetEditComplianceObjectSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetEditComplianceObjectSchema + * @throws IOException if the JSON string is invalid with respect to TweetEditComplianceObjectSchema + */ + public static TweetEditComplianceObjectSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetEditComplianceObjectSchema.class); + } + + /** + * Convert an instance of TweetEditComplianceObjectSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTweet.java b/src/main/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTweet.java new file mode 100644 index 0000000..9fb1f48 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTweet.java @@ -0,0 +1,219 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetEditComplianceObjectSchemaTweet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetEditComplianceObjectSchemaTweet { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public TweetEditComplianceObjectSchemaTweet() { + } + + public TweetEditComplianceObjectSchemaTweet id(String id) { + + this.id = id; + return this; + } + + /** + * 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. + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "1346889436626259968", required = true, value = "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.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetEditComplianceObjectSchemaTweet tweetEditComplianceObjectSchemaTweet = (TweetEditComplianceObjectSchemaTweet) o; + return Objects.equals(this.id, tweetEditComplianceObjectSchemaTweet.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetEditComplianceObjectSchemaTweet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetEditComplianceObjectSchemaTweet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetEditComplianceObjectSchemaTweet.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetEditComplianceObjectSchemaTweet is not found in the empty JSON string", TweetEditComplianceObjectSchemaTweet.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetEditComplianceObjectSchemaTweet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetEditComplianceObjectSchemaTweet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetEditComplianceObjectSchemaTweet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetEditComplianceObjectSchemaTweet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetEditComplianceObjectSchemaTweet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetEditComplianceObjectSchemaTweet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetEditComplianceObjectSchemaTweet given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetEditComplianceObjectSchemaTweet + * @throws IOException if the JSON string is invalid with respect to TweetEditComplianceObjectSchemaTweet + */ + public static TweetEditComplianceObjectSchemaTweet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetEditComplianceObjectSchemaTweet.class); + } + + /** + * Convert an instance of TweetEditComplianceObjectSchemaTweet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetEditComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetEditComplianceSchema.java new file mode 100644 index 0000000..f8ec9f9 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetEditComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetEditComplianceObjectSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetEditComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetEditComplianceSchema { + public static final String SERIALIZED_NAME_TWEET_EDIT = "tweet_edit"; + @SerializedName(SERIALIZED_NAME_TWEET_EDIT) + private TweetEditComplianceObjectSchema tweetEdit; + + public TweetEditComplianceSchema() { + } + + public TweetEditComplianceSchema tweetEdit(TweetEditComplianceObjectSchema tweetEdit) { + + this.tweetEdit = tweetEdit; + return this; + } + + /** + * Get tweetEdit + * @return tweetEdit + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetEditComplianceObjectSchema getTweetEdit() { + return tweetEdit; + } + + + public void setTweetEdit(TweetEditComplianceObjectSchema tweetEdit) { + this.tweetEdit = tweetEdit; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetEditComplianceSchema tweetEditComplianceSchema = (TweetEditComplianceSchema) o; + return Objects.equals(this.tweetEdit, tweetEditComplianceSchema.tweetEdit); + } + + @Override + public int hashCode() { + return Objects.hash(tweetEdit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetEditComplianceSchema {\n"); + sb.append(" tweetEdit: ").append(toIndentedString(tweetEdit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("tweet_edit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("tweet_edit"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetEditComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetEditComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetEditComplianceSchema is not found in the empty JSON string", TweetEditComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetEditComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `tweet_edit` + if (jsonObj.getAsJsonObject("tweet_edit") != null) { + TweetEditComplianceObjectSchema.validateJsonObject(jsonObj.getAsJsonObject("tweet_edit")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetEditComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetEditComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetEditComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetEditComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetEditComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetEditComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetEditComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetEditComplianceSchema + */ + public static TweetEditComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetEditComplianceSchema.class); + } + + /** + * Convert an instance of TweetEditComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetEditControls.java b/src/main/java/com/twitter/clientlib/model/TweetEditControls.java new file mode 100644 index 0000000..f35a17a --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetEditControls.java @@ -0,0 +1,279 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetEditControls + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetEditControls { + public static final String SERIALIZED_NAME_EDITABLE_UNTIL = "editable_until"; + @SerializedName(SERIALIZED_NAME_EDITABLE_UNTIL) + private OffsetDateTime editableUntil; + + public static final String SERIALIZED_NAME_EDITS_REMAINING = "edits_remaining"; + @SerializedName(SERIALIZED_NAME_EDITS_REMAINING) + private Integer editsRemaining; + + public static final String SERIALIZED_NAME_IS_EDIT_ELIGIBLE = "is_edit_eligible"; + @SerializedName(SERIALIZED_NAME_IS_EDIT_ELIGIBLE) + private Boolean isEditEligible; + + public TweetEditControls() { + } + + public TweetEditControls editableUntil(OffsetDateTime editableUntil) { + + this.editableUntil = editableUntil; + return this; + } + + /** + * Time when Tweet is no longer editable. + * @return editableUntil + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-01-06T18:40:40Z", required = true, value = "Time when Tweet is no longer editable.") + + public OffsetDateTime getEditableUntil() { + return editableUntil; + } + + + public void setEditableUntil(OffsetDateTime editableUntil) { + this.editableUntil = editableUntil; + } + + + public TweetEditControls editsRemaining(Integer editsRemaining) { + + this.editsRemaining = editsRemaining; + return this; + } + + /** + * Number of times this Tweet can be edited. + * @return editsRemaining + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Number of times this Tweet can be edited.") + + public Integer getEditsRemaining() { + return editsRemaining; + } + + + public void setEditsRemaining(Integer editsRemaining) { + this.editsRemaining = editsRemaining; + } + + + public TweetEditControls isEditEligible(Boolean isEditEligible) { + + this.isEditEligible = isEditEligible; + return this; + } + + /** + * Indicates if this Tweet is eligible to be edited. + * @return isEditEligible + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "false", required = true, value = "Indicates if this Tweet is eligible to be edited.") + + public Boolean getIsEditEligible() { + return isEditEligible; + } + + + public void setIsEditEligible(Boolean isEditEligible) { + this.isEditEligible = isEditEligible; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetEditControls tweetEditControls = (TweetEditControls) o; + return Objects.equals(this.editableUntil, tweetEditControls.editableUntil) && + Objects.equals(this.editsRemaining, tweetEditControls.editsRemaining) && + Objects.equals(this.isEditEligible, tweetEditControls.isEditEligible); + } + + @Override + public int hashCode() { + return Objects.hash(editableUntil, editsRemaining, isEditEligible); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetEditControls {\n"); + sb.append(" editableUntil: ").append(toIndentedString(editableUntil)).append("\n"); + sb.append(" editsRemaining: ").append(toIndentedString(editsRemaining)).append("\n"); + sb.append(" isEditEligible: ").append(toIndentedString(isEditEligible)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("editable_until"); + openapiFields.add("edits_remaining"); + openapiFields.add("is_edit_eligible"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("editable_until"); + openapiRequiredFields.add("edits_remaining"); + openapiRequiredFields.add("is_edit_eligible"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetEditControls + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetEditControls.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetEditControls is not found in the empty JSON string", TweetEditControls.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetEditControls.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetEditControls.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetEditControls' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetEditControls.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetEditControls value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetEditControls read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetEditControls given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetEditControls + * @throws IOException if the JSON string is invalid with respect to TweetEditControls + */ + public static TweetEditControls fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetEditControls.class); + } + + /** + * Convert an instance of TweetEditControls to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetTakedownComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetTakedownComplianceSchema.java new file mode 100644 index 0000000..075981e --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetTakedownComplianceSchema.java @@ -0,0 +1,328 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchemaTweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetTakedownComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetTakedownComplianceSchema { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_QUOTE_TWEET_ID = "quote_tweet_id"; + @SerializedName(SERIALIZED_NAME_QUOTE_TWEET_ID) + private String quoteTweetId; + + public static final String SERIALIZED_NAME_TWEET = "tweet"; + @SerializedName(SERIALIZED_NAME_TWEET) + private TweetComplianceSchemaTweet tweet; + + public static final String SERIALIZED_NAME_WITHHELD_IN_COUNTRIES = "withheld_in_countries"; + @SerializedName(SERIALIZED_NAME_WITHHELD_IN_COUNTRIES) + private List withheldInCountries = new ArrayList<>(); + + public TweetTakedownComplianceSchema() { + } + + public TweetTakedownComplianceSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public TweetTakedownComplianceSchema quoteTweetId(String quoteTweetId) { + + this.quoteTweetId = quoteTweetId; + return this; + } + + /** + * 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. + * @return quoteTweetId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1346889436626259968", value = "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.") + + public String getQuoteTweetId() { + return quoteTweetId; + } + + + public void setQuoteTweetId(String quoteTweetId) { + this.quoteTweetId = quoteTweetId; + } + + + public TweetTakedownComplianceSchema tweet(TweetComplianceSchemaTweet tweet) { + + this.tweet = tweet; + return this; + } + + /** + * Get tweet + * @return tweet + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetComplianceSchemaTweet getTweet() { + return tweet; + } + + + public void setTweet(TweetComplianceSchemaTweet tweet) { + this.tweet = tweet; + } + + + public TweetTakedownComplianceSchema withheldInCountries(List withheldInCountries) { + + this.withheldInCountries = withheldInCountries; + return this; + } + + public TweetTakedownComplianceSchema addWithheldInCountriesItem(String withheldInCountriesItem) { + this.withheldInCountries.add(withheldInCountriesItem); + return this; + } + + /** + * Get withheldInCountries + * @return withheldInCountries + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getWithheldInCountries() { + return withheldInCountries; + } + + + public void setWithheldInCountries(List withheldInCountries) { + this.withheldInCountries = withheldInCountries; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetTakedownComplianceSchema tweetTakedownComplianceSchema = (TweetTakedownComplianceSchema) o; + return Objects.equals(this.eventAt, tweetTakedownComplianceSchema.eventAt) && + Objects.equals(this.quoteTweetId, tweetTakedownComplianceSchema.quoteTweetId) && + Objects.equals(this.tweet, tweetTakedownComplianceSchema.tweet) && + Objects.equals(this.withheldInCountries, tweetTakedownComplianceSchema.withheldInCountries); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, quoteTweetId, tweet, withheldInCountries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetTakedownComplianceSchema {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" quoteTweetId: ").append(toIndentedString(quoteTweetId)).append("\n"); + sb.append(" tweet: ").append(toIndentedString(tweet)).append("\n"); + sb.append(" withheldInCountries: ").append(toIndentedString(withheldInCountries)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("quote_tweet_id"); + openapiFields.add("tweet"); + openapiFields.add("withheld_in_countries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("tweet"); + openapiRequiredFields.add("withheld_in_countries"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetTakedownComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetTakedownComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetTakedownComplianceSchema is not found in the empty JSON string", TweetTakedownComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetTakedownComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("quote_tweet_id") != null && !jsonObj.get("quote_tweet_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `quote_tweet_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("quote_tweet_id").toString())); + } + // validate the optional field `tweet` + if (jsonObj.getAsJsonObject("tweet") != null) { + TweetComplianceSchemaTweet.validateJsonObject(jsonObj.getAsJsonObject("tweet")); + } + // ensure the json data is an array + if (jsonObj.get("withheld_in_countries") != null && !jsonObj.get("withheld_in_countries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `withheld_in_countries` to be an array in the JSON string but got `%s`", jsonObj.get("withheld_in_countries").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetTakedownComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetTakedownComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetTakedownComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetTakedownComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetTakedownComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetTakedownComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetTakedownComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetTakedownComplianceSchema + */ + public static TweetTakedownComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetTakedownComplianceSchema.class); + } + + /** + * Convert an instance of TweetTakedownComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetUndropComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetUndropComplianceSchema.java new file mode 100644 index 0000000..d583ca5 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetUndropComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetUndropComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetUndropComplianceSchema { + public static final String SERIALIZED_NAME_UNDROP = "undrop"; + @SerializedName(SERIALIZED_NAME_UNDROP) + private TweetComplianceSchema undrop; + + public TweetUndropComplianceSchema() { + } + + public TweetUndropComplianceSchema undrop(TweetComplianceSchema undrop) { + + this.undrop = undrop; + return this; + } + + /** + * Get undrop + * @return undrop + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetComplianceSchema getUndrop() { + return undrop; + } + + + public void setUndrop(TweetComplianceSchema undrop) { + this.undrop = undrop; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetUndropComplianceSchema tweetUndropComplianceSchema = (TweetUndropComplianceSchema) o; + return Objects.equals(this.undrop, tweetUndropComplianceSchema.undrop); + } + + @Override + public int hashCode() { + return Objects.hash(undrop); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetUndropComplianceSchema {\n"); + sb.append(" undrop: ").append(toIndentedString(undrop)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("undrop"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("undrop"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetUndropComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetUndropComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetUndropComplianceSchema is not found in the empty JSON string", TweetUndropComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetUndropComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `undrop` + if (jsonObj.getAsJsonObject("undrop") != null) { + TweetComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("undrop")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetUndropComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetUndropComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetUndropComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetUndropComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetUndropComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetUndropComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetUndropComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetUndropComplianceSchema + */ + public static TweetUndropComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetUndropComplianceSchema.class); + } + + /** + * Convert an instance of TweetUndropComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/TweetWithheldComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/TweetWithheldComplianceSchema.java new file mode 100644 index 0000000..d5a4fbc --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/TweetWithheldComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetTakedownComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * TweetWithheldComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TweetWithheldComplianceSchema { + public static final String SERIALIZED_NAME_WITHHELD = "withheld"; + @SerializedName(SERIALIZED_NAME_WITHHELD) + private TweetTakedownComplianceSchema withheld; + + public TweetWithheldComplianceSchema() { + } + + public TweetWithheldComplianceSchema withheld(TweetTakedownComplianceSchema withheld) { + + this.withheld = withheld; + return this; + } + + /** + * Get withheld + * @return withheld + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public TweetTakedownComplianceSchema getWithheld() { + return withheld; + } + + + public void setWithheld(TweetTakedownComplianceSchema withheld) { + this.withheld = withheld; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TweetWithheldComplianceSchema tweetWithheldComplianceSchema = (TweetWithheldComplianceSchema) o; + return Objects.equals(this.withheld, tweetWithheldComplianceSchema.withheld); + } + + @Override + public int hashCode() { + return Objects.hash(withheld); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TweetWithheldComplianceSchema {\n"); + sb.append(" withheld: ").append(toIndentedString(withheld)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("withheld"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("withheld"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TweetWithheldComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (TweetWithheldComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in TweetWithheldComplianceSchema is not found in the empty JSON string", TweetWithheldComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TweetWithheldComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `withheld` + if (jsonObj.getAsJsonObject("withheld") != null) { + TweetTakedownComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("withheld")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TweetWithheldComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TweetWithheldComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TweetWithheldComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TweetWithheldComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TweetWithheldComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TweetWithheldComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of TweetWithheldComplianceSchema + * @throws IOException if the JSON string is invalid with respect to TweetWithheldComplianceSchema + */ + public static TweetWithheldComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TweetWithheldComplianceSchema.class); + } + + /** + * Convert an instance of TweetWithheldComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserComplianceData.java b/src/main/java/com/twitter/clientlib/model/UserComplianceData.java new file mode 100644 index 0000000..6685f64 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserComplianceData.java @@ -0,0 +1,670 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import com.twitter.clientlib.model.UserDeleteComplianceSchema; +import com.twitter.clientlib.model.UserProfileModificationComplianceSchema; +import com.twitter.clientlib.model.UserProfileModificationObjectSchema; +import com.twitter.clientlib.model.UserProtectComplianceSchema; +import com.twitter.clientlib.model.UserScrubGeoObjectSchema; +import com.twitter.clientlib.model.UserScrubGeoSchema; +import com.twitter.clientlib.model.UserSuspendComplianceSchema; +import com.twitter.clientlib.model.UserTakedownComplianceSchema; +import com.twitter.clientlib.model.UserUndeleteComplianceSchema; +import com.twitter.clientlib.model.UserUnprotectComplianceSchema; +import com.twitter.clientlib.model.UserUnsuspendComplianceSchema; +import com.twitter.clientlib.model.UserWithheldComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.twitter.clientlib.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserComplianceData extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserComplianceData.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserComplianceData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserComplianceData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterUserDeleteComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserDeleteComplianceSchema.class)); + final TypeAdapter adapterUserProfileModificationComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserProfileModificationComplianceSchema.class)); + final TypeAdapter adapterUserProtectComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserProtectComplianceSchema.class)); + final TypeAdapter adapterUserScrubGeoSchema = gson.getDelegateAdapter(this, TypeToken.get(UserScrubGeoSchema.class)); + final TypeAdapter adapterUserSuspendComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserSuspendComplianceSchema.class)); + final TypeAdapter adapterUserUndeleteComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserUndeleteComplianceSchema.class)); + final TypeAdapter adapterUserUnprotectComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserUnprotectComplianceSchema.class)); + final TypeAdapter adapterUserUnsuspendComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserUnsuspendComplianceSchema.class)); + final TypeAdapter adapterUserWithheldComplianceSchema = gson.getDelegateAdapter(this, TypeToken.get(UserWithheldComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserComplianceData value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `UserDeleteComplianceSchema` + if (value.getActualInstance() instanceof UserDeleteComplianceSchema) { + JsonObject obj = adapterUserDeleteComplianceSchema.toJsonTree((UserDeleteComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserProfileModificationComplianceSchema` + if (value.getActualInstance() instanceof UserProfileModificationComplianceSchema) { + JsonObject obj = adapterUserProfileModificationComplianceSchema.toJsonTree((UserProfileModificationComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserProtectComplianceSchema` + if (value.getActualInstance() instanceof UserProtectComplianceSchema) { + JsonObject obj = adapterUserProtectComplianceSchema.toJsonTree((UserProtectComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserScrubGeoSchema` + if (value.getActualInstance() instanceof UserScrubGeoSchema) { + JsonObject obj = adapterUserScrubGeoSchema.toJsonTree((UserScrubGeoSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserSuspendComplianceSchema` + if (value.getActualInstance() instanceof UserSuspendComplianceSchema) { + JsonObject obj = adapterUserSuspendComplianceSchema.toJsonTree((UserSuspendComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserUndeleteComplianceSchema` + if (value.getActualInstance() instanceof UserUndeleteComplianceSchema) { + JsonObject obj = adapterUserUndeleteComplianceSchema.toJsonTree((UserUndeleteComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserUnprotectComplianceSchema` + if (value.getActualInstance() instanceof UserUnprotectComplianceSchema) { + JsonObject obj = adapterUserUnprotectComplianceSchema.toJsonTree((UserUnprotectComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserUnsuspendComplianceSchema` + if (value.getActualInstance() instanceof UserUnsuspendComplianceSchema) { + JsonObject obj = adapterUserUnsuspendComplianceSchema.toJsonTree((UserUnsuspendComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserWithheldComplianceSchema` + if (value.getActualInstance() instanceof UserWithheldComplianceSchema) { + JsonObject obj = adapterUserWithheldComplianceSchema.toJsonTree((UserWithheldComplianceSchema)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: UserDeleteComplianceSchema, UserProfileModificationComplianceSchema, UserProtectComplianceSchema, UserScrubGeoSchema, UserSuspendComplianceSchema, UserUndeleteComplianceSchema, UserUnprotectComplianceSchema, UserUnsuspendComplianceSchema, UserWithheldComplianceSchema"); + } + + @Override + public UserComplianceData read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize UserDeleteComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserDeleteComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserDeleteComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserDeleteComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserDeleteComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserDeleteComplianceSchema'", e); + } + + // deserialize UserProfileModificationComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserProfileModificationComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserProfileModificationComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserProfileModificationComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserProfileModificationComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserProfileModificationComplianceSchema'", e); + } + + // deserialize UserProtectComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserProtectComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserProtectComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserProtectComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserProtectComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserProtectComplianceSchema'", e); + } + + // deserialize UserScrubGeoSchema + try { + // validate the JSON object to see if any exception is thrown + UserScrubGeoSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserScrubGeoSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserScrubGeoSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserScrubGeoSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserScrubGeoSchema'", e); + } + + // deserialize UserSuspendComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserSuspendComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserSuspendComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserSuspendComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserSuspendComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserSuspendComplianceSchema'", e); + } + + // deserialize UserUndeleteComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserUndeleteComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserUndeleteComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserUndeleteComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserUndeleteComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserUndeleteComplianceSchema'", e); + } + + // deserialize UserUnprotectComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserUnprotectComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserUnprotectComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserUnprotectComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserUnprotectComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserUnprotectComplianceSchema'", e); + } + + // deserialize UserUnsuspendComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserUnsuspendComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserUnsuspendComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserUnsuspendComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserUnsuspendComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserUnsuspendComplianceSchema'", e); + } + + // deserialize UserWithheldComplianceSchema + try { + // validate the JSON object to see if any exception is thrown + UserWithheldComplianceSchema.validateJsonObject(jsonObject); + actualAdapter = adapterUserWithheldComplianceSchema; + match++; + log.log(Level.FINER, "Input data matches schema 'UserWithheldComplianceSchema'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserWithheldComplianceSchema failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserWithheldComplianceSchema'", e); + } + + if (match == 1) { + UserComplianceData ret = new UserComplianceData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserComplianceData: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public UserComplianceData() { + super("oneOf", Boolean.FALSE); + } + + public UserComplianceData(UserDeleteComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserProfileModificationComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserProtectComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserScrubGeoSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserSuspendComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserUndeleteComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserUnprotectComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserUnsuspendComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceData(UserWithheldComplianceSchema o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("UserDeleteComplianceSchema", new GenericType() { + }); + schemas.put("UserProfileModificationComplianceSchema", new GenericType() { + }); + schemas.put("UserProtectComplianceSchema", new GenericType() { + }); + schemas.put("UserScrubGeoSchema", new GenericType() { + }); + schemas.put("UserSuspendComplianceSchema", new GenericType() { + }); + schemas.put("UserUndeleteComplianceSchema", new GenericType() { + }); + schemas.put("UserUnprotectComplianceSchema", new GenericType() { + }); + schemas.put("UserUnsuspendComplianceSchema", new GenericType() { + }); + schemas.put("UserWithheldComplianceSchema", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return UserComplianceData.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * UserDeleteComplianceSchema, UserProfileModificationComplianceSchema, UserProtectComplianceSchema, UserScrubGeoSchema, UserSuspendComplianceSchema, UserUndeleteComplianceSchema, UserUnprotectComplianceSchema, UserUnsuspendComplianceSchema, UserWithheldComplianceSchema + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof UserDeleteComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserProfileModificationComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserProtectComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserScrubGeoSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserSuspendComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserUndeleteComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserUnprotectComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserUnsuspendComplianceSchema) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserWithheldComplianceSchema) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be UserDeleteComplianceSchema, UserProfileModificationComplianceSchema, UserProtectComplianceSchema, UserScrubGeoSchema, UserSuspendComplianceSchema, UserUndeleteComplianceSchema, UserUnprotectComplianceSchema, UserUnsuspendComplianceSchema, UserWithheldComplianceSchema"); + } + + /** + * Get the actual instance, which can be the following: + * UserDeleteComplianceSchema, UserProfileModificationComplianceSchema, UserProtectComplianceSchema, UserScrubGeoSchema, UserSuspendComplianceSchema, UserUndeleteComplianceSchema, UserUnprotectComplianceSchema, UserUnsuspendComplianceSchema, UserWithheldComplianceSchema + * + * @return The actual instance (UserDeleteComplianceSchema, UserProfileModificationComplianceSchema, UserProtectComplianceSchema, UserScrubGeoSchema, UserSuspendComplianceSchema, UserUndeleteComplianceSchema, UserUnprotectComplianceSchema, UserUnsuspendComplianceSchema, UserWithheldComplianceSchema) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `UserDeleteComplianceSchema`. If the actual instance is not `UserDeleteComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserDeleteComplianceSchema` + * @throws ClassCastException if the instance is not `UserDeleteComplianceSchema` + */ + public UserDeleteComplianceSchema getUserDeleteComplianceSchema() throws ClassCastException { + return (UserDeleteComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserProfileModificationComplianceSchema`. If the actual instance is not `UserProfileModificationComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserProfileModificationComplianceSchema` + * @throws ClassCastException if the instance is not `UserProfileModificationComplianceSchema` + */ + public UserProfileModificationComplianceSchema getUserProfileModificationComplianceSchema() throws ClassCastException { + return (UserProfileModificationComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserProtectComplianceSchema`. If the actual instance is not `UserProtectComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserProtectComplianceSchema` + * @throws ClassCastException if the instance is not `UserProtectComplianceSchema` + */ + public UserProtectComplianceSchema getUserProtectComplianceSchema() throws ClassCastException { + return (UserProtectComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserScrubGeoSchema`. If the actual instance is not `UserScrubGeoSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserScrubGeoSchema` + * @throws ClassCastException if the instance is not `UserScrubGeoSchema` + */ + public UserScrubGeoSchema getUserScrubGeoSchema() throws ClassCastException { + return (UserScrubGeoSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserSuspendComplianceSchema`. If the actual instance is not `UserSuspendComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserSuspendComplianceSchema` + * @throws ClassCastException if the instance is not `UserSuspendComplianceSchema` + */ + public UserSuspendComplianceSchema getUserSuspendComplianceSchema() throws ClassCastException { + return (UserSuspendComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserUndeleteComplianceSchema`. If the actual instance is not `UserUndeleteComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserUndeleteComplianceSchema` + * @throws ClassCastException if the instance is not `UserUndeleteComplianceSchema` + */ + public UserUndeleteComplianceSchema getUserUndeleteComplianceSchema() throws ClassCastException { + return (UserUndeleteComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserUnprotectComplianceSchema`. If the actual instance is not `UserUnprotectComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserUnprotectComplianceSchema` + * @throws ClassCastException if the instance is not `UserUnprotectComplianceSchema` + */ + public UserUnprotectComplianceSchema getUserUnprotectComplianceSchema() throws ClassCastException { + return (UserUnprotectComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserUnsuspendComplianceSchema`. If the actual instance is not `UserUnsuspendComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserUnsuspendComplianceSchema` + * @throws ClassCastException if the instance is not `UserUnsuspendComplianceSchema` + */ + public UserUnsuspendComplianceSchema getUserUnsuspendComplianceSchema() throws ClassCastException { + return (UserUnsuspendComplianceSchema)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserWithheldComplianceSchema`. If the actual instance is not `UserWithheldComplianceSchema`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserWithheldComplianceSchema` + * @throws ClassCastException if the instance is not `UserWithheldComplianceSchema` + */ + public UserWithheldComplianceSchema getUserWithheldComplianceSchema() throws ClassCastException { + return (UserWithheldComplianceSchema)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserComplianceData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with UserDeleteComplianceSchema + try { + UserDeleteComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserDeleteComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserProfileModificationComplianceSchema + try { + UserProfileModificationComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserProfileModificationComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserProtectComplianceSchema + try { + UserProtectComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserProtectComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserScrubGeoSchema + try { + UserScrubGeoSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserScrubGeoSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserSuspendComplianceSchema + try { + UserSuspendComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserSuspendComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserUndeleteComplianceSchema + try { + UserUndeleteComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserUndeleteComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserUnprotectComplianceSchema + try { + UserUnprotectComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserUnprotectComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserUnsuspendComplianceSchema + try { + UserUnsuspendComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserUnsuspendComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserWithheldComplianceSchema + try { + UserWithheldComplianceSchema.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserWithheldComplianceSchema failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserComplianceData with oneOf schemas: UserDeleteComplianceSchema, UserProfileModificationComplianceSchema, UserProtectComplianceSchema, UserScrubGeoSchema, UserSuspendComplianceSchema, UserUndeleteComplianceSchema, UserUnprotectComplianceSchema, UserUnsuspendComplianceSchema, UserWithheldComplianceSchema. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of UserComplianceData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserComplianceData + * @throws IOException if the JSON string is invalid with respect to UserComplianceData + */ + public static UserComplianceData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserComplianceData.class); + } + + /** + * Convert an instance of UserComplianceData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserComplianceSchema.java new file mode 100644 index 0000000..286431f --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserComplianceSchema.java @@ -0,0 +1,253 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserComplianceSchema { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private UserComplianceSchemaUser user; + + public UserComplianceSchema() { + } + + public UserComplianceSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public UserComplianceSchema user(UserComplianceSchemaUser user) { + + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchemaUser getUser() { + return user; + } + + + public void setUser(UserComplianceSchemaUser user) { + this.user = user; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserComplianceSchema userComplianceSchema = (UserComplianceSchema) o; + return Objects.equals(this.eventAt, userComplianceSchema.eventAt) && + Objects.equals(this.user, userComplianceSchema.user); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserComplianceSchema {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("user"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("user"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserComplianceSchema is not found in the empty JSON string", UserComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user` + if (jsonObj.getAsJsonObject("user") != null) { + UserComplianceSchemaUser.validateJsonObject(jsonObj.getAsJsonObject("user")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserComplianceSchema + */ + public static UserComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserComplianceSchema.class); + } + + /** + * Convert an instance of UserComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserComplianceSchemaUser.java b/src/main/java/com/twitter/clientlib/model/UserComplianceSchemaUser.java new file mode 100644 index 0000000..09c9b8d --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserComplianceSchemaUser.java @@ -0,0 +1,219 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserComplianceSchemaUser + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserComplianceSchemaUser { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public UserComplianceSchemaUser() { + } + + public UserComplianceSchemaUser id(String id) { + + this.id = id; + return this; + } + + /** + * 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. + * @return id + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2244994945", required = true, value = "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.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserComplianceSchemaUser userComplianceSchemaUser = (UserComplianceSchemaUser) o; + return Objects.equals(this.id, userComplianceSchemaUser.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserComplianceSchemaUser {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserComplianceSchemaUser + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserComplianceSchemaUser.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserComplianceSchemaUser is not found in the empty JSON string", UserComplianceSchemaUser.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserComplianceSchemaUser.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserComplianceSchemaUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserComplianceSchemaUser' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserComplianceSchemaUser.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserComplianceSchemaUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserComplianceSchemaUser read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserComplianceSchemaUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserComplianceSchemaUser + * @throws IOException if the JSON string is invalid with respect to UserComplianceSchemaUser + */ + public static UserComplianceSchemaUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserComplianceSchemaUser.class); + } + + /** + * Convert an instance of UserComplianceSchemaUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserComplianceStreamResponse.java b/src/main/java/com/twitter/clientlib/model/UserComplianceStreamResponse.java new file mode 100644 index 0000000..099075f --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserComplianceStreamResponse.java @@ -0,0 +1,299 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf1; +import com.twitter.clientlib.model.UserComplianceData; +import com.twitter.clientlib.model.UserComplianceStreamResponseOneOf; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.twitter.clientlib.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserComplianceStreamResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserComplianceStreamResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserComplianceStreamResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserComplianceStreamResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterTweetComplianceStreamResponseOneOf1 = gson.getDelegateAdapter(this, TypeToken.get(TweetComplianceStreamResponseOneOf1.class)); + final TypeAdapter adapterUserComplianceStreamResponseOneOf = gson.getDelegateAdapter(this, TypeToken.get(UserComplianceStreamResponseOneOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserComplianceStreamResponse value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `TweetComplianceStreamResponseOneOf1` + if (value.getActualInstance() instanceof TweetComplianceStreamResponseOneOf1) { + JsonObject obj = adapterTweetComplianceStreamResponseOneOf1.toJsonTree((TweetComplianceStreamResponseOneOf1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UserComplianceStreamResponseOneOf` + if (value.getActualInstance() instanceof UserComplianceStreamResponseOneOf) { + JsonObject obj = adapterUserComplianceStreamResponseOneOf.toJsonTree((UserComplianceStreamResponseOneOf)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: TweetComplianceStreamResponseOneOf1, UserComplianceStreamResponseOneOf"); + } + + @Override + public UserComplianceStreamResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize TweetComplianceStreamResponseOneOf1 + try { + // validate the JSON object to see if any exception is thrown + TweetComplianceStreamResponseOneOf1.validateJsonObject(jsonObject); + actualAdapter = adapterTweetComplianceStreamResponseOneOf1; + match++; + log.log(Level.FINER, "Input data matches schema 'TweetComplianceStreamResponseOneOf1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TweetComplianceStreamResponseOneOf1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TweetComplianceStreamResponseOneOf1'", e); + } + + // deserialize UserComplianceStreamResponseOneOf + try { + // validate the JSON object to see if any exception is thrown + UserComplianceStreamResponseOneOf.validateJsonObject(jsonObject); + actualAdapter = adapterUserComplianceStreamResponseOneOf; + match++; + log.log(Level.FINER, "Input data matches schema 'UserComplianceStreamResponseOneOf'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UserComplianceStreamResponseOneOf failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UserComplianceStreamResponseOneOf'", e); + } + + if (match == 1) { + UserComplianceStreamResponse ret = new UserComplianceStreamResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserComplianceStreamResponse: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public UserComplianceStreamResponse() { + super("oneOf", Boolean.FALSE); + } + + public UserComplianceStreamResponse(TweetComplianceStreamResponseOneOf1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserComplianceStreamResponse(UserComplianceStreamResponseOneOf o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("TweetComplianceStreamResponseOneOf1", new GenericType() { + }); + schemas.put("UserComplianceStreamResponseOneOf", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return UserComplianceStreamResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * TweetComplianceStreamResponseOneOf1, UserComplianceStreamResponseOneOf + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof TweetComplianceStreamResponseOneOf1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UserComplianceStreamResponseOneOf) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be TweetComplianceStreamResponseOneOf1, UserComplianceStreamResponseOneOf"); + } + + /** + * Get the actual instance, which can be the following: + * TweetComplianceStreamResponseOneOf1, UserComplianceStreamResponseOneOf + * + * @return The actual instance (TweetComplianceStreamResponseOneOf1, UserComplianceStreamResponseOneOf) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `TweetComplianceStreamResponseOneOf1`. If the actual instance is not `TweetComplianceStreamResponseOneOf1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TweetComplianceStreamResponseOneOf1` + * @throws ClassCastException if the instance is not `TweetComplianceStreamResponseOneOf1` + */ + public TweetComplianceStreamResponseOneOf1 getTweetComplianceStreamResponseOneOf1() throws ClassCastException { + return (TweetComplianceStreamResponseOneOf1)super.getActualInstance(); + } + + /** + * Get the actual instance of `UserComplianceStreamResponseOneOf`. If the actual instance is not `UserComplianceStreamResponseOneOf`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UserComplianceStreamResponseOneOf` + * @throws ClassCastException if the instance is not `UserComplianceStreamResponseOneOf` + */ + public UserComplianceStreamResponseOneOf getUserComplianceStreamResponseOneOf() throws ClassCastException { + return (UserComplianceStreamResponseOneOf)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserComplianceStreamResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with TweetComplianceStreamResponseOneOf1 + try { + TweetComplianceStreamResponseOneOf1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TweetComplianceStreamResponseOneOf1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UserComplianceStreamResponseOneOf + try { + UserComplianceStreamResponseOneOf.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UserComplianceStreamResponseOneOf failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserComplianceStreamResponse with oneOf schemas: TweetComplianceStreamResponseOneOf1, UserComplianceStreamResponseOneOf. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of UserComplianceStreamResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserComplianceStreamResponse + * @throws IOException if the JSON string is invalid with respect to UserComplianceStreamResponse + */ + public static UserComplianceStreamResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserComplianceStreamResponse.class); + } + + /** + * Convert an instance of UserComplianceStreamResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserComplianceStreamResponseOneOf.java b/src/main/java/com/twitter/clientlib/model/UserComplianceStreamResponseOneOf.java new file mode 100644 index 0000000..9bc75b2 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserComplianceStreamResponseOneOf.java @@ -0,0 +1,222 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceData; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * User compliance event. + */ +@ApiModel(description = "User compliance event.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserComplianceStreamResponseOneOf { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserComplianceData data; + + public UserComplianceStreamResponseOneOf() { + } + + public UserComplianceStreamResponseOneOf data(UserComplianceData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceData getData() { + return data; + } + + + public void setData(UserComplianceData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserComplianceStreamResponseOneOf userComplianceStreamResponseOneOf = (UserComplianceStreamResponseOneOf) o; + return Objects.equals(this.data, userComplianceStreamResponseOneOf.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserComplianceStreamResponseOneOf {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserComplianceStreamResponseOneOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserComplianceStreamResponseOneOf.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserComplianceStreamResponseOneOf is not found in the empty JSON string", UserComplianceStreamResponseOneOf.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserComplianceStreamResponseOneOf.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `data` + if (jsonObj.getAsJsonObject("data") != null) { + UserComplianceData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserComplianceStreamResponseOneOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserComplianceStreamResponseOneOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserComplianceStreamResponseOneOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserComplianceStreamResponseOneOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserComplianceStreamResponseOneOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserComplianceStreamResponseOneOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserComplianceStreamResponseOneOf + * @throws IOException if the JSON string is invalid with respect to UserComplianceStreamResponseOneOf + */ + public static UserComplianceStreamResponseOneOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserComplianceStreamResponseOneOf.class); + } + + /** + * Convert an instance of UserComplianceStreamResponseOneOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserDeleteComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserDeleteComplianceSchema.java new file mode 100644 index 0000000..2335642 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserDeleteComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserDeleteComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserDeleteComplianceSchema { + public static final String SERIALIZED_NAME_USER_DELETE = "user_delete"; + @SerializedName(SERIALIZED_NAME_USER_DELETE) + private UserComplianceSchema userDelete; + + public UserDeleteComplianceSchema() { + } + + public UserDeleteComplianceSchema userDelete(UserComplianceSchema userDelete) { + + this.userDelete = userDelete; + return this; + } + + /** + * Get userDelete + * @return userDelete + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchema getUserDelete() { + return userDelete; + } + + + public void setUserDelete(UserComplianceSchema userDelete) { + this.userDelete = userDelete; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDeleteComplianceSchema userDeleteComplianceSchema = (UserDeleteComplianceSchema) o; + return Objects.equals(this.userDelete, userDeleteComplianceSchema.userDelete); + } + + @Override + public int hashCode() { + return Objects.hash(userDelete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDeleteComplianceSchema {\n"); + sb.append(" userDelete: ").append(toIndentedString(userDelete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_delete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_delete"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserDeleteComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserDeleteComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserDeleteComplianceSchema is not found in the empty JSON string", UserDeleteComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserDeleteComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_delete` + if (jsonObj.getAsJsonObject("user_delete") != null) { + UserComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_delete")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDeleteComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDeleteComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserDeleteComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDeleteComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDeleteComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserDeleteComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDeleteComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserDeleteComplianceSchema + */ + public static UserDeleteComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDeleteComplianceSchema.class); + } + + /** + * Convert an instance of UserDeleteComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserProfileModificationComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserProfileModificationComplianceSchema.java new file mode 100644 index 0000000..fb1799e --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserProfileModificationComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserProfileModificationObjectSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserProfileModificationComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserProfileModificationComplianceSchema { + public static final String SERIALIZED_NAME_USER_PROFILE_MODIFICATION = "user_profile_modification"; + @SerializedName(SERIALIZED_NAME_USER_PROFILE_MODIFICATION) + private UserProfileModificationObjectSchema userProfileModification; + + public UserProfileModificationComplianceSchema() { + } + + public UserProfileModificationComplianceSchema userProfileModification(UserProfileModificationObjectSchema userProfileModification) { + + this.userProfileModification = userProfileModification; + return this; + } + + /** + * Get userProfileModification + * @return userProfileModification + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserProfileModificationObjectSchema getUserProfileModification() { + return userProfileModification; + } + + + public void setUserProfileModification(UserProfileModificationObjectSchema userProfileModification) { + this.userProfileModification = userProfileModification; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileModificationComplianceSchema userProfileModificationComplianceSchema = (UserProfileModificationComplianceSchema) o; + return Objects.equals(this.userProfileModification, userProfileModificationComplianceSchema.userProfileModification); + } + + @Override + public int hashCode() { + return Objects.hash(userProfileModification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileModificationComplianceSchema {\n"); + sb.append(" userProfileModification: ").append(toIndentedString(userProfileModification)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_profile_modification"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_profile_modification"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserProfileModificationComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserProfileModificationComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileModificationComplianceSchema is not found in the empty JSON string", UserProfileModificationComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserProfileModificationComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_profile_modification` + if (jsonObj.getAsJsonObject("user_profile_modification") != null) { + UserProfileModificationObjectSchema.validateJsonObject(jsonObj.getAsJsonObject("user_profile_modification")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserProfileModificationComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileModificationComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileModificationComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserProfileModificationComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserProfileModificationComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileModificationComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileModificationComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserProfileModificationComplianceSchema + */ + public static UserProfileModificationComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileModificationComplianceSchema.class); + } + + /** + * Convert an instance of UserProfileModificationComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserProfileModificationObjectSchema.java b/src/main/java/com/twitter/clientlib/model/UserProfileModificationObjectSchema.java new file mode 100644 index 0000000..52203c1 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserProfileModificationObjectSchema.java @@ -0,0 +1,321 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserProfileModificationObjectSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserProfileModificationObjectSchema { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_NEW_VALUE = "new_value"; + @SerializedName(SERIALIZED_NAME_NEW_VALUE) + private String newValue; + + public static final String SERIALIZED_NAME_PROFILE_FIELD = "profile_field"; + @SerializedName(SERIALIZED_NAME_PROFILE_FIELD) + private String profileField; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private UserComplianceSchemaUser user; + + public UserProfileModificationObjectSchema() { + } + + public UserProfileModificationObjectSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public UserProfileModificationObjectSchema newValue(String newValue) { + + this.newValue = newValue; + return this; + } + + /** + * Get newValue + * @return newValue + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getNewValue() { + return newValue; + } + + + public void setNewValue(String newValue) { + this.newValue = newValue; + } + + + public UserProfileModificationObjectSchema profileField(String profileField) { + + this.profileField = profileField; + return this; + } + + /** + * Get profileField + * @return profileField + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getProfileField() { + return profileField; + } + + + public void setProfileField(String profileField) { + this.profileField = profileField; + } + + + public UserProfileModificationObjectSchema user(UserComplianceSchemaUser user) { + + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchemaUser getUser() { + return user; + } + + + public void setUser(UserComplianceSchemaUser user) { + this.user = user; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileModificationObjectSchema userProfileModificationObjectSchema = (UserProfileModificationObjectSchema) o; + return Objects.equals(this.eventAt, userProfileModificationObjectSchema.eventAt) && + Objects.equals(this.newValue, userProfileModificationObjectSchema.newValue) && + Objects.equals(this.profileField, userProfileModificationObjectSchema.profileField) && + Objects.equals(this.user, userProfileModificationObjectSchema.user); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, newValue, profileField, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileModificationObjectSchema {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" newValue: ").append(toIndentedString(newValue)).append("\n"); + sb.append(" profileField: ").append(toIndentedString(profileField)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("new_value"); + openapiFields.add("profile_field"); + openapiFields.add("user"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("new_value"); + openapiRequiredFields.add("profile_field"); + openapiRequiredFields.add("user"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserProfileModificationObjectSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserProfileModificationObjectSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileModificationObjectSchema is not found in the empty JSON string", UserProfileModificationObjectSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserProfileModificationObjectSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("new_value") != null && !jsonObj.get("new_value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `new_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_value").toString())); + } + if (jsonObj.get("profile_field") != null && !jsonObj.get("profile_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `profile_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profile_field").toString())); + } + // validate the optional field `user` + if (jsonObj.getAsJsonObject("user") != null) { + UserComplianceSchemaUser.validateJsonObject(jsonObj.getAsJsonObject("user")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserProfileModificationObjectSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileModificationObjectSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileModificationObjectSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserProfileModificationObjectSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserProfileModificationObjectSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileModificationObjectSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileModificationObjectSchema + * @throws IOException if the JSON string is invalid with respect to UserProfileModificationObjectSchema + */ + public static UserProfileModificationObjectSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileModificationObjectSchema.class); + } + + /** + * Convert an instance of UserProfileModificationObjectSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserProtectComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserProtectComplianceSchema.java new file mode 100644 index 0000000..33e8a38 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserProtectComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserProtectComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserProtectComplianceSchema { + public static final String SERIALIZED_NAME_USER_PROTECT = "user_protect"; + @SerializedName(SERIALIZED_NAME_USER_PROTECT) + private UserComplianceSchema userProtect; + + public UserProtectComplianceSchema() { + } + + public UserProtectComplianceSchema userProtect(UserComplianceSchema userProtect) { + + this.userProtect = userProtect; + return this; + } + + /** + * Get userProtect + * @return userProtect + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchema getUserProtect() { + return userProtect; + } + + + public void setUserProtect(UserComplianceSchema userProtect) { + this.userProtect = userProtect; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProtectComplianceSchema userProtectComplianceSchema = (UserProtectComplianceSchema) o; + return Objects.equals(this.userProtect, userProtectComplianceSchema.userProtect); + } + + @Override + public int hashCode() { + return Objects.hash(userProtect); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProtectComplianceSchema {\n"); + sb.append(" userProtect: ").append(toIndentedString(userProtect)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_protect"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_protect"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserProtectComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserProtectComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserProtectComplianceSchema is not found in the empty JSON string", UserProtectComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserProtectComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_protect` + if (jsonObj.getAsJsonObject("user_protect") != null) { + UserComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_protect")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserProtectComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProtectComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProtectComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserProtectComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserProtectComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProtectComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProtectComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserProtectComplianceSchema + */ + public static UserProtectComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProtectComplianceSchema.class); + } + + /** + * Convert an instance of UserProtectComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserScrubGeoObjectSchema.java b/src/main/java/com/twitter/clientlib/model/UserScrubGeoObjectSchema.java new file mode 100644 index 0000000..53e445f --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserScrubGeoObjectSchema.java @@ -0,0 +1,287 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserScrubGeoObjectSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserScrubGeoObjectSchema { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_UP_TO_TWEET_ID = "up_to_tweet_id"; + @SerializedName(SERIALIZED_NAME_UP_TO_TWEET_ID) + private String upToTweetId; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private UserComplianceSchemaUser user; + + public UserScrubGeoObjectSchema() { + } + + public UserScrubGeoObjectSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public UserScrubGeoObjectSchema upToTweetId(String upToTweetId) { + + this.upToTweetId = upToTweetId; + return this; + } + + /** + * 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. + * @return upToTweetId + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "1346889436626259968", required = true, value = "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.") + + public String getUpToTweetId() { + return upToTweetId; + } + + + public void setUpToTweetId(String upToTweetId) { + this.upToTweetId = upToTweetId; + } + + + public UserScrubGeoObjectSchema user(UserComplianceSchemaUser user) { + + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchemaUser getUser() { + return user; + } + + + public void setUser(UserComplianceSchemaUser user) { + this.user = user; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserScrubGeoObjectSchema userScrubGeoObjectSchema = (UserScrubGeoObjectSchema) o; + return Objects.equals(this.eventAt, userScrubGeoObjectSchema.eventAt) && + Objects.equals(this.upToTweetId, userScrubGeoObjectSchema.upToTweetId) && + Objects.equals(this.user, userScrubGeoObjectSchema.user); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, upToTweetId, user); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserScrubGeoObjectSchema {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" upToTweetId: ").append(toIndentedString(upToTweetId)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("up_to_tweet_id"); + openapiFields.add("user"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("up_to_tweet_id"); + openapiRequiredFields.add("user"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserScrubGeoObjectSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserScrubGeoObjectSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserScrubGeoObjectSchema is not found in the empty JSON string", UserScrubGeoObjectSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserScrubGeoObjectSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("up_to_tweet_id") != null && !jsonObj.get("up_to_tweet_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `up_to_tweet_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("up_to_tweet_id").toString())); + } + // validate the optional field `user` + if (jsonObj.getAsJsonObject("user") != null) { + UserComplianceSchemaUser.validateJsonObject(jsonObj.getAsJsonObject("user")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserScrubGeoObjectSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserScrubGeoObjectSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserScrubGeoObjectSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserScrubGeoObjectSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserScrubGeoObjectSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserScrubGeoObjectSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserScrubGeoObjectSchema + * @throws IOException if the JSON string is invalid with respect to UserScrubGeoObjectSchema + */ + public static UserScrubGeoObjectSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserScrubGeoObjectSchema.class); + } + + /** + * Convert an instance of UserScrubGeoObjectSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserScrubGeoSchema.java b/src/main/java/com/twitter/clientlib/model/UserScrubGeoSchema.java new file mode 100644 index 0000000..232a12d --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserScrubGeoSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserScrubGeoObjectSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserScrubGeoSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserScrubGeoSchema { + public static final String SERIALIZED_NAME_SCRUB_GEO = "scrub_geo"; + @SerializedName(SERIALIZED_NAME_SCRUB_GEO) + private UserScrubGeoObjectSchema scrubGeo; + + public UserScrubGeoSchema() { + } + + public UserScrubGeoSchema scrubGeo(UserScrubGeoObjectSchema scrubGeo) { + + this.scrubGeo = scrubGeo; + return this; + } + + /** + * Get scrubGeo + * @return scrubGeo + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserScrubGeoObjectSchema getScrubGeo() { + return scrubGeo; + } + + + public void setScrubGeo(UserScrubGeoObjectSchema scrubGeo) { + this.scrubGeo = scrubGeo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserScrubGeoSchema userScrubGeoSchema = (UserScrubGeoSchema) o; + return Objects.equals(this.scrubGeo, userScrubGeoSchema.scrubGeo); + } + + @Override + public int hashCode() { + return Objects.hash(scrubGeo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserScrubGeoSchema {\n"); + sb.append(" scrubGeo: ").append(toIndentedString(scrubGeo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("scrub_geo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("scrub_geo"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserScrubGeoSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserScrubGeoSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserScrubGeoSchema is not found in the empty JSON string", UserScrubGeoSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserScrubGeoSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `scrub_geo` + if (jsonObj.getAsJsonObject("scrub_geo") != null) { + UserScrubGeoObjectSchema.validateJsonObject(jsonObj.getAsJsonObject("scrub_geo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserScrubGeoSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserScrubGeoSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserScrubGeoSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserScrubGeoSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserScrubGeoSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserScrubGeoSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserScrubGeoSchema + * @throws IOException if the JSON string is invalid with respect to UserScrubGeoSchema + */ + public static UserScrubGeoSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserScrubGeoSchema.class); + } + + /** + * Convert an instance of UserScrubGeoSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserSuspendComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserSuspendComplianceSchema.java new file mode 100644 index 0000000..5c890b2 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserSuspendComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserSuspendComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserSuspendComplianceSchema { + public static final String SERIALIZED_NAME_USER_SUSPEND = "user_suspend"; + @SerializedName(SERIALIZED_NAME_USER_SUSPEND) + private UserComplianceSchema userSuspend; + + public UserSuspendComplianceSchema() { + } + + public UserSuspendComplianceSchema userSuspend(UserComplianceSchema userSuspend) { + + this.userSuspend = userSuspend; + return this; + } + + /** + * Get userSuspend + * @return userSuspend + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchema getUserSuspend() { + return userSuspend; + } + + + public void setUserSuspend(UserComplianceSchema userSuspend) { + this.userSuspend = userSuspend; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSuspendComplianceSchema userSuspendComplianceSchema = (UserSuspendComplianceSchema) o; + return Objects.equals(this.userSuspend, userSuspendComplianceSchema.userSuspend); + } + + @Override + public int hashCode() { + return Objects.hash(userSuspend); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSuspendComplianceSchema {\n"); + sb.append(" userSuspend: ").append(toIndentedString(userSuspend)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_suspend"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_suspend"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserSuspendComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserSuspendComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserSuspendComplianceSchema is not found in the empty JSON string", UserSuspendComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserSuspendComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_suspend` + if (jsonObj.getAsJsonObject("user_suspend") != null) { + UserComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_suspend")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserSuspendComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserSuspendComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserSuspendComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserSuspendComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserSuspendComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserSuspendComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserSuspendComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserSuspendComplianceSchema + */ + public static UserSuspendComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserSuspendComplianceSchema.class); + } + + /** + * Convert an instance of UserSuspendComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserTakedownComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserTakedownComplianceSchema.java new file mode 100644 index 0000000..270147d --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserTakedownComplianceSchema.java @@ -0,0 +1,295 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserTakedownComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserTakedownComplianceSchema { + public static final String SERIALIZED_NAME_EVENT_AT = "event_at"; + @SerializedName(SERIALIZED_NAME_EVENT_AT) + private OffsetDateTime eventAt; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private UserComplianceSchemaUser user; + + public static final String SERIALIZED_NAME_WITHHELD_IN_COUNTRIES = "withheld_in_countries"; + @SerializedName(SERIALIZED_NAME_WITHHELD_IN_COUNTRIES) + private List withheldInCountries = new ArrayList<>(); + + public UserTakedownComplianceSchema() { + } + + public UserTakedownComplianceSchema eventAt(OffsetDateTime eventAt) { + + this.eventAt = eventAt; + return this; + } + + /** + * Event time. + * @return eventAt + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "2021-07-06T18:40:40Z", required = true, value = "Event time.") + + public OffsetDateTime getEventAt() { + return eventAt; + } + + + public void setEventAt(OffsetDateTime eventAt) { + this.eventAt = eventAt; + } + + + public UserTakedownComplianceSchema user(UserComplianceSchemaUser user) { + + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchemaUser getUser() { + return user; + } + + + public void setUser(UserComplianceSchemaUser user) { + this.user = user; + } + + + public UserTakedownComplianceSchema withheldInCountries(List withheldInCountries) { + + this.withheldInCountries = withheldInCountries; + return this; + } + + public UserTakedownComplianceSchema addWithheldInCountriesItem(String withheldInCountriesItem) { + this.withheldInCountries.add(withheldInCountriesItem); + return this; + } + + /** + * Get withheldInCountries + * @return withheldInCountries + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getWithheldInCountries() { + return withheldInCountries; + } + + + public void setWithheldInCountries(List withheldInCountries) { + this.withheldInCountries = withheldInCountries; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTakedownComplianceSchema userTakedownComplianceSchema = (UserTakedownComplianceSchema) o; + return Objects.equals(this.eventAt, userTakedownComplianceSchema.eventAt) && + Objects.equals(this.user, userTakedownComplianceSchema.user) && + Objects.equals(this.withheldInCountries, userTakedownComplianceSchema.withheldInCountries); + } + + @Override + public int hashCode() { + return Objects.hash(eventAt, user, withheldInCountries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTakedownComplianceSchema {\n"); + sb.append(" eventAt: ").append(toIndentedString(eventAt)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" withheldInCountries: ").append(toIndentedString(withheldInCountries)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("event_at"); + openapiFields.add("user"); + openapiFields.add("withheld_in_countries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("event_at"); + openapiRequiredFields.add("user"); + openapiRequiredFields.add("withheld_in_countries"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserTakedownComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserTakedownComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserTakedownComplianceSchema is not found in the empty JSON string", UserTakedownComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserTakedownComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user` + if (jsonObj.getAsJsonObject("user") != null) { + UserComplianceSchemaUser.validateJsonObject(jsonObj.getAsJsonObject("user")); + } + // ensure the json data is an array + if (jsonObj.get("withheld_in_countries") != null && !jsonObj.get("withheld_in_countries").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `withheld_in_countries` to be an array in the JSON string but got `%s`", jsonObj.get("withheld_in_countries").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserTakedownComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserTakedownComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserTakedownComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserTakedownComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserTakedownComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserTakedownComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserTakedownComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserTakedownComplianceSchema + */ + public static UserTakedownComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserTakedownComplianceSchema.class); + } + + /** + * Convert an instance of UserTakedownComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserUndeleteComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserUndeleteComplianceSchema.java new file mode 100644 index 0000000..c2221b3 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserUndeleteComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserUndeleteComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserUndeleteComplianceSchema { + public static final String SERIALIZED_NAME_USER_UNDELETE = "user_undelete"; + @SerializedName(SERIALIZED_NAME_USER_UNDELETE) + private UserComplianceSchema userUndelete; + + public UserUndeleteComplianceSchema() { + } + + public UserUndeleteComplianceSchema userUndelete(UserComplianceSchema userUndelete) { + + this.userUndelete = userUndelete; + return this; + } + + /** + * Get userUndelete + * @return userUndelete + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchema getUserUndelete() { + return userUndelete; + } + + + public void setUserUndelete(UserComplianceSchema userUndelete) { + this.userUndelete = userUndelete; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUndeleteComplianceSchema userUndeleteComplianceSchema = (UserUndeleteComplianceSchema) o; + return Objects.equals(this.userUndelete, userUndeleteComplianceSchema.userUndelete); + } + + @Override + public int hashCode() { + return Objects.hash(userUndelete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUndeleteComplianceSchema {\n"); + sb.append(" userUndelete: ").append(toIndentedString(userUndelete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_undelete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_undelete"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserUndeleteComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserUndeleteComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserUndeleteComplianceSchema is not found in the empty JSON string", UserUndeleteComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserUndeleteComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_undelete` + if (jsonObj.getAsJsonObject("user_undelete") != null) { + UserComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_undelete")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUndeleteComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUndeleteComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUndeleteComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUndeleteComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUndeleteComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUndeleteComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUndeleteComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserUndeleteComplianceSchema + */ + public static UserUndeleteComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUndeleteComplianceSchema.class); + } + + /** + * Convert an instance of UserUndeleteComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserUnprotectComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserUnprotectComplianceSchema.java new file mode 100644 index 0000000..8752a79 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserUnprotectComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserUnprotectComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserUnprotectComplianceSchema { + public static final String SERIALIZED_NAME_USER_UNPROTECT = "user_unprotect"; + @SerializedName(SERIALIZED_NAME_USER_UNPROTECT) + private UserComplianceSchema userUnprotect; + + public UserUnprotectComplianceSchema() { + } + + public UserUnprotectComplianceSchema userUnprotect(UserComplianceSchema userUnprotect) { + + this.userUnprotect = userUnprotect; + return this; + } + + /** + * Get userUnprotect + * @return userUnprotect + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchema getUserUnprotect() { + return userUnprotect; + } + + + public void setUserUnprotect(UserComplianceSchema userUnprotect) { + this.userUnprotect = userUnprotect; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUnprotectComplianceSchema userUnprotectComplianceSchema = (UserUnprotectComplianceSchema) o; + return Objects.equals(this.userUnprotect, userUnprotectComplianceSchema.userUnprotect); + } + + @Override + public int hashCode() { + return Objects.hash(userUnprotect); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUnprotectComplianceSchema {\n"); + sb.append(" userUnprotect: ").append(toIndentedString(userUnprotect)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_unprotect"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_unprotect"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserUnprotectComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserUnprotectComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserUnprotectComplianceSchema is not found in the empty JSON string", UserUnprotectComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserUnprotectComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_unprotect` + if (jsonObj.getAsJsonObject("user_unprotect") != null) { + UserComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_unprotect")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUnprotectComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUnprotectComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUnprotectComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUnprotectComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUnprotectComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUnprotectComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUnprotectComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserUnprotectComplianceSchema + */ + public static UserUnprotectComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUnprotectComplianceSchema.class); + } + + /** + * Convert an instance of UserUnprotectComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserUnsuspendComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserUnsuspendComplianceSchema.java new file mode 100644 index 0000000..078e6b4 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserUnsuspendComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserUnsuspendComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserUnsuspendComplianceSchema { + public static final String SERIALIZED_NAME_USER_UNSUSPEND = "user_unsuspend"; + @SerializedName(SERIALIZED_NAME_USER_UNSUSPEND) + private UserComplianceSchema userUnsuspend; + + public UserUnsuspendComplianceSchema() { + } + + public UserUnsuspendComplianceSchema userUnsuspend(UserComplianceSchema userUnsuspend) { + + this.userUnsuspend = userUnsuspend; + return this; + } + + /** + * Get userUnsuspend + * @return userUnsuspend + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserComplianceSchema getUserUnsuspend() { + return userUnsuspend; + } + + + public void setUserUnsuspend(UserComplianceSchema userUnsuspend) { + this.userUnsuspend = userUnsuspend; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUnsuspendComplianceSchema userUnsuspendComplianceSchema = (UserUnsuspendComplianceSchema) o; + return Objects.equals(this.userUnsuspend, userUnsuspendComplianceSchema.userUnsuspend); + } + + @Override + public int hashCode() { + return Objects.hash(userUnsuspend); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUnsuspendComplianceSchema {\n"); + sb.append(" userUnsuspend: ").append(toIndentedString(userUnsuspend)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_unsuspend"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_unsuspend"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserUnsuspendComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserUnsuspendComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserUnsuspendComplianceSchema is not found in the empty JSON string", UserUnsuspendComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserUnsuspendComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_unsuspend` + if (jsonObj.getAsJsonObject("user_unsuspend") != null) { + UserComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_unsuspend")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUnsuspendComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUnsuspendComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUnsuspendComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUnsuspendComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUnsuspendComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUnsuspendComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUnsuspendComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserUnsuspendComplianceSchema + */ + public static UserUnsuspendComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUnsuspendComplianceSchema.class); + } + + /** + * Convert an instance of UserUnsuspendComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/twitter/clientlib/model/UserWithheldComplianceSchema.java b/src/main/java/com/twitter/clientlib/model/UserWithheldComplianceSchema.java new file mode 100644 index 0000000..10e0ca1 --- /dev/null +++ b/src/main/java/com/twitter/clientlib/model/UserWithheldComplianceSchema.java @@ -0,0 +1,221 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserTakedownComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.twitter.clientlib.JSON; + +/** + * UserWithheldComplianceSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserWithheldComplianceSchema { + public static final String SERIALIZED_NAME_USER_WITHHELD = "user_withheld"; + @SerializedName(SERIALIZED_NAME_USER_WITHHELD) + private UserTakedownComplianceSchema userWithheld; + + public UserWithheldComplianceSchema() { + } + + public UserWithheldComplianceSchema userWithheld(UserTakedownComplianceSchema userWithheld) { + + this.userWithheld = userWithheld; + return this; + } + + /** + * Get userWithheld + * @return userWithheld + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public UserTakedownComplianceSchema getUserWithheld() { + return userWithheld; + } + + + public void setUserWithheld(UserTakedownComplianceSchema userWithheld) { + this.userWithheld = userWithheld; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserWithheldComplianceSchema userWithheldComplianceSchema = (UserWithheldComplianceSchema) o; + return Objects.equals(this.userWithheld, userWithheldComplianceSchema.userWithheld); + } + + @Override + public int hashCode() { + return Objects.hash(userWithheld); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserWithheldComplianceSchema {\n"); + sb.append(" userWithheld: ").append(toIndentedString(userWithheld)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user_withheld"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user_withheld"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UserWithheldComplianceSchema + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // if (jsonObj == null) { + // if (UserWithheldComplianceSchema.openapiRequiredFields.isEmpty()) { + // return; + // } else { // has required fields + // throw new IllegalArgumentException(String.format("The required field(s) %s in UserWithheldComplianceSchema is not found in the empty JSON string", UserWithheldComplianceSchema.openapiRequiredFields.toString())); + // } + // } + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserWithheldComplianceSchema.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `user_withheld` + if (jsonObj.getAsJsonObject("user_withheld") != null) { + UserTakedownComplianceSchema.validateJsonObject(jsonObj.getAsJsonObject("user_withheld")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserWithheldComplianceSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserWithheldComplianceSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserWithheldComplianceSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserWithheldComplianceSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserWithheldComplianceSchema read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserWithheldComplianceSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserWithheldComplianceSchema + * @throws IOException if the JSON string is invalid with respect to UserWithheldComplianceSchema + */ + public static UserWithheldComplianceSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserWithheldComplianceSchema.class); + } + + /** + * Convert an instance of UserWithheldComplianceSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/test/java/com/twitter/clientlib/api/ComplianceApiTest.java b/src/test/java/com/twitter/clientlib/api/ComplianceApiTest.java index 3e70098..e4290dd 100644 --- a/src/test/java/com/twitter/clientlib/api/ComplianceApiTest.java +++ b/src/test/java/com/twitter/clientlib/api/ComplianceApiTest.java @@ -29,8 +29,11 @@ import com.twitter.clientlib.model.Error; import com.twitter.clientlib.model.Get2ComplianceJobsIdResponse; import com.twitter.clientlib.model.Get2ComplianceJobsResponse; +import java.time.OffsetDateTime; import com.twitter.clientlib.model.Problem; import java.util.Set; +import com.twitter.clientlib.model.TweetComplianceStreamResponse; +import com.twitter.clientlib.model.UserComplianceStreamResponse; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -83,6 +86,50 @@ public void getBatchComplianceJobTest() throws ApiException { } + /** + * Tweets Compliance stream + * + * Streams 100% of compliance data for Tweets + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTweetsComplianceStreamTest() throws ApiException { + Integer backfillMinutes = null; + Integer partition = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + InputStream response = apiInstance.compliance().getTweetsComplianceStream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .execute(); + // TODO: test validations + } + + + /** + * Users Compliance stream + * + * Streams 100% of compliance data for Users + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUsersComplianceStreamTest() throws ApiException { + Integer backfillMinutes = null; + Integer partition = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + InputStream response = apiInstance.compliance().getUsersComplianceStream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .execute(); + // TODO: test validations + } + + /** * List Compliance Jobs * diff --git a/src/test/java/com/twitter/clientlib/api/TweetsApiTest.java b/src/test/java/com/twitter/clientlib/api/TweetsApiTest.java index f5e6893..44e7cd0 100644 --- a/src/test/java/com/twitter/clientlib/api/TweetsApiTest.java +++ b/src/test/java/com/twitter/clientlib/api/TweetsApiTest.java @@ -36,6 +36,7 @@ import com.twitter.clientlib.model.Get2TweetsIdQuoteTweetsResponse; import com.twitter.clientlib.model.Get2TweetsIdResponse; import com.twitter.clientlib.model.Get2TweetsResponse; +import com.twitter.clientlib.model.Get2TweetsSample10StreamResponse; import com.twitter.clientlib.model.Get2TweetsSearchAllResponse; import com.twitter.clientlib.model.Get2TweetsSearchRecentResponse; import com.twitter.clientlib.model.Get2UsersIdLikedTweetsResponse; @@ -237,6 +238,74 @@ public void getRulesTest() throws ApiException { } + /** + * Firehose stream + * + * Streams 100% of public Tweets. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTweetsFirehoseStreamTest() throws ApiException { + Integer backfillMinutes = null; + Integer partition = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + Set tweetFields = null; + Set expansions = null; + Set mediaFields = null; + Set pollFields = null; + Set userFields = null; + Set placeFields = null; + InputStream response = apiInstance.tweets().getTweetsFirehoseStream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .tweetFields(tweetFields) + .expansions(expansions) + .mediaFields(mediaFields) + .pollFields(pollFields) + .userFields(userFields) + .placeFields(placeFields) + .execute(); + // TODO: test validations + } + + + /** + * Sample 10% stream + * + * Streams a deterministic 10% of public Tweets. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTweetsSample10StreamTest() throws ApiException { + Integer backfillMinutes = null; + Integer partition = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; + Set tweetFields = null; + Set expansions = null; + Set mediaFields = null; + Set pollFields = null; + Set userFields = null; + Set placeFields = null; + InputStream response = apiInstance.tweets().getTweetsSample10Stream(partition) + .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) + .tweetFields(tweetFields) + .expansions(expansions) + .mediaFields(mediaFields) + .pollFields(pollFields) + .userFields(userFields) + .placeFields(placeFields) + .execute(); + // TODO: test validations + } + + /** * Hide replies * @@ -326,6 +395,8 @@ public void sampleStreamTest() throws ApiException { @Test public void searchStreamTest() throws ApiException { Integer backfillMinutes = null; + OffsetDateTime startTime = null; + OffsetDateTime endTime = null; Set tweetFields = null; Set expansions = null; Set mediaFields = null; @@ -334,6 +405,8 @@ public void searchStreamTest() throws ApiException { Set placeFields = null; InputStream response = apiInstance.tweets().searchStream() .backfillMinutes(backfillMinutes) + .startTime(startTime) + .endTime(endTime) .tweetFields(tweetFields) .expansions(expansions) .mediaFields(mediaFields) diff --git a/src/test/java/com/twitter/clientlib/api/UsersApiTest.java b/src/test/java/com/twitter/clientlib/api/UsersApiTest.java index 177dac5..112858d 100644 --- a/src/test/java/com/twitter/clientlib/api/UsersApiTest.java +++ b/src/test/java/com/twitter/clientlib/api/UsersApiTest.java @@ -340,9 +340,9 @@ public void usersIdFollowTest() throws ApiException { /** - * Returns User objects that follow a List by the provided User ID + * Followers by User ID * - * Returns a list of Users that follow the provided User ID + * Returns a list of Users who are followers of the specified User ID. * * @throws ApiException if the Api call fails */ diff --git a/src/test/java/com/twitter/clientlib/integration/ApiTweetBearerTester.java b/src/test/java/com/twitter/clientlib/integration/ApiTweetBearerTester.java index afb4467..2849f37 100644 --- a/src/test/java/com/twitter/clientlib/integration/ApiTweetBearerTester.java +++ b/src/test/java/com/twitter/clientlib/integration/ApiTweetBearerTester.java @@ -75,47 +75,18 @@ private AddOrDeleteRulesResponse deleteRule(String ruleStrValue) throws ApiExcep .execute(); } - private void deleteAllRules() throws ApiException { - RulesLookupResponse result = apiInstance.tweets().getRules().execute(); - if(result.getData() != null) { - for(Rule rule : result.getData()) { - AddOrDeleteRulesRequest request = new AddOrDeleteRulesRequest(); - DeleteRulesRequest dr = new DeleteRulesRequest(); - DeleteRulesRequestDelete drd = new DeleteRulesRequestDelete(); - drd.setValues(Arrays.asList(rule.getValue())); - dr.setDelete(drd); - request.setActualInstance(dr); - apiInstance.tweets().addOrDeleteRules(request).dryRun(false).execute(); - } - } - } - @Test + /* @Test public void getRulesAllTest() throws ApiException { - try { - addRule(ruleValue); - RulesLookupResponse result = apiInstance.tweets().getRules().execute(); - assertNotNull(result.getData()); - assertNotNull(result.getData().get(0)); - assertNotNull(result.getData().get(0).getValue()); - assertNotNull(result.getData().get(0).getId()); - assertNotNull(result.getMeta()); - assertNotNull(result.getMeta().getSent()); - assertTrue(result.getMeta().getResultCount() > 0); - } finally { - deleteRule(ruleValue); - } - } - - @Test - public void getRulesNoRulesTest() throws ApiException { - deleteAllRules(); - RulesLookupResponse result = apiInstance.tweets().getRules().execute(); - assertNull(result.getData()); + GetRulesResponse result = apiInstance.tweets().getRules(null, null, null); + assertNotNull(result.getData()); + assertNotNull(result.getData().get(0)); + assertNotNull(result.getData().get(0).getValue()); + assertNotNull(result.getData().get(0).getId()); assertNotNull(result.getMeta()); assertNotNull(result.getMeta().getSent()); - assertEquals(0, result.getMeta().getResultCount()); - } + assertTrue(result.getMeta().getResultCount() > 0); + } */ @Test public void addOrDeleteRulesAddTest() throws ApiException { diff --git a/src/test/java/com/twitter/clientlib/model/Get2TweetsFirehoseStreamResponseTest.java b/src/test/java/com/twitter/clientlib/model/Get2TweetsFirehoseStreamResponseTest.java new file mode 100644 index 0000000..4a1b7a5 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/Get2TweetsFirehoseStreamResponseTest.java @@ -0,0 +1,80 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Expansions; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.Tweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Get2TweetsFirehoseStreamResponse + */ +public class Get2TweetsFirehoseStreamResponseTest { + private final Get2TweetsFirehoseStreamResponse model = new Get2TweetsFirehoseStreamResponse(); + + /** + * Model tests for Get2TweetsFirehoseStreamResponse + */ + @Test + public void testGet2TweetsFirehoseStreamResponse() { + // TODO: test Get2TweetsFirehoseStreamResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + + /** + * Test the property 'includes' + */ + @Test + public void includesTest() { + // TODO: test includes + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/Get2TweetsSample10StreamResponseTest.java b/src/test/java/com/twitter/clientlib/model/Get2TweetsSample10StreamResponseTest.java new file mode 100644 index 0000000..9e32047 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/Get2TweetsSample10StreamResponseTest.java @@ -0,0 +1,80 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Expansions; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.Tweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Get2TweetsSample10StreamResponse + */ +public class Get2TweetsSample10StreamResponseTest { + private final Get2TweetsSample10StreamResponse model = new Get2TweetsSample10StreamResponse(); + + /** + * Model tests for Get2TweetsSample10StreamResponse + */ + @Test + public void testGet2TweetsSample10StreamResponse() { + // TODO: test Get2TweetsSample10StreamResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + + /** + * Test the property 'includes' + */ + @Test + public void includesTest() { + // TODO: test includes + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetComplianceDataTest.java b/src/test/java/com/twitter/clientlib/model/TweetComplianceDataTest.java new file mode 100644 index 0000000..928b85c --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetComplianceDataTest.java @@ -0,0 +1,99 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import com.twitter.clientlib.model.TweetDeleteComplianceSchema; +import com.twitter.clientlib.model.TweetDropComplianceSchema; +import com.twitter.clientlib.model.TweetEditComplianceObjectSchema; +import com.twitter.clientlib.model.TweetEditComplianceSchema; +import com.twitter.clientlib.model.TweetTakedownComplianceSchema; +import com.twitter.clientlib.model.TweetUndropComplianceSchema; +import com.twitter.clientlib.model.TweetWithheldComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetComplianceData + */ +public class TweetComplianceDataTest { + private final TweetComplianceData model = new TweetComplianceData(); + + /** + * Model tests for TweetComplianceData + */ + @Test + public void testTweetComplianceData() { + // TODO: test TweetComplianceData + } + + /** + * Test the property 'delete' + */ + @Test + public void deleteTest() { + // TODO: test delete + } + + /** + * Test the property 'withheld' + */ + @Test + public void withheldTest() { + // TODO: test withheld + } + + /** + * Test the property 'drop' + */ + @Test + public void dropTest() { + // TODO: test drop + } + + /** + * Test the property 'undrop' + */ + @Test + public void undropTest() { + // TODO: test undrop + } + + /** + * Test the property 'tweetEdit' + */ + @Test + public void tweetEditTest() { + // TODO: test tweetEdit + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetComplianceSchemaTest.java new file mode 100644 index 0000000..728ff94 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetComplianceSchemaTest.java @@ -0,0 +1,77 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchemaTweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetComplianceSchema + */ +public class TweetComplianceSchemaTest { + private final TweetComplianceSchema model = new TweetComplianceSchema(); + + /** + * Model tests for TweetComplianceSchema + */ + @Test + public void testTweetComplianceSchema() { + // TODO: test TweetComplianceSchema + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'quoteTweetId' + */ + @Test + public void quoteTweetIdTest() { + // TODO: test quoteTweetId + } + + /** + * Test the property 'tweet' + */ + @Test + public void tweetTest() { + // TODO: test tweet + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetComplianceSchemaTweetTest.java b/src/test/java/com/twitter/clientlib/model/TweetComplianceSchemaTweetTest.java new file mode 100644 index 0000000..7b3255b --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetComplianceSchemaTweetTest.java @@ -0,0 +1,67 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetComplianceSchemaTweet + */ +public class TweetComplianceSchemaTweetTest { + private final TweetComplianceSchemaTweet model = new TweetComplianceSchemaTweet(); + + /** + * Model tests for TweetComplianceSchemaTweet + */ + @Test + public void testTweetComplianceSchemaTweet() { + // TODO: test TweetComplianceSchemaTweet + } + + /** + * Test the property 'authorId' + */ + @Test + public void authorIdTest() { + // TODO: test authorId + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf1Test.java b/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf1Test.java new file mode 100644 index 0000000..c6ffdcd --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOf1Test.java @@ -0,0 +1,62 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Problem; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetComplianceStreamResponseOneOf1 + */ +public class TweetComplianceStreamResponseOneOf1Test { + private final TweetComplianceStreamResponseOneOf1 model = new TweetComplianceStreamResponseOneOf1(); + + /** + * Model tests for TweetComplianceStreamResponseOneOf1 + */ + @Test + public void testTweetComplianceStreamResponseOneOf1() { + // TODO: test TweetComplianceStreamResponseOneOf1 + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOfTest.java b/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOfTest.java new file mode 100644 index 0000000..2c31e7f --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseOneOfTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceData; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetComplianceStreamResponseOneOf + */ +public class TweetComplianceStreamResponseOneOfTest { + private final TweetComplianceStreamResponseOneOf model = new TweetComplianceStreamResponseOneOf(); + + /** + * Model tests for TweetComplianceStreamResponseOneOf + */ + @Test + public void testTweetComplianceStreamResponseOneOf() { + // TODO: test TweetComplianceStreamResponseOneOf + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseTest.java b/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseTest.java new file mode 100644 index 0000000..66a758b --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetComplianceStreamResponseTest.java @@ -0,0 +1,73 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.TweetComplianceData; +import com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf; +import com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf1; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetComplianceStreamResponse + */ +public class TweetComplianceStreamResponseTest { + private final TweetComplianceStreamResponse model = new TweetComplianceStreamResponse(); + + /** + * Model tests for TweetComplianceStreamResponse + */ + @Test + public void testTweetComplianceStreamResponse() { + // TODO: test TweetComplianceStreamResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetDeleteComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetDeleteComplianceSchemaTest.java new file mode 100644 index 0000000..6d946af --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetDeleteComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetDeleteComplianceSchema + */ +public class TweetDeleteComplianceSchemaTest { + private final TweetDeleteComplianceSchema model = new TweetDeleteComplianceSchema(); + + /** + * Model tests for TweetDeleteComplianceSchema + */ + @Test + public void testTweetDeleteComplianceSchema() { + // TODO: test TweetDeleteComplianceSchema + } + + /** + * Test the property 'delete' + */ + @Test + public void deleteTest() { + // TODO: test delete + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetDropComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetDropComplianceSchemaTest.java new file mode 100644 index 0000000..0767b5f --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetDropComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetDropComplianceSchema + */ +public class TweetDropComplianceSchemaTest { + private final TweetDropComplianceSchema model = new TweetDropComplianceSchema(); + + /** + * Model tests for TweetDropComplianceSchema + */ + @Test + public void testTweetDropComplianceSchema() { + // TODO: test TweetDropComplianceSchema + } + + /** + * Test the property 'drop' + */ + @Test + public void dropTest() { + // TODO: test drop + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTest.java new file mode 100644 index 0000000..363571f --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTest.java @@ -0,0 +1,87 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetEditComplianceObjectSchemaTweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetEditComplianceObjectSchema + */ +public class TweetEditComplianceObjectSchemaTest { + private final TweetEditComplianceObjectSchema model = new TweetEditComplianceObjectSchema(); + + /** + * Model tests for TweetEditComplianceObjectSchema + */ + @Test + public void testTweetEditComplianceObjectSchema() { + // TODO: test TweetEditComplianceObjectSchema + } + + /** + * Test the property 'editTweetIds' + */ + @Test + public void editTweetIdsTest() { + // TODO: test editTweetIds + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'initialTweetId' + */ + @Test + public void initialTweetIdTest() { + // TODO: test initialTweetId + } + + /** + * Test the property 'tweet' + */ + @Test + public void tweetTest() { + // TODO: test tweet + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTweetTest.java b/src/test/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTweetTest.java new file mode 100644 index 0000000..f015b91 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetEditComplianceObjectSchemaTweetTest.java @@ -0,0 +1,59 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetEditComplianceObjectSchemaTweet + */ +public class TweetEditComplianceObjectSchemaTweetTest { + private final TweetEditComplianceObjectSchemaTweet model = new TweetEditComplianceObjectSchemaTweet(); + + /** + * Model tests for TweetEditComplianceObjectSchemaTweet + */ + @Test + public void testTweetEditComplianceObjectSchemaTweet() { + // TODO: test TweetEditComplianceObjectSchemaTweet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetEditComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetEditComplianceSchemaTest.java new file mode 100644 index 0000000..24767c7 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetEditComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetEditComplianceObjectSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetEditComplianceSchema + */ +public class TweetEditComplianceSchemaTest { + private final TweetEditComplianceSchema model = new TweetEditComplianceSchema(); + + /** + * Model tests for TweetEditComplianceSchema + */ + @Test + public void testTweetEditComplianceSchema() { + // TODO: test TweetEditComplianceSchema + } + + /** + * Test the property 'tweetEdit' + */ + @Test + public void tweetEditTest() { + // TODO: test tweetEdit + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetEditControlsTest.java b/src/test/java/com/twitter/clientlib/model/TweetEditControlsTest.java new file mode 100644 index 0000000..ef77a65 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetEditControlsTest.java @@ -0,0 +1,76 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetEditControls + */ +public class TweetEditControlsTest { + private final TweetEditControls model = new TweetEditControls(); + + /** + * Model tests for TweetEditControls + */ + @Test + public void testTweetEditControls() { + // TODO: test TweetEditControls + } + + /** + * Test the property 'editableUntil' + */ + @Test + public void editableUntilTest() { + // TODO: test editableUntil + } + + /** + * Test the property 'editsRemaining' + */ + @Test + public void editsRemainingTest() { + // TODO: test editsRemaining + } + + /** + * Test the property 'isEditEligible' + */ + @Test + public void isEditEligibleTest() { + // TODO: test isEditEligible + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetTakedownComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetTakedownComplianceSchemaTest.java new file mode 100644 index 0000000..127912f --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetTakedownComplianceSchemaTest.java @@ -0,0 +1,87 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchemaTweet; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetTakedownComplianceSchema + */ +public class TweetTakedownComplianceSchemaTest { + private final TweetTakedownComplianceSchema model = new TweetTakedownComplianceSchema(); + + /** + * Model tests for TweetTakedownComplianceSchema + */ + @Test + public void testTweetTakedownComplianceSchema() { + // TODO: test TweetTakedownComplianceSchema + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'quoteTweetId' + */ + @Test + public void quoteTweetIdTest() { + // TODO: test quoteTweetId + } + + /** + * Test the property 'tweet' + */ + @Test + public void tweetTest() { + // TODO: test tweet + } + + /** + * Test the property 'withheldInCountries' + */ + @Test + public void withheldInCountriesTest() { + // TODO: test withheldInCountries + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetTest.java b/src/test/java/com/twitter/clientlib/model/TweetTest.java index aa5c0ca..586e708 100644 --- a/src/test/java/com/twitter/clientlib/model/TweetTest.java +++ b/src/test/java/com/twitter/clientlib/model/TweetTest.java @@ -31,6 +31,7 @@ import com.twitter.clientlib.model.FullTextEntities; import com.twitter.clientlib.model.ReplySettings; import com.twitter.clientlib.model.TweetAttachments; +import com.twitter.clientlib.model.TweetEditControls; import com.twitter.clientlib.model.TweetGeo; import com.twitter.clientlib.model.TweetNonPublicMetrics; import com.twitter.clientlib.model.TweetOrganicMetrics; @@ -102,6 +103,22 @@ public void createdAtTest() { // TODO: test createdAt } + /** + * Test the property 'editControls' + */ + @Test + public void editControlsTest() { + // TODO: test editControls + } + + /** + * Test the property 'editHistoryTweetIds' + */ + @Test + public void editHistoryTweetIdsTest() { + // TODO: test editHistoryTweetIds + } + /** * Test the property 'entities' */ diff --git a/src/test/java/com/twitter/clientlib/model/TweetUndropComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetUndropComplianceSchemaTest.java new file mode 100644 index 0000000..6d2ae2e --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetUndropComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetUndropComplianceSchema + */ +public class TweetUndropComplianceSchemaTest { + private final TweetUndropComplianceSchema model = new TweetUndropComplianceSchema(); + + /** + * Model tests for TweetUndropComplianceSchema + */ + @Test + public void testTweetUndropComplianceSchema() { + // TODO: test TweetUndropComplianceSchema + } + + /** + * Test the property 'undrop' + */ + @Test + public void undropTest() { + // TODO: test undrop + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/TweetWithheldComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/TweetWithheldComplianceSchemaTest.java new file mode 100644 index 0000000..4e541fd --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/TweetWithheldComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.TweetTakedownComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TweetWithheldComplianceSchema + */ +public class TweetWithheldComplianceSchemaTest { + private final TweetWithheldComplianceSchema model = new TweetWithheldComplianceSchema(); + + /** + * Model tests for TweetWithheldComplianceSchema + */ + @Test + public void testTweetWithheldComplianceSchema() { + // TODO: test TweetWithheldComplianceSchema + } + + /** + * Test the property 'withheld' + */ + @Test + public void withheldTest() { + // TODO: test withheld + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserComplianceDataTest.java b/src/test/java/com/twitter/clientlib/model/UserComplianceDataTest.java new file mode 100644 index 0000000..8f324d4 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserComplianceDataTest.java @@ -0,0 +1,136 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import com.twitter.clientlib.model.UserDeleteComplianceSchema; +import com.twitter.clientlib.model.UserProfileModificationComplianceSchema; +import com.twitter.clientlib.model.UserProfileModificationObjectSchema; +import com.twitter.clientlib.model.UserProtectComplianceSchema; +import com.twitter.clientlib.model.UserScrubGeoObjectSchema; +import com.twitter.clientlib.model.UserScrubGeoSchema; +import com.twitter.clientlib.model.UserSuspendComplianceSchema; +import com.twitter.clientlib.model.UserTakedownComplianceSchema; +import com.twitter.clientlib.model.UserUndeleteComplianceSchema; +import com.twitter.clientlib.model.UserUnprotectComplianceSchema; +import com.twitter.clientlib.model.UserUnsuspendComplianceSchema; +import com.twitter.clientlib.model.UserWithheldComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserComplianceData + */ +public class UserComplianceDataTest { + private final UserComplianceData model = new UserComplianceData(); + + /** + * Model tests for UserComplianceData + */ + @Test + public void testUserComplianceData() { + // TODO: test UserComplianceData + } + + /** + * Test the property 'userProtect' + */ + @Test + public void userProtectTest() { + // TODO: test userProtect + } + + /** + * Test the property 'userUnprotect' + */ + @Test + public void userUnprotectTest() { + // TODO: test userUnprotect + } + + /** + * Test the property 'userDelete' + */ + @Test + public void userDeleteTest() { + // TODO: test userDelete + } + + /** + * Test the property 'userUndelete' + */ + @Test + public void userUndeleteTest() { + // TODO: test userUndelete + } + + /** + * Test the property 'userSuspend' + */ + @Test + public void userSuspendTest() { + // TODO: test userSuspend + } + + /** + * Test the property 'userUnsuspend' + */ + @Test + public void userUnsuspendTest() { + // TODO: test userUnsuspend + } + + /** + * Test the property 'userWithheld' + */ + @Test + public void userWithheldTest() { + // TODO: test userWithheld + } + + /** + * Test the property 'scrubGeo' + */ + @Test + public void scrubGeoTest() { + // TODO: test scrubGeo + } + + /** + * Test the property 'userProfileModification' + */ + @Test + public void userProfileModificationTest() { + // TODO: test userProfileModification + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserComplianceSchemaTest.java new file mode 100644 index 0000000..81d8b0e --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserComplianceSchemaTest.java @@ -0,0 +1,69 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserComplianceSchema + */ +public class UserComplianceSchemaTest { + private final UserComplianceSchema model = new UserComplianceSchema(); + + /** + * Model tests for UserComplianceSchema + */ + @Test + public void testUserComplianceSchema() { + // TODO: test UserComplianceSchema + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'user' + */ + @Test + public void userTest() { + // TODO: test user + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserComplianceSchemaUserTest.java b/src/test/java/com/twitter/clientlib/model/UserComplianceSchemaUserTest.java new file mode 100644 index 0000000..30ad7e1 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserComplianceSchemaUserTest.java @@ -0,0 +1,59 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserComplianceSchemaUser + */ +public class UserComplianceSchemaUserTest { + private final UserComplianceSchemaUser model = new UserComplianceSchemaUser(); + + /** + * Model tests for UserComplianceSchemaUser + */ + @Test + public void testUserComplianceSchemaUser() { + // TODO: test UserComplianceSchemaUser + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserComplianceStreamResponseOneOfTest.java b/src/test/java/com/twitter/clientlib/model/UserComplianceStreamResponseOneOfTest.java new file mode 100644 index 0000000..3f6140a --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserComplianceStreamResponseOneOfTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceData; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserComplianceStreamResponseOneOf + */ +public class UserComplianceStreamResponseOneOfTest { + private final UserComplianceStreamResponseOneOf model = new UserComplianceStreamResponseOneOf(); + + /** + * Model tests for UserComplianceStreamResponseOneOf + */ + @Test + public void testUserComplianceStreamResponseOneOf() { + // TODO: test UserComplianceStreamResponseOneOf + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserComplianceStreamResponseTest.java b/src/test/java/com/twitter/clientlib/model/UserComplianceStreamResponseTest.java new file mode 100644 index 0000000..0e3189f --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserComplianceStreamResponseTest.java @@ -0,0 +1,73 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.Problem; +import com.twitter.clientlib.model.TweetComplianceStreamResponseOneOf1; +import com.twitter.clientlib.model.UserComplianceData; +import com.twitter.clientlib.model.UserComplianceStreamResponseOneOf; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserComplianceStreamResponse + */ +public class UserComplianceStreamResponseTest { + private final UserComplianceStreamResponse model = new UserComplianceStreamResponse(); + + /** + * Model tests for UserComplianceStreamResponse + */ + @Test + public void testUserComplianceStreamResponse() { + // TODO: test UserComplianceStreamResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserDeleteComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserDeleteComplianceSchemaTest.java new file mode 100644 index 0000000..8b3ee54 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserDeleteComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserDeleteComplianceSchema + */ +public class UserDeleteComplianceSchemaTest { + private final UserDeleteComplianceSchema model = new UserDeleteComplianceSchema(); + + /** + * Model tests for UserDeleteComplianceSchema + */ + @Test + public void testUserDeleteComplianceSchema() { + // TODO: test UserDeleteComplianceSchema + } + + /** + * Test the property 'userDelete' + */ + @Test + public void userDeleteTest() { + // TODO: test userDelete + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserProfileModificationComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserProfileModificationComplianceSchemaTest.java new file mode 100644 index 0000000..7128601 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserProfileModificationComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserProfileModificationObjectSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserProfileModificationComplianceSchema + */ +public class UserProfileModificationComplianceSchemaTest { + private final UserProfileModificationComplianceSchema model = new UserProfileModificationComplianceSchema(); + + /** + * Model tests for UserProfileModificationComplianceSchema + */ + @Test + public void testUserProfileModificationComplianceSchema() { + // TODO: test UserProfileModificationComplianceSchema + } + + /** + * Test the property 'userProfileModification' + */ + @Test + public void userProfileModificationTest() { + // TODO: test userProfileModification + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserProfileModificationObjectSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserProfileModificationObjectSchemaTest.java new file mode 100644 index 0000000..4ab858a --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserProfileModificationObjectSchemaTest.java @@ -0,0 +1,85 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserProfileModificationObjectSchema + */ +public class UserProfileModificationObjectSchemaTest { + private final UserProfileModificationObjectSchema model = new UserProfileModificationObjectSchema(); + + /** + * Model tests for UserProfileModificationObjectSchema + */ + @Test + public void testUserProfileModificationObjectSchema() { + // TODO: test UserProfileModificationObjectSchema + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'newValue' + */ + @Test + public void newValueTest() { + // TODO: test newValue + } + + /** + * Test the property 'profileField' + */ + @Test + public void profileFieldTest() { + // TODO: test profileField + } + + /** + * Test the property 'user' + */ + @Test + public void userTest() { + // TODO: test user + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserProtectComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserProtectComplianceSchemaTest.java new file mode 100644 index 0000000..c35853f --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserProtectComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserProtectComplianceSchema + */ +public class UserProtectComplianceSchemaTest { + private final UserProtectComplianceSchema model = new UserProtectComplianceSchema(); + + /** + * Model tests for UserProtectComplianceSchema + */ + @Test + public void testUserProtectComplianceSchema() { + // TODO: test UserProtectComplianceSchema + } + + /** + * Test the property 'userProtect' + */ + @Test + public void userProtectTest() { + // TODO: test userProtect + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserScrubGeoObjectSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserScrubGeoObjectSchemaTest.java new file mode 100644 index 0000000..0ebdf47 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserScrubGeoObjectSchemaTest.java @@ -0,0 +1,77 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserScrubGeoObjectSchema + */ +public class UserScrubGeoObjectSchemaTest { + private final UserScrubGeoObjectSchema model = new UserScrubGeoObjectSchema(); + + /** + * Model tests for UserScrubGeoObjectSchema + */ + @Test + public void testUserScrubGeoObjectSchema() { + // TODO: test UserScrubGeoObjectSchema + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'upToTweetId' + */ + @Test + public void upToTweetIdTest() { + // TODO: test upToTweetId + } + + /** + * Test the property 'user' + */ + @Test + public void userTest() { + // TODO: test user + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserScrubGeoSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserScrubGeoSchemaTest.java new file mode 100644 index 0000000..962b3ab --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserScrubGeoSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserScrubGeoObjectSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserScrubGeoSchema + */ +public class UserScrubGeoSchemaTest { + private final UserScrubGeoSchema model = new UserScrubGeoSchema(); + + /** + * Model tests for UserScrubGeoSchema + */ + @Test + public void testUserScrubGeoSchema() { + // TODO: test UserScrubGeoSchema + } + + /** + * Test the property 'scrubGeo' + */ + @Test + public void scrubGeoTest() { + // TODO: test scrubGeo + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserSuspendComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserSuspendComplianceSchemaTest.java new file mode 100644 index 0000000..a493f0c --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserSuspendComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserSuspendComplianceSchema + */ +public class UserSuspendComplianceSchemaTest { + private final UserSuspendComplianceSchema model = new UserSuspendComplianceSchema(); + + /** + * Model tests for UserSuspendComplianceSchema + */ + @Test + public void testUserSuspendComplianceSchema() { + // TODO: test UserSuspendComplianceSchema + } + + /** + * Test the property 'userSuspend' + */ + @Test + public void userSuspendTest() { + // TODO: test userSuspend + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserTakedownComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserTakedownComplianceSchemaTest.java new file mode 100644 index 0000000..bc710d7 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserTakedownComplianceSchemaTest.java @@ -0,0 +1,79 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchemaUser; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserTakedownComplianceSchema + */ +public class UserTakedownComplianceSchemaTest { + private final UserTakedownComplianceSchema model = new UserTakedownComplianceSchema(); + + /** + * Model tests for UserTakedownComplianceSchema + */ + @Test + public void testUserTakedownComplianceSchema() { + // TODO: test UserTakedownComplianceSchema + } + + /** + * Test the property 'eventAt' + */ + @Test + public void eventAtTest() { + // TODO: test eventAt + } + + /** + * Test the property 'user' + */ + @Test + public void userTest() { + // TODO: test user + } + + /** + * Test the property 'withheldInCountries' + */ + @Test + public void withheldInCountriesTest() { + // TODO: test withheldInCountries + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserUndeleteComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserUndeleteComplianceSchemaTest.java new file mode 100644 index 0000000..24b7d64 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserUndeleteComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserUndeleteComplianceSchema + */ +public class UserUndeleteComplianceSchemaTest { + private final UserUndeleteComplianceSchema model = new UserUndeleteComplianceSchema(); + + /** + * Model tests for UserUndeleteComplianceSchema + */ + @Test + public void testUserUndeleteComplianceSchema() { + // TODO: test UserUndeleteComplianceSchema + } + + /** + * Test the property 'userUndelete' + */ + @Test + public void userUndeleteTest() { + // TODO: test userUndelete + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserUnprotectComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserUnprotectComplianceSchemaTest.java new file mode 100644 index 0000000..47590d2 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserUnprotectComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserUnprotectComplianceSchema + */ +public class UserUnprotectComplianceSchemaTest { + private final UserUnprotectComplianceSchema model = new UserUnprotectComplianceSchema(); + + /** + * Model tests for UserUnprotectComplianceSchema + */ + @Test + public void testUserUnprotectComplianceSchema() { + // TODO: test UserUnprotectComplianceSchema + } + + /** + * Test the property 'userUnprotect' + */ + @Test + public void userUnprotectTest() { + // TODO: test userUnprotect + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserUnsuspendComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserUnsuspendComplianceSchemaTest.java new file mode 100644 index 0000000..da70c25 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserUnsuspendComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserUnsuspendComplianceSchema + */ +public class UserUnsuspendComplianceSchemaTest { + private final UserUnsuspendComplianceSchema model = new UserUnsuspendComplianceSchema(); + + /** + * Model tests for UserUnsuspendComplianceSchema + */ + @Test + public void testUserUnsuspendComplianceSchema() { + // TODO: test UserUnsuspendComplianceSchema + } + + /** + * Test the property 'userUnsuspend' + */ + @Test + public void userUnsuspendTest() { + // TODO: test userUnsuspend + } + +} diff --git a/src/test/java/com/twitter/clientlib/model/UserWithheldComplianceSchemaTest.java b/src/test/java/com/twitter/clientlib/model/UserWithheldComplianceSchemaTest.java new file mode 100644 index 0000000..b7687d8 --- /dev/null +++ b/src/test/java/com/twitter/clientlib/model/UserWithheldComplianceSchemaTest.java @@ -0,0 +1,60 @@ +/* +Copyright 2020 Twitter, Inc. +SPDX-License-Identifier: Apache-2.0 + +Licensed 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. + +NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +https://openapi-generator.tech +Do not edit the class manually. +*/ + + +package com.twitter.clientlib.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.twitter.clientlib.model.UserTakedownComplianceSchema; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for UserWithheldComplianceSchema + */ +public class UserWithheldComplianceSchemaTest { + private final UserWithheldComplianceSchema model = new UserWithheldComplianceSchema(); + + /** + * Model tests for UserWithheldComplianceSchema + */ + @Test + public void testUserWithheldComplianceSchema() { + // TODO: test UserWithheldComplianceSchema + } + + /** + * Test the property 'userWithheld' + */ + @Test + public void userWithheldTest() { + // TODO: test userWithheld + } + +}