Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 75 lines 2.1 kB view raw
1<?php 2 3namespace SocialDept\AtpSchema\Generated\App\Bsky\Video\Defs; 4 5use SocialDept\AtpSchema\Data\BlobReference; 6use SocialDept\AtpSchema\Data\Data; 7 8/** 9 * GENERATED CODE - DO NOT EDIT 10 * 11 * Lexicon: app.bsky.video.defs.jobStatus 12 * Type: object 13 * 14 * @property string $jobId 15 * @property string $did 16 * @property string $state The state of the video processing job. All values not listed as a known value indicate that the job is in process. 17 * @property int|null $progress Progress within the current processing state. 18 * @property BlobReference|null $blob 19 * @property string|null $error 20 * @property string|null $message 21 * 22 * Constraints: 23 * - Required: jobId, did, state 24 * - did: Format: did 25 * - progress: Maximum: 100 26 * - progress: Minimum: 0 27 */ 28class JobStatus extends Data 29{ 30 /** 31 * @param string $state The state of the video processing job. All values not listed as a known value indicate that the job is in process. 32 * @param int|null $progress Progress within the current processing state. 33 */ 34 public function __construct( 35 public readonly string $jobId, 36 public readonly string $did, 37 public readonly string $state, 38 public readonly ?int $progress = null, 39 public readonly ?BlobReference $blob = null, 40 public readonly ?string $error = null, 41 public readonly ?string $message = null 42 ) { 43 } 44 45 /** 46 * Get the lexicon NSID for this data type. 47 * 48 * @return string 49 */ 50 public static function getLexicon(): string 51 { 52 return 'app.bsky.video.defs.jobStatus'; 53 } 54 55 56 /** 57 * Create an instance from an array. 58 * 59 * @param array $data The data array 60 * @return static 61 */ 62 public static function fromArray(array $data): static 63 { 64 return new static( 65 jobId: $data['jobId'], 66 did: $data['did'], 67 state: $data['state'], 68 progress: $data['progress'] ?? null, 69 blob: $data['blob'] ?? null, 70 error: $data['error'] ?? null, 71 message: $data['message'] ?? null 72 ); 73 } 74 75}