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..d99ab81 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
+configured_endpoints: 102
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-ec9b23603f987503f8837da5992b5db4c59a2bc627b090557539791a2b2b64a5.yml
+openapi_spec_hash: faf6a6deaadba884a07e970fd05ac570
config_hash: 8894c96caeb6df84c9394518810221bd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2239e78..f61ae42 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
# 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 ([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))
+
## 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..8d50a20 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.apix-twitter-scraper-java
- 0.2.0
+ 0.3.0
```
@@ -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")
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..80222dd 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
@@ -19,6 +19,7 @@ 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(
@@ -244,6 +245,7 @@ private constructor(
(if (nextCursor.asKnown().isPresent) 1 else 0) +
(tweets.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** Tweet returned from search results with inline author info. */
class Tweet
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -252,6 +254,7 @@ private constructor(
private val author: JsonField,
private val bookmarkCount: JsonField,
private val createdAt: JsonField,
+ private val isNoteTweet: JsonField,
private val likeCount: JsonField,
private val quoteCount: JsonField,
private val replyCount: JsonField,
@@ -271,6 +274,9 @@ private constructor(
@JsonProperty("createdAt")
@ExcludeMissing
createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("isNoteTweet")
+ @ExcludeMissing
+ isNoteTweet: JsonField = JsonMissing.of(),
@JsonProperty("likeCount")
@ExcludeMissing
likeCount: JsonField = JsonMissing.of(),
@@ -290,6 +296,7 @@ private constructor(
author,
bookmarkCount,
createdAt,
+ isNoteTweet,
likeCount,
quoteCount,
replyCount,
@@ -330,6 +337,14 @@ private constructor(
*/
fun createdAt(): Optional = createdAt.getOptional("createdAt")
+ /**
+ * True for Note Tweets (long-form content, up to 25,000 characters)
+ *
+ * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun isNoteTweet(): Optional = isNoteTweet.getOptional("isNoteTweet")
+
/**
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -398,6 +413,15 @@ private constructor(
*/
@JsonProperty("createdAt") @ExcludeMissing fun _createdAt(): JsonField = createdAt
+ /**
+ * Returns the raw JSON value of [isNoteTweet].
+ *
+ * Unlike [isNoteTweet], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("isNoteTweet")
+ @ExcludeMissing
+ fun _isNoteTweet(): JsonField = isNoteTweet
+
/**
* Returns the raw JSON value of [likeCount].
*
@@ -470,6 +494,7 @@ private constructor(
private var author: JsonField = JsonMissing.of()
private var bookmarkCount: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
+ private var isNoteTweet: JsonField = JsonMissing.of()
private var likeCount: JsonField = JsonMissing.of()
private var quoteCount: JsonField = JsonMissing.of()
private var replyCount: JsonField = JsonMissing.of()
@@ -484,6 +509,7 @@ private constructor(
author = tweet.author
bookmarkCount = tweet.bookmarkCount
createdAt = tweet.createdAt
+ isNoteTweet = tweet.isNoteTweet
likeCount = tweet.likeCount
quoteCount = tweet.quoteCount
replyCount = tweet.replyCount
@@ -549,6 +575,20 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** True for Note Tweets (long-form content, up to 25,000 characters) */
+ fun isNoteTweet(isNoteTweet: Boolean) = isNoteTweet(JsonField.of(isNoteTweet))
+
+ /**
+ * Sets [Builder.isNoteTweet] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.isNoteTweet] with a well-typed [Boolean] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun isNoteTweet(isNoteTweet: JsonField) = apply {
+ this.isNoteTweet = isNoteTweet
+ }
+
fun likeCount(likeCount: Long) = likeCount(JsonField.of(likeCount))
/**
@@ -645,6 +685,7 @@ private constructor(
author,
bookmarkCount,
createdAt,
+ isNoteTweet,
likeCount,
quoteCount,
replyCount,
@@ -666,6 +707,7 @@ private constructor(
author().ifPresent { it.validate() }
bookmarkCount()
createdAt()
+ isNoteTweet()
likeCount()
quoteCount()
replyCount()
@@ -695,6 +737,7 @@ private constructor(
(author.asKnown().getOrNull()?.validity() ?: 0) +
(if (bookmarkCount.asKnown().isPresent) 1 else 0) +
(if (createdAt.asKnown().isPresent) 1 else 0) +
+ (if (isNoteTweet.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) +
@@ -984,6 +1027,7 @@ private constructor(
author == other.author &&
bookmarkCount == other.bookmarkCount &&
createdAt == other.createdAt &&
+ isNoteTweet == other.isNoteTweet &&
likeCount == other.likeCount &&
quoteCount == other.quoteCount &&
replyCount == other.replyCount &&
@@ -999,6 +1043,7 @@ private constructor(
author,
bookmarkCount,
createdAt,
+ isNoteTweet,
likeCount,
quoteCount,
replyCount,
@@ -1011,7 +1056,7 @@ private constructor(
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}"
+ "Tweet{id=$id, text=$text, author=$author, bookmarkCount=$bookmarkCount, createdAt=$createdAt, isNoteTweet=$isNoteTweet, likeCount=$likeCount, quoteCount=$quoteCount, replyCount=$replyCount, retweetCount=$retweetCount, viewCount=$viewCount, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
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..7d6465f 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
@@ -19,6 +19,7 @@ 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(
@@ -242,6 +243,7 @@ private constructor(
(if (nextCursor.asKnown().isPresent) 1 else 0) +
(users.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** X user profile with bio, follower counts, and verification status. */
class User
@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/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..edd6128 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
@@ -167,6 +167,7 @@ private constructor(
internal fun validity(): Int =
(keys.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** API key metadata returned when listing keys. */
class Key
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/compose/ComposeCreateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/compose/ComposeCreateResponse.kt
index 2687153..34478fb 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/compose/ComposeCreateResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/compose/ComposeCreateResponse.kt
@@ -3,23 +3,112 @@
package com.x_twitter_scraper.api.models.compose
import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
import com.x_twitter_scraper.api.core.ExcludeMissing
+import com.x_twitter_scraper.api.core.JsonField
+import com.x_twitter_scraper.api.core.JsonMissing
import com.x_twitter_scraper.api.core.JsonValue
+import com.x_twitter_scraper.api.core.checkKnown
import com.x_twitter_scraper.api.core.toImmutable
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
+import java.util.Collections
import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
class ComposeCreateResponse
-@JsonCreator
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
- @com.fasterxml.jackson.annotation.JsonValue
- private val additionalProperties: Map
+ private val feedback: JsonField,
+ private val score: JsonField,
+ private val suggestions: JsonField>,
+ private val text: JsonField,
+ private val additionalProperties: MutableMap,
) {
+ @JsonCreator
+ private constructor(
+ @JsonProperty("feedback") @ExcludeMissing feedback: JsonField = JsonMissing.of(),
+ @JsonProperty("score") @ExcludeMissing score: JsonField = JsonMissing.of(),
+ @JsonProperty("suggestions")
+ @ExcludeMissing
+ suggestions: JsonField> = JsonMissing.of(),
+ @JsonProperty("text") @ExcludeMissing text: JsonField = JsonMissing.of(),
+ ) : this(feedback, score, suggestions, text, mutableMapOf())
+
+ /**
+ * AI feedback on the draft
+ *
+ * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun feedback(): Optional = feedback.getOptional("feedback")
+
+ /**
+ * Engagement score (0-100)
+ *
+ * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun score(): Optional = score.getOptional("score")
+
+ /**
+ * Improvement suggestions
+ *
+ * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun suggestions(): Optional> = suggestions.getOptional("suggestions")
+
+ /**
+ * Generated or refined tweet text
+ *
+ * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun text(): Optional = text.getOptional("text")
+
+ /**
+ * Returns the raw JSON value of [feedback].
+ *
+ * Unlike [feedback], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("feedback") @ExcludeMissing fun _feedback(): JsonField = feedback
+
+ /**
+ * Returns the raw JSON value of [score].
+ *
+ * Unlike [score], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("score") @ExcludeMissing fun _score(): JsonField = score
+
+ /**
+ * Returns the raw JSON value of [suggestions].
+ *
+ * Unlike [suggestions], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("suggestions")
+ @ExcludeMissing
+ fun _suggestions(): JsonField> = suggestions
+
+ /**
+ * 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
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
@JsonAnyGetter
@ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
fun toBuilder() = Builder().from(this)
@@ -32,13 +121,80 @@ private constructor(
/** A builder for [ComposeCreateResponse]. */
class Builder internal constructor() {
+ private var feedback: JsonField = JsonMissing.of()
+ private var score: JsonField = JsonMissing.of()
+ private var suggestions: JsonField>? = null
+ private var text: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(composeCreateResponse: ComposeCreateResponse) = apply {
+ feedback = composeCreateResponse.feedback
+ score = composeCreateResponse.score
+ suggestions = composeCreateResponse.suggestions.map { it.toMutableList() }
+ text = composeCreateResponse.text
additionalProperties = composeCreateResponse.additionalProperties.toMutableMap()
}
+ /** AI feedback on the draft */
+ fun feedback(feedback: String) = feedback(JsonField.of(feedback))
+
+ /**
+ * Sets [Builder.feedback] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.feedback] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun feedback(feedback: JsonField) = apply { this.feedback = feedback }
+
+ /** Engagement score (0-100) */
+ fun score(score: Double) = score(JsonField.of(score))
+
+ /**
+ * Sets [Builder.score] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.score] with a well-typed [Double] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun score(score: JsonField) = apply { this.score = score }
+
+ /** Improvement suggestions */
+ fun suggestions(suggestions: List) = suggestions(JsonField.of(suggestions))
+
+ /**
+ * Sets [Builder.suggestions] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.suggestions] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun suggestions(suggestions: JsonField>) = apply {
+ this.suggestions = suggestions.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [suggestions].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addSuggestion(suggestion: String) = apply {
+ suggestions =
+ (suggestions ?: JsonField.of(mutableListOf())).also {
+ checkKnown("suggestions", it).add(suggestion)
+ }
+ }
+
+ /** Generated or refined tweet text */
+ 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 additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -64,7 +220,13 @@ private constructor(
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): ComposeCreateResponse =
- ComposeCreateResponse(additionalProperties.toImmutable())
+ ComposeCreateResponse(
+ feedback,
+ score,
+ (suggestions ?: JsonMissing.of()).map { it.toImmutable() },
+ text,
+ additionalProperties.toMutableMap(),
+ )
}
private var validated: Boolean = false
@@ -74,6 +236,10 @@ private constructor(
return@apply
}
+ feedback()
+ score()
+ suggestions()
+ text()
validated = true
}
@@ -92,19 +258,30 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
+ (if (feedback.asKnown().isPresent) 1 else 0) +
+ (if (score.asKnown().isPresent) 1 else 0) +
+ (suggestions.asKnown().getOrNull()?.size ?: 0) +
+ (if (text.asKnown().isPresent) 1 else 0)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
- return other is ComposeCreateResponse && additionalProperties == other.additionalProperties
+ return other is ComposeCreateResponse &&
+ feedback == other.feedback &&
+ score == other.score &&
+ suggestions == other.suggestions &&
+ text == other.text &&
+ additionalProperties == other.additionalProperties
}
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ private val hashCode: Int by lazy {
+ Objects.hash(feedback, score, suggestions, text, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
- override fun toString() = "ComposeCreateResponse{additionalProperties=$additionalProperties}"
+ override fun toString() =
+ "ComposeCreateResponse{feedback=$feedback, score=$score, suggestions=$suggestions, text=$text, additionalProperties=$additionalProperties}"
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/Draft.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/Draft.kt
index 40c2080..81ebb82 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/Draft.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/Draft.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Saved tweet draft with optional topic and goal. */
class Draft
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftCreateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftCreateResponse.kt
index 37fd934..db3edc3 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftCreateResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftCreateResponse.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Full tweet draft including update timestamp. */
class DraftCreateResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftDetail.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftDetail.kt
index 3a80f3d..e4c8ebd 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftDetail.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftDetail.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Full tweet draft including update timestamp. */
class DraftDetail
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListParams.kt
index 727ae92..791ebf8 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListParams.kt
@@ -21,6 +21,7 @@ private constructor(
/** Cursor for pagination */
fun afterCursor(): Optional = Optional.ofNullable(afterCursor)
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(): Optional = Optional.ofNullable(limit)
/** Additional headers to send with the request. */
@@ -61,6 +62,7 @@ private constructor(
/** Alias for calling [Builder.afterCursor] with `afterCursor.orElse(null)`. */
fun afterCursor(afterCursor: Optional) = afterCursor(afterCursor.getOrNull())
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(limit: Long?) = apply { this.limit = limit }
/**
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListResponse.kt
index da62295..95098f6 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftListResponse.kt
@@ -236,6 +236,7 @@ private constructor(
(if (hasMore.asKnown().isPresent) 1 else 0) +
(if (nextCursor.asKnown().isPresent) 1 else 0)
+ /** Saved tweet draft with optional topic and goal. */
class Draft
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftRetrieveResponse.kt
index 45f2c57..23e4330 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/drafts/DraftRetrieveResponse.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Full tweet draft including update timestamp. */
class DraftRetrieveResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawDetail.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawDetail.kt
index 330c1b4..ee79d40 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawDetail.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawDetail.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Full giveaway draw with tweet metrics, entries, and timing. */
class DrawDetail
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawExportParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawExportParams.kt
index 9071e39..d37a0b7 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawExportParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawExportParams.kt
@@ -25,6 +25,7 @@ private constructor(
fun id(): Optional = Optional.ofNullable(id)
+ /** Export output format */
fun format(): Optional = Optional.ofNullable(format)
/** Export winners or all entries */
@@ -69,6 +70,7 @@ private constructor(
/** Alias for calling [Builder.id] with `id.orElse(null)`. */
fun id(id: Optional) = id(id.getOrNull())
+ /** Export output format */
fun format(format: Format?) = apply { this.format = format }
/** Alias for calling [Builder.format] with `format.orElse(null)`. */
@@ -210,6 +212,7 @@ private constructor(
}
.build()
+ /** Export output format */
class Format @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/draws/DrawListItem.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListItem.kt
index 3297fd6..050b004 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListItem.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListItem.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Giveaway draw summary with entry counts and status. */
class DrawListItem
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListParams.kt
index 1676adb..ab4f65a 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListParams.kt
@@ -18,9 +18,10 @@ private constructor(
private val additionalQueryParams: QueryParams,
) : Params {
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(): Optional = Optional.ofNullable(after)
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(): Optional = Optional.ofNullable(limit)
/** Additional headers to send with the request. */
@@ -55,12 +56,13 @@ private constructor(
additionalQueryParams = drawListParams.additionalQueryParams.toBuilder()
}
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(after: String?) = apply { this.after = after }
/** Alias for calling [Builder.after] with `after.orElse(null)`. */
fun after(after: Optional) = after(after.getOrNull())
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(limit: Long?) = apply { this.limit = limit }
/**
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListResponse.kt
index fd73ddd..9dff273 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawListResponse.kt
@@ -234,6 +234,7 @@ private constructor(
(if (hasMore.asKnown().isPresent) 1 else 0) +
(if (nextCursor.asKnown().isPresent) 1 else 0)
+ /** Giveaway draw summary with entry counts and status. */
class Draw
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRetrieveResponse.kt
index 28fe343..32280b4 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRetrieveResponse.kt
@@ -35,6 +35,8 @@ private constructor(
) : this(draw, winners, mutableMapOf())
/**
+ * Full giveaway draw with tweet metrics, entries, and timing.
+ *
* @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).
*/
@@ -100,6 +102,7 @@ private constructor(
additionalProperties = drawRetrieveResponse.additionalProperties.toMutableMap()
}
+ /** Full giveaway draw with tweet metrics, entries, and timing. */
fun draw(draw: Draw) = draw(JsonField.of(draw))
/**
@@ -205,6 +208,7 @@ private constructor(
(draw.asKnown().getOrNull()?.validity() ?: 0) +
(winners.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** Full giveaway draw with tweet metrics, entries, and timing. */
class Draw
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -915,6 +919,7 @@ private constructor(
"Draw{id=$id, createdAt=$createdAt, status=$status, totalEntries=$totalEntries, tweetAuthorUsername=$tweetAuthorUsername, tweetId=$tweetId, tweetLikeCount=$tweetLikeCount, tweetQuoteCount=$tweetQuoteCount, tweetReplyCount=$tweetReplyCount, tweetRetweetCount=$tweetRetweetCount, tweetText=$tweetText, tweetUrl=$tweetUrl, validEntries=$validEntries, drawnAt=$drawnAt, additionalProperties=$additionalProperties}"
}
+ /** Giveaway draw winner with position and backup flag. */
class Winner
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRunResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRunResponse.kt
index 0c4883f..7b4874a 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRunResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/DrawRunResponse.kt
@@ -309,6 +309,7 @@ private constructor(
(if (validEntries.asKnown().isPresent) 1 else 0) +
(winners.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** Giveaway draw winner with position and backup flag. */
class Winner
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/Winner.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/Winner.kt
index 186f724..f2b9e45 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/Winner.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/draws/Winner.kt
@@ -15,6 +15,7 @@ import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
import java.util.Collections
import java.util.Objects
+/** Giveaway draw winner with position and backup flag. */
class Winner
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/Event.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/Event.kt
index ec20d19..90905c5 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/Event.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/Event.kt
@@ -19,6 +19,7 @@ import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
+/** Monitor event summary with type, username, and occurrence time. */
class Event
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -68,6 +69,8 @@ private constructor(
fun occurredAt(): OffsetDateTime = occurredAt.getRequired("occurredAt")
/**
+ * Type of monitor event fired when account activity occurs.
+ *
* @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).
*/
@@ -219,6 +222,7 @@ private constructor(
this.occurredAt = occurredAt
}
+ /** Type of monitor event fired when account activity occurs. */
fun type(type: Type) = type(JsonField.of(type))
/**
@@ -424,6 +428,7 @@ private constructor(
override fun toString() = "Data{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class Type @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/events/EventDetail.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventDetail.kt
index c6b2f6b..94a9651 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventDetail.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventDetail.kt
@@ -20,6 +20,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Full monitor event including payload data and optional X event ID. */
class EventDetail
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -53,6 +54,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Event payload — shape varies by event type (JSON)
+ *
* @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).
*/
@@ -71,6 +74,8 @@ private constructor(
fun occurredAt(): OffsetDateTime = occurredAt.getRequired("occurredAt")
/**
+ * Type of monitor event fired when account activity occurs.
+ *
* @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).
*/
@@ -203,6 +208,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Event payload — shape varies by event type (JSON) */
fun data(data: Data) = data(JsonField.of(data))
/**
@@ -237,6 +243,7 @@ private constructor(
this.occurredAt = occurredAt
}
+ /** Type of monitor event fired when account activity occurs. */
fun type(type: Type) = type(JsonField.of(type))
/**
@@ -356,6 +363,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xEventId.asKnown().isPresent) 1 else 0)
+ /** Event payload — shape varies by event type (JSON) */
class Data
@JsonCreator
private constructor(
@@ -455,6 +463,7 @@ private constructor(
override fun toString() = "Data{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class Type @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/events/EventListParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventListParams.kt
index f61e383..64661e3 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventListParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventListParams.kt
@@ -24,13 +24,16 @@ private constructor(
private val additionalQueryParams: QueryParams,
) : Params {
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(): Optional = Optional.ofNullable(after)
+ /** Filter events by type */
fun eventType(): Optional = Optional.ofNullable(eventType)
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(): Optional = Optional.ofNullable(limit)
+ /** Filter events by monitor ID */
fun monitorId(): Optional = Optional.ofNullable(monitorId)
/** Additional headers to send with the request. */
@@ -69,17 +72,19 @@ private constructor(
additionalQueryParams = eventListParams.additionalQueryParams.toBuilder()
}
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(after: String?) = apply { this.after = after }
/** Alias for calling [Builder.after] with `after.orElse(null)`. */
fun after(after: Optional) = after(after.getOrNull())
+ /** Filter events by type */
fun eventType(eventType: EventType?) = apply { this.eventType = eventType }
/** Alias for calling [Builder.eventType] with `eventType.orElse(null)`. */
fun eventType(eventType: Optional) = eventType(eventType.getOrNull())
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(limit: Long?) = apply { this.limit = limit }
/**
@@ -92,6 +97,7 @@ private constructor(
/** Alias for calling [Builder.limit] with `limit.orElse(null)`. */
fun limit(limit: Optional) = limit(limit.getOrNull())
+ /** Filter events by monitor ID */
fun monitorId(monitorId: String?) = apply { this.monitorId = monitorId }
/** Alias for calling [Builder.monitorId] with `monitorId.orElse(null)`. */
@@ -224,6 +230,7 @@ private constructor(
}
.build()
+ /** Filter events by type */
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/events/EventListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventListResponse.kt
index 32fc614..8d5eb62 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventListResponse.kt
@@ -237,6 +237,7 @@ private constructor(
(if (hasMore.asKnown().isPresent) 1 else 0) +
(if (nextCursor.asKnown().isPresent) 1 else 0)
+ /** Monitor event summary with type, username, and occurrence time. */
class Event
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -292,6 +293,8 @@ private constructor(
fun occurredAt(): OffsetDateTime = occurredAt.getRequired("occurredAt")
/**
+ * Type of monitor event fired when account activity occurs.
+ *
* @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).
@@ -447,6 +450,7 @@ private constructor(
this.occurredAt = occurredAt
}
+ /** Type of monitor event fired when account activity occurs. */
fun type(type: Type) = type(JsonField.of(type))
/**
@@ -658,6 +662,7 @@ private constructor(
override fun toString() = "Data{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class Type @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/events/EventRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventRetrieveResponse.kt
index e3ccc73..977dfa6 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventRetrieveResponse.kt
@@ -20,6 +20,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Full monitor event including payload data and optional X event ID. */
class EventRetrieveResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -53,6 +54,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Event payload — shape varies by event type (JSON)
+ *
* @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).
*/
@@ -71,6 +74,8 @@ private constructor(
fun occurredAt(): OffsetDateTime = occurredAt.getRequired("occurredAt")
/**
+ * Type of monitor event fired when account activity occurs.
+ *
* @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).
*/
@@ -203,6 +208,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Event payload — shape varies by event type (JSON) */
fun data(data: Data) = data(JsonField.of(data))
/**
@@ -237,6 +243,7 @@ private constructor(
this.occurredAt = occurredAt
}
+ /** Type of monitor event fired when account activity occurs. */
fun type(type: Type) = type(JsonField.of(type))
/**
@@ -356,6 +363,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xEventId.asKnown().isPresent) 1 else 0)
+ /** Event payload — shape varies by event type (JSON) */
class Data
@JsonCreator
private constructor(
@@ -455,6 +463,7 @@ private constructor(
override fun toString() = "Data{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class Type @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/extractions/ExtractionEstimateCostParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostParams.kt
index 5dbf9e1..de3f924 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostParams.kt
@@ -30,13 +30,15 @@ private constructor(
) : Params {
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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 toolType(): ToolType = body.toolType()
/**
- * Raw advanced search query appended as-is (tweet_search_extractor)
+ * Raw advanced query string appended to the estimate (tweet_search_extractor)
*
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
@@ -44,7 +46,7 @@ private constructor(
fun advancedQuery(): Optional = body.advancedQuery()
/**
- * Exact phrase to match (tweet_search_extractor)
+ * Exact phrase filter for search estimation
*
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
@@ -52,7 +54,7 @@ private constructor(
fun exactPhrase(): Optional = body.exactPhrase()
/**
- * Words to exclude from results (tweet_search_extractor)
+ * Words excluded from estimated search results
*
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
@@ -217,6 +219,7 @@ private constructor(
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = apply { body.toolType(toolType) }
/**
@@ -228,7 +231,7 @@ private constructor(
*/
fun toolType(toolType: JsonField) = apply { body.toolType(toolType) }
- /** Raw advanced search query appended as-is (tweet_search_extractor) */
+ /** Raw advanced query string appended to the estimate (tweet_search_extractor) */
fun advancedQuery(advancedQuery: String) = apply { body.advancedQuery(advancedQuery) }
/**
@@ -242,7 +245,7 @@ private constructor(
body.advancedQuery(advancedQuery)
}
- /** Exact phrase to match (tweet_search_extractor) */
+ /** Exact phrase filter for search estimation */
fun exactPhrase(exactPhrase: String) = apply { body.exactPhrase(exactPhrase) }
/**
@@ -254,7 +257,7 @@ private constructor(
*/
fun exactPhrase(exactPhrase: JsonField) = apply { body.exactPhrase(exactPhrase) }
- /** Words to exclude from results (tweet_search_extractor) */
+ /** Words excluded from estimated search results */
fun excludeWords(excludeWords: String) = apply { body.excludeWords(excludeWords) }
/**
@@ -552,6 +555,8 @@ private constructor(
)
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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).
@@ -559,7 +564,7 @@ private constructor(
fun toolType(): ToolType = toolType.getRequired("toolType")
/**
- * Raw advanced search query appended as-is (tweet_search_extractor)
+ * Raw advanced query string appended to the estimate (tweet_search_extractor)
*
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -567,7 +572,7 @@ private constructor(
fun advancedQuery(): Optional = advancedQuery.getOptional("advancedQuery")
/**
- * Exact phrase to match (tweet_search_extractor)
+ * Exact phrase filter for search estimation
*
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -575,7 +580,7 @@ private constructor(
fun exactPhrase(): Optional = exactPhrase.getOptional("exactPhrase")
/**
- * Words to exclude from results (tweet_search_extractor)
+ * Words excluded from estimated search results
*
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
@@ -769,6 +774,7 @@ private constructor(
additionalProperties = body.additionalProperties.toMutableMap()
}
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = toolType(JsonField.of(toolType))
/**
@@ -780,7 +786,7 @@ private constructor(
*/
fun toolType(toolType: JsonField) = apply { this.toolType = toolType }
- /** Raw advanced search query appended as-is (tweet_search_extractor) */
+ /** Raw advanced query string appended to the estimate (tweet_search_extractor) */
fun advancedQuery(advancedQuery: String) = advancedQuery(JsonField.of(advancedQuery))
/**
@@ -794,7 +800,7 @@ private constructor(
this.advancedQuery = advancedQuery
}
- /** Exact phrase to match (tweet_search_extractor) */
+ /** Exact phrase filter for search estimation */
fun exactPhrase(exactPhrase: String) = exactPhrase(JsonField.of(exactPhrase))
/**
@@ -808,7 +814,7 @@ private constructor(
this.exactPhrase = exactPhrase
}
- /** Words to exclude from results (tweet_search_extractor) */
+ /** Words excluded from estimated search results */
fun excludeWords(excludeWords: String) = excludeWords(JsonField.of(excludeWords))
/**
@@ -1037,6 +1043,7 @@ private constructor(
"Body{toolType=$toolType, advancedQuery=$advancedQuery, exactPhrase=$exactPhrase, excludeWords=$excludeWords, searchQuery=$searchQuery, targetCommunityId=$targetCommunityId, targetListId=$targetListId, targetSpaceId=$targetSpaceId, targetTweetId=$targetTweetId, targetUsername=$targetUsername, additionalProperties=$additionalProperties}"
}
+ /** Identifier for the extraction tool used to run a job. */
class ToolType @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/extractions/ExtractionExportResultsParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionExportResultsParams.kt
index b43fdda..15900b3 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionExportResultsParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionExportResultsParams.kt
@@ -24,6 +24,7 @@ private constructor(
fun id(): Optional = Optional.ofNullable(id)
+ /** Export file format */
fun format(): Optional = Optional.ofNullable(format)
/** Additional headers to send with the request. */
@@ -66,6 +67,7 @@ private constructor(
/** Alias for calling [Builder.id] with `id.orElse(null)`. */
fun id(id: Optional) = id(id.getOrNull())
+ /** Export file format */
fun format(format: Format?) = apply { this.format = format }
/** Alias for calling [Builder.format] with `format.orElse(null)`. */
@@ -199,6 +201,7 @@ private constructor(
}
.build()
+ /** Export file format */
class Format @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/extractions/ExtractionJob.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionJob.kt
index fa48bb8..eb6d678 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionJob.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionJob.kt
@@ -19,6 +19,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Extraction job tracking status, tool type, and result count. */
class ExtractionJob
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -66,6 +67,8 @@ private constructor(
fun status(): Status = status.getRequired("status")
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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).
*/
@@ -213,6 +216,7 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = toolType(JsonField.of(toolType))
/**
@@ -466,6 +470,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Identifier for the extraction tool used to run a job. */
class ToolType @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/extractions/ExtractionListParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionListParams.kt
index c0769c4..2c0627e 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionListParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionListParams.kt
@@ -24,13 +24,16 @@ private constructor(
private val additionalQueryParams: QueryParams,
) : Params {
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(): Optional = Optional.ofNullable(after)
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(): Optional = Optional.ofNullable(limit)
+ /** Filter by job status */
fun status(): Optional = Optional.ofNullable(status)
+ /** Filter by extraction tool type */
fun toolType(): Optional = Optional.ofNullable(toolType)
/** Additional headers to send with the request. */
@@ -69,12 +72,13 @@ private constructor(
additionalQueryParams = extractionListParams.additionalQueryParams.toBuilder()
}
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(after: String?) = apply { this.after = after }
/** Alias for calling [Builder.after] with `after.orElse(null)`. */
fun after(after: Optional) = after(after.getOrNull())
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(limit: Long?) = apply { this.limit = limit }
/**
@@ -87,11 +91,13 @@ private constructor(
/** Alias for calling [Builder.limit] with `limit.orElse(null)`. */
fun limit(limit: Optional) = limit(limit.getOrNull())
+ /** Filter by job status */
fun status(status: Status?) = apply { this.status = status }
/** Alias for calling [Builder.status] with `status.orElse(null)`. */
fun status(status: Optional) = status(status.getOrNull())
+ /** Filter by extraction tool type */
fun toolType(toolType: ToolType?) = apply { this.toolType = toolType }
/** Alias for calling [Builder.toolType] with `toolType.orElse(null)`. */
@@ -224,6 +230,7 @@ private constructor(
}
.build()
+ /** Filter by job status */
class Status @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -357,6 +364,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Filter by extraction tool type */
class ToolType @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/extractions/ExtractionListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionListResponse.kt
index 86aadc7..bfc4718 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionListResponse.kt
@@ -241,6 +241,7 @@ private constructor(
(if (hasMore.asKnown().isPresent) 1 else 0) +
(if (nextCursor.asKnown().isPresent) 1 else 0)
+ /** Extraction job tracking status, tool type, and result count. */
class Extraction
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -293,6 +294,8 @@ private constructor(
fun status(): Status = status.getRequired("status")
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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).
@@ -447,6 +450,7 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = toolType(JsonField.of(toolType))
/**
@@ -705,6 +709,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Identifier for the extraction tool used to run a job. */
class ToolType @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/extractions/ExtractionRetrieveParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveParams.kt
index 4daafbd..7b4c2c3 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveParams.kt
@@ -21,9 +21,10 @@ private constructor(
fun id(): Optional = Optional.ofNullable(id)
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(): Optional = Optional.ofNullable(after)
+ /** Maximum number of results to return (1-1000, default 100) */
fun limit(): Optional = Optional.ofNullable(limit)
/** Additional headers to send with the request. */
@@ -65,12 +66,13 @@ private constructor(
/** Alias for calling [Builder.id] with `id.orElse(null)`. */
fun id(id: Optional) = id(id.getOrNull())
- /** Cursor for pagination */
+ /** Cursor for keyset pagination */
fun after(after: String?) = apply { this.after = after }
/** Alias for calling [Builder.after] with `after.orElse(null)`. */
fun after(after: Optional) = after(after.getOrNull())
+ /** Maximum number of results to return (1-1000, default 100) */
fun limit(limit: Long?) = apply { this.limit = limit }
/**
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveResponse.kt
index c5b275d..488f5a1 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRetrieveResponse.kt
@@ -46,6 +46,8 @@ private constructor(
fun hasMore(): Boolean = hasMore.getRequired("hasMore")
/**
+ * Extraction job metadata — shape varies by tool type (JSON)
+ *
* @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).
*/
@@ -146,6 +148,7 @@ private constructor(
*/
fun hasMore(hasMore: JsonField) = apply { this.hasMore = hasMore }
+ /** Extraction job metadata — shape varies by tool type (JSON) */
fun job(job: Job) = job(JsonField.of(job))
/**
@@ -269,6 +272,7 @@ private constructor(
(results.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (nextCursor.asKnown().isPresent) 1 else 0)
+ /** Extraction job metadata — shape varies by tool type (JSON) */
class Job
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunParams.kt
index 96d2335..ff38946 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunParams.kt
@@ -30,6 +30,8 @@ private constructor(
) : Params {
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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).
*/
@@ -217,6 +219,7 @@ private constructor(
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = apply { body.toolType(toolType) }
/**
@@ -552,6 +555,8 @@ private constructor(
)
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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).
@@ -769,6 +774,7 @@ private constructor(
additionalProperties = body.additionalProperties.toMutableMap()
}
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = toolType(JsonField.of(toolType))
/**
@@ -1037,6 +1043,7 @@ private constructor(
"Body{toolType=$toolType, advancedQuery=$advancedQuery, exactPhrase=$exactPhrase, excludeWords=$excludeWords, searchQuery=$searchQuery, targetCommunityId=$targetCommunityId, targetListId=$targetListId, targetSpaceId=$targetSpaceId, targetTweetId=$targetTweetId, targetUsername=$targetUsername, additionalProperties=$additionalProperties}"
}
+ /** Identifier for the extraction tool used to run a job. */
class ToolType @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/extractions/ExtractionRunResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunResponse.kt
index efcace5..3d384ed 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionRunResponse.kt
@@ -46,6 +46,8 @@ private constructor(
fun status(): Status = status.getRequired("status")
/**
+ * Identifier for the extraction tool used to run a job.
+ *
* @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).
*/
@@ -135,6 +137,7 @@ private constructor(
*/
fun status(status: JsonField) = apply { this.status = status }
+ /** Identifier for the extraction tool used to run a job. */
fun toolType(toolType: ToolType) = toolType(JsonField.of(toolType))
/**
@@ -341,6 +344,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Identifier for the extraction tool used to run a job. */
class ToolType @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/integrations/Integration.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/Integration.kt
index d5e93ca..a00121a 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/Integration.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/Integration.kt
@@ -21,6 +21,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Third-party integration (e.g. Telegram) subscribed to monitor events. */
class Integration
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -83,6 +84,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Integration config — shape varies by type (JSON)
+ *
* @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).
*/
@@ -95,6 +98,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -119,6 +124,8 @@ private constructor(
fun type(): Type = type.getRequired("type")
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -301,6 +308,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Integration config — shape varies by type (JSON) */
fun config(config: Config) = config(JsonField.of(config))
/**
@@ -322,6 +330,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -378,6 +387,7 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -529,6 +539,7 @@ private constructor(
(if (scopeAllMonitors.asKnown().isPresent) 1 else 0) +
(if (silentPush.asKnown().isPresent) 1 else 0)
+ /** Integration config — shape varies by type (JSON) */
class Config
@JsonCreator
private constructor(
@@ -628,6 +639,7 @@ private constructor(
override fun toString() = "Config{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -902,6 +914,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateParams.kt
index da00f53..1081983 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateParams.kt
@@ -39,6 +39,8 @@ private constructor(
fun config(): Config = body.config()
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -147,6 +149,7 @@ private constructor(
*/
fun config(config: JsonField) = apply { body.config(config) }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = apply { body.eventTypes(eventTypes) }
/**
@@ -363,6 +366,8 @@ private constructor(
fun config(): Config = config.getRequired("config")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
@@ -471,6 +476,7 @@ private constructor(
*/
fun config(config: JsonField) = apply { this.config = config }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -775,6 +781,7 @@ private constructor(
"Config{chatId=$chatId, additionalProperties=$additionalProperties}"
}
+ /** 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/integrations/IntegrationCreateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateResponse.kt
index ce362aa..0eff30a 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateResponse.kt
@@ -21,6 +21,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Third-party integration (e.g. Telegram) subscribed to monitor events. */
class IntegrationCreateResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -83,6 +84,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Integration config — shape varies by type (JSON)
+ *
* @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).
*/
@@ -95,6 +98,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -119,6 +124,8 @@ private constructor(
fun type(): Type = type.getRequired("type")
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -301,6 +308,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Integration config — shape varies by type (JSON) */
fun config(config: Config) = config(JsonField.of(config))
/**
@@ -322,6 +330,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -378,6 +387,7 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -529,6 +539,7 @@ private constructor(
(if (scopeAllMonitors.asKnown().isPresent) 1 else 0) +
(if (silentPush.asKnown().isPresent) 1 else 0)
+ /** Integration config — shape varies by type (JSON) */
class Config
@JsonCreator
private constructor(
@@ -628,6 +639,7 @@ private constructor(
override fun toString() = "Config{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -902,6 +914,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDelivery.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDelivery.kt
index ae1dcc6..9fc6c54 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDelivery.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDelivery.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Integration delivery attempt record with status and retry count. */
class IntegrationDelivery
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesParams.kt
index b5eee15..be7b04c 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesParams.kt
@@ -20,6 +20,7 @@ private constructor(
fun id(): Optional = Optional.ofNullable(id)
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(): Optional = Optional.ofNullable(limit)
/** Additional headers to send with the request. */
@@ -64,6 +65,7 @@ private constructor(
/** Alias for calling [Builder.id] with `id.orElse(null)`. */
fun id(id: Optional) = id(id.getOrNull())
+ /** Maximum number of items to return (1-100, default 50) */
fun limit(limit: Long?) = apply { this.limit = limit }
/**
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesResponse.kt
index 6caf9f4..b595f38 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListDeliveriesResponse.kt
@@ -180,6 +180,7 @@ private constructor(
internal fun validity(): Int =
(deliveries.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** Integration delivery attempt record with status and retry count. */
class Delivery
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListResponse.kt
index c75b31a..a74eb0e 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListResponse.kt
@@ -178,6 +178,7 @@ private constructor(
internal fun validity(): Int =
(integrations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ /** Third-party integration (e.g. Telegram) subscribed to monitor events. */
class Integration
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -243,6 +244,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Integration config — shape varies by type (JSON)
+ *
* @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).
@@ -257,6 +260,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
@@ -285,6 +290,8 @@ private constructor(
fun type(): Type = type.getRequired("type")
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
*/
@@ -471,6 +478,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Integration config — shape varies by type (JSON) */
fun config(config: Config) = config(JsonField.of(config))
/**
@@ -495,6 +503,7 @@ private constructor(
this.createdAt = createdAt
}
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -553,6 +562,7 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -706,6 +716,7 @@ private constructor(
(if (scopeAllMonitors.asKnown().isPresent) 1 else 0) +
(if (silentPush.asKnown().isPresent) 1 else 0)
+ /** Integration config — shape varies by type (JSON) */
class Config
@JsonCreator
private constructor(
@@ -808,6 +819,7 @@ private constructor(
override fun toString() = "Config{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) :
Enum {
@@ -1084,6 +1096,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationRetrieveResponse.kt
index fa24dc8..9484811 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationRetrieveResponse.kt
@@ -21,6 +21,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Third-party integration (e.g. Telegram) subscribed to monitor events. */
class IntegrationRetrieveResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -83,6 +84,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Integration config — shape varies by type (JSON)
+ *
* @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).
*/
@@ -95,6 +98,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -119,6 +124,8 @@ private constructor(
fun type(): Type = type.getRequired("type")
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -301,6 +308,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Integration config — shape varies by type (JSON) */
fun config(config: Config) = config(JsonField.of(config))
/**
@@ -322,6 +330,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -378,6 +387,7 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -529,6 +539,7 @@ private constructor(
(if (scopeAllMonitors.asKnown().isPresent) 1 else 0) +
(if (silentPush.asKnown().isPresent) 1 else 0)
+ /** Integration config — shape varies by type (JSON) */
class Config
@JsonCreator
private constructor(
@@ -628,6 +639,7 @@ private constructor(
override fun toString() = "Config{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -902,6 +914,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateParams.kt
index ed6d8cb..4188c51 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateParams.kt
@@ -34,12 +34,16 @@ private constructor(
fun id(): Optional = Optional.ofNullable(id)
/**
+ * Array of event types to subscribe to.
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun eventTypes(): Optional> = body.eventTypes()
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -52,6 +56,8 @@ private constructor(
fun isActive(): Optional = body.isActive()
/**
+ * Custom message template (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -178,6 +184,7 @@ private constructor(
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = apply { body.eventTypes(eventTypes) }
/**
@@ -198,6 +205,7 @@ private constructor(
*/
fun addEventType(eventType: EventType) = apply { body.addEventType(eventType) }
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = apply { body.filters(filters) }
/**
@@ -219,6 +227,7 @@ private constructor(
*/
fun isActive(isActive: JsonField) = apply { body.isActive(isActive) }
+ /** Custom message template (JSON) */
fun messageTemplate(messageTemplate: MessageTemplate) = apply {
body.messageTemplate(messageTemplate)
}
@@ -457,12 +466,16 @@ private constructor(
)
/**
+ * Array of event types to subscribe to.
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
*/
fun eventTypes(): Optional> = eventTypes.getOptional("eventTypes")
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
*/
@@ -475,6 +488,8 @@ private constructor(
fun isActive(): Optional = isActive.getOptional("isActive")
/**
+ * Custom message template (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
*/
@@ -600,6 +615,7 @@ private constructor(
additionalProperties = body.additionalProperties.toMutableMap()
}
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -625,6 +641,7 @@ private constructor(
}
}
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -647,6 +664,7 @@ private constructor(
*/
fun isActive(isActive: JsonField) = apply { this.isActive = isActive }
+ /** Custom message template (JSON) */
fun messageTemplate(messageTemplate: MessageTemplate) =
messageTemplate(JsonField.of(messageTemplate))
@@ -810,6 +828,7 @@ private constructor(
"Body{eventTypes=$eventTypes, filters=$filters, isActive=$isActive, messageTemplate=$messageTemplate, name=$name, scopeAllMonitors=$scopeAllMonitors, silentPush=$silentPush, additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -963,6 +982,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
@@ -1062,6 +1082,7 @@ private constructor(
override fun toString() = "Filters{additionalProperties=$additionalProperties}"
}
+ /** Custom message template (JSON) */
class MessageTemplate
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateResponse.kt
index 46c510e..97dc95e 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationUpdateResponse.kt
@@ -21,6 +21,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Third-party integration (e.g. Telegram) subscribed to monitor events. */
class IntegrationUpdateResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -83,6 +84,8 @@ private constructor(
fun id(): String = id.getRequired("id")
/**
+ * Integration config — shape varies by type (JSON)
+ *
* @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).
*/
@@ -95,6 +98,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -119,6 +124,8 @@ private constructor(
fun type(): Type = type.getRequired("type")
/**
+ * Event filter rules (JSON)
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -301,6 +308,7 @@ private constructor(
*/
fun id(id: JsonField) = apply { this.id = id }
+ /** Integration config — shape varies by type (JSON) */
fun config(config: Config) = config(JsonField.of(config))
/**
@@ -322,6 +330,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -378,6 +387,7 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -529,6 +539,7 @@ private constructor(
(if (scopeAllMonitors.asKnown().isPresent) 1 else 0) +
(if (silentPush.asKnown().isPresent) 1 else 0)
+ /** Integration config — shape varies by type (JSON) */
class Config
@JsonCreator
private constructor(
@@ -628,6 +639,7 @@ private constructor(
override fun toString() = "Config{additionalProperties=$additionalProperties}"
}
+ /** Type of monitor event fired when account activity occurs. */
class EventType @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
@@ -902,6 +914,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/Monitor.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/Monitor.kt
index 264356a..d5e2352 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/Monitor.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/Monitor.kt
@@ -20,6 +20,7 @@ import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
+/** Account monitor that tracks activity for a given X user. */
class Monitor
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -59,6 +60,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -201,6 +204,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -343,6 +347,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xUserId.asKnown().isPresent) 1 else 0)
+ /** 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/monitors/MonitorCreateParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorCreateParams.kt
index 7afdf68..3444b93 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorCreateParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorCreateParams.kt
@@ -31,6 +31,8 @@ private constructor(
) : Params {
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -106,6 +108,7 @@ private constructor(
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = apply { body.eventTypes(eventTypes) }
/**
@@ -298,6 +301,8 @@ private constructor(
) : this(eventTypes, username, mutableMapOf())
/**
+ * Array of event types to subscribe to.
+ *
* @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).
@@ -369,6 +374,7 @@ private constructor(
additionalProperties = body.additionalProperties.toMutableMap()
}
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -498,6 +504,7 @@ private constructor(
"Body{eventTypes=$eventTypes, username=$username, additionalProperties=$additionalProperties}"
}
+ /** 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/monitors/MonitorCreateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorCreateResponse.kt
index 97199ba..a91144e 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorCreateResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorCreateResponse.kt
@@ -57,6 +57,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -183,6 +185,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -310,6 +313,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xUserId.asKnown().isPresent) 1 else 0)
+ /** 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/monitors/MonitorListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorListResponse.kt
index 74fb015..122f2f3 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorListResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorListResponse.kt
@@ -207,6 +207,7 @@ private constructor(
(monitors.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (total.asKnown().isPresent) 1 else 0)
+ /** Account monitor that tracks activity for a given X user. */
class Monitor
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -252,6 +253,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
@@ -401,6 +404,7 @@ private constructor(
this.createdAt = createdAt
}
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -546,6 +550,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xUserId.asKnown().isPresent) 1 else 0)
+ /** 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/monitors/MonitorRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorRetrieveResponse.kt
index 43a9471..73895f8 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorRetrieveResponse.kt
@@ -20,6 +20,7 @@ import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
+/** Account monitor that tracks activity for a given X user. */
class MonitorRetrieveResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -59,6 +60,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -201,6 +204,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -343,6 +347,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xUserId.asKnown().isPresent) 1 else 0)
+ /** 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/monitors/MonitorUpdateParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorUpdateParams.kt
index 03f85bf..5b5dc4f 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorUpdateParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorUpdateParams.kt
@@ -34,6 +34,8 @@ private constructor(
fun id(): Optional = Optional.ofNullable(id)
/**
+ * Array of event types to subscribe to.
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
@@ -108,6 +110,7 @@ private constructor(
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = apply { body.eventTypes(eventTypes) }
/**
@@ -301,6 +304,8 @@ private constructor(
) : this(eventTypes, isActive, mutableMapOf())
/**
+ * Array of event types to subscribe to.
+ *
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type
* (e.g. if the server responded with an unexpected value).
*/
@@ -360,6 +365,7 @@ private constructor(
additionalProperties = body.additionalProperties.toMutableMap()
}
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -480,6 +486,7 @@ private constructor(
"Body{eventTypes=$eventTypes, isActive=$isActive, additionalProperties=$additionalProperties}"
}
+ /** 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/monitors/MonitorUpdateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorUpdateResponse.kt
index 84a791c..51e4cbc 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorUpdateResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/monitors/MonitorUpdateResponse.kt
@@ -20,6 +20,7 @@ import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
+/** Account monitor that tracks activity for a given X user. */
class MonitorUpdateResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -59,6 +60,8 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
/**
+ * Array of event types to subscribe to.
+ *
* @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).
*/
@@ -201,6 +204,7 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Array of event types to subscribe to. */
fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
/**
@@ -343,6 +347,7 @@ private constructor(
(if (username.asKnown().isPresent) 1 else 0) +
(if (xUserId.asKnown().isPresent) 1 else 0)
+ /** 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/radar/RadarItem.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarItem.kt
index 153dea2..7231e8e 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarItem.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarItem.kt
@@ -17,6 +17,7 @@ import java.util.Collections
import java.util.Objects
import java.util.Optional
+/** Trending topic with score, category, source, and region. */
class RadarItem
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsParams.kt
index 9c74f5c..a00f5fb 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsParams.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsParams.kt
@@ -2,9 +2,13 @@
package com.x_twitter_scraper.api.models.radar
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.x_twitter_scraper.api.core.Enum
+import com.x_twitter_scraper.api.core.JsonField
import com.x_twitter_scraper.api.core.Params
import com.x_twitter_scraper.api.core.http.Headers
import com.x_twitter_scraper.api.core.http.QueryParams
+import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
@@ -16,7 +20,7 @@ private constructor(
private val count: Long?,
private val hours: Long?,
private val region: String?,
- private val source: String?,
+ private val source: Source?,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
) : Params {
@@ -37,7 +41,7 @@ private constructor(
* Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, trustmrr,
* wikipedia
*/
- fun source(): Optional = Optional.ofNullable(source)
+ fun source(): Optional = Optional.ofNullable(source)
/** Additional headers to send with the request. */
fun _additionalHeaders(): Headers = additionalHeaders
@@ -65,7 +69,7 @@ private constructor(
private var count: Long? = null
private var hours: Long? = null
private var region: String? = null
- private var source: String? = null
+ private var source: Source? = null
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@@ -124,10 +128,10 @@ private constructor(
* Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, trustmrr,
* wikipedia
*/
- fun source(source: String?) = apply { this.source = source }
+ fun source(source: Source?) = apply { this.source = source }
/** Alias for calling [Builder.source] with `source.orElse(null)`. */
- fun source(source: Optional) = source(source.getOrNull())
+ fun source(source: Optional) = source(source.getOrNull())
fun additionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.clear()
@@ -253,11 +257,172 @@ private constructor(
count?.let { put("count", it.toString()) }
hours?.let { put("hours", it.toString()) }
region?.let { put("region", it) }
- source?.let { put("source", it) }
+ source?.let { put("source", it.toString()) }
putAll(additionalQueryParams)
}
.build()
+ /**
+ * Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, trustmrr,
+ * wikipedia
+ */
+ class Source @JsonCreator private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val GITHUB = of("github")
+
+ @JvmField val GOOGLE_TRENDS = of("google_trends")
+
+ @JvmField val HACKER_NEWS = of("hacker_news")
+
+ @JvmField val POLYMARKET = of("polymarket")
+
+ @JvmField val REDDIT = of("reddit")
+
+ @JvmField val TRUSTMRR = of("trustmrr")
+
+ @JvmField val WIKIPEDIA = of("wikipedia")
+
+ @JvmStatic fun of(value: String) = Source(JsonField.of(value))
+ }
+
+ /** An enum containing [Source]'s known values. */
+ enum class Known {
+ GITHUB,
+ GOOGLE_TRENDS,
+ HACKER_NEWS,
+ POLYMARKET,
+ REDDIT,
+ TRUSTMRR,
+ WIKIPEDIA,
+ }
+
+ /**
+ * An enum containing [Source]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Source] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ GITHUB,
+ GOOGLE_TRENDS,
+ HACKER_NEWS,
+ POLYMARKET,
+ REDDIT,
+ TRUSTMRR,
+ WIKIPEDIA,
+ /** An enum member indicating that [Source] was instantiated with an unknown value. */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ GITHUB -> Value.GITHUB
+ GOOGLE_TRENDS -> Value.GOOGLE_TRENDS
+ HACKER_NEWS -> Value.HACKER_NEWS
+ POLYMARKET -> Value.POLYMARKET
+ REDDIT -> Value.REDDIT
+ TRUSTMRR -> Value.TRUSTMRR
+ WIKIPEDIA -> Value.WIKIPEDIA
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws XTwitterScraperInvalidDataException if this class instance's value is a not a
+ * known member.
+ */
+ fun known(): Known =
+ when (this) {
+ GITHUB -> Known.GITHUB
+ GOOGLE_TRENDS -> Known.GOOGLE_TRENDS
+ HACKER_NEWS -> Known.HACKER_NEWS
+ POLYMARKET -> Known.POLYMARKET
+ REDDIT -> Known.REDDIT
+ TRUSTMRR -> Known.TRUSTMRR
+ WIKIPEDIA -> Known.WIKIPEDIA
+ else -> throw XTwitterScraperInvalidDataException("Unknown Source: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws XTwitterScraperInvalidDataException if this class instance's value does not have
+ * the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ XTwitterScraperInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Source = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ 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 (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Source && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
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/radar/RadarRetrieveTrendingTopicsResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsResponse.kt
index ee848b7..8a4834d 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/radar/RadarRetrieveTrendingTopicsResponse.kt
@@ -207,6 +207,7 @@ private constructor(
(items.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (total.asKnown().isPresent) 1 else 0)
+ /** Trending topic with score, category, source, and region. */
class Item
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleAnalyzeResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleAnalyzeResponse.kt
index 8f7c1c5..9276b0a 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleAnalyzeResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleAnalyzeResponse.kt
@@ -20,6 +20,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
+/** Full style profile with sampled tweets used for tone analysis. */
class StyleAnalyzeResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleCompareResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleCompareResponse.kt
index e42856e..90baaa7 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleCompareResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleCompareResponse.kt
@@ -35,12 +35,16 @@ private constructor(
) : this(style1, style2, mutableMapOf())
/**
+ * Full style profile with sampled tweets used for tone analysis.
+ *
* @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 style1(): Style1 = style1.getRequired("style1")
/**
+ * Full style profile with sampled tweets used for tone analysis.
+ *
* @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).
*/
@@ -100,6 +104,7 @@ private constructor(
additionalProperties = styleCompareResponse.additionalProperties.toMutableMap()
}
+ /** Full style profile with sampled tweets used for tone analysis. */
fun style1(style1: Style1) = style1(JsonField.of(style1))
/**
@@ -110,6 +115,7 @@ private constructor(
*/
fun style1(style1: JsonField) = apply { this.style1 = style1 }
+ /** Full style profile with sampled tweets used for tone analysis. */
fun style2(style2: Style2) = style2(JsonField.of(style2))
/**
@@ -190,6 +196,7 @@ private constructor(
(style1.asKnown().getOrNull()?.validity() ?: 0) +
(style2.asKnown().getOrNull()?.validity() ?: 0)
+ /** Full style profile with sampled tweets used for tone analysis. */
class Style1
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -807,6 +814,7 @@ private constructor(
"Style1{fetchedAt=$fetchedAt, isOwnAccount=$isOwnAccount, tweetCount=$tweetCount, tweets=$tweets, xUsername=$xUsername, additionalProperties=$additionalProperties}"
}
+ /** Full style profile with sampled tweets used for tone analysis. */
class Style2
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleDeleteParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleDeleteParams.kt
deleted file mode 100644
index 73c092b..0000000
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/styles/StyleDeleteParams.kt
+++ /dev/null
@@ -1,229 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.x_twitter_scraper.api.models.styles
-
-import com.x_twitter_scraper.api.core.JsonValue
-import com.x_twitter_scraper.api.core.Params
-import com.x_twitter_scraper.api.core.http.Headers
-import com.x_twitter_scraper.api.core.http.QueryParams
-import com.x_twitter_scraper.api.core.toImmutable
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-/** Delete a style profile */
-class StyleDeleteParams
-private constructor(
- private val username: String?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
- private val additionalBodyProperties: Map,
-) : Params {
-
- fun username(): Optional = Optional.ofNullable(username)
-
- /** Additional body properties to send with the request. */
- fun _additionalBodyProperties(): Map = additionalBodyProperties
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun none(): StyleDeleteParams = builder().build()
-
- /** Returns a mutable builder for constructing an instance of [StyleDeleteParams]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [StyleDeleteParams]. */
- class Builder internal constructor() {
-
- private var username: String? = null
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
- private var additionalBodyProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(styleDeleteParams: StyleDeleteParams) = apply {
- username = styleDeleteParams.username
- additionalHeaders = styleDeleteParams.additionalHeaders.toBuilder()
- additionalQueryParams = styleDeleteParams.additionalQueryParams.toBuilder()
- additionalBodyProperties = styleDeleteParams.additionalBodyProperties.toMutableMap()
- }
-
- fun username(username: String?) = apply { this.username = username }
-
- /** Alias for calling [Builder.username] with `username.orElse(null)`. */
- fun username(username: Optional) = username(username.getOrNull())
-
- fun additionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun additionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun putAdditionalHeader(name: String, value: String) = apply {
- additionalHeaders.put(name, value)
- }
-
- fun putAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.put(name, values)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun replaceAdditionalHeaders(name: String, value: String) = apply {
- additionalHeaders.replace(name, value)
- }
-
- fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.replace(name, values)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
-
- fun removeAllAdditionalHeaders(names: Set) = apply {
- additionalHeaders.removeAll(names)
- }
-
- fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun additionalQueryParams(additionalQueryParams: Map>) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun putAdditionalQueryParam(key: String, value: String) = apply {
- additionalQueryParams.put(key, value)
- }
-
- fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.put(key, values)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun replaceAdditionalQueryParams(key: String, value: String) = apply {
- additionalQueryParams.replace(key, value)
- }
-
- fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.replace(key, values)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
-
- fun removeAllAdditionalQueryParams(keys: Set) = apply {
- additionalQueryParams.removeAll(keys)
- }
-
- fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
- this.additionalBodyProperties.clear()
- putAllAdditionalBodyProperties(additionalBodyProperties)
- }
-
- fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
- additionalBodyProperties.put(key, value)
- }
-
- fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
- apply {
- this.additionalBodyProperties.putAll(additionalBodyProperties)
- }
-
- fun removeAdditionalBodyProperty(key: String) = apply {
- additionalBodyProperties.remove(key)
- }
-
- fun removeAllAdditionalBodyProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalBodyProperty)
- }
-
- /**
- * Returns an immutable instance of [StyleDeleteParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): StyleDeleteParams =
- StyleDeleteParams(
- username,
- additionalHeaders.build(),
- additionalQueryParams.build(),
- additionalBodyProperties.toImmutable(),
- )
- }
-
- fun _body(): Optional