(events)
REST APIs for managing events captured by a speakeasy binary (CLI, GitHub Action etc)
- getEventsByTarget - Load recent events for a particular workspace
- getTargets - Load targets for a particular workspace
- getTargetsDeprecated - Load targets for a particular workspace
- post - Post events for a specific workspace
- search - Search events for a particular workspace by any field
Load recent events for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceEventsByTargetRequest(
targetId: '<id>',
workspaceId: '<id>',
);
$response = $sdk->events->getEventsByTarget(
request: $request
);
if ($response->cliEventBatch !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceEventsByTargetRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceEventsByTargetResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |
Load targets for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceTargetsRequest();
$response = $sdk->events->getTargets(
request: $request
);
if ($response->targetSDKList !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceTargetsRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceTargetsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |
Load targets for a particular workspace
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceTargetsDeprecatedRequest(
workspaceId: '<id>',
);
$response = $sdk->events->getTargetsDeprecated(
request: $request
);
if ($response->targetSDKList !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceTargetsDeprecatedRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceTargetsDeprecatedResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |
Sends an array of events to be stored for a particular workspace.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
use Speakeasy\SpeakeasyClientSDK\Utils;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\PostWorkspaceEventsRequest(
requestBody: [
new Shared\CliEvent(
createdAt: Utils\Utils::parseDateTime('2024-05-07T03:24:39.583Z'),
executionId: '<id>',
id: '<id>',
interactionType: Shared\InteractionType::Quickstart,
localStartedAt: Utils\Utils::parseDateTime('2024-09-08T05:59:33.876Z'),
speakeasyApiKeyName: '<value>',
speakeasyVersion: '<value>',
success: false,
workspaceId: '<id>',
),
],
workspaceId: '<id>',
);
$response = $sdk->events->post(
request: $request
);
if ($response->statusCode === 200) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\PostWorkspaceEventsRequest | ✔️ | The request object to use for the request. |
?Operations\PostWorkspaceEventsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |
Search events for a particular workspace by any field
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\SearchWorkspaceEventsRequest(
workspaceId: '<id>',
);
$response = $sdk->events->search(
request: $request
);
if ($response->cliEventBatch !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SearchWorkspaceEventsRequest | ✔️ | The request object to use for the request. |
?Operations\SearchWorkspaceEventsResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 5XX | application/json |
Errorors\SDKException | 4XX | */* |