Skip to content

Commit b180266

Browse files
chore: 🐝 Update SDK - Generate SDK 1.5.1
1 parent 686fc94 commit b180266

File tree

8 files changed

+89
-20
lines changed

8 files changed

+89
-20
lines changed

.speakeasy/gen.lock

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 16ed6937-9038-4c34-a8b6-e4732948f250
33
management:
4-
docChecksum: a240839e3f0eebfe8c1af416f07748d6
4+
docChecksum: 95edc2594618bce65f5df9316266857e
55
docVersion: 1.0.0
66
speakeasyVersion: 1.662.0
77
generationVersion: 2.763.3
8-
releaseVersion: 1.5.0
9-
configChecksum: d7e89c14410d8a46316d093a72b31434
8+
releaseVersion: 1.5.1
9+
configChecksum: 2a7a47820be3c58cce0ddd54d5de548b
1010
repoURL: https://github.com/gr4vy/gr4vy-php.git
1111
installationURL: https://github.com/gr4vy/gr4vy-php
1212
published: true
@@ -4379,6 +4379,3 @@ examples:
43794379
application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"}
43804380
examplesVersion: 1.0.2
43814381
generatedTests: {}
4382-
releaseNotes: |
4383-
## Php SDK Changes Detected:
4384-
* `sdk->transactions->events->list()`: `response.items->[]->context` **Changed** **Breaking** :warning:

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ generation:
2626
generateNewTests: false
2727
skipResponseBodyAssertions: false
2828
php:
29-
version: 1.5.0
29+
version: 1.5.1
3030
additionalDependencies:
3131
autoload: {}
3232
autoload-dev: {}

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ speakeasyVersion: 1.662.0
22
sources:
33
openapi:
44
sourceNamespace: openapi
5-
sourceRevisionDigest: sha256:0071095ec8acf5b9ec17c5b644fe20cd28dc9e0ef3c4390dce90035f1e107068
6-
sourceBlobDigest: sha256:9df4baabed869acb3e7a3e00c2a91def07812a9d91c9b5e4d13ce97f94b3d6f7
5+
sourceRevisionDigest: sha256:3060d0a2d51daf83d92cefebfc3bf565b38f51a53b8b712ae210fb0a73551e33
6+
sourceBlobDigest: sha256:ea249b87004dac436a9f12d412e185a736e8dc67f6a7ebb65b6ffb6a2c681c71
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1764180443
9+
- speakeasy-sdk-regen-1764182541
1010
- 1.0.0
1111
targets:
1212
php:
1313
source: openapi
1414
sourceNamespace: openapi
15-
sourceRevisionDigest: sha256:0071095ec8acf5b9ec17c5b644fe20cd28dc9e0ef3c4390dce90035f1e107068
16-
sourceBlobDigest: sha256:9df4baabed869acb3e7a3e00c2a91def07812a9d91c9b5e4d13ce97f94b3d6f7
15+
sourceRevisionDigest: sha256:3060d0a2d51daf83d92cefebfc3bf565b38f51a53b8b712ae210fb0a73551e33
16+
sourceBlobDigest: sha256:ea249b87004dac436a9f12d412e185a736e8dc67f6a7ebb65b6ffb6a2c681c71
1717
codeSamplesNamespace: openapi-php-code-samples
18-
codeSamplesRevisionDigest: sha256:9904f91c4ec7f199b3476ccd0991035df5de73640e1541f97ec3550b74aa40dc
18+
codeSamplesRevisionDigest: sha256:94eb611dc9ff0246ed39f2829dadf239279ec07a0859202f88c9e8de7449f0de
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,4 +858,14 @@ Based on:
858858
### Generated
859859
- [php v1.5.0] .
860860
### Releases
861-
- [Composer v1.5.0] https://packagist.org/packages/gr4vy/gr4vy-php#v1.5.0 - .
861+
- [Composer v1.5.0] https://packagist.org/packages/gr4vy/gr4vy-php#v1.5.0 - .
862+
863+
## 2025-11-26 18:42:02
864+
### Changes
865+
Based on:
866+
- OpenAPI Doc
867+
- Speakeasy CLI 1.662.0 (2.763.3) https://github.com/speakeasy-api/speakeasy
868+
### Generated
869+
- [php v1.5.1] .
870+
### Releases
871+
- [Composer v1.5.1] https://packagist.org/packages/gr4vy/gr4vy-php#v1.5.1 - .

docs/sdks/events/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ $sdk = Gr4vy\SDK::builder()
3030

3131

3232

