Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 72 lines 2.5 kB view raw
1<?php 2 3namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs; 4 5use SocialDept\AtpSchema\Data\Data; 6 7/** 8 * GENERATED CODE - DO NOT EDIT 9 * 10 * Lexicon: app.bsky.actor.defs.feedViewPref 11 * Type: object 12 * 13 * @property string $feed The URI of the feed, or an identifier which describes the feed. 14 * @property bool|null $hideReplies Hide replies in the feed. 15 * @property bool|null $hideRepliesByUnfollowed Hide replies in the feed if they are not by followed users. 16 * @property int|null $hideRepliesByLikeCount Hide replies in the feed if they do not have this number of likes. 17 * @property bool|null $hideReposts Hide reposts in the feed. 18 * @property bool|null $hideQuotePosts Hide quote posts in the feed. 19 * 20 * Constraints: 21 * - Required: feed 22 */ 23class FeedViewPref extends Data 24{ 25 /** 26 * @param string $feed The URI of the feed, or an identifier which describes the feed. 27 * @param bool|null $hideReplies Hide replies in the feed. 28 * @param bool|null $hideRepliesByUnfollowed Hide replies in the feed if they are not by followed users. 29 * @param int|null $hideRepliesByLikeCount Hide replies in the feed if they do not have this number of likes. 30 * @param bool|null $hideReposts Hide reposts in the feed. 31 * @param bool|null $hideQuotePosts Hide quote posts in the feed. 32 */ 33 public function __construct( 34 public readonly string $feed, 35 public readonly ?bool $hideReplies = null, 36 public readonly ?bool $hideRepliesByUnfollowed = null, 37 public readonly ?int $hideRepliesByLikeCount = null, 38 public readonly ?bool $hideReposts = null, 39 public readonly ?bool $hideQuotePosts = null 40 ) { 41 } 42 43 /** 44 * Get the lexicon NSID for this data type. 45 * 46 * @return string 47 */ 48 public static function getLexicon(): string 49 { 50 return 'app.bsky.actor.defs.feedViewPref'; 51 } 52 53 54 /** 55 * Create an instance from an array. 56 * 57 * @param array $data The data array 58 * @return static 59 */ 60 public static function fromArray(array $data): static 61 { 62 return new static( 63 feed: $data['feed'], 64 hideReplies: $data['hideReplies'] ?? null, 65 hideRepliesByUnfollowed: $data['hideRepliesByUnfollowed'] ?? null, 66 hideRepliesByLikeCount: $data['hideRepliesByLikeCount'] ?? null, 67 hideReposts: $data['hideReposts'] ?? null, 68 hideQuotePosts: $data['hideQuotePosts'] ?? null 69 ); 70 } 71 72}