Something went wrong. Try again.
Laravel AT Protocol Client (alpha & unstable)
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344<?php
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
use Illuminate\Contracts\Support\Arrayable;use Illuminate\Support\Collection;use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListItemView;use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListView;
/** * @implements Arrayable<string, mixed> */class GetListResponse implements Arrayable{ /** * @param Collection<int, ListItemView> $items */ public function __construct( public readonly ListView $list, public readonly Collection $items, public readonly ?string $cursor = null, ) {}
public static function fromArray(array $data): self { return new self( list: ListView::fromArray($data['list']), items: collect($data['items'] ?? [])->map( fn (array $item) => ListItemView::fromArray($item) ), cursor: $data['cursor'] ?? null, ); }
public function toArray(): array { return [ 'list' => $this->list->toArray(), 'items' => $this->items->map(fn (ListItemView $i) => $i->toArray())->all(), 'cursor' => $this->cursor, ]; }}