Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0"
".": "0.3.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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-46a9af86900d469595bc007c73410022306d0863a896758d9c3c1250fbe937a3.yml
openapi_spec_hash: d858851b15eb367466f343da3cb2d556
config_hash: 8894c96caeb6df84c9394518810221bd
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.3.0 (2026-04-02)

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 ([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)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.x_twitter_scraper.api/x-twitter-scraper-java)](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0)
[![javadoc](https://javadoc.io/badge2/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0/javadoc.svg)](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.2.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.x_twitter_scraper.api/x-twitter-scraper-java)](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)
[![javadoc](https://javadoc.io/badge2/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0/javadoc.svg)](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)

<!-- x-release-please-end -->

Expand All @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).

<!-- x-release-please-start-version -->

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).

<!-- x-release-please-end -->

Expand All @@ -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
Expand All @@ -35,7 +35,7 @@ implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.2.0")
<dependency>
<groupId>com.x_twitter_scraper.api</groupId>
<artifactId>x-twitter-scraper-java</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, JsonValue>
private val feedback: JsonField<String>,
private val score: JsonField<Double>,
private val suggestions: JsonField<List<String>>,
private val text: JsonField<String>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

@JsonCreator
private constructor(
@JsonProperty("feedback") @ExcludeMissing feedback: JsonField<String> = JsonMissing.of(),
@JsonProperty("score") @ExcludeMissing score: JsonField<Double> = JsonMissing.of(),
@JsonProperty("suggestions")
@ExcludeMissing
suggestions: JsonField<List<String>> = JsonMissing.of(),
@JsonProperty("text") @ExcludeMissing text: JsonField<String> = 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<String> = 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<Double> = 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<List<String>> = 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<String> = 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<String> = 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<Double> = 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<List<String>> = 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<String> = text

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
}

@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
fun _additionalProperties(): Map<String, JsonValue> =
Collections.unmodifiableMap(additionalProperties)

fun toBuilder() = Builder().from(this)

Expand All @@ -32,13 +121,80 @@ private constructor(
/** A builder for [ComposeCreateResponse]. */
class Builder internal constructor() {

private var feedback: JsonField<String> = JsonMissing.of()
private var score: JsonField<Double> = JsonMissing.of()
private var suggestions: JsonField<MutableList<String>>? = null
private var text: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = 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<String>) = 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<Double>) = apply { this.score = score }

/** Improvement suggestions */
fun suggestions(suggestions: List<String>) = suggestions(JsonField.of(suggestions))

/**
* Sets [Builder.suggestions] to an arbitrary JSON value.
*
* You should usually call [Builder.suggestions] with a well-typed `List<String>` value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun suggestions(suggestions: JsonField<List<String>>) = 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<String>) = apply { this.text = text }

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand All @@ -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
Expand All @@ -74,6 +236,10 @@ private constructor(
return@apply
}

feedback()
score()
suggestions()
text()
validated = true
}

Expand All @@ -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}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down Expand Up @@ -203,6 +205,7 @@ private constructor(
*/
fun id(id: JsonField<String>) = apply { this.id = id }

/** Event payload — shape varies by event type (JSON) */
fun data(data: Data) = data(JsonField.of(data))

/**
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down Expand Up @@ -203,6 +205,7 @@ private constructor(
*/
fun id(id: JsonField<String>) = apply { this.id = id }

/** Event payload — shape varies by event type (JSON) */
fun data(data: Data) = data(JsonField.of(data))

/**
Expand Down Expand Up @@ -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(
Expand Down
Loading
Loading