Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 54 lines 1.4 kB 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 * Mute incoming reports from an account 11 * 12 * Lexicon: tools.ozone.moderation.defs.modEventMuteReporter 13 * Type: object 14 * 15 * @property string|null $comment 16 * @property int|null $durationInHours Indicates how long the account should remain muted. Falsy value here means a permanent mute. 17 */ 18class ModEventMuteReporter extends Data 19{ 20 /** 21 * @param int|null $durationInHours Indicates how long the account should remain muted. Falsy value here means a permanent mute. 22 */ 23 public function __construct( 24 public readonly ?string $comment = null, 25 public readonly ?int $durationInHours = null 26 ) { 27 } 28 29 /** 30 * Get the lexicon NSID for this data type. 31 * 32 * @return string 33 */ 34 public static function getLexicon(): string 35 { 36 return 'tools.ozone.moderation.defs.modEventMuteReporter'; 37 } 38 39 40 /** 41 * Create an instance from an array. 42 * 43 * @param array $data The data array 44 * @return static 45 */ 46 public static function fromArray(array $data): static 47 { 48 return new static( 49 comment: $data['comment'] ?? null, 50 durationInHours: $data['durationInHours'] ?? null 51 ); 52 } 53 54}