Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 66 lines 2.3 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 * Revert take down action on a subject 11 * 12 * Lexicon: tools.ozone.moderation.defs.modEventReverseTakedown 13 * Type: object 14 * 15 * @property string|null $comment Describe reasoning behind the reversal. 16 * @property array<string>|null $policies Names/Keywords of the policy infraction for which takedown is being reversed. 17 * @property string|null $severityLevel Severity level of the violation. Usually set from the last policy infraction's severity. 18 * @property int|null $strikeCount Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. 19 * 20 * Constraints: 21 * - policies: Max length: 5 22 */ 23class ModEventReverseTakedown extends Data 24{ 25 /** 26 * @param string|null $comment Describe reasoning behind the reversal. 27 * @param array<string>|null $policies Names/Keywords of the policy infraction for which takedown is being reversed. 28 * @param string|null $severityLevel Severity level of the violation. Usually set from the last policy infraction's severity. 29 * @param int|null $strikeCount Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. 30 */ 31 public function __construct( 32 public readonly ?string $comment = null, 33 public readonly ?array $policies = null, 34 public readonly ?string $severityLevel = null, 35 public readonly ?int $strikeCount = null 36 ) { 37 } 38 39 /** 40 * Get the lexicon NSID for this data type. 41 * 42 * @return string 43 */ 44 public static function getLexicon(): string 45 { 46 return 'tools.ozone.moderation.defs.modEventReverseTakedown'; 47 } 48 49 50 /** 51 * Create an instance from an array. 52 * 53 * @param array $data The data array 54 * @return static 55 */ 56 public static function fromArray(array $data): static 57 { 58 return new static( 59 comment: $data['comment'] ?? null, 60 policies: $data['policies'] ?? null, 61 severityLevel: $data['severityLevel'] ?? null, 62 strikeCount: $data['strikeCount'] ?? null 63 ); 64 } 65 66}