diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6b7b74c..da59f99 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.3.0"
+ ".": "0.4.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index db87955..d470135 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 117
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-d40c57a05527faf060d21c0e013729f371d88017b10680cea7c8fd6780ffaef5.yml
-openapi_spec_hash: 597ebc460cf86740b9f6f7c95478dece
-config_hash: 30ce23c9cfbf8fb8be9e5dd28a2124fa
+configured_endpoints: 110
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-2adc33156b4b42a4be18cc20c0205b38f0432d7958da99c65ee9b3f6a555ea0e.yml
+openapi_spec_hash: be760f5620a268521d6793f65576a61f
+config_hash: 320a9cb2f1293d1a7b73c63ab5865af5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ee5e83..e6a1d15 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,32 @@
# Changelog
+## 0.4.0 (2026-04-25)
+
+Full Changelog: [v0.3.0...v0.4.0](https://github.com/Xquik-dev/x-twitter-scraper-java/compare/v0.3.0...v0.4.0)
+
+### Features
+
+* **api:** api update ([30c1879](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/30c1879055bd1a7fb925a8dc674fbbd932c29f9f))
+* **api:** api update ([5e2cc73](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/5e2cc73283addfe9ac177efb47623c0f51dedf8e))
+* **api:** api update ([6022295](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/6022295c6a25bd0b0797c85ae96304cc3eeb2103))
+* **api:** api update ([d4c753a](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/d4c753ab0a9ee134dc567e576dac2892407e7e29))
+
+
+### Bug Fixes
+
+* escape ampersand in OpenAPI summaries for C# XML docs ([fb78c9a](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/fb78c9aea1252be7535e3b5efcc5f916805831d4))
+
+
+### Chores
+
+* sync OpenAPI spec ([c225ad8](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/c225ad8eb377c71093ce3f9b5292257ce191ed3a))
+* wire production_repo for all targets ([1a3de89](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/1a3de8994dc023e9602bc359a0f5067f03082e9a))
+
+
+### Documentation
+
+* add Contributor Covenant 2.1 Code of Conduct ([#2192](https://github.com/Xquik-dev/x-twitter-scraper-java/issues/2192)) ([afb97b0](https://github.com/Xquik-dev/x-twitter-scraper-java/commit/afb97b0d326a8ff3602f871cd12daa63c7a3d847))
+
## 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)
diff --git a/README.md b/README.md
index c3a3578..fe78e68 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.3.0)
-[](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.3.0)
+[](https://central.sonatype.com/artifact/com.x_twitter_scraper.api/x-twitter-scraper-java/0.4.0)
+[](https://javadoc.io/doc/com.x_twitter_scraper.api/x-twitter-scraper-java/0.4.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.3.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.4.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.3.0")
+implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.4.0")
```
### Maven
@@ -35,7 +35,7 @@ implementation("com.x_twitter_scraper.api:x-twitter-scraper-java:0.3.0")
com.x_twitter_scraper.api
x-twitter-scraper-java
- 0.3.0
+ 0.4.0
```
@@ -85,7 +85,6 @@ import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient;
XTwitterScraperClient client = XTwitterScraperOkHttpClient.builder()
.apiKey("My API Key")
- .bearerToken("My Bearer Token")
.build();
```
@@ -564,21 +563,6 @@ TweetSearchParams params = TweetSearchParams.builder()
These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.
-To set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:
-
-```java
-import com.x_twitter_scraper.api.core.JsonValue;
-import com.x_twitter_scraper.api.models.integrations.IntegrationCreateParams;
-
-IntegrationCreateParams params = IntegrationCreateParams.builder()
- .config(IntegrationCreateParams.Config.builder()
- .putAdditionalProperty("secretProperty", JsonValue.from("42"))
- .build())
- .build();
-```
-
-These properties can be accessed on the nested built object later using the `_additionalProperties()` method.
-
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/Values.kt) object to its setter:
```java
diff --git a/build.gradle.kts b/build.gradle.kts
index 93d1d37..36ef221 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.x_twitter_scraper.api"
- version = "0.3.0" // x-release-please-version
+ version = "0.4.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 c59ccf8..f090adc 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("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.")
+ description.set("Look up any tweet, user, or trend on X. Search tweets, check follower\nrelationships, download media, and monitor accounts in real time. 32 pay-per-use\nread endpoints work without a subscription — just pay per call. Write endpoints\n(post, like, retweet, follow, DM) and automation endpoints (bulk extractions,\ngiveaway draws, monitors, webhooks) require an API key or OAuth 2.1 bearer\ntoken.")
url.set("https://xquik.com")
licenses {
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClient.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClient.kt
index f9265b9..cf3e6dc 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClient.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClient.kt
@@ -5,14 +5,12 @@ package com.x_twitter_scraper.api.client
import com.x_twitter_scraper.api.core.ClientOptions
import com.x_twitter_scraper.api.services.blocking.AccountService
import com.x_twitter_scraper.api.services.blocking.ApiKeyService
-import com.x_twitter_scraper.api.services.blocking.BotService
import com.x_twitter_scraper.api.services.blocking.ComposeService
import com.x_twitter_scraper.api.services.blocking.CreditService
import com.x_twitter_scraper.api.services.blocking.DraftService
import com.x_twitter_scraper.api.services.blocking.DrawService
import com.x_twitter_scraper.api.services.blocking.EventService
import com.x_twitter_scraper.api.services.blocking.ExtractionService
-import com.x_twitter_scraper.api.services.blocking.IntegrationService
import com.x_twitter_scraper.api.services.blocking.MonitorService
import com.x_twitter_scraper.api.services.blocking.RadarService
import com.x_twitter_scraper.api.services.blocking.StyleService
@@ -59,25 +57,25 @@ interface XTwitterScraperClient {
*/
fun withOptions(modifier: Consumer): XTwitterScraperClient
- /** Account info & settings */
+ /** Account info and settings */
fun account(): AccountService
/** API key management (session auth only) */
fun apiKeys(): ApiKeyService
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun subscribe(): SubscribeService
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun compose(): ComposeService
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun drafts(): DraftService
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun styles(): StyleService
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun radar(): RadarService
/** Real-time X account monitoring */
@@ -92,23 +90,17 @@ interface XTwitterScraperClient {
/** Giveaway draws from tweet replies */
fun draws(): DrawService
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
fun webhooks(): WebhookService
- /** Push notification integrations (Telegram) */
- fun integrations(): IntegrationService
-
- /** X data lookups (subscription required) */
fun x(): XService
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
fun trends(): TrendService
- fun bot(): BotService
-
fun support(): SupportService
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun credits(): CreditService
/**
@@ -138,25 +130,25 @@ interface XTwitterScraperClient {
modifier: Consumer
): XTwitterScraperClient.WithRawResponse
- /** Account info & settings */
+ /** Account info and settings */
fun account(): AccountService.WithRawResponse
/** API key management (session auth only) */
fun apiKeys(): ApiKeyService.WithRawResponse
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun subscribe(): SubscribeService.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun compose(): ComposeService.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun drafts(): DraftService.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun styles(): StyleService.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun radar(): RadarService.WithRawResponse
/** Real-time X account monitoring */
@@ -171,23 +163,17 @@ interface XTwitterScraperClient {
/** Giveaway draws from tweet replies */
fun draws(): DrawService.WithRawResponse
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
fun webhooks(): WebhookService.WithRawResponse
- /** Push notification integrations (Telegram) */
- fun integrations(): IntegrationService.WithRawResponse
-
- /** X data lookups (subscription required) */
fun x(): XService.WithRawResponse
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
fun trends(): TrendService.WithRawResponse
- fun bot(): BotService.WithRawResponse
-
fun support(): SupportService.WithRawResponse
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun credits(): CreditService.WithRawResponse
}
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsync.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsync.kt
index 39c429d..6de1cbe 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsync.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsync.kt
@@ -5,14 +5,12 @@ package com.x_twitter_scraper.api.client
import com.x_twitter_scraper.api.core.ClientOptions
import com.x_twitter_scraper.api.services.async.AccountServiceAsync
import com.x_twitter_scraper.api.services.async.ApiKeyServiceAsync
-import com.x_twitter_scraper.api.services.async.BotServiceAsync
import com.x_twitter_scraper.api.services.async.ComposeServiceAsync
import com.x_twitter_scraper.api.services.async.CreditServiceAsync
import com.x_twitter_scraper.api.services.async.DraftServiceAsync
import com.x_twitter_scraper.api.services.async.DrawServiceAsync
import com.x_twitter_scraper.api.services.async.EventServiceAsync
import com.x_twitter_scraper.api.services.async.ExtractionServiceAsync
-import com.x_twitter_scraper.api.services.async.IntegrationServiceAsync
import com.x_twitter_scraper.api.services.async.MonitorServiceAsync
import com.x_twitter_scraper.api.services.async.RadarServiceAsync
import com.x_twitter_scraper.api.services.async.StyleServiceAsync
@@ -59,25 +57,25 @@ interface XTwitterScraperClientAsync {
*/
fun withOptions(modifier: Consumer): XTwitterScraperClientAsync
- /** Account info & settings */
+ /** Account info and settings */
fun account(): AccountServiceAsync
/** API key management (session auth only) */
fun apiKeys(): ApiKeyServiceAsync
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun subscribe(): SubscribeServiceAsync
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun compose(): ComposeServiceAsync
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun drafts(): DraftServiceAsync
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun styles(): StyleServiceAsync
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun radar(): RadarServiceAsync
/** Real-time X account monitoring */
@@ -92,23 +90,17 @@ interface XTwitterScraperClientAsync {
/** Giveaway draws from tweet replies */
fun draws(): DrawServiceAsync
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
fun webhooks(): WebhookServiceAsync
- /** Push notification integrations (Telegram) */
- fun integrations(): IntegrationServiceAsync
-
- /** X data lookups (subscription required) */
fun x(): XServiceAsync
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
fun trends(): TrendServiceAsync
- fun bot(): BotServiceAsync
-
fun support(): SupportServiceAsync
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun credits(): CreditServiceAsync
/**
@@ -139,25 +131,25 @@ interface XTwitterScraperClientAsync {
modifier: Consumer
): XTwitterScraperClientAsync.WithRawResponse
- /** Account info & settings */
+ /** Account info and settings */
fun account(): AccountServiceAsync.WithRawResponse
/** API key management (session auth only) */
fun apiKeys(): ApiKeyServiceAsync.WithRawResponse
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun subscribe(): SubscribeServiceAsync.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun compose(): ComposeServiceAsync.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun drafts(): DraftServiceAsync.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun styles(): StyleServiceAsync.WithRawResponse
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
fun radar(): RadarServiceAsync.WithRawResponse
/** Real-time X account monitoring */
@@ -172,23 +164,17 @@ interface XTwitterScraperClientAsync {
/** Giveaway draws from tweet replies */
fun draws(): DrawServiceAsync.WithRawResponse
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
fun webhooks(): WebhookServiceAsync.WithRawResponse
- /** Push notification integrations (Telegram) */
- fun integrations(): IntegrationServiceAsync.WithRawResponse
-
- /** X data lookups (subscription required) */
fun x(): XServiceAsync.WithRawResponse
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
fun trends(): TrendServiceAsync.WithRawResponse
- fun bot(): BotServiceAsync.WithRawResponse
-
fun support(): SupportServiceAsync.WithRawResponse
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
fun credits(): CreditServiceAsync.WithRawResponse
}
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsyncImpl.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsyncImpl.kt
index 5917e0a..8e09841 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsyncImpl.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientAsyncImpl.kt
@@ -8,8 +8,6 @@ import com.x_twitter_scraper.api.services.async.AccountServiceAsync
import com.x_twitter_scraper.api.services.async.AccountServiceAsyncImpl
import com.x_twitter_scraper.api.services.async.ApiKeyServiceAsync
import com.x_twitter_scraper.api.services.async.ApiKeyServiceAsyncImpl
-import com.x_twitter_scraper.api.services.async.BotServiceAsync
-import com.x_twitter_scraper.api.services.async.BotServiceAsyncImpl
import com.x_twitter_scraper.api.services.async.ComposeServiceAsync
import com.x_twitter_scraper.api.services.async.ComposeServiceAsyncImpl
import com.x_twitter_scraper.api.services.async.CreditServiceAsync
@@ -22,8 +20,6 @@ import com.x_twitter_scraper.api.services.async.EventServiceAsync
import com.x_twitter_scraper.api.services.async.EventServiceAsyncImpl
import com.x_twitter_scraper.api.services.async.ExtractionServiceAsync
import com.x_twitter_scraper.api.services.async.ExtractionServiceAsyncImpl
-import com.x_twitter_scraper.api.services.async.IntegrationServiceAsync
-import com.x_twitter_scraper.api.services.async.IntegrationServiceAsyncImpl
import com.x_twitter_scraper.api.services.async.MonitorServiceAsync
import com.x_twitter_scraper.api.services.async.MonitorServiceAsyncImpl
import com.x_twitter_scraper.api.services.async.RadarServiceAsync
@@ -106,18 +102,12 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
WebhookServiceAsyncImpl(clientOptionsWithUserAgent)
}
- private val integrations: IntegrationServiceAsync by lazy {
- IntegrationServiceAsyncImpl(clientOptionsWithUserAgent)
- }
-
private val x: XServiceAsync by lazy { XServiceAsyncImpl(clientOptionsWithUserAgent) }
private val trends: TrendServiceAsync by lazy {
TrendServiceAsyncImpl(clientOptionsWithUserAgent)
}
- private val bot: BotServiceAsync by lazy { BotServiceAsyncImpl(clientOptionsWithUserAgent) }
-
private val support: SupportServiceAsync by lazy {
SupportServiceAsyncImpl(clientOptionsWithUserAgent)
}
@@ -135,25 +125,25 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
): XTwitterScraperClientAsync =
XTwitterScraperClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
- /** Account info & settings */
+ /** Account info and settings */
override fun account(): AccountServiceAsync = account
/** API key management (session auth only) */
override fun apiKeys(): ApiKeyServiceAsync = apiKeys
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun subscribe(): SubscribeServiceAsync = subscribe
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun compose(): ComposeServiceAsync = compose
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun drafts(): DraftServiceAsync = drafts
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun styles(): StyleServiceAsync = styles
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun radar(): RadarServiceAsync = radar
/** Real-time X account monitoring */
@@ -168,23 +158,17 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
/** Giveaway draws from tweet replies */
override fun draws(): DrawServiceAsync = draws
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
override fun webhooks(): WebhookServiceAsync = webhooks
- /** Push notification integrations (Telegram) */
- override fun integrations(): IntegrationServiceAsync = integrations
-
- /** X data lookups (subscription required) */
override fun x(): XServiceAsync = x
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
override fun trends(): TrendServiceAsync = trends
- override fun bot(): BotServiceAsync = bot
-
override fun support(): SupportServiceAsync = support
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun credits(): CreditServiceAsync = credits
override fun close() = clientOptions.close()
@@ -240,10 +224,6 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
WebhookServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
- private val integrations: IntegrationServiceAsync.WithRawResponse by lazy {
- IntegrationServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
private val x: XServiceAsync.WithRawResponse by lazy {
XServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -252,10 +232,6 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
TrendServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
- private val bot: BotServiceAsync.WithRawResponse by lazy {
- BotServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
private val support: SupportServiceAsync.WithRawResponse by lazy {
SupportServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
@@ -271,25 +247,25 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
clientOptions.toBuilder().apply(modifier::accept).build()
)
- /** Account info & settings */
+ /** Account info and settings */
override fun account(): AccountServiceAsync.WithRawResponse = account
/** API key management (session auth only) */
override fun apiKeys(): ApiKeyServiceAsync.WithRawResponse = apiKeys
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun subscribe(): SubscribeServiceAsync.WithRawResponse = subscribe
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun compose(): ComposeServiceAsync.WithRawResponse = compose
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun drafts(): DraftServiceAsync.WithRawResponse = drafts
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun styles(): StyleServiceAsync.WithRawResponse = styles
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun radar(): RadarServiceAsync.WithRawResponse = radar
/** Real-time X account monitoring */
@@ -304,23 +280,17 @@ class XTwitterScraperClientAsyncImpl(private val clientOptions: ClientOptions) :
/** Giveaway draws from tweet replies */
override fun draws(): DrawServiceAsync.WithRawResponse = draws
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
override fun webhooks(): WebhookServiceAsync.WithRawResponse = webhooks
- /** Push notification integrations (Telegram) */
- override fun integrations(): IntegrationServiceAsync.WithRawResponse = integrations
-
- /** X data lookups (subscription required) */
override fun x(): XServiceAsync.WithRawResponse = x
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
override fun trends(): TrendServiceAsync.WithRawResponse = trends
- override fun bot(): BotServiceAsync.WithRawResponse = bot
-
override fun support(): SupportServiceAsync.WithRawResponse = support
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun credits(): CreditServiceAsync.WithRawResponse = credits
}
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientImpl.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientImpl.kt
index 36b4c7e..a67932c 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientImpl.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/client/XTwitterScraperClientImpl.kt
@@ -8,8 +8,6 @@ import com.x_twitter_scraper.api.services.blocking.AccountService
import com.x_twitter_scraper.api.services.blocking.AccountServiceImpl
import com.x_twitter_scraper.api.services.blocking.ApiKeyService
import com.x_twitter_scraper.api.services.blocking.ApiKeyServiceImpl
-import com.x_twitter_scraper.api.services.blocking.BotService
-import com.x_twitter_scraper.api.services.blocking.BotServiceImpl
import com.x_twitter_scraper.api.services.blocking.ComposeService
import com.x_twitter_scraper.api.services.blocking.ComposeServiceImpl
import com.x_twitter_scraper.api.services.blocking.CreditService
@@ -22,8 +20,6 @@ import com.x_twitter_scraper.api.services.blocking.EventService
import com.x_twitter_scraper.api.services.blocking.EventServiceImpl
import com.x_twitter_scraper.api.services.blocking.ExtractionService
import com.x_twitter_scraper.api.services.blocking.ExtractionServiceImpl
-import com.x_twitter_scraper.api.services.blocking.IntegrationService
-import com.x_twitter_scraper.api.services.blocking.IntegrationServiceImpl
import com.x_twitter_scraper.api.services.blocking.MonitorService
import com.x_twitter_scraper.api.services.blocking.MonitorServiceImpl
import com.x_twitter_scraper.api.services.blocking.RadarService
@@ -89,16 +85,10 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
private val webhooks: WebhookService by lazy { WebhookServiceImpl(clientOptionsWithUserAgent) }
- private val integrations: IntegrationService by lazy {
- IntegrationServiceImpl(clientOptionsWithUserAgent)
- }
-
private val x: XService by lazy { XServiceImpl(clientOptionsWithUserAgent) }
private val trends: TrendService by lazy { TrendServiceImpl(clientOptionsWithUserAgent) }
- private val bot: BotService by lazy { BotServiceImpl(clientOptionsWithUserAgent) }
-
private val support: SupportService by lazy { SupportServiceImpl(clientOptionsWithUserAgent) }
private val credits: CreditService by lazy { CreditServiceImpl(clientOptionsWithUserAgent) }
@@ -110,25 +100,25 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
override fun withOptions(modifier: Consumer): XTwitterScraperClient =
XTwitterScraperClientImpl(clientOptions.toBuilder().apply(modifier::accept).build())
- /** Account info & settings */
+ /** Account info and settings */
override fun account(): AccountService = account
/** API key management (session auth only) */
override fun apiKeys(): ApiKeyService = apiKeys
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun subscribe(): SubscribeService = subscribe
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun compose(): ComposeService = compose
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun drafts(): DraftService = drafts
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun styles(): StyleService = styles
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun radar(): RadarService = radar
/** Real-time X account monitoring */
@@ -143,23 +133,17 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
/** Giveaway draws from tweet replies */
override fun draws(): DrawService = draws
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
override fun webhooks(): WebhookService = webhooks
- /** Push notification integrations (Telegram) */
- override fun integrations(): IntegrationService = integrations
-
- /** X data lookups (subscription required) */
override fun x(): XService = x
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
override fun trends(): TrendService = trends
- override fun bot(): BotService = bot
-
override fun support(): SupportService = support
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun credits(): CreditService = credits
override fun close() = clientOptions.close()
@@ -215,10 +199,6 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
WebhookServiceImpl.WithRawResponseImpl(clientOptions)
}
- private val integrations: IntegrationService.WithRawResponse by lazy {
- IntegrationServiceImpl.WithRawResponseImpl(clientOptions)
- }
-
private val x: XService.WithRawResponse by lazy {
XServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -227,10 +207,6 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
TrendServiceImpl.WithRawResponseImpl(clientOptions)
}
- private val bot: BotService.WithRawResponse by lazy {
- BotServiceImpl.WithRawResponseImpl(clientOptions)
- }
-
private val support: SupportService.WithRawResponse by lazy {
SupportServiceImpl.WithRawResponseImpl(clientOptions)
}
@@ -246,25 +222,25 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
clientOptions.toBuilder().apply(modifier::accept).build()
)
- /** Account info & settings */
+ /** Account info and settings */
override fun account(): AccountService.WithRawResponse = account
/** API key management (session auth only) */
override fun apiKeys(): ApiKeyService.WithRawResponse = apiKeys
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun subscribe(): SubscribeService.WithRawResponse = subscribe
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun compose(): ComposeService.WithRawResponse = compose
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun drafts(): DraftService.WithRawResponse = drafts
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun styles(): StyleService.WithRawResponse = styles
- /** Tweet composition, drafts, writing styles & radar */
+ /** AI tweet composition, drafts, writing styles, and radar */
override fun radar(): RadarService.WithRawResponse = radar
/** Real-time X account monitoring */
@@ -279,23 +255,17 @@ class XTwitterScraperClientImpl(private val clientOptions: ClientOptions) : XTwi
/** Giveaway draws from tweet replies */
override fun draws(): DrawService.WithRawResponse = draws
- /** Webhook endpoint management & delivery */
+ /** Webhook endpoint management and delivery */
override fun webhooks(): WebhookService.WithRawResponse = webhooks
- /** Push notification integrations (Telegram) */
- override fun integrations(): IntegrationService.WithRawResponse = integrations
-
- /** X data lookups (subscription required) */
override fun x(): XService.WithRawResponse = x
- /** Trending topics by region */
+ /** Trending topics and hashtags by region */
override fun trends(): TrendService.WithRawResponse = trends
- override fun bot(): BotService.WithRawResponse = bot
-
override fun support(): SupportService.WithRawResponse = support
- /** Subscription & billing */
+ /** Subscription, billing, and credits */
override fun credits(): CreditService.WithRawResponse = credits
}
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/ClientOptions.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/ClientOptions.kt
index a049f9e..314db97 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/ClientOptions.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/ClientOptions.kt
@@ -424,6 +424,16 @@ private constructor(
// We replace after all the default headers to allow end-users to overwrite them.
headers.replaceAll(this.headers.build())
queryParams.replaceAll(this.queryParams.build())
+ apiKey?.let {
+ if (!it.isEmpty()) {
+ headers.replace("X-Api-Key", it)
+ }
+ }
+ bearerToken?.let {
+ if (!it.isEmpty()) {
+ headers.replace("Authorization", "Bearer $it")
+ }
+ }
return ClientOptions(
httpClient,
@@ -463,24 +473,4 @@ private constructor(
httpClient.close()
sleeper.close()
}
-
- @JvmSynthetic
- internal fun securityHeaders(security: SecurityOptions): Headers {
- val headers = Headers.builder()
- if (security.apiKey) {
- apiKey?.let {
- if (!it.isEmpty()) {
- headers.replace("X-Api-Key", it)
- }
- }
- }
- if (security.oauthBearer) {
- bearerToken?.let {
- if (!it.isEmpty()) {
- headers.replace("Authorization", "Bearer $it")
- }
- }
- }
- return headers.build()
- }
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/PrepareRequest.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/PrepareRequest.kt
index 9587a46..3837943 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/PrepareRequest.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/PrepareRequest.kt
@@ -6,15 +6,10 @@ import com.x_twitter_scraper.api.core.http.HttpRequest
import java.util.concurrent.CompletableFuture
@JvmSynthetic
-internal fun HttpRequest.prepare(
- clientOptions: ClientOptions,
- params: Params,
- security: SecurityOptions = SecurityOptions.all(),
-): HttpRequest =
+internal fun HttpRequest.prepare(clientOptions: ClientOptions, params: Params): HttpRequest =
toBuilder()
.putAllQueryParams(clientOptions.queryParams)
.replaceAllQueryParams(params._queryParams())
- .putAllHeaders(clientOptions.securityHeaders(security))
.putAllHeaders(clientOptions.headers)
.replaceAllHeaders(params._headers())
.build()
@@ -23,8 +18,7 @@ internal fun HttpRequest.prepare(
internal fun HttpRequest.prepareAsync(
clientOptions: ClientOptions,
params: Params,
- security: SecurityOptions = SecurityOptions.all(),
): CompletableFuture =
// This async version exists to make it easier to add async specific preparation logic in the
// future.
- CompletableFuture.completedFuture(prepare(clientOptions, params, security))
+ CompletableFuture.completedFuture(prepare(clientOptions, params))
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/SecurityOptions.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/SecurityOptions.kt
deleted file mode 100644
index 2735930..0000000
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/core/SecurityOptions.kt
+++ /dev/null
@@ -1,69 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.x_twitter_scraper.api.core
-
-import java.util.Objects
-
-/** A class for configuring which security schemes are enabled for a request. */
-class SecurityOptions
-private constructor(
- /** Whether the apiKey security scheme is enabled. */
- @get:JvmName("apiKey") val apiKey: Boolean,
- /** Whether the oauthBearer security scheme is enabled. */
- @get:JvmName("oauthBearer") val oauthBearer: Boolean,
-) {
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [SecurityOptions]. */
- @JvmStatic fun builder() = Builder()
-
- /** Returns a [Security] instance with all security schemes enabled. */
- @JvmStatic fun all(): SecurityOptions = builder().apiKey(true).oauthBearer(true).build()
-
- /** Returns a [Security] instance with no security schemes enabled. */
- @JvmStatic fun none(): SecurityOptions = builder().build()
- }
-
- /** A builder for [SecurityOptions]. */
- class Builder internal constructor() {
-
- private var apiKey: Boolean = false
- private var oauthBearer: Boolean = false
-
- @JvmSynthetic
- internal fun from(securityOptions: SecurityOptions) = apply {
- apiKey = securityOptions.apiKey
- oauthBearer = securityOptions.oauthBearer
- }
-
- /** Whether the apiKey security scheme is enabled. */
- fun apiKey(apiKey: Boolean) = apply { this.apiKey = apiKey }
-
- /** Whether the oauthBearer security scheme is enabled. */
- fun oauthBearer(oauthBearer: Boolean) = apply { this.oauthBearer = oauthBearer }
-
- /**
- * Returns an immutable instance of [SecurityOptions].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): SecurityOptions = SecurityOptions(apiKey, oauthBearer)
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is SecurityOptions &&
- apiKey == other.apiKey &&
- oauthBearer == other.oauthBearer
- }
-
- override fun hashCode(): Int = Objects.hash(apiKey, oauthBearer)
-
- override fun toString() = "SecurityOptions{apiKey=$apiKey, oauthBearer=$oauthBearer}"
-}
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 6356b08..5ebd98d 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
@@ -184,6 +184,8 @@ private constructor(
@JvmField val INVALID_USERNAME = of("invalid_username")
+ @JvmField val INSUFFICIENT_CREDITS = of("insufficient_credits")
+
@JvmField val MISSING_PARAMS = of("missing_params")
@JvmField val MISSING_QUERY = of("missing_query")
@@ -192,20 +194,18 @@ private constructor(
@JvmField val MONITOR_LIMIT_REACHED = of("monitor_limit_reached")
+ @JvmField val NO_CREDITS = of("no_credits")
+
@JvmField val NO_SUBSCRIPTION = of("no_subscription")
@JvmField val NOT_FOUND = of("not_found")
- @JvmField val STREAM_REGISTRATION_FAILED = of("stream_registration_failed")
-
@JvmField val SUBSCRIPTION_INACTIVE = of("subscription_inactive")
@JvmField val TWEET_NOT_FOUND = of("tweet_not_found")
@JvmField val UNAUTHENTICATED = of("unauthenticated")
- @JvmField val USAGE_LIMIT_REACHED = of("usage_limit_reached")
-
@JvmField val USER_NOT_FOUND = of("user_not_found")
@JvmField val WEBHOOK_INACTIVE = of("webhook_inactive")
@@ -230,17 +230,17 @@ private constructor(
INVALID_TWEET_ID,
INVALID_TWEET_URL,
INVALID_USERNAME,
+ INSUFFICIENT_CREDITS,
MISSING_PARAMS,
MISSING_QUERY,
MONITOR_ALREADY_EXISTS,
MONITOR_LIMIT_REACHED,
+ NO_CREDITS,
NO_SUBSCRIPTION,
NOT_FOUND,
- STREAM_REGISTRATION_FAILED,
SUBSCRIPTION_INACTIVE,
TWEET_NOT_FOUND,
UNAUTHENTICATED,
- USAGE_LIMIT_REACHED,
USER_NOT_FOUND,
WEBHOOK_INACTIVE,
X_API_RATE_LIMITED,
@@ -267,17 +267,17 @@ private constructor(
INVALID_TWEET_ID,
INVALID_TWEET_URL,
INVALID_USERNAME,
+ INSUFFICIENT_CREDITS,
MISSING_PARAMS,
MISSING_QUERY,
MONITOR_ALREADY_EXISTS,
MONITOR_LIMIT_REACHED,
+ NO_CREDITS,
NO_SUBSCRIPTION,
NOT_FOUND,
- STREAM_REGISTRATION_FAILED,
SUBSCRIPTION_INACTIVE,
TWEET_NOT_FOUND,
UNAUTHENTICATED,
- USAGE_LIMIT_REACHED,
USER_NOT_FOUND,
WEBHOOK_INACTIVE,
X_API_RATE_LIMITED,
@@ -307,17 +307,17 @@ private constructor(
INVALID_TWEET_ID -> Value.INVALID_TWEET_ID
INVALID_TWEET_URL -> Value.INVALID_TWEET_URL
INVALID_USERNAME -> Value.INVALID_USERNAME
+ INSUFFICIENT_CREDITS -> Value.INSUFFICIENT_CREDITS
MISSING_PARAMS -> Value.MISSING_PARAMS
MISSING_QUERY -> Value.MISSING_QUERY
MONITOR_ALREADY_EXISTS -> Value.MONITOR_ALREADY_EXISTS
MONITOR_LIMIT_REACHED -> Value.MONITOR_LIMIT_REACHED
+ NO_CREDITS -> Value.NO_CREDITS
NO_SUBSCRIPTION -> Value.NO_SUBSCRIPTION
NOT_FOUND -> Value.NOT_FOUND
- STREAM_REGISTRATION_FAILED -> Value.STREAM_REGISTRATION_FAILED
SUBSCRIPTION_INACTIVE -> Value.SUBSCRIPTION_INACTIVE
TWEET_NOT_FOUND -> Value.TWEET_NOT_FOUND
UNAUTHENTICATED -> Value.UNAUTHENTICATED
- USAGE_LIMIT_REACHED -> Value.USAGE_LIMIT_REACHED
USER_NOT_FOUND -> Value.USER_NOT_FOUND
WEBHOOK_INACTIVE -> Value.WEBHOOK_INACTIVE
X_API_RATE_LIMITED -> Value.X_API_RATE_LIMITED
@@ -346,17 +346,17 @@ private constructor(
INVALID_TWEET_ID -> Known.INVALID_TWEET_ID
INVALID_TWEET_URL -> Known.INVALID_TWEET_URL
INVALID_USERNAME -> Known.INVALID_USERNAME
+ INSUFFICIENT_CREDITS -> Known.INSUFFICIENT_CREDITS
MISSING_PARAMS -> Known.MISSING_PARAMS
MISSING_QUERY -> Known.MISSING_QUERY
MONITOR_ALREADY_EXISTS -> Known.MONITOR_ALREADY_EXISTS
MONITOR_LIMIT_REACHED -> Known.MONITOR_LIMIT_REACHED
+ NO_CREDITS -> Known.NO_CREDITS
NO_SUBSCRIPTION -> Known.NO_SUBSCRIPTION
NOT_FOUND -> Known.NOT_FOUND
- STREAM_REGISTRATION_FAILED -> Known.STREAM_REGISTRATION_FAILED
SUBSCRIPTION_INACTIVE -> Known.SUBSCRIPTION_INACTIVE
TWEET_NOT_FOUND -> Known.TWEET_NOT_FOUND
UNAUTHENTICATED -> Known.UNAUTHENTICATED
- USAGE_LIMIT_REACHED -> Known.USAGE_LIMIT_REACHED
USER_NOT_FOUND -> Known.USER_NOT_FOUND
WEBHOOK_INACTIVE -> Known.WEBHOOK_INACTIVE
X_API_RATE_LIMITED -> Known.X_API_RATE_LIMITED
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 fad6c19..419dd0e 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
@@ -29,10 +29,6 @@ class EventType @JsonCreator private constructor(private val value: JsonField Value.TWEET_REPLY
TWEET_RETWEET -> Value.TWEET_RETWEET
TWEET_QUOTE -> Value.TWEET_QUOTE
- FOLLOWER_GAINED -> Value.FOLLOWER_GAINED
- FOLLOWER_LOST -> Value.FOLLOWER_LOST
else -> Value._UNKNOWN
}
@@ -99,8 +89,6 @@ class EventType @JsonCreator private constructor(private val value: JsonField Known.TWEET_REPLY
TWEET_RETWEET -> Known.TWEET_RETWEET
TWEET_QUOTE -> Known.TWEET_QUOTE
- FOLLOWER_GAINED -> Known.FOLLOWER_GAINED
- FOLLOWER_LOST -> Known.FOLLOWER_LOST
else -> throw XTwitterScraperInvalidDataException("Unknown EventType: $value")
}
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 2817a3e..49fe132 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedTweets.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedTweets.kt
@@ -14,7 +14,6 @@ import com.x_twitter_scraper.api.core.checkKnown
import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.core.toImmutable
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
-import com.x_twitter_scraper.api.models.x.tweets.SearchTweet
import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
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 f7a0acf..e03d8ad 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedUsers.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/PaginatedUsers.kt
@@ -14,7 +14,6 @@ import com.x_twitter_scraper.api.core.checkKnown
import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.core.toImmutable
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
-import com.x_twitter_scraper.api.models.x.users.UserProfile
import java.util.Collections
import java.util.Objects
import kotlin.jvm.optionals.getOrNull
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/tweets/SearchTweet.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/SearchTweet.kt
similarity index 99%
rename from x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/tweets/SearchTweet.kt
rename to x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/SearchTweet.kt
index 6bea90b..ca875d3 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/tweets/SearchTweet.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/SearchTweet.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.x_twitter_scraper.api.models.x.tweets
+package com.x_twitter_scraper.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/users/UserProfile.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/UserProfile.kt
similarity index 99%
rename from x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/users/UserProfile.kt
rename to x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/UserProfile.kt
index f95b2aa..bb77db6 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/x/users/UserProfile.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/UserProfile.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.x_twitter_scraper.api.models.x.users
+package com.x_twitter_scraper.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/account/AccountRetrieveResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/account/AccountRetrieveResponse.kt
index e2d4dca..35889aa 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/account/AccountRetrieveResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/account/AccountRetrieveResponse.kt
@@ -13,7 +13,6 @@ import com.x_twitter_scraper.api.core.JsonMissing
import com.x_twitter_scraper.api.core.JsonValue
import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
-import java.time.OffsetDateTime
import java.util.Collections
import java.util.Objects
import java.util.Optional
@@ -25,7 +24,7 @@ private constructor(
private val monitorsAllowed: JsonField,
private val monitorsUsed: JsonField,
private val plan: JsonField,
- private val currentPeriod: JsonField,
+ private val creditInfo: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -38,10 +37,10 @@ private constructor(
@ExcludeMissing
monitorsUsed: JsonField = JsonMissing.of(),
@JsonProperty("plan") @ExcludeMissing plan: JsonField = JsonMissing.of(),
- @JsonProperty("currentPeriod")
+ @JsonProperty("creditInfo")
@ExcludeMissing
- currentPeriod: JsonField = JsonMissing.of(),
- ) : this(monitorsAllowed, monitorsUsed, plan, currentPeriod, mutableMapOf())
+ creditInfo: JsonField = JsonMissing.of(),
+ ) : this(monitorsAllowed, monitorsUsed, plan, creditInfo, mutableMapOf())
/**
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
@@ -65,7 +64,7 @@ private constructor(
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
- fun currentPeriod(): Optional = currentPeriod.getOptional("currentPeriod")
+ fun creditInfo(): Optional = creditInfo.getOptional("creditInfo")
/**
* Returns the raw JSON value of [monitorsAllowed].
@@ -93,13 +92,13 @@ private constructor(
@JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan
/**
- * Returns the raw JSON value of [currentPeriod].
+ * Returns the raw JSON value of [creditInfo].
*
- * Unlike [currentPeriod], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [creditInfo], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("currentPeriod")
+ @JsonProperty("creditInfo")
@ExcludeMissing
- fun _currentPeriod(): JsonField = currentPeriod
+ fun _creditInfo(): JsonField = creditInfo
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -134,7 +133,7 @@ private constructor(
private var monitorsAllowed: JsonField? = null
private var monitorsUsed: JsonField? = null
private var plan: JsonField? = null
- private var currentPeriod: JsonField = JsonMissing.of()
+ private var creditInfo: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -142,7 +141,7 @@ private constructor(
monitorsAllowed = accountRetrieveResponse.monitorsAllowed
monitorsUsed = accountRetrieveResponse.monitorsUsed
plan = accountRetrieveResponse.plan
- currentPeriod = accountRetrieveResponse.currentPeriod
+ creditInfo = accountRetrieveResponse.creditInfo
additionalProperties = accountRetrieveResponse.additionalProperties.toMutableMap()
}
@@ -180,18 +179,16 @@ private constructor(
*/
fun plan(plan: JsonField) = apply { this.plan = plan }
- fun currentPeriod(currentPeriod: CurrentPeriod) = currentPeriod(JsonField.of(currentPeriod))
+ fun creditInfo(creditInfo: CreditInfo) = creditInfo(JsonField.of(creditInfo))
/**
- * Sets [Builder.currentPeriod] to an arbitrary JSON value.
+ * Sets [Builder.creditInfo] to an arbitrary JSON value.
*
- * You should usually call [Builder.currentPeriod] with a well-typed [CurrentPeriod] value
+ * You should usually call [Builder.creditInfo] with a well-typed [CreditInfo] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
- fun currentPeriod(currentPeriod: JsonField) = apply {
- this.currentPeriod = currentPeriod
- }
+ fun creditInfo(creditInfo: JsonField) = apply { this.creditInfo = creditInfo }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -231,7 +228,7 @@ private constructor(
checkRequired("monitorsAllowed", monitorsAllowed),
checkRequired("monitorsUsed", monitorsUsed),
checkRequired("plan", plan),
- currentPeriod,
+ creditInfo,
additionalProperties.toMutableMap(),
)
}
@@ -246,7 +243,7 @@ private constructor(
monitorsAllowed()
monitorsUsed()
plan().validate()
- currentPeriod().ifPresent { it.validate() }
+ creditInfo().ifPresent { it.validate() }
validated = true
}
@@ -268,7 +265,7 @@ private constructor(
(if (monitorsAllowed.asKnown().isPresent) 1 else 0) +
(if (monitorsUsed.asKnown().isPresent) 1 else 0) +
(plan.asKnown().getOrNull()?.validity() ?: 0) +
- (currentPeriod.asKnown().getOrNull()?.validity() ?: 0)
+ (creditInfo.asKnown().getOrNull()?.validity() ?: 0)
class Plan @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -397,70 +394,94 @@ private constructor(
override fun toString() = value.toString()
}
- class CurrentPeriod
+ class CreditInfo
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
- private val end: JsonField,
- private val start: JsonField,
- private val usagePercent: JsonField,
+ private val autoTopupEnabled: JsonField,
+ private val balance: JsonField,
+ private val lifetimePurchased: JsonField,
+ private val lifetimeUsed: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
- @JsonProperty("end") @ExcludeMissing end: JsonField = JsonMissing.of(),
- @JsonProperty("start")
+ @JsonProperty("autoTopupEnabled")
+ @ExcludeMissing
+ autoTopupEnabled: JsonField = JsonMissing.of(),
+ @JsonProperty("balance") @ExcludeMissing balance: JsonField = JsonMissing.of(),
+ @JsonProperty("lifetimePurchased")
@ExcludeMissing
- start: JsonField = JsonMissing.of(),
- @JsonProperty("usagePercent")
+ lifetimePurchased: JsonField = JsonMissing.of(),
+ @JsonProperty("lifetimeUsed")
@ExcludeMissing
- usagePercent: JsonField = JsonMissing.of(),
- ) : this(end, start, usagePercent, mutableMapOf())
+ lifetimeUsed: JsonField = JsonMissing.of(),
+ ) : this(autoTopupEnabled, balance, lifetimePurchased, lifetimeUsed, mutableMapOf())
/**
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
* is unexpectedly missing or null (e.g. if the server responded with an unexpected
* value).
*/
- fun end(): OffsetDateTime = end.getRequired("end")
+ fun autoTopupEnabled(): Boolean = autoTopupEnabled.getRequired("autoTopupEnabled")
/**
* @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 start(): OffsetDateTime = start.getRequired("start")
+ fun balance(): Long = balance.getRequired("balance")
/**
* @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 usagePercent(): Double = usagePercent.getRequired("usagePercent")
+ fun lifetimePurchased(): Long = lifetimePurchased.getRequired("lifetimePurchased")
/**
- * Returns the raw JSON value of [end].
+ * @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 lifetimeUsed(): Long = lifetimeUsed.getRequired("lifetimeUsed")
+
+ /**
+ * Returns the raw JSON value of [autoTopupEnabled].
*
- * Unlike [end], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [autoTopupEnabled], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- @JsonProperty("end") @ExcludeMissing fun _end(): JsonField = end
+ @JsonProperty("autoTopupEnabled")
+ @ExcludeMissing
+ fun _autoTopupEnabled(): JsonField = autoTopupEnabled
/**
- * Returns the raw JSON value of [start].
+ * Returns the raw JSON value of [balance].
*
- * Unlike [start], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("start") @ExcludeMissing fun _start(): JsonField = start
+ @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance
/**
- * Returns the raw JSON value of [usagePercent].
+ * Returns the raw JSON value of [lifetimePurchased].
*
- * Unlike [usagePercent], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [lifetimePurchased], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("usagePercent")
+ @JsonProperty("lifetimePurchased")
@ExcludeMissing
- fun _usagePercent(): JsonField = usagePercent
+ fun _lifetimePurchased(): JsonField = lifetimePurchased
+
+ /**
+ * Returns the raw JSON value of [lifetimeUsed].
+ *
+ * Unlike [lifetimeUsed], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("lifetimeUsed")
+ @ExcludeMissing
+ fun _lifetimeUsed(): JsonField = lifetimeUsed
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -477,67 +498,87 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of [CurrentPeriod].
+ * Returns a mutable builder for constructing an instance of [CreditInfo].
*
* The following fields are required:
* ```java
- * .end()
- * .start()
- * .usagePercent()
+ * .autoTopupEnabled()
+ * .balance()
+ * .lifetimePurchased()
+ * .lifetimeUsed()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [CurrentPeriod]. */
+ /** A builder for [CreditInfo]. */
class Builder internal constructor() {
- private var end: JsonField? = null
- private var start: JsonField? = null
- private var usagePercent: JsonField? = null
+ private var autoTopupEnabled: JsonField? = null
+ private var balance: JsonField? = null
+ private var lifetimePurchased: JsonField? = null
+ private var lifetimeUsed: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(currentPeriod: CurrentPeriod) = apply {
- end = currentPeriod.end
- start = currentPeriod.start
- usagePercent = currentPeriod.usagePercent
- additionalProperties = currentPeriod.additionalProperties.toMutableMap()
+ internal fun from(creditInfo: CreditInfo) = apply {
+ autoTopupEnabled = creditInfo.autoTopupEnabled
+ balance = creditInfo.balance
+ lifetimePurchased = creditInfo.lifetimePurchased
+ lifetimeUsed = creditInfo.lifetimeUsed
+ additionalProperties = creditInfo.additionalProperties.toMutableMap()
}
- fun end(end: OffsetDateTime) = end(JsonField.of(end))
+ fun autoTopupEnabled(autoTopupEnabled: Boolean) =
+ autoTopupEnabled(JsonField.of(autoTopupEnabled))
/**
- * Sets [Builder.end] to an arbitrary JSON value.
+ * Sets [Builder.autoTopupEnabled] to an arbitrary JSON value.
*
- * You should usually call [Builder.end] with a well-typed [OffsetDateTime] value
+ * You should usually call [Builder.autoTopupEnabled] with a well-typed [Boolean] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
- fun end(end: JsonField) = apply { this.end = end }
+ fun autoTopupEnabled(autoTopupEnabled: JsonField) = apply {
+ this.autoTopupEnabled = autoTopupEnabled
+ }
+
+ fun balance(balance: Long) = balance(JsonField.of(balance))
+
+ /**
+ * Sets [Builder.balance] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.balance] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun balance(balance: JsonField) = apply { this.balance = balance }
- fun start(start: OffsetDateTime) = start(JsonField.of(start))
+ fun lifetimePurchased(lifetimePurchased: Long) =
+ lifetimePurchased(JsonField.of(lifetimePurchased))
/**
- * Sets [Builder.start] to an arbitrary JSON value.
+ * Sets [Builder.lifetimePurchased] to an arbitrary JSON value.
*
- * You should usually call [Builder.start] with a well-typed [OffsetDateTime] value
+ * You should usually call [Builder.lifetimePurchased] with a well-typed [Long] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
- fun start(start: JsonField) = apply { this.start = start }
+ fun lifetimePurchased(lifetimePurchased: JsonField) = apply {
+ this.lifetimePurchased = lifetimePurchased
+ }
- fun usagePercent(usagePercent: Double) = usagePercent(JsonField.of(usagePercent))
+ fun lifetimeUsed(lifetimeUsed: Long) = lifetimeUsed(JsonField.of(lifetimeUsed))
/**
- * Sets [Builder.usagePercent] to an arbitrary JSON value.
+ * Sets [Builder.lifetimeUsed] to an arbitrary JSON value.
*
- * You should usually call [Builder.usagePercent] with a well-typed [Double] value
+ * You should usually call [Builder.lifetimeUsed] with a well-typed [Long] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
- fun usagePercent(usagePercent: JsonField) = apply {
- this.usagePercent = usagePercent
+ fun lifetimeUsed(lifetimeUsed: JsonField) = apply {
+ this.lifetimeUsed = lifetimeUsed
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -560,38 +601,41 @@ private constructor(
}
/**
- * Returns an immutable instance of [CurrentPeriod].
+ * Returns an immutable instance of [CreditInfo].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
- * .end()
- * .start()
- * .usagePercent()
+ * .autoTopupEnabled()
+ * .balance()
+ * .lifetimePurchased()
+ * .lifetimeUsed()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): CurrentPeriod =
- CurrentPeriod(
- checkRequired("end", end),
- checkRequired("start", start),
- checkRequired("usagePercent", usagePercent),
+ fun build(): CreditInfo =
+ CreditInfo(
+ checkRequired("autoTopupEnabled", autoTopupEnabled),
+ checkRequired("balance", balance),
+ checkRequired("lifetimePurchased", lifetimePurchased),
+ checkRequired("lifetimeUsed", lifetimeUsed),
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): CurrentPeriod = apply {
+ fun validate(): CreditInfo = apply {
if (validated) {
return@apply
}
- end()
- start()
- usagePercent()
+ autoTopupEnabled()
+ balance()
+ lifetimePurchased()
+ lifetimeUsed()
validated = true
}
@@ -611,30 +655,38 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (if (end.asKnown().isPresent) 1 else 0) +
- (if (start.asKnown().isPresent) 1 else 0) +
- (if (usagePercent.asKnown().isPresent) 1 else 0)
+ (if (autoTopupEnabled.asKnown().isPresent) 1 else 0) +
+ (if (balance.asKnown().isPresent) 1 else 0) +
+ (if (lifetimePurchased.asKnown().isPresent) 1 else 0) +
+ (if (lifetimeUsed.asKnown().isPresent) 1 else 0)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
- return other is CurrentPeriod &&
- end == other.end &&
- start == other.start &&
- usagePercent == other.usagePercent &&
+ return other is CreditInfo &&
+ autoTopupEnabled == other.autoTopupEnabled &&
+ balance == other.balance &&
+ lifetimePurchased == other.lifetimePurchased &&
+ lifetimeUsed == other.lifetimeUsed &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
- Objects.hash(end, start, usagePercent, additionalProperties)
+ Objects.hash(
+ autoTopupEnabled,
+ balance,
+ lifetimePurchased,
+ lifetimeUsed,
+ additionalProperties,
+ )
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "CurrentPeriod{end=$end, start=$start, usagePercent=$usagePercent, additionalProperties=$additionalProperties}"
+ "CreditInfo{autoTopupEnabled=$autoTopupEnabled, balance=$balance, lifetimePurchased=$lifetimePurchased, lifetimeUsed=$lifetimeUsed, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
@@ -646,16 +698,16 @@ private constructor(
monitorsAllowed == other.monitorsAllowed &&
monitorsUsed == other.monitorsUsed &&
plan == other.plan &&
- currentPeriod == other.currentPeriod &&
+ creditInfo == other.creditInfo &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
- Objects.hash(monitorsAllowed, monitorsUsed, plan, currentPeriod, additionalProperties)
+ Objects.hash(monitorsAllowed, monitorsUsed, plan, creditInfo, additionalProperties)
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "AccountRetrieveResponse{monitorsAllowed=$monitorsAllowed, monitorsUsed=$monitorsUsed, plan=$plan, currentPeriod=$currentPeriod, additionalProperties=$additionalProperties}"
+ "AccountRetrieveResponse{monitorsAllowed=$monitorsAllowed, monitorsUsed=$monitorsUsed, plan=$plan, creditInfo=$creditInfo, additionalProperties=$additionalProperties}"
}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostResponse.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostResponse.kt
index 9869751..16d32a5 100644
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostResponse.kt
+++ b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/extractions/ExtractionEstimateCostResponse.kt
@@ -14,32 +14,45 @@ import com.x_twitter_scraper.api.core.checkRequired
import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
import java.util.Collections
import java.util.Objects
+import java.util.Optional
class ExtractionEstimateCostResponse
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val allowed: JsonField,
+ private val creditsAvailable: JsonField,
+ private val creditsRequired: JsonField,
private val estimatedResults: JsonField,
- private val projectedPercent: JsonField,
private val source: JsonField,
- private val usagePercent: JsonField,
+ private val resolvedXUserId: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
@JsonProperty("allowed") @ExcludeMissing allowed: JsonField = JsonMissing.of(),
+ @JsonProperty("creditsAvailable")
+ @ExcludeMissing
+ creditsAvailable: JsonField = JsonMissing.of(),
+ @JsonProperty("creditsRequired")
+ @ExcludeMissing
+ creditsRequired: JsonField = JsonMissing.of(),
@JsonProperty("estimatedResults")
@ExcludeMissing
estimatedResults: JsonField = JsonMissing.of(),
- @JsonProperty("projectedPercent")
- @ExcludeMissing
- projectedPercent: JsonField = JsonMissing.of(),
@JsonProperty("source") @ExcludeMissing source: JsonField = JsonMissing.of(),
- @JsonProperty("usagePercent")
+ @JsonProperty("resolvedXUserId")
@ExcludeMissing
- usagePercent: JsonField = JsonMissing.of(),
- ) : this(allowed, estimatedResults, projectedPercent, source, usagePercent, mutableMapOf())
+ resolvedXUserId: JsonField = JsonMissing.of(),
+ ) : this(
+ allowed,
+ creditsAvailable,
+ creditsRequired,
+ estimatedResults,
+ source,
+ resolvedXUserId,
+ mutableMapOf(),
+ )
/**
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
@@ -51,25 +64,31 @@ private constructor(
* @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun estimatedResults(): Long = estimatedResults.getRequired("estimatedResults")
+ fun creditsAvailable(): String = creditsAvailable.getRequired("creditsAvailable")
/**
* @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 projectedPercent(): Double = projectedPercent.getRequired("projectedPercent")
+ fun creditsRequired(): String = creditsRequired.getRequired("creditsRequired")
/**
* @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 source(): String = source.getRequired("source")
+ fun estimatedResults(): Long = estimatedResults.getRequired("estimatedResults")
/**
* @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 usagePercent(): Double = usagePercent.getRequired("usagePercent")
+ fun source(): String = source.getRequired("source")
+
+ /**
+ * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun resolvedXUserId(): Optional = resolvedXUserId.getOptional("resolvedXUserId")
/**
* Returns the raw JSON value of [allowed].
@@ -79,24 +98,33 @@ private constructor(
@JsonProperty("allowed") @ExcludeMissing fun _allowed(): JsonField = allowed
/**
- * Returns the raw JSON value of [estimatedResults].
+ * Returns the raw JSON value of [creditsAvailable].
*
- * Unlike [estimatedResults], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [creditsAvailable], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("estimatedResults")
+ @JsonProperty("creditsAvailable")
@ExcludeMissing
- fun _estimatedResults(): JsonField = estimatedResults
+ fun _creditsAvailable(): JsonField = creditsAvailable
/**
- * Returns the raw JSON value of [projectedPercent].
+ * Returns the raw JSON value of [creditsRequired].
*
- * Unlike [projectedPercent], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [creditsRequired], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("creditsRequired")
+ @ExcludeMissing
+ fun _creditsRequired(): JsonField = creditsRequired
+
+ /**
+ * Returns the raw JSON value of [estimatedResults].
+ *
+ * Unlike [estimatedResults], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("projectedPercent")
+ @JsonProperty("estimatedResults")
@ExcludeMissing
- fun _projectedPercent(): JsonField = projectedPercent
+ fun _estimatedResults(): JsonField = estimatedResults
/**
* Returns the raw JSON value of [source].
@@ -106,13 +134,13 @@ private constructor(
@JsonProperty("source") @ExcludeMissing fun _source(): JsonField = source
/**
- * Returns the raw JSON value of [usagePercent].
+ * Returns the raw JSON value of [resolvedXUserId].
*
- * Unlike [usagePercent], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [resolvedXUserId], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("usagePercent")
+ @JsonProperty("resolvedXUserId")
@ExcludeMissing
- fun _usagePercent(): JsonField = usagePercent
+ fun _resolvedXUserId(): JsonField = resolvedXUserId
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -135,10 +163,10 @@ private constructor(
* The following fields are required:
* ```java
* .allowed()
+ * .creditsAvailable()
+ * .creditsRequired()
* .estimatedResults()
- * .projectedPercent()
* .source()
- * .usagePercent()
* ```
*/
@JvmStatic fun builder() = Builder()
@@ -148,19 +176,21 @@ private constructor(
class Builder internal constructor() {
private var allowed: JsonField? = null
+ private var creditsAvailable: JsonField? = null
+ private var creditsRequired: JsonField? = null
private var estimatedResults: JsonField? = null
- private var projectedPercent: JsonField? = null
private var source: JsonField? = null
- private var usagePercent: JsonField? = null
+ private var resolvedXUserId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(extractionEstimateCostResponse: ExtractionEstimateCostResponse) = apply {
allowed = extractionEstimateCostResponse.allowed
+ creditsAvailable = extractionEstimateCostResponse.creditsAvailable
+ creditsRequired = extractionEstimateCostResponse.creditsRequired
estimatedResults = extractionEstimateCostResponse.estimatedResults
- projectedPercent = extractionEstimateCostResponse.projectedPercent
source = extractionEstimateCostResponse.source
- usagePercent = extractionEstimateCostResponse.usagePercent
+ resolvedXUserId = extractionEstimateCostResponse.resolvedXUserId
additionalProperties =
extractionEstimateCostResponse.additionalProperties.toMutableMap()
}
@@ -175,32 +205,46 @@ private constructor(
*/
fun allowed(allowed: JsonField) = apply { this.allowed = allowed }
- fun estimatedResults(estimatedResults: Long) =
- estimatedResults(JsonField.of(estimatedResults))
+ fun creditsAvailable(creditsAvailable: String) =
+ creditsAvailable(JsonField.of(creditsAvailable))
/**
- * Sets [Builder.estimatedResults] to an arbitrary JSON value.
+ * Sets [Builder.creditsAvailable] to an arbitrary JSON value.
*
- * You should usually call [Builder.estimatedResults] with a well-typed [Long] value
+ * You should usually call [Builder.creditsAvailable] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
- fun estimatedResults(estimatedResults: JsonField) = apply {
- this.estimatedResults = estimatedResults
+ fun creditsAvailable(creditsAvailable: JsonField) = apply {
+ this.creditsAvailable = creditsAvailable
+ }
+
+ fun creditsRequired(creditsRequired: String) =
+ creditsRequired(JsonField.of(creditsRequired))
+
+ /**
+ * Sets [Builder.creditsRequired] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.creditsRequired] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun creditsRequired(creditsRequired: JsonField) = apply {
+ this.creditsRequired = creditsRequired
}
- fun projectedPercent(projectedPercent: Double) =
- projectedPercent(JsonField.of(projectedPercent))
+ fun estimatedResults(estimatedResults: Long) =
+ estimatedResults(JsonField.of(estimatedResults))
/**
- * Sets [Builder.projectedPercent] to an arbitrary JSON value.
+ * Sets [Builder.estimatedResults] to an arbitrary JSON value.
*
- * You should usually call [Builder.projectedPercent] with a well-typed [Double] value
+ * You should usually call [Builder.estimatedResults] with a well-typed [Long] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
- fun projectedPercent(projectedPercent: JsonField) = apply {
- this.projectedPercent = projectedPercent
+ fun estimatedResults(estimatedResults: JsonField) = apply {
+ this.estimatedResults = estimatedResults
}
fun source(source: String) = source(JsonField.of(source))
@@ -213,17 +257,18 @@ private constructor(
*/
fun source(source: JsonField) = apply { this.source = source }
- fun usagePercent(usagePercent: Double) = usagePercent(JsonField.of(usagePercent))
+ fun resolvedXUserId(resolvedXUserId: String) =
+ resolvedXUserId(JsonField.of(resolvedXUserId))
/**
- * Sets [Builder.usagePercent] to an arbitrary JSON value.
+ * Sets [Builder.resolvedXUserId] to an arbitrary JSON value.
*
- * You should usually call [Builder.usagePercent] with a well-typed [Double] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
+ * You should usually call [Builder.resolvedXUserId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun usagePercent(usagePercent: JsonField) = apply {
- this.usagePercent = usagePercent
+ fun resolvedXUserId(resolvedXUserId: JsonField) = apply {
+ this.resolvedXUserId = resolvedXUserId
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -253,10 +298,10 @@ private constructor(
* The following fields are required:
* ```java
* .allowed()
+ * .creditsAvailable()
+ * .creditsRequired()
* .estimatedResults()
- * .projectedPercent()
* .source()
- * .usagePercent()
* ```
*
* @throws IllegalStateException if any required field is unset.
@@ -264,10 +309,11 @@ private constructor(
fun build(): ExtractionEstimateCostResponse =
ExtractionEstimateCostResponse(
checkRequired("allowed", allowed),
+ checkRequired("creditsAvailable", creditsAvailable),
+ checkRequired("creditsRequired", creditsRequired),
checkRequired("estimatedResults", estimatedResults),
- checkRequired("projectedPercent", projectedPercent),
checkRequired("source", source),
- checkRequired("usagePercent", usagePercent),
+ resolvedXUserId,
additionalProperties.toMutableMap(),
)
}
@@ -280,10 +326,11 @@ private constructor(
}
allowed()
+ creditsAvailable()
+ creditsRequired()
estimatedResults()
- projectedPercent()
source()
- usagePercent()
+ resolvedXUserId()
validated = true
}
@@ -303,10 +350,11 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(if (allowed.asKnown().isPresent) 1 else 0) +
+ (if (creditsAvailable.asKnown().isPresent) 1 else 0) +
+ (if (creditsRequired.asKnown().isPresent) 1 else 0) +
(if (estimatedResults.asKnown().isPresent) 1 else 0) +
- (if (projectedPercent.asKnown().isPresent) 1 else 0) +
(if (source.asKnown().isPresent) 1 else 0) +
- (if (usagePercent.asKnown().isPresent) 1 else 0)
+ (if (resolvedXUserId.asKnown().isPresent) 1 else 0)
override fun equals(other: Any?): Boolean {
if (this === other) {
@@ -315,20 +363,22 @@ private constructor(
return other is ExtractionEstimateCostResponse &&
allowed == other.allowed &&
+ creditsAvailable == other.creditsAvailable &&
+ creditsRequired == other.creditsRequired &&
estimatedResults == other.estimatedResults &&
- projectedPercent == other.projectedPercent &&
source == other.source &&
- usagePercent == other.usagePercent &&
+ resolvedXUserId == other.resolvedXUserId &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
Objects.hash(
allowed,
+ creditsAvailable,
+ creditsRequired,
estimatedResults,
- projectedPercent,
source,
- usagePercent,
+ resolvedXUserId,
additionalProperties,
)
}
@@ -336,5 +386,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "ExtractionEstimateCostResponse{allowed=$allowed, estimatedResults=$estimatedResults, projectedPercent=$projectedPercent, source=$source, usagePercent=$usagePercent, additionalProperties=$additionalProperties}"
+ "ExtractionEstimateCostResponse{allowed=$allowed, creditsAvailable=$creditsAvailable, creditsRequired=$creditsRequired, estimatedResults=$estimatedResults, source=$source, resolvedXUserId=$resolvedXUserId, additionalProperties=$additionalProperties}"
}
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
deleted file mode 100644
index 2e88a37..0000000
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/Integration.kt
+++ /dev/null
@@ -1,787 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.x_twitter_scraper.api.models.integrations
-
-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.checkRequired
-import com.x_twitter_scraper.api.core.toImmutable
-import com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
-import com.x_twitter_scraper.api.models.EventType
-import java.time.OffsetDateTime
-import java.util.Collections
-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(
- private val id: JsonField,
- private val config: JsonField,
- private val createdAt: JsonField,
- private val eventTypes: JsonField>,
- private val isActive: JsonField,
- private val name: JsonField,
- private val type: JsonValue,
- private val filters: JsonField,
- private val messageTemplate: JsonField,
- private val scopeAllMonitors: JsonField,
- private val silentPush: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("config") @ExcludeMissing config: JsonField = JsonMissing.of(),
- @JsonProperty("createdAt")
- @ExcludeMissing
- createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("eventTypes")
- @ExcludeMissing
- eventTypes: JsonField> = JsonMissing.of(),
- @JsonProperty("isActive") @ExcludeMissing isActive: JsonField = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("filters") @ExcludeMissing filters: JsonField = JsonMissing.of(),
- @JsonProperty("messageTemplate")
- @ExcludeMissing
- messageTemplate: JsonField = JsonMissing.of(),
- @JsonProperty("scopeAllMonitors")
- @ExcludeMissing
- scopeAllMonitors: JsonField = JsonMissing.of(),
- @JsonProperty("silentPush")
- @ExcludeMissing
- silentPush: JsonField = JsonMissing.of(),
- ) : this(
- id,
- config,
- createdAt,
- eventTypes,
- isActive,
- name,
- type,
- filters,
- messageTemplate,
- scopeAllMonitors,
- silentPush,
- mutableMapOf(),
- )
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun id(): String = id.getRequired("id")
-
- /**
- * 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).
- */
- fun config(): Config = config.getRequired("config")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun createdAt(): OffsetDateTime = createdAt.getRequired("createdAt")
-
- /**
- * 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).
- */
- fun eventTypes(): List = eventTypes.getRequired("eventTypes")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun isActive(): Boolean = isActive.getRequired("isActive")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("telegram")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = 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).
- */
- fun filters(): Optional = filters.getOptional("filters")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun messageTemplate(): Optional = messageTemplate.getOptional("messageTemplate")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun scopeAllMonitors(): Optional = scopeAllMonitors.getOptional("scopeAllMonitors")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun silentPush(): Optional = silentPush.getOptional("silentPush")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [config].
- *
- * Unlike [config], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("config") @ExcludeMissing fun _config(): JsonField = config
-
- /**
- * Returns the raw JSON value of [createdAt].
- *
- * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("createdAt")
- @ExcludeMissing
- fun _createdAt(): JsonField = createdAt
-
- /**
- * Returns the raw JSON value of [eventTypes].
- *
- * Unlike [eventTypes], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("eventTypes")
- @ExcludeMissing
- fun _eventTypes(): JsonField> = eventTypes
-
- /**
- * Returns the raw JSON value of [isActive].
- *
- * Unlike [isActive], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("isActive") @ExcludeMissing fun _isActive(): JsonField = isActive
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * Returns the raw JSON value of [filters].
- *
- * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField = filters
-
- /**
- * Returns the raw JSON value of [messageTemplate].
- *
- * Unlike [messageTemplate], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("messageTemplate")
- @ExcludeMissing
- fun _messageTemplate(): JsonField = messageTemplate
-
- /**
- * Returns the raw JSON value of [scopeAllMonitors].
- *
- * Unlike [scopeAllMonitors], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("scopeAllMonitors")
- @ExcludeMissing
- fun _scopeAllMonitors(): JsonField = scopeAllMonitors
-
- /**
- * Returns the raw JSON value of [silentPush].
- *
- * Unlike [silentPush], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("silentPush") @ExcludeMissing fun _silentPush(): JsonField = silentPush
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Integration].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .config()
- * .createdAt()
- * .eventTypes()
- * .isActive()
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Integration]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var config: JsonField? = null
- private var createdAt: JsonField? = null
- private var eventTypes: JsonField>? = null
- private var isActive: JsonField? = null
- private var name: JsonField? = null
- private var type: JsonValue = JsonValue.from("telegram")
- private var filters: JsonField = JsonMissing.of()
- private var messageTemplate: JsonField = JsonMissing.of()
- private var scopeAllMonitors: JsonField = JsonMissing.of()
- private var silentPush: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(integration: Integration) = apply {
- id = integration.id
- config = integration.config
- createdAt = integration.createdAt
- eventTypes = integration.eventTypes.map { it.toMutableList() }
- isActive = integration.isActive
- name = integration.name
- type = integration.type
- filters = integration.filters
- messageTemplate = integration.messageTemplate
- scopeAllMonitors = integration.scopeAllMonitors
- silentPush = integration.silentPush
- additionalProperties = integration.additionalProperties.toMutableMap()
- }
-
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- /** Integration config — shape varies by type (JSON) */
- fun config(config: Config) = config(JsonField.of(config))
-
- /**
- * Sets [Builder.config] to an arbitrary JSON value.
- *
- * You should usually call [Builder.config] with a well-typed [Config] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun config(config: JsonField) = apply { this.config = config }
-
- fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
-
- /**
- * Sets [Builder.createdAt] to an arbitrary JSON value.
- *
- * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
-
- /** Array of event types to subscribe to. */
- fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
-
- /**
- * Sets [Builder.eventTypes] to an arbitrary JSON value.
- *
- * You should usually call [Builder.eventTypes] with a well-typed `List` value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun eventTypes(eventTypes: JsonField>) = apply {
- this.eventTypes = eventTypes.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [EventType] to [eventTypes].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addEventType(eventType: EventType) = apply {
- eventTypes =
- (eventTypes ?: JsonField.of(mutableListOf())).also {
- checkKnown("eventTypes", it).add(eventType)
- }
- }
-
- fun isActive(isActive: Boolean) = isActive(JsonField.of(isActive))
-
- /**
- * Sets [Builder.isActive] to an arbitrary JSON value.
- *
- * You should usually call [Builder.isActive] with a well-typed [Boolean] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun isActive(isActive: JsonField) = apply { this.isActive = isActive }
-
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("telegram")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- /** Event filter rules (JSON) */
- fun filters(filters: Filters) = filters(JsonField.of(filters))
-
- /**
- * Sets [Builder.filters] to an arbitrary JSON value.
- *
- * You should usually call [Builder.filters] with a well-typed [Filters] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun filters(filters: JsonField) = apply { this.filters = filters }
-
- fun messageTemplate(messageTemplate: String) =
- messageTemplate(JsonField.of(messageTemplate))
-
- /**
- * Sets [Builder.messageTemplate] to an arbitrary JSON value.
- *
- * You should usually call [Builder.messageTemplate] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun messageTemplate(messageTemplate: JsonField) = apply {
- this.messageTemplate = messageTemplate
- }
-
- fun scopeAllMonitors(scopeAllMonitors: Boolean) =
- scopeAllMonitors(JsonField.of(scopeAllMonitors))
-
- /**
- * Sets [Builder.scopeAllMonitors] to an arbitrary JSON value.
- *
- * You should usually call [Builder.scopeAllMonitors] with a well-typed [Boolean] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun scopeAllMonitors(scopeAllMonitors: JsonField) = apply {
- this.scopeAllMonitors = scopeAllMonitors
- }
-
- fun silentPush(silentPush: Boolean) = silentPush(JsonField.of(silentPush))
-
- /**
- * Sets [Builder.silentPush] to an arbitrary JSON value.
- *
- * You should usually call [Builder.silentPush] with a well-typed [Boolean] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun silentPush(silentPush: JsonField) = apply { this.silentPush = silentPush }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Integration].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .config()
- * .createdAt()
- * .eventTypes()
- * .isActive()
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Integration =
- Integration(
- checkRequired("id", id),
- checkRequired("config", config),
- checkRequired("createdAt", createdAt),
- checkRequired("eventTypes", eventTypes).map { it.toImmutable() },
- checkRequired("isActive", isActive),
- checkRequired("name", name),
- type,
- filters,
- messageTemplate,
- scopeAllMonitors,
- silentPush,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Integration = apply {
- if (validated) {
- return@apply
- }
-
- id()
- config().validate()
- createdAt()
- eventTypes().forEach { it.validate() }
- isActive()
- name()
- _type().let {
- if (it != JsonValue.from("telegram")) {
- throw XTwitterScraperInvalidDataException("'type' is invalid, received $it")
- }
- }
- filters().ifPresent { it.validate() }
- messageTemplate()
- scopeAllMonitors()
- silentPush()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: XTwitterScraperInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (id.asKnown().isPresent) 1 else 0) +
- (config.asKnown().getOrNull()?.validity() ?: 0) +
- (if (createdAt.asKnown().isPresent) 1 else 0) +
- (eventTypes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
- (if (isActive.asKnown().isPresent) 1 else 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("telegram")) 1 else 0 } +
- (filters.asKnown().getOrNull()?.validity() ?: 0) +
- (if (messageTemplate.asKnown().isPresent) 1 else 0) +
- (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(
- @com.fasterxml.jackson.annotation.JsonValue
- private val additionalProperties: Map
- ) {
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [Config]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Config]. */
- class Builder internal constructor() {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(config: Config) = apply {
- additionalProperties = config.additionalProperties.toMutableMap()
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Config].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): Config = Config(additionalProperties.toImmutable())
- }
-
- private var validated: Boolean = false
-
- fun validate(): Config = apply {
- if (validated) {
- return@apply
- }
-
- 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 =
- additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Config && additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() = "Config{additionalProperties=$additionalProperties}"
- }
-
- /** Event filter rules (JSON) */
- class Filters
- @JsonCreator
- private constructor(
- @com.fasterxml.jackson.annotation.JsonValue
- private val additionalProperties: Map
- ) {
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /** Returns a mutable builder for constructing an instance of [Filters]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Filters]. */
- class Builder internal constructor() {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(filters: Filters) = apply {
- additionalProperties = filters.additionalProperties.toMutableMap()
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Filters].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): Filters = Filters(additionalProperties.toImmutable())
- }
-
- private var validated: Boolean = false
-
- fun validate(): Filters = apply {
- if (validated) {
- return@apply
- }
-
- 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 =
- additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Filters && additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() = "Filters{additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Integration &&
- id == other.id &&
- config == other.config &&
- createdAt == other.createdAt &&
- eventTypes == other.eventTypes &&
- isActive == other.isActive &&
- name == other.name &&
- type == other.type &&
- filters == other.filters &&
- messageTemplate == other.messageTemplate &&
- scopeAllMonitors == other.scopeAllMonitors &&
- silentPush == other.silentPush &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- config,
- createdAt,
- eventTypes,
- isActive,
- name,
- type,
- filters,
- messageTemplate,
- scopeAllMonitors,
- silentPush,
- additionalProperties,
- )
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Integration{id=$id, config=$config, createdAt=$createdAt, eventTypes=$eventTypes, isActive=$isActive, name=$name, type=$type, filters=$filters, messageTemplate=$messageTemplate, scopeAllMonitors=$scopeAllMonitors, silentPush=$silentPush, additionalProperties=$additionalProperties}"
-}
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
deleted file mode 100644
index e1b81b6..0000000
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationCreateParams.kt
+++ /dev/null
@@ -1,801 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.x_twitter_scraper.api.models.integrations
-
-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.Params
-import com.x_twitter_scraper.api.core.checkKnown
-import com.x_twitter_scraper.api.core.checkRequired
-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 com.x_twitter_scraper.api.errors.XTwitterScraperInvalidDataException
-import com.x_twitter_scraper.api.models.EventType
-import java.util.Collections
-import java.util.Objects
-import kotlin.jvm.optionals.getOrNull
-
-/** Create integration */
-class IntegrationCreateParams
-private constructor(
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /**
- * Integration config (e.g. Telegram chatId)
- *
- * @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 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).
- */
- fun eventTypes(): List = body.eventTypes()
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun name(): String = body.name()
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("telegram")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- fun _type(): JsonValue = body._type()
-
- /**
- * Returns the raw JSON value of [config].
- *
- * Unlike [config], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _config(): JsonField = body._config()
-
- /**
- * Returns the raw JSON value of [eventTypes].
- *
- * Unlike [eventTypes], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _eventTypes(): JsonField> = body._eventTypes()
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _name(): JsonField = body._name()
-
- fun _additionalBodyProperties(): Map = body._additionalProperties()
-
- /** 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 {
-
- /**
- * Returns a mutable builder for constructing an instance of [IntegrationCreateParams].
- *
- * The following fields are required:
- * ```java
- * .config()
- * .eventTypes()
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [IntegrationCreateParams]. */
- class Builder internal constructor() {
-
- private var body: Body.Builder = Body.builder()
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(integrationCreateParams: IntegrationCreateParams) = apply {
- body = integrationCreateParams.body.toBuilder()
- additionalHeaders = integrationCreateParams.additionalHeaders.toBuilder()
- additionalQueryParams = integrationCreateParams.additionalQueryParams.toBuilder()
- }
-
- /**
- * Sets the entire request body.
- *
- * This is generally only useful if you are already constructing the body separately.
- * Otherwise, it's more convenient to use the top-level setters instead:
- * - [config]
- * - [eventTypes]
- * - [name]
- * - [type]
- */
- fun body(body: Body) = apply { this.body = body.toBuilder() }
-
- /** Integration config (e.g. Telegram chatId) */
- fun config(config: Config) = apply { body.config(config) }
-
- /**
- * Sets [Builder.config] to an arbitrary JSON value.
- *
- * You should usually call [Builder.config] with a well-typed [Config] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun config(config: JsonField) = apply { body.config(config) }
-
- /** Array of event types to subscribe to. */
- fun eventTypes(eventTypes: List) = apply { body.eventTypes(eventTypes) }
-
- /**
- * Sets [Builder.eventTypes] to an arbitrary JSON value.
- *
- * You should usually call [Builder.eventTypes] with a well-typed `List` value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun eventTypes(eventTypes: JsonField>) = apply {
- body.eventTypes(eventTypes)
- }
-
- /**
- * Adds a single [EventType] to [eventTypes].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addEventType(eventType: EventType) = apply { body.addEventType(eventType) }
-
- fun name(name: String) = apply { body.name(name) }
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun name(name: JsonField) = apply { body.name(name) }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("telegram")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { body.type(type) }
-
- fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
- body.additionalProperties(additionalBodyProperties)
- }
-
- fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
- body.putAdditionalProperty(key, value)
- }
-
- fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
- apply {
- body.putAllAdditionalProperties(additionalBodyProperties)
- }
-
- fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
-
- fun removeAllAdditionalBodyProperties(keys: Set) = apply {
- body.removeAllAdditionalProperties(keys)
- }
-
- 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)
- }
-
- /**
- * Returns an immutable instance of [IntegrationCreateParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .config()
- * .eventTypes()
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): IntegrationCreateParams =
- IntegrationCreateParams(
- body.build(),
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _body(): Body = body
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams = additionalQueryParams
-
- class Body
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val config: JsonField,
- private val eventTypes: JsonField>,
- private val name: JsonField,
- private val type: JsonValue,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("config") @ExcludeMissing config: JsonField = JsonMissing.of(),
- @JsonProperty("eventTypes")
- @ExcludeMissing
- eventTypes: JsonField> = JsonMissing.of(),
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- ) : this(config, eventTypes, name, type, mutableMapOf())
-
- /**
- * Integration config (e.g. Telegram chatId)
- *
- * @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 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).
- */
- fun eventTypes(): List = eventTypes.getRequired("eventTypes")
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun name(): String = name.getRequired("name")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("telegram")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server
- * responded with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * Returns the raw JSON value of [config].
- *
- * Unlike [config], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("config") @ExcludeMissing fun _config(): JsonField = config
-
- /**
- * Returns the raw JSON value of [eventTypes].
- *
- * Unlike [eventTypes], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("eventTypes")
- @ExcludeMissing
- fun _eventTypes(): JsonField> = eventTypes
-
- /**
- * Returns the raw JSON value of [name].
- *
- * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Body].
- *
- * The following fields are required:
- * ```java
- * .config()
- * .eventTypes()
- * .name()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Body]. */
- class Builder internal constructor() {
-
- private var config: JsonField? = null
- private var eventTypes: JsonField>? = null
- private var name: JsonField? = null
- private var type: JsonValue = JsonValue.from("telegram")
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(body: Body) = apply {
- config = body.config
- eventTypes = body.eventTypes.map { it.toMutableList() }
- name = body.name
- type = body.type
- additionalProperties = body.additionalProperties.toMutableMap()
- }
-
- /** Integration config (e.g. Telegram chatId) */
- fun config(config: Config) = config(JsonField.of(config))
-
- /**
- * Sets [Builder.config] to an arbitrary JSON value.
- *
- * You should usually call [Builder.config] with a well-typed [Config] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun config(config: JsonField) = apply { this.config = config }
-
- /** Array of event types to subscribe to. */
- fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes))
-
- /**
- * Sets [Builder.eventTypes] to an arbitrary JSON value.
- *
- * You should usually call [Builder.eventTypes] with a well-typed `List`
- * value instead. This method is primarily for setting the field to an undocumented or
- * not yet supported value.
- */
- fun eventTypes(eventTypes: JsonField>) = apply {
- this.eventTypes = eventTypes.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [EventType] to [eventTypes].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addEventType(eventType: EventType) = apply {
- eventTypes =
- (eventTypes ?: JsonField.of(mutableListOf())).also {
- checkKnown("eventTypes", it).add(eventType)
- }
- }
-
- fun name(name: String) = name(JsonField.of(name))
-
- /**
- * Sets [Builder.name] to an arbitrary JSON value.
- *
- * You should usually call [Builder.name] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun name(name: JsonField) = apply { this.name = name }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("telegram")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Body].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .config()
- * .eventTypes()
- * .name()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Body =
- Body(
- checkRequired("config", config),
- checkRequired("eventTypes", eventTypes).map { it.toImmutable() },
- checkRequired("name", name),
- type,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- config().validate()
- eventTypes().forEach { it.validate() }
- name()
- _type().let {
- if (it != JsonValue.from("telegram")) {
- throw XTwitterScraperInvalidDataException("'type' is invalid, received $it")
- }
- }
- 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 =
- (config.asKnown().getOrNull()?.validity() ?: 0) +
- (eventTypes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
- (if (name.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("telegram")) 1 else 0 }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- config == other.config &&
- eventTypes == other.eventTypes &&
- name == other.name &&
- type == other.type &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(config, eventTypes, name, type, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Body{config=$config, eventTypes=$eventTypes, name=$name, type=$type, additionalProperties=$additionalProperties}"
- }
-
- /** Integration config (e.g. Telegram chatId) */
- class Config
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val chatId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("chatId") @ExcludeMissing chatId: JsonField = JsonMissing.of()
- ) : this(chatId, mutableMapOf())
-
- /**
- * @throws XTwitterScraperInvalidDataException if the JSON field has an unexpected type or
- * is unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun chatId(): String = chatId.getRequired("chatId")
-
- /**
- * Returns the raw JSON value of [chatId].
- *
- * Unlike [chatId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("chatId") @ExcludeMissing fun _chatId(): JsonField = chatId
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Config].
- *
- * The following fields are required:
- * ```java
- * .chatId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Config]. */
- class Builder internal constructor() {
-
- private var chatId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(config: Config) = apply {
- chatId = config.chatId
- additionalProperties = config.additionalProperties.toMutableMap()
- }
-
- fun chatId(chatId: String) = chatId(JsonField.of(chatId))
-
- /**
- * Sets [Builder.chatId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.chatId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun chatId(chatId: JsonField) = apply { this.chatId = chatId }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Config].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .chatId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Config =
- Config(checkRequired("chatId", chatId), additionalProperties.toMutableMap())
- }
-
- private var validated: Boolean = false
-
- fun validate(): Config = apply {
- if (validated) {
- return@apply
- }
-
- chatId()
- 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 (chatId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Config &&
- chatId == other.chatId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(chatId, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Config{chatId=$chatId, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is IntegrationCreateParams &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "IntegrationCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDeleteParams.kt b/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDeleteParams.kt
deleted file mode 100644
index 93f939c..0000000
--- a/x-twitter-scraper-java-core/src/main/kotlin/com/x_twitter_scraper/api/models/integrations/IntegrationDeleteParams.kt
+++ /dev/null
@@ -1,230 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.x_twitter_scraper.api.models.integrations
-
-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 integration */
-class IntegrationDeleteParams
-private constructor(
- private val id: String?,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
- private val additionalBodyProperties: Map