Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 49 lines 968 B 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.threadViewPref 11 * Type: object 12 * 13 * @property string|null $sort Sorting mode for threads. 14 */ 15class ThreadViewPref extends Data 16{ 17 /** 18 * @param string|null $sort Sorting mode for threads. 19 */ 20 public function __construct( 21 public readonly ?string $sort = null 22 ) { 23 } 24 25 /** 26 * Get the lexicon NSID for this data type. 27 * 28 * @return string 29 */ 30 public static function getLexicon(): string 31 { 32 return 'app.bsky.actor.defs.threadViewPref'; 33 } 34 35 36 /** 37 * Create an instance from an array. 38 * 39 * @param array $data The data array 40 * @return static 41 */ 42 public static function fromArray(array $data): static 43 { 44 return new static( 45 sort: $data['sort'] ?? null 46 ); 47 } 48 49}