Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 84 lines 3.7 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 * Lexicon: tools.ozone.moderation.defs.reporterStats 11 * Type: object 12 * 13 * @property string $did 14 * @property int $accountReportCount The total number of reports made by the user on accounts. 15 * @property int $recordReportCount The total number of reports made by the user on records. 16 * @property int $reportedAccountCount The total number of accounts reported by the user. 17 * @property int $reportedRecordCount The total number of records reported by the user. 18 * @property int $takendownAccountCount The total number of accounts taken down as a result of the user's reports. 19 * @property int $takendownRecordCount The total number of records taken down as a result of the user's reports. 20 * @property int $labeledAccountCount The total number of accounts labeled as a result of the user's reports. 21 * @property int $labeledRecordCount The total number of records labeled as a result of the user's reports. 22 * 23 * Constraints: 24 * - Required: did, accountReportCount, recordReportCount, reportedAccountCount, reportedRecordCount, takendownAccountCount, takendownRecordCount, labeledAccountCount, labeledRecordCount 25 * - did: Format: did 26 */ 27class ReporterStats extends Data 28{ 29 /** 30 * @param int $accountReportCount The total number of reports made by the user on accounts. 31 * @param int $recordReportCount The total number of reports made by the user on records. 32 * @param int $reportedAccountCount The total number of accounts reported by the user. 33 * @param int $reportedRecordCount The total number of records reported by the user. 34 * @param int $takendownAccountCount The total number of accounts taken down as a result of the user's reports. 35 * @param int $takendownRecordCount The total number of records taken down as a result of the user's reports. 36 * @param int $labeledAccountCount The total number of accounts labeled as a result of the user's reports. 37 * @param int $labeledRecordCount The total number of records labeled as a result of the user's reports. 38 */ 39 public function __construct( 40 public readonly string $did, 41 public readonly int $accountReportCount, 42 public readonly int $recordReportCount, 43 public readonly int $reportedAccountCount, 44 public readonly int $reportedRecordCount, 45 public readonly int $takendownAccountCount, 46 public readonly int $takendownRecordCount, 47 public readonly int $labeledAccountCount, 48 public readonly int $labeledRecordCount 49 ) { 50 } 51 52 /** 53 * Get the lexicon NSID for this data type. 54 * 55 * @return string 56 */ 57 public static function getLexicon(): string 58 { 59 return 'tools.ozone.moderation.defs.reporterStats'; 60 } 61 62 63 /** 64 * Create an instance from an array. 65 * 66 * @param array $data The data array 67 * @return static 68 */ 69 public static function fromArray(array $data): static 70 { 71 return new static( 72 did: $data['did'], 73 accountReportCount: $data['accountReportCount'], 74 recordReportCount: $data['recordReportCount'], 75 reportedAccountCount: $data['reportedAccountCount'], 76 reportedRecordCount: $data['reportedRecordCount'], 77 takendownAccountCount: $data['takendownAccountCount'], 78 takendownRecordCount: $data['takendownRecordCount'], 79 labeledAccountCount: $data['labeledAccountCount'], 80 labeledRecordCount: $data['labeledRecordCount'] 81 ); 82 } 83 84}