Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 56 lines 1.2 kB view raw
1<?php 2 3namespace SocialDept\AtpSchema\Generated\Com\Atproto\Label\Defs; 4 5use SocialDept\AtpSchema\Data\Data; 6 7/** 8 * GENERATED CODE - DO NOT EDIT 9 * 10 * Metadata tag on an atproto record, published by the author within the record. 11 * Note that schemas should use #selfLabels, not #selfLabel. 12 * 13 * Lexicon: com.atproto.label.defs.selfLabel 14 * Type: object 15 * 16 * @property string $val The short string name of the value or type of this label. 17 * 18 * Constraints: 19 * - Required: val 20 * - val: Max length: 128 21 */ 22class SelfLabel extends Data 23{ 24 /** 25 * @param string $val The short string name of the value or type of this label. 26 */ 27 public function __construct( 28 public readonly string $val 29 ) { 30 } 31 32 /** 33 * Get the lexicon NSID for this data type. 34 * 35 * @return string 36 */ 37 public static function getLexicon(): string 38 { 39 return 'com.atproto.label.defs.selfLabel'; 40 } 41 42 43 /** 44 * Create an instance from an array. 45 * 46 * @param array $data The data array 47 * @return static 48 */ 49 public static function fromArray(array $data): static 50 { 51 return new static( 52 val: $data['val'] 53 ); 54 } 55 56}