Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 48 lines 983 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 * Divert a record's blobs to a 3rd party service for further scanning/tagging 11 * 12 * Lexicon: tools.ozone.moderation.defs.modEventDivert 13 * Type: object 14 * 15 * @property string|null $comment 16 */ 17class ModEventDivert extends Data 18{ 19 public function __construct( 20 public readonly ?string $comment = null 21 ) { 22 } 23 24 /** 25 * Get the lexicon NSID for this data type. 26 * 27 * @return string 28 */ 29 public static function getLexicon(): string 30 { 31 return 'tools.ozone.moderation.defs.modEventDivert'; 32 } 33 34 35 /** 36 * Create an instance from an array. 37 * 38 * @param array $data The data array 39 * @return static 40 */ 41 public static function fromArray(array $data): static 42 { 43 return new static( 44 comment: $data['comment'] ?? null 45 ); 46 } 47 48}