From 7afa5fe27fb92bf13d6f5bedcc1a3e6e5eb62793 Mon Sep 17 00:00:00 2001 From: mittwald-machine Date: Wed, 20 Nov 2024 19:10:30 +0000 Subject: [PATCH] feat: add logo reference ID to Marketplace Extension schema - Introduced `logoRefId` property to the Extension class with corresponding validation and serialization methods. - Updated the class constructor and data mapping to include `logoRefId`. - Added `getLogoRefId`, `withLogoRefId`, and `withoutLogoRefId` methods for managing the logo reference ID. --- .../V2/Schemas/Marketplace/Extension.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/Generated/V2/Schemas/Marketplace/Extension.php b/src/Generated/V2/Schemas/Marketplace/Extension.php index cfc3cd8f..fc8f62bf 100644 --- a/src/Generated/V2/Schemas/Marketplace/Extension.php +++ b/src/Generated/V2/Schemas/Marketplace/Extension.php @@ -73,6 +73,11 @@ class Extension 'format' => 'uuid', 'type' => 'string', ], + 'logoRefId' => [ + 'description' => 'This is the FileId of the Logo. Retrieve the file with this id on `/v2/files/{logoRefId}`.', + 'format' => 'uuid', + 'type' => 'string', + ], 'name' => [ 'type' => 'string', ], @@ -156,6 +161,11 @@ class Extension private string $id; + /** + * This is the FileId of the Logo. Retrieve the file with this id on `/v2/files/{logoRefId}`. + */ + private ?string $logoRefId = null; + private string $name; /** @@ -266,6 +276,11 @@ public function getId(): string return $this->id; } + public function getLogoRefId(): ?string + { + return $this->logoRefId ?? null; + } + public function getName(): string { return $this->name; @@ -462,6 +477,28 @@ public function withId(string $id): self return $clone; } + public function withLogoRefId(string $logoRefId): self + { + $validator = new Validator(); + $validator->validate($logoRefId, static::$schema['properties']['logoRefId']); + if (!$validator->isValid()) { + throw new InvalidArgumentException($validator->getErrors()[0]['message']); + } + + $clone = clone $this; + $clone->logoRefId = $logoRefId; + + return $clone; + } + + public function withoutLogoRefId(): self + { + $clone = clone $this; + unset($clone->logoRefId); + + return $clone; + } + public function withName(string $name): self { $validator = new Validator(); @@ -580,6 +617,10 @@ public static function buildFromInput(array|object $input, bool $validate = true $frontendFragments = (array)$input->{'frontendFragments'}; } $id = $input->{'id'}; + $logoRefId = null; + if (isset($input->{'logoRefId'})) { + $logoRefId = $input->{'logoRefId'}; + } $name = $input->{'name'}; $published = (bool)($input->{'published'}); $scopes = $input->{'scopes'}; @@ -592,6 +633,7 @@ public static function buildFromInput(array|object $input, bool $validate = true $obj->detailedDescriptions = $detailedDescriptions; $obj->frontendComponents = $frontendComponents; $obj->frontendFragments = $frontendFragments; + $obj->logoRefId = $logoRefId; return $obj; } @@ -621,6 +663,9 @@ public function toJson(): array $output['frontendFragments'] = $this->frontendFragments; } $output['id'] = $this->id; + if (isset($this->logoRefId)) { + $output['logoRefId'] = $this->logoRefId; + } $output['name'] = $this->name; $output['published'] = $this->published; $output['scopes'] = $this->scopes;