Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig;
4
5use SocialDept\AtpSchema\Data\Data;
6
7/**
8 * GENERATED CODE - DO NOT EDIT
9 *
10 * Lexicon: tools.ozone.server.getConfig.viewerConfig
11 * Type: object
12 *
13 * @property string|null $role
14 */
15class ViewerConfig extends Data
16{
17 public function __construct(
18 public readonly ?string $role = null
19 ) {
20 }
21
22 /**
23 * Get the lexicon NSID for this data type.
24 *
25 * @return string
26 */
27 public static function getLexicon(): string
28 {
29 return 'tools.ozone.server.getConfig.viewerConfig';
30 }
31
32
33 /**
34 * Create an instance from an array.
35 *
36 * @param array $data The data array
37 * @return static
38 */
39 public static function fromArray(array $data): static
40 {
41 return new static(
42 role: $data['role'] ?? null
43 );
44 }
45
46}