33-
$response = $sdk->transactions->events->list(
33+
$responses = $sdk->transactions->events->list(
3434
transactionId: '7099948d-7286-47e4-aad8-b68f7eb44591',
3535
cursor: 'ZXhhbXBsZTE',
3636
limit: 100
3737

3838
);
3939

40-
if ($response->transactionEvents !== null) {
41-
// handle response
40+
41+
foreach ($responses as $response) {
42+
if ($response->statusCode === 200) {
43+
// handle response
44+
}
4245
}
4346
```
4447

src/Events.php

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string
5757
* @return ListTransactionEventsResponse
5858
* @throws \Gr4vy\errors\APIException
5959
*/
60-
public function list(string $transactionId, ?string $cursor = null, ?int $limit = null, ?string $merchantAccountId = null, ?Options $options = null): ListTransactionEventsResponse
60+
private function listIndividual(string $transactionId, ?string $cursor = null, ?int $limit = null, ?string $merchantAccountId = null, ?Options $options = null): ListTransactionEventsResponse
6161
{
6262
$retryConfig = null;
6363
if ($options) {
@@ -132,6 +132,28 @@ public function list(string $transactionId, ?string $cursor = null, ?int $limit
132132
contentType: $contentType,
133133
rawResponse: $httpResponse,
134134
transactionEvents: $obj);
135+
$sdk = $this;
136+
137+
$response->next = function () use ($sdk, $responseData, $transactionId, $limit, $merchantAccountId): ?ListTransactionEventsResponse {
138+
$jsonObject = new \JsonPath\JsonObject($responseData);
139+
$nextCursor = $jsonObject->get('$.next_cursor');
140+
if ($nextCursor == null) {
141+
return null;
142+
} else {
143+
$nextCursor = $nextCursor[0];
144+
if ($nextCursor == null || (is_string($nextCursor) && trim($nextCursor) === '')) {
145+
return null;
146+
}
147+
}
148+
149+
return $sdk->listIndividual(
150+
transactionId: $transactionId,
151+
cursor: $nextCursor,
152+
limit: $limit,
153+
merchantAccountId: $merchantAccountId,
154+
);
155+
};
156+
135157

136158
return $response;
137159
} else {
@@ -277,5 +299,25 @@ public function list(string $transactionId, ?string $cursor = null, ?int $limit
277299
throw new \Gr4vy\errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
278300
}
279301
}
302+
/**
303+
* List transaction events
304+
*
305+
* Retrieve a paginated list of events related to processing a transaction, including status changes, API requests, and webhook delivery attempts. Events are listed in chronological order, with the most recent events first.
306+
*
307+
* @param string $transactionId
308+
* @param ?string $cursor
309+
* @param ?int $limit
310+
* @param ?string $merchantAccountId
311+
* @return \Generator<ListTransactionEventsResponse>
312+
* @throws \Gr4vy\errors\APIException
313+
*/
314+
public function list(string $transactionId, ?string $cursor = null, ?int $limit = null, ?string $merchantAccountId = null, ?Options $options = null): \Generator
315+
{
316+
$res = $this->listIndividual($transactionId, $cursor, $limit, $merchantAccountId, $options);
317+
while ($res !== null) {
318+
yield $res;
319+
$res = $res->next($res);
320+
}
321+
}
280322

281323
}

src/ListTransactionEventsResponse.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class ListTransactionEventsResponse
3939
*/
4040
public ?TransactionEvents $transactionEvents = null;
4141

42+
/**
43+
* @var \Closure(string): ?ListTransactionEventsResponse $next
44+
*/
45+
public \Closure $next;
4246
/**
4347
* @param string $contentType
4448
* @param int $statusCode
@@ -53,4 +57,17 @@ public function __construct(string $contentType, int $statusCode, \Psr\Http\Mess
5357
$this->rawResponse = $rawResponse;
5458
$this->transactionEvents = $transactionEvents;
5559
}
60+
/**
61+
* @param string $name
62+
* @param array<mixed> $args
63+
* @return ?ListTransactionEventsResponse
64+
*/
65+
public function __call($name, $args): ?ListTransactionEventsResponse
66+
{
67+
if ($name === 'next') {
68+
return call_user_func_array($this->next, $args);
69+
}
70+
71+
return null;
72+
}
5673
}

src/SDKConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class SDKConfiguration
3333

3434
public string $openapiDocVersion = '1.0.0';
3535

36-
public string $sdkVersion = '1.5.0';
36+
public string $sdkVersion = '1.5.1';
3737

3838
public string $genVersion = '2.763.3';
3939

40-
public string $userAgent = 'speakeasy-sdk/php 1.5.0 2.763.3 1.0.0 gr4vy/gr4vy-php';
40+
public string $userAgent = 'speakeasy-sdk/php 1.5.1 2.763.3 1.0.0 gr4vy/gr4vy-php';
4141
/** @var array<string, array<string, array<string, mixed>>> */
4242
public ?array $globals = [
4343
'parameters' => [],

0 commit comments

Comments
 (0)