Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 49 lines 926 B view raw
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.serviceConfig 11 * Type: object 12 * 13 * @property string|null $url 14 * 15 * Constraints: 16 * - url: Format: uri 17 */ 18class ServiceConfig extends Data 19{ 20 public function __construct( 21 public readonly ?string $url = null 22 ) { 23 } 24 25 /** 26 * Get the lexicon NSID for this data type. 27 * 28 * @return string 29 */ 30 public static function getLexicon(): string 31 { 32 return 'tools.ozone.server.getConfig.serviceConfig'; 33 } 34 35 36 /** 37 * Create an instance from an array. 38 * 39 * @param array $data The data array 40 * @return static 41 */ 42 public static function fromArray(array $data): static 43 { 44 return new static( 45 url: $data['url'] ?? null 46 ); 47 } 48 49}