Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 46 lines 907 B view raw
1<?php 2 3namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 5use SocialDept\AtpSchema\Data\Data; 6 7/** 8 * GENERATED CODE - DO NOT EDIT 9 * 10 * Lexicon: tools.ozone.moderation.defs.modEventEscalate 11 * Type: object 12 * 13 * @property string|null $comment 14 */ 15class ModEventEscalate extends Data 16{ 17 public function __construct( 18 public readonly ?string $comment = null 19 ) { 20 } 21 22 /** 23 * Get the lexicon NSID for this data type. 24 * 25 * @return string 26 */ 27 public static function getLexicon(): string 28 { 29 return 'tools.ozone.moderation.defs.modEventEscalate'; 30 } 31 32 33 /** 34 * Create an instance from an array. 35 * 36 * @param array $data The data array 37 * @return static 38 */ 39 public static function fromArray(array $data): static 40 { 41 return new static( 42 comment: $data['comment'] ?? null 43 ); 44 } 45 46}