Spaces:
Sleeping
Sleeping
Download apps/php-sdk/src/Models/AgentStatusResponse.php from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/php-sdk/src/Models/AgentStatusResponse.php
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/php-sdk/src/Models/AgentStatusResponse.php
-
curl -L -o AgentStatusResponse.php https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/php-sdk/src/Models/AgentStatusResponse.php
1.71 kB
| declare(strict_types=1); | |
| namespace Firecrawl\Models; | |
| final class AgentStatusResponse | |
| { | |
| public function __construct( | |
| private readonly bool $success = false, | |
| private readonly ?string $status = null, | |
| private readonly ?string $error = null, | |
| private readonly mixed $data = null, | |
| private readonly ?string $model = null, | |
| private readonly ?string $expiresAt = null, | |
| private readonly ?int $creditsUsed = null, | |
| ) {} | |
| /** @param array<string, mixed> $raw */ | |
| public static function fromArray(array $raw): self | |
| { | |
| return new self( | |
| success: (bool) ($raw['success'] ?? false), | |
| status: $raw['status'] ?? null, | |
| error: $raw['error'] ?? null, | |
| data: $raw['data'] ?? null, | |
| model: $raw['model'] ?? null, | |
| expiresAt: $raw['expiresAt'] ?? null, | |
| creditsUsed: isset($raw['creditsUsed']) ? (int) $raw['creditsUsed'] : null, | |
| ); | |
| } | |
| public function isDone(): bool | |
| { | |
| return in_array($this->status, ['completed', 'failed', 'cancelled'], true); | |
| } | |
| public function isSuccess(): bool | |
| { | |
| return $this->success; | |
| } | |
| public function getStatus(): ?string | |
| { | |
| return $this->status; | |
| } | |
| public function getError(): ?string | |
| { | |
| return $this->error; | |
| } | |
| public function getData(): mixed | |
| { | |
| return $this->data; | |
| } | |
| public function getModel(): ?string | |
| { | |
| return $this->model; | |
| } | |
| public function getExpiresAt(): ?string | |
| { | |
| return $this->expiresAt; | |
| } | |
| public function getCreditsUsed(): ?int | |
| { | |
| return $this->creditsUsed; | |
| } | |
| } | |