Spaces:
Sleeping
Sleeping
File size: 1,652 Bytes
097eaf0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | <?php
declare(strict_types=1);
namespace Firecrawl\Models;
final class MapOptions
{
private function __construct(
private readonly ?string $search = null,
private readonly ?string $sitemap = null,
private readonly ?bool $includeSubdomains = null,
private readonly ?bool $ignoreQueryParameters = null,
private readonly ?int $limit = null,
private readonly ?int $timeout = null,
private readonly ?string $integration = null,
private readonly ?LocationConfig $location = null,
) {}
public static function with(
?string $search = null,
?string $sitemap = null,
?bool $includeSubdomains = null,
?bool $ignoreQueryParameters = null,
?int $limit = null,
?int $timeout = null,
?string $integration = null,
?LocationConfig $location = null,
): self {
return new self(
$search, $sitemap, $includeSubdomains, $ignoreQueryParameters,
$limit, $timeout, $integration, $location,
);
}
/** @return array<string, mixed> */
public function toArray(): array
{
$fields = [
'search' => $this->search,
'sitemap' => $this->sitemap,
'includeSubdomains' => $this->includeSubdomains,
'ignoreQueryParameters' => $this->ignoreQueryParameters,
'limit' => $this->limit,
'timeout' => $this->timeout,
'integration' => $this->integration,
'location' => $this->location?->toArray(),
];
return array_filter($fields, fn (mixed $v): bool => $v !== null);
}
}
|