Skip to content

Commit f236745

Browse files
feat(api): api update
1 parent 11e59fb commit f236745

25 files changed

Lines changed: 676 additions & 46 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 115
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-3b2c6c771ad1da0bbfeb0af115972929ed2c7fcd5e47a79556d66cd21431b224.yml
3-
openapi_spec_hash: de2890233b68387bf5f9b6d19e7d87dc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-93bb7d4f1475c8043af464ec88244a034456c549136c8477f284f0a33192e1c9.yml
3+
openapi_spec_hash: 74dca63c872249274ad99b111dea0833
44
config_hash: 8894c96caeb6df84c9394518810221bd

src/Compose/ComposeNewResponse.php

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace XTwitterScraper\Compose;
6+
7+
use XTwitterScraper\Core\Attributes\Optional;
8+
use XTwitterScraper\Core\Concerns\SdkModel;
9+
use XTwitterScraper\Core\Contracts\BaseModel;
10+
11+
/**
12+
* @phpstan-type ComposeNewResponseShape = array{
13+
* feedback?: string|null,
14+
* score?: float|null,
15+
* suggestions?: list<string>|null,
16+
* text?: string|null,
17+
* }
18+
*/
19+
final class ComposeNewResponse implements BaseModel
20+
{
21+
/** @use SdkModel<ComposeNewResponseShape> */
22+
use SdkModel;
23+
24+
/**
25+
* AI feedback on the draft.
26+
*/
27+
#[Optional]
28+
public ?string $feedback;
29+
30+
/**
31+
* Engagement score (0-100).
32+
*/
33+
#[Optional]
34+
public ?float $score;
35+
36+
/**
37+
* Improvement suggestions.
38+
*
39+
* @var list<string>|null $suggestions
40+
*/
41+
#[Optional(list: 'string')]
42+
public ?array $suggestions;
43+
44+
/**
45+
* Generated or refined tweet text.
46+
*/
47+
#[Optional]
48+
public ?string $text;
49+
50+
public function __construct()
51+
{
52+
$this->initialize();
53+
}
54+
55+
/**
56+
* Construct an instance from the required parameters.
57+
*
58+
* You must use named parameters to construct any parameters with a default value.
59+
*
60+
* @param list<string>|null $suggestions
61+
*/
62+
public static function with(
63+
?string $feedback = null,
64+
?float $score = null,
65+
?array $suggestions = null,
66+
?string $text = null,
67+
): self {
68+
$self = new self;
69+
70+
null !== $feedback && $self['feedback'] = $feedback;
71+
null !== $score && $self['score'] = $score;
72+
null !== $suggestions && $self['suggestions'] = $suggestions;
73+
null !== $text && $self['text'] = $text;
74+
75+
return $self;
76+
}
77+
78+
/**
79+
* AI feedback on the draft.
80+
*/
81+
public function withFeedback(string $feedback): self
82+
{
83+
$self = clone $this;
84+
$self['feedback'] = $feedback;
85+
86+
return $self;
87+
}
88+
89+
/**
90+
* Engagement score (0-100).
91+
*/
92+
public function withScore(float $score): self
93+
{
94+
$self = clone $this;
95+
$self['score'] = $score;
96+
97+
return $self;
98+
}
99+
100+
/**
101+
* Improvement suggestions.
102+
*
103+
* @param list<string> $suggestions
104+
*/
105+
public function withSuggestions(array $suggestions): self
106+
{
107+
$self = clone $this;
108+
$self['suggestions'] = $suggestions;
109+
110+
return $self;
111+
}
112+
113+
/**
114+
* Generated or refined tweet text.
115+
*/
116+
public function withText(string $text): self
117+
{
118+
$self = clone $this;
119+
$self['text'] = $text;
120+
121+
return $self;
122+
}
123+
}

src/Events/EventDetail.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ final class EventDetail implements BaseModel
2929
#[Required]
3030
public string $id;
3131

32-
/** @var array<string,mixed> $data */
32+
/**
33+
* Event payload — shape varies by event type (JSON).
34+
*
35+
* @var array<string,mixed> $data
36+
*/
3337
#[Required(map: 'mixed')]
3438
public array $data;
3539

@@ -116,6 +120,8 @@ public function withID(string $id): self
116120
}
117121

118122
/**
123+
* Event payload — shape varies by event type (JSON).
124+
*
119125
* @param array<string,mixed> $data
120126
*/
121127
public function withData(array $data): self

src/Events/EventGetResponse.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ final class EventGetResponse implements BaseModel
2929
#[Required]
3030
public string $id;
3131

32-
/** @var array<string,mixed> $data */
32+
/**
33+
* Event payload — shape varies by event type (JSON).
34+
*
35+
* @var array<string,mixed> $data
36+
*/
3337
#[Required(map: 'mixed')]
3438
public array $data;
3539

@@ -116,6 +120,8 @@ public function withID(string $id): self
116120
}
117121

118122
/**
123+
* Event payload — shape varies by event type (JSON).
124+
*
119125
* @param array<string,mixed> $data
120126
*/
121127
public function withData(array $data): self

src/Extractions/ExtractionGetResponse.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ final class ExtractionGetResponse implements BaseModel
2626
#[Required]
2727
public bool $hasMore;
2828

29-
/** @var array<string,mixed> $job */
29+
/**
30+
* Extraction job metadata — shape varies by tool type (JSON).
31+
*
32+
* @var array<string,mixed> $job
33+
*/
3034
#[Required(map: 'mixed')]
3135
public array $job;
3236

@@ -90,6 +94,8 @@ public function withHasMore(bool $hasMore): self
9094
}
9195

