Skip to content

Commit 11e59fb

Browse files
release: 0.2.0 (#2)
* feat(api): api update * codegen metadata * feat(api): api update * codegen metadata * codegen metadata * codegen metadata * codegen metadata * codegen metadata * codegen metadata * codegen metadata * chore: update SDK settings * codegen metadata * codegen metadata * codegen metadata * release: 0.2.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 112df61 commit 11e59fb

208 files changed

Lines changed: 12748 additions & 443 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0"
2+
".": "0.2.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 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-af60c455e2c8579c3d7f0e33c07c0b8332aa3fe8869688c47b2fbf151e271235.yml
3-
openapi_spec_hash: a49d40286e54da6a4978a103b118d33f
4-
config_hash: cec075ca53645b9620ec200be71bdc48
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-3b2c6c771ad1da0bbfeb0af115972929ed2c7fcd5e47a79556d66cd21431b224.yml
3+
openapi_spec_hash: de2890233b68387bf5f9b6d19e7d87dc
4+
config_hash: 8894c96caeb6df84c9394518810221bd

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.2.0 (2026-04-01)
4+
5+
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Xquik-dev/x-twitter-scraper-php/compare/v0.1.0...v0.2.0)
6+
7+
### Features
8+
9+
* **api:** api update ([62f8c00](https://github.com/Xquik-dev/x-twitter-scraper-php/commit/62f8c00e41a54c4d9e88ea3a639f702e91823216))
10+
* **api:** api update ([a6e753f](https://github.com/Xquik-dev/x-twitter-scraper-php/commit/a6e753f715d4642778f9472c691ad0c5d66b87d0))
11+
12+
13+
### Chores
14+
15+
* update SDK settings ([95e398f](https://github.com/Xquik-dev/x-twitter-scraper-php/commit/95e398f39c8cbceb628d10895bd01330dca557bb))
16+
317
## 0.1.0 (2026-03-30)
418

519
Full Changelog: [v0.0.1...v0.1.0](https://github.com/Xquik-dev/x-twitter-scraper-php/compare/v0.0.1...v0.1.0)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ $client = new Client(
4444
apiKey: getenv('X_TWITTER_SCRAPER_API_KEY') ?: 'My API Key'
4545
);
4646

47-
$paginatedTweets = $client->x->tweets->search(q: 'from:elonmusk', limit: 10);
47+
$response = $client->x->tweets->search(q: 'from:elonmusk', limit: 10);
4848

49-
var_dump($paginatedTweets->has_next_page);
49+
var_dump($response->has_next_page);
5050
```
5151

5252
### Value Objects
@@ -68,7 +68,7 @@ use XTwitterScraper\Core\Exceptions\RateLimitException;
6868
use XTwitterScraper\Core\Exceptions\APIStatusException;
6969

7070
try {
71-
$paginatedTweets = $client->x->tweets->search(q: 'from:elonmusk');
71+
$response = $client->x->tweets->search(q: 'from:elonmusk');
7272
} catch (APIConnectionException $e) {
7373
echo "The server could not be reached", PHP_EOL;
7474
var_dump($e->getPrevious());
@@ -131,7 +131,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
131131
```php
132132
<?php
133133

134-
$paginatedTweets = $client->x->tweets->search(
134+
$response = $client->x->tweets->search(
135135
q: 'from:elonmusk',
136136
limit: 10,
137137
requestOptions: [

src/APIKeys/APIKeyListResponse.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@
44

55
namespace XTwitterScraper\APIKeys;
66

7+
use XTwitterScraper\APIKeys\APIKeyListResponse\Key;
78
use XTwitterScraper\Core\Attributes\Required;
89
use XTwitterScraper\Core\Concerns\SdkModel;
910
use XTwitterScraper\Core\Contracts\BaseModel;
1011

1112
/**
12-
* @phpstan-import-type APIKeyShape from \XTwitterScraper\APIKeys\APIKey
13+
* @phpstan-import-type KeyShape from \XTwitterScraper\APIKeys\APIKeyListResponse\Key
1314
*
14-
* @phpstan-type APIKeyListResponseShape = array{keys: list<APIKey|APIKeyShape>}
15+
* @phpstan-type APIKeyListResponseShape = array{keys: list<Key|KeyShape>}
1516
*/
1617
final class APIKeyListResponse implements BaseModel
1718
{
1819
/** @use SdkModel<APIKeyListResponseShape> */
1920
use SdkModel;
2021

21-
/** @var list<APIKey> $keys */
22-
#[Required(list: APIKey::class)]
22+
/** @var list<Key> $keys */
23+
#[Required(list: Key::class)]
2324
public array $keys;
2425

2526
/**
@@ -46,7 +47,7 @@ public function __construct()
4647
*
4748
* You must use named parameters to construct any parameters with a default value.
4849
*
49-
* @param list<APIKey|APIKeyShape> $keys
50+
* @param list<Key|KeyShape> $keys
5051
*/
5152
public static function with(array $keys): self
5253
{
@@ -58,7 +59,7 @@ public static function with(array $keys): self
5859
}
5960

6061
/**
61-
* @param list<APIKey|APIKeyShape> $keys
62+
* @param list<Key|KeyShape> $keys
6263
*/
6364
public function withKeys(array $keys): self
6465
{
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace XTwitterScraper\APIKeys\APIKeyListResponse;
6+
7+
use XTwitterScraper\Core\Attributes\Optional;
8+
use XTwitterScraper\Core\Attributes\Required;
9+
use XTwitterScraper\Core\Concerns\SdkModel;
10+
use XTwitterScraper\Core\Contracts\BaseModel;
11+
12+
/**
13+
* @phpstan-type KeyShape = array{
14+
* id: string,
15+
* createdAt: \DateTimeInterface,
16+
* isActive: bool,
17+
* name: string,
18+
* prefix: string,
19+
* lastUsedAt?: \DateTimeInterface|null,
20+
* }
21+
*/
22+
final class Key implements BaseModel
23+
{
24+
/** @use SdkModel<KeyShape> */
25+
use SdkModel;
26+
27+
#[Required]
28+
public string $id;
29+
30+
#[Required]
31+
public \DateTimeInterface $createdAt;
32+
33+
#[Required]
34+
public bool $isActive;
35+
36+
#[Required]
37+
public string $name;
38+
39+
#[Required]
40+
public string $prefix;
41+
42+
#[Optional]
43+
public ?\DateTimeInterface $lastUsedAt;
44+
45+
/**
46+
* `new Key()` is missing required properties by the API.
47+
*
48+
* To enforce required parameters use
49+
* ```
50+
* Key::with(id: ..., createdAt: ..., isActive: ..., name: ..., prefix: ...)
51+
* ```
52+
*
53+
* Otherwise ensure the following setters are called
54+
*
55+
* ```
56+
* (new Key)
57+
* ->withID(...)
58+
* ->withCreatedAt(...)
59+
* ->withIsActive(...)
60+
* ->withName(...)
61+
* ->withPrefix(...)
62+
* ```
63+
*/
64+
public function __construct()
65+
{
66+
$this->initialize();
67+
}
68+
69+
/**
70+
* Construct an instance from the required parameters.
71+
*
72+
* You must use named parameters to construct any parameters with a default value.
73+
*/
74+
public static function with(
75+
string $id,
76+
\DateTimeInterface $createdAt,
77+
bool $isActive,
78+
string $name,
79+
string $prefix,
80+
?\DateTimeInterface $lastUsedAt = null,
81+
): self {
82+
$self = new self;
83+
84+
$self['id'] = $id;
85+
$self['createdAt'] = $createdAt;
86+
$self['isActive'] = $isActive;
87+
$self['name'] = $name;
88+
$self['prefix'] = $prefix;
89+
90+
null !== $lastUsedAt && $self['lastUsedAt'] = $lastUsedAt;
91+
92+
return $self;
93+
}
94+
95+
public function withID(string $id): self
96+
{
97+
$self = clone $this;
98+
$self['id'] = $id;
99+
100+
return $self;
101+
}
102+
103+
public function withCreatedAt(\DateTimeInterface $createdAt): self
104+
{
105+
$self = clone $this;
106+
$self['createdAt'] = $createdAt;
107+
108+
return $self;
109+
}
110+
111+
public function withIsActive(bool $isActive): self
112+
{
113+
$self = clone $this;
114+
$self['isActive'] = $isActive;
115+
116+
return $self;
117+
}
118+
119+
public function withName(string $name): self
120+
{
121+
$self = clone $this;
122+
$self['name'] = $name;
123+
124+
return $self;
125+
}
126+
127+
public function withPrefix(string $prefix): self
128+
{
129+
$self = clone $this;
130+
$self['prefix'] = $prefix;
131+
132+
return $self;
133+
}
134+
135+
public function withLastUsedAt(\DateTimeInterface $lastUsedAt): self
136+
{
137+
$self = clone $this;
138+
$self['lastUsedAt'] = $lastUsedAt;
139+
140+
return $self;
141+
}
142+
}

src/Drafts/DraftGetResponse.php

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace XTwitterScraper\Drafts;
6+
7+
use XTwitterScraper\Core\Attributes\Optional;
8+
use XTwitterScraper\Core\Attributes\Required;
9+
use XTwitterScraper\Core\Concerns\SdkModel;
10+
use XTwitterScraper\Core\Contracts\BaseModel;
11+
12+
/**
13+
* @phpstan-type DraftGetResponseShape = array{
14+
* id: string,
15+
* createdAt: \DateTimeInterface,
16+
* text: string,
17+
* updatedAt: \DateTimeInterface,
18+
* goal?: string|null,
19+
* topic?: string|null,
20+
* }
21+
*/
22+
final class DraftGetResponse implements BaseModel
23+
{
24+
/** @use SdkModel<DraftGetResponseShape> */
25+
use SdkModel;
26+
27+
#[Required]
28+
public string $id;
29+
30+
#[Required]
31+
public \DateTimeInterface $createdAt;
32+
33+
#[Required]
34+
public string $text;
35+
36+
#[Required]
37+
public \DateTimeInterface $updatedAt;
38+
39+
#[Optional]
40+
public ?string $goal;
41+
42+
#[Optional]
43+
public ?string $topic;
44+
45+
/**
46+
* `new DraftGetResponse()` is missing required properties by the API.
47+
*
48+
* To enforce required parameters use
49+
* ```
50+
* DraftGetResponse::with(id: ..., createdAt: ..., text: ..., updatedAt: ...)
51+
* ```
52+
*
53+
* Otherwise ensure the following setters are called
54+
*
55+
* ```
56+
* (new DraftGetResponse)
57+
* ->withID(...)
58+
* ->withCreatedAt(...)
59+
* ->withText(...)
60+
* ->withUpdatedAt(...)
61+
* ```
62+
*/
63+
public function __construct()
64+
{
65+
$this->initialize();
66+
}
67+
68+
/**
69+
* Construct an instance from the required parameters.
70+
*
71+
* You must use named parameters to construct any parameters with a default value.
72+
*/
73+
public static function with(
74+
string $id,
75+
\DateTimeInterface $createdAt,
76+
string $text,
77+
\DateTimeInterface $updatedAt,
78+
?string $goal = null,
79+
?string $topic = null,
80+
): self {
81+
$self = new self;
82+
83+
$self['id'] = $id;
84+
$self['createdAt'] = $createdAt;
85+
$self['text'] = $text;
86+
$self['updatedAt'] = $updatedAt;
87+
88+
null !== $goal && $self['goal'] = $goal;
89+
null !== $topic && $self['topic'] = $topic;
90+
91+
return $self;
92+
}
93+
94+
public function withID(string $id): self
95+
{
96+
$self = clone $this;
97+
$self['id'] = $id;
98+
99+
return $self;
100+
}
101+
102+
public function withCreatedAt(\DateTimeInterface $createdAt): self
103+
{
104+
$self = clone $this;
105+
$self['createdAt'] = $createdAt;
106+
107+
return $self;
108+
}
109+
110+
public function withText(string $text): self
111+
{
112+
$self = clone $this;
113+
$self['text'] = $text;
114+
115+
return $self;
116+
}
117+
118+
public function withUpdatedAt(\DateTimeInterface $updatedAt): self
119+
{
120+
$self = clone $this;
121+
$self['updatedAt'] = $updatedAt;
122+
123+
return $self;
124+
}
125+
126+
public function withGoal(string $goal): self
127+
{
128+
$self = clone $this;
129+
$self['goal'] = $goal;
130+
131+
return $self;
132+
}
133+
134+
public function withTopic(string $topic): self
135+
{
136+
$self = clone $this;
137+
$self['topic'] = $topic;
138+
139+
return $self;
140+
}
141+
}

0 commit comments

Comments
 (0)