Something went wrong. Try again.
Parse and validate AT Protocol Lexicons with DTO generation for Laravel
Something went wrong. Try again.
1.7 kB · 63 lines
PHP
at dev
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364<?php
namespace SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs;
use SocialDept\AtpSchema\Data\Data;
/** * GENERATED CODE - DO NOT EDIT * * Apply/Negate labels on a subject * * Lexicon: tools.ozone.moderation.defs.modEventLabel * Type: object * * @property string|null $comment * @property array<string> $createLabelVals * @property array<string> $negateLabelVals * @property int|null $durationInHours Indicates how long the label will remain on the subject. Only applies on labels that are being added. * * Constraints: * - Required: createLabelVals, negateLabelVals */class ModEventLabel extends Data{ /** * @param int|null $durationInHours Indicates how long the label will remain on the subject. Only applies on labels that are being added. */ public function __construct( public readonly array $createLabelVals, public readonly array $negateLabelVals, public readonly ?string $comment = null, public readonly ?int $durationInHours = null ) { }
/** * Get the lexicon NSID for this data type. * * @return string */ public static function getLexicon(): string { return 'tools.ozone.moderation.defs.modEventLabel'; }
/** * Create an instance from an array. * * @param array $data The data array * @return static */ public static function fromArray(array $data): static { return new static( createLabelVals: $data['createLabelVals'], negateLabelVals: $data['negateLabelVals'], comment: $data['comment'] ?? null, durationInHours: $data['durationInHours'] ?? null ); }
}