Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs;
4
5use SocialDept\AtpSchema\Data\Data;
6
7/**
8 * GENERATED CODE - DO NOT EDIT
9 *
10 * Default post interaction settings for the account. These values should be
11 * applied as default values when creating new posts. These refs should mirror
12 * the threadgate and postgate records exactly.
13 *
14 * Lexicon: app.bsky.actor.defs.postInteractionSettingsPref
15 * Type: object
16 *
17 * @property array|null $threadgateAllowRules Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.
18 * @property array|null $postgateEmbeddingRules Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.
19 *
20 * Constraints:
21 * - threadgateAllowRules: Max length: 5
22 * - postgateEmbeddingRules: Max length: 5
23 */
24class PostInteractionSettingsPref extends Data
25{
26 /**
27 * @param array|null $threadgateAllowRules Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.
28 * @param array|null $postgateEmbeddingRules Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.
29 */
30 public function __construct(
31 public readonly ?array $threadgateAllowRules = null,
32 public readonly ?array $postgateEmbeddingRules = null
33 ) {
34 }
35
36 /**
37 * Get the lexicon NSID for this data type.
38 *
39 * @return string
40 */
41 public static function getLexicon(): string
42 {
43 return 'app.bsky.actor.defs.postInteractionSettingsPref';
44 }
45
46
47 /**
48 * Create an instance from an array.
49 *
50 * @param array $data The data array
51 * @return static
52 */
53 public static function fromArray(array $data): static
54 {
55 return new static(
56 threadgateAllowRules: $data['threadgateAllowRules'] ?? null,
57 postgateEmbeddingRules: $data['postgateEmbeddingRules'] ?? null
58 );
59 }
60
61}