Parse and validate AT Protocol Lexicons with DTO generation for Laravel
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 * Statistics about a particular account subject
11 *
12 * Lexicon: tools.ozone.moderation.defs.accountStats
13 * Type: object
14 *
15 * @property int|null $reportCount Total number of reports on the account
16 * @property int|null $appealCount Total number of appeals against a moderation action on the account
17 * @property int|null $suspendCount Number of times the account was suspended
18 * @property int|null $escalateCount Number of times the account was escalated
19 * @property int|null $takedownCount Number of times the account was taken down
20 */
21class AccountStats extends Data
22{
23 /**
24 * @param int|null $reportCount Total number of reports on the account
25 * @param int|null $appealCount Total number of appeals against a moderation action on the account
26 * @param int|null $suspendCount Number of times the account was suspended
27 * @param int|null $escalateCount Number of times the account was escalated
28 * @param int|null $takedownCount Number of times the account was taken down
29 */
30 public function __construct(
31 public readonly ?int $reportCount = null,
32 public readonly ?int $appealCount = null,
33 public readonly ?int $suspendCount = null,
34 public readonly ?int $escalateCount = null,
35 public readonly ?int $takedownCount = 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.accountStats';
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 reportCount: $data['reportCount'] ?? null,
60 appealCount: $data['appealCount'] ?? null,
61 suspendCount: $data['suspendCount'] ?? null,
62 escalateCount: $data['escalateCount'] ?? null,
63 takedownCount: $data['takedownCount'] ?? null
64 );
65 }
66
67}