Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs;
4
5use Carbon\Carbon;
6use SocialDept\AtpSchema\Data\Data;
7
8/**
9 * GENERATED CODE - DO NOT EDIT
10 *
11 * Lexicon: app.bsky.actor.defs.personalDetailsPref
12 * Type: object
13 *
14 * @property Carbon|null $birthDate The birth date of account owner.
15 *
16 * Constraints:
17 * - birthDate: Format: datetime
18 */
19class PersonalDetailsPref extends Data
20{
21 /**
22 * @param Carbon|null $birthDate The birth date of account owner.
23 */
24 public function __construct(
25 public readonly ?Carbon $birthDate = null
26 ) {
27 }
28
29 /**
30 * Get the lexicon NSID for this data type.
31 *
32 * @return string
33 */
34 public static function getLexicon(): string
35 {
36 return 'app.bsky.actor.defs.personalDetailsPref';
37 }
38
39
40 /**
41 * Create an instance from an array.
42 *
43 * @param array $data The data array
44 * @return static
45 */
46 public static function fromArray(array $data): static
47 {
48 return new static(
49 birthDate: isset($data['birthDate']) ? Carbon::parse($data['birthDate']) : null
50 );
51 }
52
53}