Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 61 lines 1.7 kB view raw
1<?php 2 3namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs; 4 5use SocialDept\AtpSchema\Data\Data; 6use SocialDept\AtpSchema\Generated\Com\Atproto\Moderation\Defs\ReasonType; 7 8/** 9 * GENERATED CODE - DO NOT EDIT 10 * 11 * Report a subject 12 * 13 * Lexicon: tools.ozone.moderation.defs.modEventReport 14 * Type: object 15 * 16 * @property string|null $comment 17 * @property bool|null $isReporterMuted Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. 18 * @property ReasonType $reportType 19 * 20 * Constraints: 21 * - Required: reportType 22 */ 23class ModEventReport extends Data 24{ 25 /** 26 * @param bool|null $isReporterMuted Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. 27 */ 28 public function __construct( 29 public readonly ReasonType $reportType, 30 public readonly ?string $comment = null, 31 public readonly ?bool $isReporterMuted = null 32 ) { 33 } 34 35 /** 36 * Get the lexicon NSID for this data type. 37 * 38 * @return string 39 */ 40 public static function getLexicon(): string 41 { 42 return 'tools.ozone.moderation.defs.modEventReport'; 43 } 44 45 46 /** 47 * Create an instance from an array. 48 * 49 * @param array $data The data array 50 * @return static 51 */ 52 public static function fromArray(array $data): static 53 { 54 return new static( 55 reportType: ReasonType::fromArray($data['reportType']), 56 comment: $data['comment'] ?? null, 57 isReporterMuted: $data['isReporterMuted'] ?? null 58 ); 59 } 60 61}