aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/TaskProcessing/ShapeEnumValue.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/TaskProcessing/ShapeEnumValue.php')
-rw-r--r--lib/public/TaskProcessing/ShapeEnumValue.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/public/TaskProcessing/ShapeEnumValue.php b/lib/public/TaskProcessing/ShapeEnumValue.php
new file mode 100644
index 00000000000..bc500524304
--- /dev/null
+++ b/lib/public/TaskProcessing/ShapeEnumValue.php
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\TaskProcessing;
+
+/**
+ * Data object for input output shape enum slot value
+ * @since 30.0.0
+ */
+class ShapeEnumValue implements \JsonSerializable {
+ /**
+ * @param string $name
+ * @param string $value
+ * @since 30.0.0
+ */
+ public function __construct(
+ private string $name,
+ private string $value,
+ ) {
+ }
+
+ /**
+ * @return string
+ * @since 30.0.0
+ */
+ public function getName(): string {
+ return $this->name;
+ }
+
+ /**
+ * @return string
+ * @since 30.0.0
+ */
+ public function getValue(): string {
+ return $this->value;
+ }
+
+ /**
+ * @return array{name: string, value: string}
+ * @since 30.0.0
+ */
+ public function jsonSerialize(): array {
+ return [
+ 'name' => $this->getName(),
+ 'value' => $this->getValue(),
+ ];
+ }
+}