9296
/**
97+
* Extraction job metadata — shape varies by tool type (JSON).
98+
*
9399
* @param array<string,mixed> $job
94100
*/
95101
public function withJob(array $job): self

src/Integrations/Integration.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ final class Integration implements BaseModel
3434
#[Required]
3535
public string $id;
3636

37-
/** @var array<string,mixed> $config */
37+
/**
38+
* Integration config — shape varies by type (JSON).
39+
*
40+
* @var array<string,mixed> $config
41+
*/
3842
#[Required(map: 'mixed')]
3943
public array $config;
4044

@@ -55,7 +59,11 @@ final class Integration implements BaseModel
5559
#[Required(enum: Type::class)]
5660
public string $type;
5761

58-
/** @var array<string,mixed>|null $filters */
62+
/**
63+
* Event filter rules (JSON).
64+
*
65+
* @var array<string,mixed>|null $filters
66+
*/
5967
#[Optional(map: 'mixed')]
6068
public ?array $filters;
6169

@@ -152,6 +160,8 @@ public function withID(string $id): self
152160
}
153161

154162
/**
163+
* Integration config — shape varies by type (JSON).
164+
*
155165
* @param array<string,mixed> $config
156166
*/
157167
public function withConfig(array $config): self
@@ -209,6 +219,8 @@ public function withType(Type|string $type): self
209219
}
210220

211221
/**
222+
* Event filter rules (JSON).
223+
*
212224
* @param array<string,mixed> $filters
213225
*/
214226
public function withFilters(array $filters): self

src/Integrations/IntegrationGetResponse.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ final class IntegrationGetResponse implements BaseModel
3434
#[Required]
3535
public string $id;
3636

37-
/** @var array<string,mixed> $config */
37+
/**
38+
* Integration config — shape varies by type (JSON).
39+
*
40+
* @var array<string,mixed> $config
41+
*/
3842
#[Required(map: 'mixed')]
3943
public array $config;
4044

@@ -55,7 +59,11 @@ final class IntegrationGetResponse implements BaseModel
5559
#[Required(enum: Type::class)]
5660
public string $type;
5761

58-
/** @var array<string,mixed>|null $filters */
62+
/**
63+
* Event filter rules (JSON).
64+
*
65+
* @var array<string,mixed>|null $filters
66+
*/
5967
#[Optional(map: 'mixed')]
6068
public ?array $filters;
6169

@@ -152,6 +160,8 @@ public function withID(string $id): self
152160
}
153161

154162
/**
163+
* Integration config — shape varies by type (JSON).
164+
*
155165
* @param array<string,mixed> $config
156166
*/
157167
public function withConfig(array $config): self
@@ -209,6 +219,8 @@ public function withType(Type|string $type): self
209219
}
210220

211221
/**
222+
* Event filter rules (JSON).
223+
*
212224
* @param array<string,mixed> $filters
213225
*/
214226
public function withFilters(array $filters): self

src/Integrations/IntegrationListResponse/Integration.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ final class Integration implements BaseModel
3434
#[Required]
3535
public string $id;
3636

37-
/** @var array<string,mixed> $config */
37+
/**
38+
* Integration config — shape varies by type (JSON).
39+
*
40+
* @var array<string,mixed> $config
41+
*/
3842
#[Required(map: 'mixed')]
3943
public array $config;
4044

@@ -55,7 +59,11 @@ final class Integration implements BaseModel
5559
#[Required(enum: Type::class)]
5660
public string $type;
5761

58-
/** @var array<string,mixed>|null $filters */
62+
/**
63+
* Event filter rules (JSON).
64+
*
65+
* @var array<string,mixed>|null $filters
66+
*/
5967
#[Optional(map: 'mixed')]
6068
public ?array $filters;
6169

@@ -152,6 +160,8 @@ public function withID(string $id): self
152160
}
153161

154162
/**
163+
* Integration config — shape varies by type (JSON).
164+
*
155165
* @param array<string,mixed> $config
156166
*/
157167
public function withConfig(array $config): self
@@ -209,6 +219,8 @@ public function withType(Type|string $type): self
209219
}
210220

211221
/**
222+
* Event filter rules (JSON).
223+
*
212224
* @param array<string,mixed> $filters
213225
*/
214226
public function withFilters(array $filters): self

src/Integrations/IntegrationNewResponse.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ final class IntegrationNewResponse implements BaseModel
3434
#[Required]
3535
public string $id;
3636

37-
/** @var array<string,mixed> $config */
37+
/**
38+
* Integration config — shape varies by type (JSON).
39+
*
40+
* @var array<string,mixed> $config
41+
*/
3842
#[Required(map: 'mixed')]
3943
public array $config;
4044

@@ -55,7 +59,11 @@ final class IntegrationNewResponse implements BaseModel
5559
#[Required(enum: Type::class)]
5660
public string $type;
5761

58-
/** @var array<string,mixed>|null $filters */
62+
/**
63+
* Event filter rules (JSON).
64+
*
65+
* @var array<string,mixed>|null $filters
66+
*/
5967
#[Optional(map: 'mixed')]
6068
public ?array $filters;
6169

@@ -152,6 +160,8 @@ public function withID(string $id): self
152160
}
153161

154162
/**
163+
* Integration config — shape varies by type (JSON).
164+
*
155165
* @param array<string,mixed> $config
156166
*/
157167
public function withConfig(array $config): self
@@ -209,6 +219,8 @@ public function withType(Type|string $type): self
209219
}
210220

211221
/**
222+
* Event filter rules (JSON).
223+
*
212224
* @param array<string,mixed> $filters
213225
*/
214226
public function withFilters(array $filters): self

0 commit comments

Comments
 (0)