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..193a413 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-61e27e87d4182e5230beae1edaf864a00a5c5f9b96defcdb9a4503544463328f.yml
+openapi_spec_hash: 782f8974cd27e51c8a7993f61b139f72
config_hash: 8894c96caeb6df84c9394518810221bd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2239e78..80dcda7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,16 @@
# Changelog
+## 0.3.0 (2026-04-07)
+
+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 ([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..752032b 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0)
-[](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0)
+[](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)
+[](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)
@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-The REST API documentation can be found on [xquik.com](https://xquik.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0).
+The REST API documentation can be found on [xquik.com](https://xquik.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0).
@@ -26,7 +26,7 @@ The REST API documentation can be found on [xquik.com](https://xquik.com). Javad
### Gradle
```kotlin
-implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.2.0")
+implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.3.0")
```
### Maven
@@ -35,7 +35,7 @@ implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.2.0")
com.x_twitter_scraper.api
x-twitter-scraper-java
- 0.2.0
+ 0.3.0
```
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/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..6085676 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
@@ -252,6 +252,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 +272,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 +294,7 @@ private constructor(
author,
bookmarkCount,
createdAt,
+ isNoteTweet,
likeCount,
quoteCount,
replyCount,
@@ -330,6 +335,14 @@ private constructor(
*/
fun createdAt(): Optional = createdAt.getOptional("createdAt")
+ /**
+ * Whether this is a Note Tweet (long-form post, 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 +411,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 +492,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 +507,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 +573,20 @@ private constructor(
*/
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
+ /** Whether this is a Note Tweet (long-form post, 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 +683,7 @@ private constructor(
author,
bookmarkCount,
createdAt,
+ isNoteTweet,
likeCount,
quoteCount,
replyCount,
@@ -666,6 +705,7 @@ private constructor(
author().ifPresent { it.validate() }
bookmarkCount()
createdAt()
+ isNoteTweet()
likeCount()
quoteCount()
replyCount()
@@ -695,6 +735,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 +1025,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 +1041,7 @@ private constructor(
author,
bookmarkCount,
createdAt,
+ isNoteTweet,
likeCount,
quoteCount,
replyCount,
@@ -1011,7 +1054,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/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/events/EventDetail.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/events/EventDetail.kt
index c6b2f6b..90158a7 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
@@ -53,6 +53,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).
*/
@@ -203,6 +205,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))
/**
@@ -356,6 +359,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(
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..8316411 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
@@ -53,6 +53,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).
*/
@@ -203,6 +205,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))
/**
@@ -356,6 +359,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(
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/integrations/Integration.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/Integration.kt
index d5e93ca..1519889 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
@@ -83,6 +83,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).
*/
@@ -119,6 +121,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 +305,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))
/**
@@ -378,6 +383,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 +535,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(
@@ -902,6 +909,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/IntegrationCreateResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateResponse.kt
index ce362aa..b1a8b89 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
@@ -83,6 +83,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).
*/
@@ -119,6 +121,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 +305,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))
/**
@@ -378,6 +383,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 +535,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(
@@ -902,6 +909,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/IntegrationListResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationListResponse.kt
index c75b31a..0bb4b6b 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
@@ -243,6 +243,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).
@@ -285,6 +287,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 +475,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))
/**
@@ -553,6 +558,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 +712,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(
@@ -1084,6 +1091,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..adfadfa 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
@@ -83,6 +83,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).
*/
@@ -119,6 +121,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 +305,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))
/**
@@ -378,6 +383,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 +535,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(
@@ -902,6 +909,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..187cd1e 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
@@ -40,6 +40,8 @@ private constructor(
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 +54,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).
*/
@@ -198,6 +202,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 +224,7 @@ private constructor(
*/
fun isActive(isActive: JsonField) = apply { body.isActive(isActive) }
+ /** Custom message template (JSON) */
fun messageTemplate(messageTemplate: MessageTemplate) = apply {
body.messageTemplate(messageTemplate)
}
@@ -463,6 +469,8 @@ private constructor(
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 +483,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).
*/
@@ -625,6 +635,7 @@ private constructor(
}
}
+ /** Event filter rules (JSON) */
fun filters(filters: Filters) = filters(JsonField.of(filters))
/**
@@ -647,6 +658,7 @@ private constructor(
*/
fun isActive(isActive: JsonField) = apply { this.isActive = isActive }
+ /** Custom message template (JSON) */
fun messageTemplate(messageTemplate: MessageTemplate) =
messageTemplate(JsonField.of(messageTemplate))
@@ -963,6 +975,7 @@ private constructor(
override fun toString() = value.toString()
}
+ /** Event filter rules (JSON) */
class Filters
@JsonCreator
private constructor(
@@ -1062,6 +1075,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..22121e8 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
@@ -83,6 +83,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).
*/
@@ -119,6 +121,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 +305,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))
/**
@@ -378,6 +383,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 +535,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(
@@ -902,6 +909,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/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/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