Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs;
4
5use Carbon\Carbon;
6use SocialDept\AtpSchema\Data\Data;
7use SocialDept\AtpSchema\Support\UnionHelper;
8
9/**
10 * GENERATED CODE - DO NOT EDIT
11 *
12 * Lexicon: tools.ozone.moderation.defs.subjectStatusView
13 * Type: object
14 *
15 * @property int $id
16 * @property mixed $subject
17 * @property mixed $hosting
18 * @property array<string>|null $subjectBlobCids
19 * @property string|null $subjectRepoHandle
20 * @property Carbon $updatedAt Timestamp referencing when the last update was made to the moderation status of the subject
21 * @property Carbon $createdAt Timestamp referencing the first moderation status impacting event was emitted on the subject
22 * @property mixed $reviewState
23 * @property string|null $comment Sticky comment on the subject.
24 * @property int|null $priorityScore Numeric value representing the level of priority. Higher score means higher priority.
25 * @property Carbon|null $muteUntil
26 * @property Carbon|null $muteReportingUntil
27 * @property string|null $lastReviewedBy
28 * @property Carbon|null $lastReviewedAt
29 * @property Carbon|null $lastReportedAt
30 * @property Carbon|null $lastAppealedAt Timestamp referencing when the author of the subject appealed a moderation action
31 * @property bool|null $takendown
32 * @property bool|null $appealed True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.
33 * @property Carbon|null $suspendUntil
34 * @property array<string>|null $tags
35 * @property mixed $accountStats Statistics related to the account subject
36 * @property mixed $recordsStats Statistics related to the record subjects authored by the subject's account
37 * @property mixed $accountStrike Strike information for the account (account-level only)
38 * @property string|null $ageAssuranceState Current age assurance state of the subject.
39 * @property string|null $ageAssuranceUpdatedBy Whether or not the last successful update to age assurance was made by the user or admin.
40 *
41 * Constraints:
42 * - Required: id, subject, createdAt, updatedAt, reviewState
43 * - updatedAt: Format: datetime
44 * - createdAt: Format: datetime
45 * - priorityScore: Maximum: 100
46 * - priorityScore: Minimum: 0
47 * - muteUntil: Format: datetime
48 * - muteReportingUntil: Format: datetime
49 * - lastReviewedBy: Format: did
50 * - lastReviewedAt: Format: datetime
51 * - lastReportedAt: Format: datetime
52 * - lastAppealedAt: Format: datetime
53 * - suspendUntil: Format: datetime
54 */
55class SubjectStatusView extends Data
56{
57 /**
58 * @param Carbon $updatedAt Timestamp referencing when the last update was made to the moderation status of the subject
59 * @param Carbon $createdAt Timestamp referencing the first moderation status impacting event was emitted on the subject
60 * @param string|null $comment Sticky comment on the subject.
61 * @param int|null $priorityScore Numeric value representing the level of priority. Higher score means higher priority.
62 * @param Carbon|null $lastAppealedAt Timestamp referencing when the author of the subject appealed a moderation action
63 * @param bool|null $appealed True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators.
64 * @param mixed $accountStats Statistics related to the account subject
65 * @param mixed $recordsStats Statistics related to the record subjects authored by the subject's account
66 * @param mixed $accountStrike Strike information for the account (account-level only)
67 * @param string|null $ageAssuranceState Current age assurance state of the subject.
68 * @param string|null $ageAssuranceUpdatedBy Whether or not the last successful update to age assurance was made by the user or admin.
69 */
70 public function __construct(
71 public readonly int $id,
72 public readonly mixed $subject,
73 public readonly Carbon $updatedAt,
74 public readonly Carbon $createdAt,
75 public readonly mixed $reviewState,
76 public readonly mixed $hosting = null,
77 public readonly ?array $subjectBlobCids = null,
78 public readonly ?string $subjectRepoHandle = null,
79 public readonly ?string $comment = null,
80 public readonly ?int $priorityScore = null,
81 public readonly ?Carbon $muteUntil = null,
82 public readonly ?Carbon $muteReportingUntil = null,
83 public readonly ?string $lastReviewedBy = null,
84 public readonly ?Carbon $lastReviewedAt = null,
85 public readonly ?Carbon $lastReportedAt = null,
86 public readonly ?Carbon $lastAppealedAt = null,
87 public readonly ?bool $takendown = null,
88 public readonly ?bool $appealed = null,
89 public readonly ?Carbon $suspendUntil = null,
90 public readonly ?array $tags = null,
91 public readonly mixed $accountStats = null,
92 public readonly mixed $recordsStats = null,
93 public readonly mixed $accountStrike = null,
94 public readonly ?string $ageAssuranceState = null,
95 public readonly ?string $ageAssuranceUpdatedBy = null
96 ) {
97 }
98
99 /**
100 * Get the lexicon NSID for this data type.
101 *
102 * @return string
103 */
104 public static function getLexicon(): string
105 {
106 return 'tools.ozone.moderation.defs.subjectStatusView';
107 }
108
109
110 /**
111 * Create an instance from an array.
112 *
113 * @param array $data The data array
114 * @return static
115 */
116 public static function fromArray(array $data): static
117 {
118 return new static(
119 id: $data['id'],
120 subject: UnionHelper::validateOpenUnion($data['subject']),
121 updatedAt: Carbon::parse($data['updatedAt']),
122 createdAt: Carbon::parse($data['createdAt']),
123 reviewState: $data['reviewState'],
124 hosting: isset($data['hosting']) ? UnionHelper::validateOpenUnion($data['hosting']) : null,
125 subjectBlobCids: $data['subjectBlobCids'] ?? null,
126 subjectRepoHandle: $data['subjectRepoHandle'] ?? null,
127 comment: $data['comment'] ?? null,
128 priorityScore: $data['priorityScore'] ?? null,
129 muteUntil: isset($data['muteUntil']) ? Carbon::parse($data['muteUntil']) : null,
130 muteReportingUntil: isset($data['muteReportingUntil']) ? Carbon::parse($data['muteReportingUntil']) : null,
131 lastReviewedBy: $data['lastReviewedBy'] ?? null,
132 lastReviewedAt: isset($data['lastReviewedAt']) ? Carbon::parse($data['lastReviewedAt']) : null,
133 lastReportedAt: isset($data['lastReportedAt']) ? Carbon::parse($data['lastReportedAt']) : null,
134 lastAppealedAt: isset($data['lastAppealedAt']) ? Carbon::parse($data['lastAppealedAt']) : null,
135 takendown: $data['takendown'] ?? null,
136 appealed: $data['appealed'] ?? null,
137 suspendUntil: isset($data['suspendUntil']) ? Carbon::parse($data['suspendUntil']) : null,
138 tags: $data['tags'] ?? null,
139 accountStats: $data['accountStats'] ?? null,
140 recordsStats: $data['recordsStats'] ?? null,
141 accountStrike: $data['accountStrike'] ?? null,
142 ageAssuranceState: $data['ageAssuranceState'] ?? null,
143 ageAssuranceUpdatedBy: $data['ageAssuranceUpdatedBy'] ?? null
144 );
145 }
146
147}