Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 49 lines 1.0 kB view raw
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 * Lexicon: app.bsky.actor.defs.profileAssociatedActivitySubscription 11 * Type: object 12 * 13 * @property string $allowSubscriptions 14 * 15 * Constraints: 16 * - Required: allowSubscriptions 17 */ 18class ProfileAssociatedActivitySubscription extends Data 19{ 20 public function __construct( 21 public readonly string $allowSubscriptions 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 'app.bsky.actor.defs.profileAssociatedActivitySubscription'; 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 allowSubscriptions: $data['allowSubscriptions'] 46 ); 47 } 48 49}