Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Generated\App\Bsky\Notification\Defs;
4
5use SocialDept\AtpSchema\Data\Data;
6
7/**
8 * GENERATED CODE - DO NOT EDIT
9 *
10 * Lexicon: app.bsky.notification.defs.preferences
11 * Type: object
12 *
13 * @property mixed $chat
14 * @property mixed $follow
15 * @property mixed $like
16 * @property mixed $likeViaRepost
17 * @property mixed $mention
18 * @property mixed $quote
19 * @property mixed $reply
20 * @property mixed $repost
21 * @property mixed $repostViaRepost
22 * @property mixed $starterpackJoined
23 * @property mixed $subscribedPost
24 * @property mixed $unverified
25 * @property mixed $verified
26 *
27 * Constraints:
28 * - Required: chat, follow, like, likeViaRepost, mention, quote, reply, repost, repostViaRepost, starterpackJoined, subscribedPost, unverified, verified
29 */
30class Preferences extends Data
31{
32 public function __construct(
33 public readonly mixed $chat,
34 public readonly mixed $follow,
35 public readonly mixed $like,
36 public readonly mixed $likeViaRepost,
37 public readonly mixed $mention,
38 public readonly mixed $quote,
39 public readonly mixed $reply,
40 public readonly mixed $repost,
41 public readonly mixed $repostViaRepost,
42 public readonly mixed $starterpackJoined,
43 public readonly mixed $subscribedPost,
44 public readonly mixed $unverified,
45 public readonly mixed $verified
46 ) {
47 }
48
49 /**
50 * Get the lexicon NSID for this data type.
51 *
52 * @return string
53 */
54 public static function getLexicon(): string
55 {
56 return 'app.bsky.notification.defs.preferences';
57 }
58
59
60 /**
61 * Create an instance from an array.
62 *
63 * @param array $data The data array
64 * @return static
65 */
66 public static function fromArray(array $data): static
67 {
68 return new static(
69 chat: $data['chat'],
70 follow: $data['follow'],
71 like: $data['like'],
72 likeViaRepost: $data['likeViaRepost'],
73 mention: $data['mention'],
74 quote: $data['quote'],
75 reply: $data['reply'],
76 repost: $data['repost'],
77 repostViaRepost: $data['repostViaRepost'],
78 starterpackJoined: $data['starterpackJoined'],
79 subscribedPost: $data['subscribedPost'],
80 unverified: $data['unverified'],
81 verified: $data['verified']
82 );
83 }
84
85}