diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 10f3091..6b7b74c 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.2.0"
+ ".": "0.3.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 58aca93..db87955 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-3b2c6c771ad1da0bbfeb0af115972929ed2c7fcd5e47a79556d66cd21431b224.yml
-openapi_spec_hash: de2890233b68387bf5f9b6d19e7d87dc
-config_hash: 8894c96caeb6df84c9394518810221bd
+configured_endpoints: 117
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-d40c57a05527faf060d21c0e013729f371d88017b10680cea7c8fd6780ffaef5.yml
+openapi_spec_hash: 597ebc460cf86740b9f6f7c95478dece
+config_hash: 30ce23c9cfbf8fb8be9e5dd28a2124fa
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2239e78..8ee5e83 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,25 @@
# Changelog
+## 0.3.0 (2026-04-08)
+
+Full Changelog: [v0.2.0...v0.3.0](https://github.com/Xquik-dev/x-twitter-scraper-java/compare/v0.2.0...v0.3.0)
+
+### Features
+
+* **api:** api update ([c190c61](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/c190c61c7ec6d8edd03874f8bcaac3ca9bce5fae))
+* **api:** api update ([d3ad9b3](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/d3ad9b3b176efa1edd42d9500965287b714acef5))
+* **api:** api update ([91fe731](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/91fe7314ce8e6e9db863a4bc4863333ffb94fc5c))
+* **api:** api update ([85f6788](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/85f67881300bb5cdb912fe7c59edcd0af640a14f))
+* **api:** api update ([d4be9ff](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/d4be9ff16190320b7cdaffae495057ee2ceda50c))
+* **api:** api update ([f8f5138](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/f8f51380d7cb3d07a0be410e69492edf9fba07cc))
+* **api:** api update ([be5b4f9](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/be5b4f9f89ea2e7606d57cb7f0ea809c17c4096f))
+* **api:** api update ([a4e0acd](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/a4e0acdd9e95507a2d69d05b50c5b8c114c7cd0b))
+
+
+### Chores
+
+* update SDK settings ([0a6a774](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/0a6a774604e8868c1a286b2235433829a46ebe92))
+
## 0.2.0 (2026-04-01)
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Xquik-dev/x-twitter-scraper-java/compare/v0.1.0...v0.2.0)
diff --git a/README.md b/README.md
index 39d4d2e..c3a3578 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0)
-[](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0)
+[](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)
+[](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)
@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-The REST API documentation can be found on [xquik.com](https://xquik.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0).
+The REST API documentation can be found on [xquik.com](https://xquik.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0).
@@ -26,7 +26,7 @@ The REST API documentation can be found on [xquik.com](https://xquik.com). Javad
### Gradle
```kotlin
-implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.2.0")
+implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.3.0")
```
### Maven
@@ -35,7 +35,7 @@ implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.2.0")
com.x_twitter_scraper.api
x-twitter-scraper-java
- 0.2.0
+ 0.3.0
```
@@ -50,8 +50,8 @@ This library requires Java 8 or later.
```java
import com.x_twitter_scraper.api.client.XTwitterScraperClient;
import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams;
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
// Configures using the `xtwitterscraper.apiKey`, `xtwitterscraper.bearerToken` and `xtwitterscraper.baseUrl` system properties
// Or configures using the `X_TWITTER_SCRAPER_API_KEY`, `X_TWITTER_SCRAPER_BEARER_TOKEN` and `X_TWITTER_SCRAPER_BASE_URL` environment variables
@@ -61,7 +61,7 @@ TweetSearchParams params = TweetSearchParams.builder()
.q("from:elonmusk")
.limit(10L)
.build();
-TweetSearchResponse response = client.x().tweets().search(params);
+PaginatedTweets paginatedTweets = client.x().tweets().search(params);
```
## Client configuration
@@ -136,7 +136,7 @@ The `withOptions()` method does not affect the original client or service.
To send a request to the X Twitter Scraper API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.
-For example, `client.x().tweets().search(...)` should be called with an instance of `TweetSearchParams`, and it will return an instance of `TweetSearchResponse`.
+For example, `client.x().tweets().search(...)` should be called with an instance of `TweetSearchParams`, and it will return an instance of `PaginatedTweets`.
## Immutability
@@ -153,8 +153,8 @@ The default client is synchronous. To switch to asynchronous execution, call the
```java
import com.x_twitter_scraper.api.client.XTwitterScraperClient;
import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams;
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
import java.util.concurrent.CompletableFuture;
// Configures using the `xtwitterscraper.apiKey`, `xtwitterscraper.bearerToken` and `xtwitterscraper.baseUrl` system properties
@@ -165,7 +165,7 @@ TweetSearchParams params = TweetSearchParams.builder()
.q("from:elonmusk")
.limit(10L)
.build();
-CompletableFuture response = client.async().x().tweets().search(params);
+CompletableFuture paginatedTweets = client.async().x().tweets().search(params);
```
Or create an asynchronous client from the beginning:
@@ -173,8 +173,8 @@ Or create an asynchronous client from the beginning:
```java
import com.x_twitter_scraper.api.client.XTwitterScraperClientAsync;
import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClientAsync;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams;
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
import java.util.concurrent.CompletableFuture;
// Configures using the `xtwitterscraper.apiKey`, `xtwitterscraper.bearerToken` and `xtwitterscraper.baseUrl` system properties
@@ -185,7 +185,7 @@ TweetSearchParams params = TweetSearchParams.builder()
.q("from:elonmusk")
.limit(10L)
.build();
-CompletableFuture response = client.x().tweets().search(params);
+CompletableFuture paginatedTweets = client.x().tweets().search(params);
```
The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.
@@ -202,7 +202,7 @@ import com.x_twitter_scraper.api.models.x.media.MediaUploadResponse;
import java.nio.file.Paths;
MediaUploadParams params = MediaUploadParams.builder()
- .account("account")
+ .account("@elonmusk")
.file(Paths.get("/path/to/file"))
.build();
MediaUploadResponse response = client.x().media().upload(params);
@@ -216,7 +216,7 @@ import com.x_twitter_scraper.api.models.x.media.MediaUploadResponse;
import java.net.URL;
MediaUploadParams params = MediaUploadParams.builder()
- .account("account")
+ .account("@elonmusk")
.file(new URL("https://example.com//path/to/file").openStream())
.build();
MediaUploadResponse response = client.x().media().upload(params);
@@ -229,7 +229,7 @@ import com.x_twitter_scraper.api.models.x.media.MediaUploadParams;
import com.x_twitter_scraper.api.models.x.media.MediaUploadResponse;
MediaUploadParams params = MediaUploadParams.builder()
- .account("account")
+ .account("@elonmusk")
.file("content".getBytes())
.build();
MediaUploadResponse response = client.x().media().upload(params);
@@ -245,7 +245,7 @@ import java.io.InputStream;
import java.net.URL;
MediaUploadParams params = MediaUploadParams.builder()
- .account("account")
+ .account("@elonmusk")
.file(MultipartField.builder()
.value(new URL("https://example.com//path/to/file").openStream())
.filename("/path/to/file")
@@ -311,25 +311,25 @@ To access this data, prefix any HTTP method call on a client or service with `wi
```java
import com.x_twitter_scraper.api.core.http.Headers;
import com.x_twitter_scraper.api.core.http.HttpResponseFor;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams;
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
TweetSearchParams params = TweetSearchParams.builder()
.q("from:elonmusk")
.limit(10L)
.build();
-HttpResponseFor response = client.x().tweets().withRawResponse().search(params);
+HttpResponseFor paginatedTweets = client.x().tweets().withRawResponse().search(params);
-int statusCode = response.statusCode();
-Headers headers = response.headers();
+int statusCode = paginatedTweets.statusCode();
+Headers headers = paginatedTweets.headers();
```
You can still deserialize the response into an instance of a Java class if needed:
```java
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
-TweetSearchResponse parsedResponse = response.parse();
+PaginatedTweets parsedPaginatedTweets = paginatedTweets.parse();
```
## Error handling
@@ -427,9 +427,9 @@ Requests time out after 1 minute by default.
To set a custom timeout, configure the method call using the `timeout` method:
```java
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
-TweetSearchResponse response = client.x().tweets().search(
+PaginatedTweets paginatedTweets = client.x().tweets().search(
params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build()
);
```
@@ -705,17 +705,17 @@ By default, the SDK will not throw an exception in this case. It will throw [`XT
If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
```java
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
-TweetSearchResponse response = client.x().tweets().search(params).validate();
+PaginatedTweets paginatedTweets = client.x().tweets().search(params).validate();
```
Or configure the method call to validate the response using the `responseValidation` method:
```java
-import com.x_twitter_scraper.api.models.x.tweets.TweetSearchResponse;
+import com.x_twitter_scraper.api.models.PaginatedTweets;
-TweetSearchResponse response = client.x().tweets().search(
+PaginatedTweets paginatedTweets = client.x().tweets().search(
params, RequestOptions.builder().responseValidation(true).build()
);
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 81f4172..93d1d37 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.x_twitter_scraper.api"
- version = "0.2.0" // x-release-please-version
+ version = "0.3.0" // x-release-please-version
}
subprojects {
diff --git a/buildSrc/src/main/kotlin/x-twitter-scraper.publish.gradle.kts b/buildSrc/src/main/kotlin/x-twitter-scraper.publish.gradle.kts
index b0ad2e8..c59ccf8 100644
--- a/buildSrc/src/main/kotlin/x-twitter-scraper.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/x-twitter-scraper.publish.gradle.kts
@@ -43,7 +43,7 @@ configure {
pom {
name.set("Xquik API")
- description.set("X real-time data platform — extractions, giveaway draws, monitoring, webhooks.")
+ description.set("Xquik is an all-in-one X (Twitter) automation API with 40+ endpoints for\nreading, writing, and monitoring X data. **Read endpoints** let you look up\ntweets, search tweets, fetch user profiles, list followers & following, browse\ntimelines, bookmarks, notifications, communities, lists, trending topics, and\ndownload media. **Write endpoints** let you post tweets, reply, like, unlike,\nretweet, unretweet, follow, unfollow, send DMs, upload media, update profiles,\nand manage communities. **Automation endpoints** power bulk data extractions (20\ntool types), giveaway draws from tweet replies, real-time account monitoring\nwith webhooks & Telegram integrations, tweet composition with AI, and writing\nstyle analysis. Authenticate with an API key or OAuth 2.1 bearer token.\nPay-per-use endpoints are also available without an account.")
url.set("https://xquik.com")
licenses {
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/Error.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/Error.kt
index cb6ccba..6356b08 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/Error.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/Error.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
+/** Error response containing a machine-readable error code. */
class Error
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/EventType.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/EventType.kt
index 4f21ed7..fad6c19 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/EventType.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/EventType.kt
@@ -7,6 +7,7 @@ import com.x_twitter_scraper.api.core.Enum
import com.x_twitter_scraper.api.core.JsonField
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
+/** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedTweets.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedTweets.kt
index 2880aa9..2817a3e 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedTweets.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedTweets.kt
@@ -14,17 +14,18 @@ import com.x_twitter_scraper.api.core.checkKnown
import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.core.toImmutable
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
+import com.x_twitter_scraper.api.models.x.tweets.SearchTweet
import java.util.Collections
import java.util.Objects
-import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Paginated list of tweets with cursor-based navigation. */
class PaginatedTweets
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val hasNextPage: JsonField,
private val nextCursor: JsonField,
- private val tweets: JsonField>,
+ private val tweets: JsonField>,
private val additionalProperties: MutableMap,
) {
@@ -36,7 +37,9 @@ private constructor(
@JsonProperty("next_cursor")
@ExcludeMissing
nextCursor: JsonField = JsonMissing.of(),
- @JsonProperty("tweets") @ExcludeMissing tweets: JsonField> = JsonMissing.of(),
+ @JsonProperty("tweets")
+ @ExcludeMissing
+ tweets: JsonField> = JsonMissing.of(),
) : this(hasNextPage, nextCursor, tweets, mutableMapOf())
/**
@@ -55,7 +58,7 @@ private constructor(
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun tweets(): List = tweets.getRequired("tweets")
+ fun tweets(): List = tweets.getRequired("tweets")
/**
* Returns the raw JSON value of [hasNextPage].
@@ -78,7 +81,7 @@ private constructor(
*
* Unlike [tweets], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("tweets") @ExcludeMissing fun _tweets(): JsonField> = tweets
+ @JsonProperty("tweets") @ExcludeMissing fun _tweets(): JsonField> = tweets
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -112,7 +115,7 @@ private constructor(
private var hasNextPage: JsonField? = null
private var nextCursor: JsonField? = null
- private var tweets: JsonField>? = null
+ private var tweets: JsonField>? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -145,25 +148,25 @@ private constructor(
*/
fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor }
- fun tweets(tweets: List) = tweets(JsonField.of(tweets))
+ fun tweets(tweets: List) = tweets(JsonField.of(tweets))
/**
* Sets [Builder.tweets] to an arbitrary JSON value.
*
- * You should usually call [Builder.tweets] with a well-typed `List` value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
+ * You should usually call [Builder.tweets] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun tweets(tweets: JsonField>) = apply {
+ fun tweets(tweets: JsonField>) = apply {
this.tweets = tweets.map { it.toMutableList() }
}
/**
- * Adds a single [Tweet] to [tweets].
+ * Adds a single [SearchTweet] to [tweets].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
- fun addTweet(tweet: Tweet) = apply {
+ fun addTweet(tweet: SearchTweet) = apply {
tweets =
(tweets ?: JsonField.of(mutableListOf())).also {
checkKnown("tweets", it).add(tweet)
@@ -244,776 +247,6 @@ private constructor(
(if (nextCursor.asKnown().isPresent) 1 else 0) +
(tweets.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
- class Tweet
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val id: JsonField,
- private val text: JsonField,
- private val author: JsonField,
- private val bookmarkCount: JsonField,
- private val createdAt: JsonField,
- private val likeCount: JsonField,
- private val quoteCount: JsonField,
- private val replyCount: JsonField,
- private val retweetCount: JsonField,
- private val viewCount: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("text") @ExcludeMissing text: JsonField = JsonMissing.of(),
- @JsonProperty("author") @ExcludeMissing author: JsonField = JsonMissing.of(),
- @JsonProperty("bookmarkCount")
- @ExcludeMissing
- bookmarkCount: JsonField = JsonMissing.of(),
- @JsonProperty("createdAt")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("likeCount")
- @ExcludeMissing
- likeCount: JsonField = JsonMissing.of(),
- @JsonProperty("quoteCount")
- @ExcludeMissing
- quoteCount: JsonField = JsonMissing.of(),
- @JsonProperty("replyCount")
- @ExcludeMissing
- replyCount: JsonField = JsonMissing.of(),
- @JsonProperty("retweetCount")
- @ExcludeMissing
- retweetCount: JsonField = JsonMissing.of(),
- @JsonProperty("viewCount") @ExcludeMissing viewCount: JsonField = JsonMissing.of(),
- ) : this(
- id,
- text,
- author,
- bookmarkCount,
- createdAt,
- likeCount,
- quoteCount,
- replyCount,
- retweetCount,
- viewCount,
- mutableMapOf(),
- )
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun id(): String = id.getRequired("id")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun text(): String = text.getRequired("text")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun author(): Optional = author.getOptional("author")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun bookmarkCount(): Optional = bookmarkCount.getOptional("bookmarkCount")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun createdAt(): Optional = createdAt.getOptional("createdAt")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun likeCount(): Optional = likeCount.getOptional("likeCount")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun quoteCount(): Optional = quoteCount.getOptional("quoteCount")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun replyCount(): Optional = replyCount.getOptional("replyCount")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun retweetCount(): Optional = retweetCount.getOptional("retweetCount")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun viewCount(): Optional = viewCount.getOptional("viewCount")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [text].
- *
- * Unlike [text], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("text") @ExcludeMissing fun _text(): JsonField = text
-
- /**
- * Returns the raw JSON value of [author].
- *
- * Unlike [author], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("author") @ExcludeMissing fun _author(): JsonField = author
-
- /**
- * Returns the raw JSON value of [bookmarkCount].
- *
- * Unlike [bookmarkCount], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("bookmarkCount")
- @ExcludeMissing
- fun _bookmarkCount(): JsonField = bookmarkCount
-
- /**
- * Returns the raw JSON value of [createdAt].
- *
- * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("createdAt") @ExcludeMissing fun _createdAt(): JsonField = createdAt
-
- /**
- * Returns the raw JSON value of [likeCount].
- *
- * Unlike [likeCount], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("likeCount") @ExcludeMissing fun _likeCount(): JsonField = likeCount
-
- /**
- * Returns the raw JSON value of [quoteCount].
- *
- * Unlike [quoteCount], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("quoteCount") @ExcludeMissing fun _quoteCount(): JsonField = quoteCount
-
- /**
- * Returns the raw JSON value of [replyCount].
- *
- * Unlike [replyCount], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("replyCount") @ExcludeMissing fun _replyCount(): JsonField = replyCount
-
- /**
- * Returns the raw JSON value of [retweetCount].
- *
- * Unlike [retweetCount], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("retweetCount")
- @ExcludeMissing
- fun _retweetCount(): JsonField = retweetCount
-
- /**
- * Returns the raw JSON value of [viewCount].
- *
- * Unlike [viewCount], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("viewCount") @ExcludeMissing fun _viewCount(): JsonField = viewCount
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Tweet].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .text()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Tweet]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var text: JsonField? = null
- private var author: JsonField = JsonMissing.of()
- private var bookmarkCount: JsonField = JsonMissing.of()
- private var createdAt: JsonField = JsonMissing.of()
- private var likeCount: JsonField = JsonMissing.of()
- private var quoteCount: JsonField = JsonMissing.of()
- private var replyCount: JsonField = JsonMissing.of()
- private var retweetCount: JsonField = JsonMissing.of()
- private var viewCount: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(tweet: Tweet) = apply {
- id = tweet.id
- text = tweet.text
- author = tweet.author
- bookmarkCount = tweet.bookmarkCount
- createdAt = tweet.createdAt
- likeCount = tweet.likeCount
- quoteCount = tweet.quoteCount
- replyCount = tweet.replyCount
- retweetCount = tweet.retweetCount
- viewCount = tweet.viewCount
- additionalProperties = tweet.additionalProperties.toMutableMap()
- }
-
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun text(text: String) = text(JsonField.of(text))
-
- /**
- * Sets [Builder.text] to an arbitrary JSON value.
- *
- * You should usually call [Builder.text] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun text(text: JsonField) = apply { this.text = text }
-
- fun author(author: Author) = author(JsonField.of(author))
-
- /**
- * Sets [Builder.author] to an arbitrary JSON value.
- *
- * You should usually call [Builder.author] with a well-typed [Author] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun author(author: JsonField) = apply { this.author = author }
-
- fun bookmarkCount(bookmarkCount: Long) = bookmarkCount(JsonField.of(bookmarkCount))
-
- /**
- * Sets [Builder.bookmarkCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.bookmarkCount] with a well-typed [Long] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun bookmarkCount(bookmarkCount: JsonField) = apply {
- this.bookmarkCount = bookmarkCount
- }
-
- fun createdAt(createdAt: String) = createdAt(JsonField.of(createdAt))
-
- /**
- * Sets [Builder.createdAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.createdAt] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
-
- fun likeCount(likeCount: Long) = likeCount(JsonField.of(likeCount))
-
- /**
- * Sets [Builder.likeCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.likeCount] with a well-typed [Long] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun likeCount(likeCount: JsonField) = apply { this.likeCount = likeCount }
-
- fun quoteCount(quoteCount: Long) = quoteCount(JsonField.of(quoteCount))
-
- /**
- * Sets [Builder.quoteCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.quoteCount] with a well-typed [Long] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun quoteCount(quoteCount: JsonField) = apply { this.quoteCount = quoteCount }
-
- fun replyCount(replyCount: Long) = replyCount(JsonField.of(replyCount))
-
- /**
- * Sets [Builder.replyCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.replyCount] with a well-typed [Long] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun replyCount(replyCount: JsonField) = apply { this.replyCount = replyCount }
-
- fun retweetCount(retweetCount: Long) = retweetCount(JsonField.of(retweetCount))
-
- /**
- * Sets [Builder.retweetCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.retweetCount] with a well-typed [Long] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun retweetCount(retweetCount: JsonField) = apply {
- this.retweetCount = retweetCount
- }
-
- fun viewCount(viewCount: Long) = viewCount(JsonField.of(viewCount))
-
- /**
- * Sets [Builder.viewCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.viewCount] with a well-typed [Long] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun viewCount(viewCount: JsonField) = apply { this.viewCount = viewCount }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Tweet].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .text()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Tweet =
- Tweet(
- checkRequired("id", id),
- checkRequired("text", text),
- author,
- bookmarkCount,
- createdAt,
- likeCount,
- quoteCount,
- replyCount,
- retweetCount,
- viewCount,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Tweet = apply {
- if (validated) {
- return@apply
- }
-
- id()
- text()
- author().ifPresent { it.validate() }
- bookmarkCount()
- createdAt()
- likeCount()
- quoteCount()
- replyCount()
- retweetCount()
- viewCount()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: XTwitterScraperInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (id.asKnown().isPresent) 1 else 0) +
- (if (text.asKnown().isPresent) 1 else 0) +
- (author.asKnown().getOrNull()?.validity() ?: 0) +
- (if (bookmarkCount.asKnown().isPresent) 1 else 0) +
- (if (createdAt.asKnown().isPresent) 1 else 0) +
- (if (likeCount.asKnown().isPresent) 1 else 0) +
- (if (quoteCount.asKnown().isPresent) 1 else 0) +
- (if (replyCount.asKnown().isPresent) 1 else 0) +
- (if (retweetCount.asKnown().isPresent) 1 else 0) +
- (if (viewCount.asKnown().isPresent) 1 else 0)
-
- class Author
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val id: JsonField,
- private val name: JsonField,
- private val username: JsonField,
- private val verified: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("username")
- @ExcludeMissing
- username: JsonField = JsonMissing.of(),
- @JsonProperty("verified")
- @ExcludeMissing
- verified: JsonField = JsonMissing.of(),
- ) : this(id, name, username, verified, mutableMapOf())
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun id(): String = id.getRequired("id")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * or is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun username(): String = username.getRequired("username")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun verified(): Optional = verified.getOptional("verified")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * Returns the raw JSON value of [username].
- *
- * Unlike [username], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("username") @ExcludeMissing fun _username(): JsonField = username
-
- /**
- * Returns the raw JSON value of [verified].
- *
- * Unlike [verified], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("verified") @ExcludeMissing fun _verified(): JsonField = verified
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Author].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .name()
- * .username()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Author]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var name: JsonField? = null
- private var username: JsonField? = null
- private var verified: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(author: Author) = apply {
- id = author.id
- name = author.name
- username = author.username
- verified = author.verified
- additionalProperties = author.additionalProperties.toMutableMap()
- }
-
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- fun username(username: String) = username(JsonField.of(username))
-
- /**
- * Sets [Builder.username] to an arbitrary JSON value.
- *
- * You should usually call [Builder.username] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun username(username: JsonField) = apply { this.username = username }
-
- fun verified(verified: Boolean) = verified(JsonField.of(verified))
-
- /**
- * Sets [Builder.verified] to an arbitrary JSON value.
- *
- * You should usually call [Builder.verified] with a well-typed [Boolean] value
- * instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun verified(verified: JsonField) = apply { this.verified = verified }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Author].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .name()
- * .username()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Author =
- Author(
- checkRequired("id", id),
- checkRequired("name", name),
- checkRequired("username", username),
- verified,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Author = apply {
- if (validated) {
- return@apply
- }
-
- id()
- name()
- username()
- verified()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: XTwitterScraperInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (id.asKnown().isPresent) 1 else 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
- (if (username.asKnown().isPresent) 1 else 0) +
- (if (verified.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Author &&
- id == other.id &&
- name == other.name &&
- username == other.username &&
- verified == other.verified &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, name, username, verified, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Author{id=$id, name=$name, username=$username, verified=$verified, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Tweet &&
- id == other.id &&
- text == other.text &&
- author == other.author &&
- bookmarkCount == other.bookmarkCount &&
- createdAt == other.createdAt &&
- likeCount == other.likeCount &&
- quoteCount == other.quoteCount &&
- replyCount == other.replyCount &&
- retweetCount == other.retweetCount &&
- viewCount == other.viewCount &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- text,
- author,
- bookmarkCount,
- createdAt,
- likeCount,
- quoteCount,
- replyCount,
- retweetCount,
- viewCount,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Tweet{id=$id, text=$text, author=$author, bookmarkCount=$bookmarkCount, createdAt=$createdAt, likeCount=$likeCount, quoteCount=$quoteCount, replyCount=$replyCount, retweetCount=$retweetCount, viewCount=$viewCount, additionalProperties=$additionalProperties}"
- }
-
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedUsers.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedUsers.kt
index c3e969c..f7a0acf 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedUsers.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedUsers.kt
@@ -14,17 +14,18 @@ import com.x_twitter_scraper.api.core.checkKnown
import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.core.toImmutable
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
+import com.x_twitter_scraper.api.models.x.users.UserProfile
import java.util.Collections
import java.util.Objects
-import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Paginated list of user profiles with cursor-based navigation. */
class PaginatedUsers
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val hasNextPage: JsonField,
private val nextCursor: JsonField,
- private val users: JsonField>,
+ private val users: JsonField>,
private val additionalProperties: MutableMap,
) {
@@ -36,7 +37,9 @@ private constructor(
@JsonProperty("next_cursor")
@ExcludeMissing
nextCursor: JsonField = JsonMissing.of(),
- @JsonProperty("users") @ExcludeMissing users: JsonField> = JsonMissing.of(),
+ @JsonProperty("users")
+ @ExcludeMissing
+ users: JsonField> = JsonMissing.of(),
) : this(hasNextPage, nextCursor, users, mutableMapOf())
/**
@@ -55,7 +58,7 @@ private constructor(
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun users(): List = users.getRequired("users")
+ fun users(): List = users.getRequired("users")
/**
* Returns the raw JSON value of [hasNextPage].
@@ -78,7 +81,7 @@ private constructor(
*
* Unlike [users], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("users") @ExcludeMissing fun _users(): JsonField> = users
+ @JsonProperty("users") @ExcludeMissing fun _users(): JsonField> = users
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -112,7 +115,7 @@ private constructor(
private var hasNextPage: JsonField? = null
private var nextCursor: JsonField? = null
- private var users: JsonField>? = null
+ private var users: JsonField>? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -145,25 +148,25 @@ private constructor(
*/
fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor }
- fun users(users: List) = users(JsonField.of(users))
+ fun users(users: List) = users(JsonField.of(users))
/**
* Sets [Builder.users] to an arbitrary JSON value.
*
- * You should usually call [Builder.users] with a well-typed `List` value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
+ * You should usually call [Builder.users] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun users(users: JsonField>) = apply {
+ fun users(users: JsonField>) = apply {
this.users = users.map { it.toMutableList() }
}
/**
- * Adds a single [User] to [users].
+ * Adds a single [UserProfile] to [users].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
- fun addUser(user: User) = apply {
+ fun addUser(user: UserProfile) = apply {
users =
(users ?: JsonField.of(mutableListOf())).also { checkKnown("users", it).add(user) }
}
@@ -242,552 +245,6 @@ private constructor(
(if (nextCursor.asKnown().isPresent) 1 else 0) +
(users.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
- class User
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val id: JsonField,
- private val name: JsonField,
- private val username: JsonField,
- private val createdAt: JsonField,
- private val description: JsonField,
- private val followers: JsonField,
- private val following: JsonField,
- private val location: JsonField,
- private val profilePicture: JsonField,
- private val statusesCount: JsonField,
- private val verified: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("username")
- @ExcludeMissing
- username: JsonField = JsonMissing.of(),
- @JsonProperty("createdAt")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("description")
- @ExcludeMissing
- description: JsonField = JsonMissing.of(),
- @JsonProperty("followers")
- @ExcludeMissing
- followers: JsonField = JsonMissing.of(),
- @JsonProperty("following")
- @ExcludeMissing
- following: JsonField = JsonMissing.of(),
- @JsonProperty("location")
- @ExcludeMissing
- location: JsonField = JsonMissing.of(),
- @JsonProperty("profilePicture")
- @ExcludeMissing
- profilePicture: JsonField = JsonMissing.of(),
- @JsonProperty("statusesCount")
- @ExcludeMissing
- statusesCount: JsonField = JsonMissing.of(),
- @JsonProperty("verified")
- @ExcludeMissing
- verified: JsonField = JsonMissing.of(),
- ) : this(
- id,
- name,
- username,
- createdAt,
- description,
- followers,
- following,
- location,
- profilePicture,
- statusesCount,
- verified,
- mutableMapOf(),
- )
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun id(): String = id.getRequired("id")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun username(): String = username.getRequired("username")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun createdAt(): Optional = createdAt.getOptional("createdAt")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun description(): Optional = description.getOptional("description")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun followers(): Optional = followers.getOptional("followers")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun following(): Optional = following.getOptional("following")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun location(): Optional = location.getOptional("location")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun profilePicture(): Optional = profilePicture.getOptional("profilePicture")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun statusesCount(): Optional = statusesCount.getOptional("statusesCount")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun verified(): Optional = verified.getOptional("verified")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * Returns the raw JSON value of [username].
- *
- * Unlike [username], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("username") @ExcludeMissing fun _username(): JsonField = username
-
- /**
- * Returns the raw JSON value of [createdAt].
- *
- * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("createdAt") @ExcludeMissing fun _createdAt(): JsonField = createdAt
-
- /**
- * Returns the raw JSON value of [description].
- *
- * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("description")
- @ExcludeMissing
- fun _description(): JsonField = description
-
- /**
- * Returns the raw JSON value of [followers].
- *
- * Unlike [followers], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("followers") @ExcludeMissing fun _followers(): JsonField = followers
-
- /**
- * Returns the raw JSON value of [following].
- *
- * Unlike [following], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("following") @ExcludeMissing fun _following(): JsonField = following
-
- /**
- * Returns the raw JSON value of [location].
- *
- * Unlike [location], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("location") @ExcludeMissing fun _location(): JsonField = location
-
- /**
- * Returns the raw JSON value of [profilePicture].
- *
- * Unlike [profilePicture], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("profilePicture")
- @ExcludeMissing
- fun _profilePicture(): JsonField = profilePicture
-
- /**
- * Returns the raw JSON value of [statusesCount].
- *
- * Unlike [statusesCount], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("statusesCount")
- @ExcludeMissing
- fun _statusesCount(): JsonField = statusesCount
-
- /**
- * Returns the raw JSON value of [verified].
- *
- * Unlike [verified], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("verified") @ExcludeMissing fun _verified(): JsonField = verified
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [User].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .name()
- * .username()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [User]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var name: JsonField? = null
- private var username: JsonField? = null
- private var createdAt: JsonField = JsonMissing.of()
- private var description: JsonField = JsonMissing.of()
- private var followers: JsonField = JsonMissing.of()
- private var following: JsonField = JsonMissing.of()
- private var location: JsonField = JsonMissing.of()
- private var profilePicture: JsonField = JsonMissing.of()
- private var statusesCount: JsonField = JsonMissing.of()
- private var verified: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(user: User) = apply {
- id = user.id
- name = user.name
- username = user.username
- createdAt = user.createdAt
- description = user.description
- followers = user.followers
- following = user.following
- location = user.location
- profilePicture = user.profilePicture
- statusesCount = user.statusesCount
- verified = user.verified
- additionalProperties = user.additionalProperties.toMutableMap()
- }
-
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- fun username(username: String) = username(JsonField.of(username))
-
- /**
- * Sets [Builder.username] to an arbitrary JSON value.
- *
- * You should usually call [Builder.username] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun username(username: JsonField) = apply { this.username = username }
-
- fun createdAt(createdAt: String) = createdAt(JsonField.of(createdAt))
-
- /**
- * Sets [Builder.createdAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.createdAt] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
-
- fun description(description: String) = description(JsonField.of(description))
-
- /**
- * Sets [Builder.description] to an arbitrary JSON value.
- *
- * You should usually call [Builder.description] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun description(description: JsonField) = apply {
- this.description = description
- }
-
- fun followers(followers: Long) = followers(JsonField.of(followers))
-
- /**
- * Sets [Builder.followers] to an arbitrary JSON value.
- *
- * You should usually call [Builder.followers] with a well-typed [Long] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun followers(followers: JsonField) = apply { this.followers = followers }
-
- fun following(following: Long) = following(JsonField.of(following))
-
- /**
- * Sets [Builder.following] to an arbitrary JSON value.
- *
- * You should usually call [Builder.following] with a well-typed [Long] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun following(following: JsonField) = apply { this.following = following }
-
- fun location(location: String) = location(JsonField.of(location))
-
- /**
- * Sets [Builder.location] to an arbitrary JSON value.
- *
- * You should usually call [Builder.location] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun location(location: JsonField) = apply { this.location = location }
-
- fun profilePicture(profilePicture: String) =
- profilePicture(JsonField.of(profilePicture))
-
- /**
- * Sets [Builder.profilePicture] to an arbitrary JSON value.
- *
- * You should usually call [Builder.profilePicture] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun profilePicture(profilePicture: JsonField) = apply {
- this.profilePicture = profilePicture
- }
-
- fun statusesCount(statusesCount: Long) = statusesCount(JsonField.of(statusesCount))
-
- /**
- * Sets [Builder.statusesCount] to an arbitrary JSON value.
- *
- * You should usually call [Builder.statusesCount] with a well-typed [Long] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun statusesCount(statusesCount: JsonField) = apply {
- this.statusesCount = statusesCount
- }
-
- fun verified(verified: Boolean) = verified(JsonField.of(verified))
-
- /**
- * Sets [Builder.verified] to an arbitrary JSON value.
- *
- * You should usually call [Builder.verified] with a well-typed [Boolean] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun verified(verified: JsonField) = apply { this.verified = verified }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [User].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .name()
- * .username()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): User =
- User(
- checkRequired("id", id),
- checkRequired("name", name),
- checkRequired("username", username),
- createdAt,
- description,
- followers,
- following,
- location,
- profilePicture,
- statusesCount,
- verified,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): User = apply {
- if (validated) {
- return@apply
- }
-
- id()
- name()
- username()
- createdAt()
- description()
- followers()
- following()
- location()
- profilePicture()
- statusesCount()
- verified()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: XTwitterScraperInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (id.asKnown().isPresent) 1 else 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
- (if (username.asKnown().isPresent) 1 else 0) +
- (if (createdAt.asKnown().isPresent) 1 else 0) +
- (if (description.asKnown().isPresent) 1 else 0) +
- (if (followers.asKnown().isPresent) 1 else 0) +
- (if (following.asKnown().isPresent) 1 else 0) +
- (if (location.asKnown().isPresent) 1 else 0) +
- (if (profilePicture.asKnown().isPresent) 1 else 0) +
- (if (statusesCount.asKnown().isPresent) 1 else 0) +
- (if (verified.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is User &&
- id == other.id &&
- name == other.name &&
- username == other.username &&
- createdAt == other.createdAt &&
- description == other.description &&
- followers == other.followers &&
- following == other.following &&
- location == other.location &&
- profilePicture == other.profilePicture &&
- statusesCount == other.statusesCount &&
- verified == other.verified &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- name,
- username,
- createdAt,
- description,
- followers,
- following,
- location,
- profilePicture,
- statusesCount,
- verified,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "User{id=$id, name=$name, username=$username, createdAt=$createdAt, description=$description, followers=$followers, following=$following, location=$location, profilePicture=$profilePicture, statusesCount=$statusesCount, verified=$verified, additionalProperties=$additionalProperties}"
- }
-
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKey.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKey.kt
index f4edb41..f7477af 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKey.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKey.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** API key metadata returned when listing keys. */
class ApiKey
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKeyListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKeyListResponse.kt
index cc46a86..dc1a8f1 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKeyListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/apikeys/ApiKeyListResponse.kt
@@ -14,36 +14,34 @@ import com.x_twitter_scraper.api.core.checkKnown
import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.core.toImmutable
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
-import java.time.OffsetDateTime
import java.util.Collections
import java.util.Objects
-import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class ApiKeyListResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
- private val keys: JsonField>,
+ private val keys: JsonField>,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
- @JsonProperty("keys") @ExcludeMissing keys: JsonField> = JsonMissing.of()
+ @JsonProperty("keys") @ExcludeMissing keys: JsonField> = JsonMissing.of()
) : this(keys, mutableMapOf())
/**
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun keys(): List = keys.getRequired("keys")
+ fun keys(): List = keys.getRequired("keys")
/**
* Returns the raw JSON value of [keys].
*
* Unlike [keys], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("keys") @ExcludeMissing fun _keys(): JsonField> = keys
+ @JsonProperty("keys") @ExcludeMissing fun _keys(): JsonField> = keys
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -73,7 +71,7 @@ private constructor(
/** A builder for [ApiKeyListResponse]. */
class Builder internal constructor() {
- private var keys: JsonField>? = null
+ private var keys: JsonField>? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -82,22 +80,25 @@ private constructor(
additionalProperties = apiKeyListResponse.additionalProperties.toMutableMap()
}
- fun keys(keys: List) = keys(JsonField.of(keys))
+ fun keys(keys: List) = keys(JsonField.of(keys))
/**
* Sets [Builder.keys] to an arbitrary JSON value.
*
- * You should usually call [Builder.keys] with a well-typed `List` value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
+ * You should usually call [Builder.keys] with a well-typed `List` value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
*/
- fun keys(keys: JsonField>) = apply { this.keys = keys.map { it.toMutableList() } }
+ fun keys(keys: JsonField>) = apply {
+ this.keys = keys.map { it.toMutableList() }
+ }
/**
- * Adds a single [Key] to [keys].
+ * Adds a single [ApiKey] to [keys].
*
* @throws IllegalStateException if the field was previously set to a non-list.
*/
- fun addKey(key: Key) = apply {
+ fun addKey(key: ApiKey) = apply {
keys = (keys ?: JsonField.of(mutableListOf())).also { checkKnown("keys", it).add(key) }
}
@@ -167,353 +168,6 @@ private constructor(
internal fun validity(): Int =
(keys.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
- class Key
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val id: JsonField,
- private val createdAt: JsonField,
- private val isActive: JsonField,
- private val name: JsonField,
- private val prefix: JsonField,
- private val lastUsedAt: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("createdAt")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("isActive")
- @ExcludeMissing
- isActive: JsonField = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("prefix") @ExcludeMissing prefix: JsonField = JsonMissing.of(),
- @JsonProperty("lastUsedAt")
- @ExcludeMissing
- lastUsedAt: JsonField = JsonMissing.of(),
- ) : this(id, createdAt, isActive, name, prefix, lastUsedAt, mutableMapOf())
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun id(): String = id.getRequired("id")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun isActive(): Boolean = isActive.getRequired("isActive")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun prefix(): String = prefix.getRequired("prefix")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun lastUsedAt(): Optional = lastUsedAt.getOptional("lastUsedAt")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [createdAt].
- *
- * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("createdAt")
- @ExcludeMissing
- fun _createdAt(): JsonField = createdAt
-
- /**
- * Returns the raw JSON value of [isActive].
- *
- * Unlike [isActive], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("isActive") @ExcludeMissing fun _isActive(): JsonField = isActive
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * Returns the raw JSON value of [prefix].
- *
- * Unlike [prefix], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("prefix") @ExcludeMissing fun _prefix(): JsonField = prefix
-
- /**
- * Returns the raw JSON value of [lastUsedAt].
- *
- * Unlike [lastUsedAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("lastUsedAt")
- @ExcludeMissing
- fun _lastUsedAt(): JsonField