Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Generated\Com\Atproto\Repo\ApplyWrites;
4
5use SocialDept\AtpSchema\Data\Data;
6
7/**
8 * GENERATED CODE - DO NOT EDIT
9 *
10 * Lexicon: com.atproto.repo.applyWrites.createResult
11 * Type: object
12 *
13 * @property string $uri
14 * @property string $cid
15 * @property string|null $validationStatus
16 *
17 * Constraints:
18 * - Required: uri, cid
19 * - uri: Format: at-uri
20 * - cid: Format: cid
21 */
22class CreateResult extends Data
23{
24 public function __construct(
25 public readonly string $uri,
26 public readonly string $cid,
27 public readonly ?string $validationStatus = null
28 ) {
29 }
30
31 /**
32 * Get the lexicon NSID for this data type.
33 *
34 * @return string
35 */
36 public static function getLexicon(): string
37 {
38 return 'com.atproto.repo.applyWrites.createResult';
39 }
40
41
42 /**
43 * Create an instance from an array.
44 *
45 * @param array $data The data array
46 * @return static
47 */
48 public static function fromArray(array $data): static
49 {
50 return new static(
51 uri: $data['uri'],
52 cid: $data['cid'],
53 validationStatus: $data['validationStatus'] ?? null
54 );
55 }
56
57}