Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 63 lines 1.9 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 * A grab bag of state that's specific to the bsky.app program. Third-party apps 11 * shouldn't use this. 12 * 13 * Lexicon: app.bsky.actor.defs.bskyAppStatePref 14 * Type: object 15 * 16 * @property mixed $activeProgressGuide 17 * @property array<string>|null $queuedNudges An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. 18 * @property array<Nux>|null $nuxs Storage for NUXs the user has encountered. 19 * 20 * Constraints: 21 * - queuedNudges: Max length: 1000 22 * - nuxs: Max length: 100 23 */ 24class BskyAppStatePref extends Data 25{ 26 /** 27 * @param array<string>|null $queuedNudges An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. 28 * @param array<Nux>|null $nuxs Storage for NUXs the user has encountered. 29 */ 30 public function __construct( 31 public readonly mixed $activeProgressGuide = null, 32 public readonly ?array $queuedNudges = null, 33 public readonly ?array $nuxs = null 34 ) { 35 } 36 37 /** 38 * Get the lexicon NSID for this data type. 39 * 40 * @return string 41 */ 42 public static function getLexicon(): string 43 { 44 return 'app.bsky.actor.defs.bskyAppStatePref'; 45 } 46 47 48 /** 49 * Create an instance from an array. 50 * 51 * @param array $data The data array 52 * @return static 53 */ 54 public static function fromArray(array $data): static 55 { 56 return new static( 57 activeProgressGuide: $data['activeProgressGuide'] ?? null, 58 queuedNudges: $data['queuedNudges'] ?? null, 59 nuxs: isset($data['nuxs']) ? array_map(fn ($item) => Nux::fromArray($item), $data['nuxs']) : [] 60 ); 61 } 62 63}