1
0

ShapeEnumValue.php 886 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\TaskProcessing;
  7. /**
  8. * Data object for input output shape enum slot value
  9. * @since 30.0.0
  10. */
  11. class ShapeEnumValue implements \JsonSerializable {
  12. /**
  13. * @param string $name
  14. * @param string $value
  15. * @since 30.0.0
  16. */
  17. public function __construct(
  18. private string $name,
  19. private string $value,
  20. ) {
  21. }
  22. /**
  23. * @return string
  24. * @since 30.0.0
  25. */
  26. public function getName(): string {
  27. return $this->name;
  28. }
  29. /**
  30. * @return string
  31. * @since 30.0.0
  32. */
  33. public function getValue(): string {
  34. return $this->value;
  35. }
  36. /**
  37. * @return array{name: string, value: string}
  38. * @since 30.0.0
  39. */
  40. public function jsonSerialize(): array {
  41. return [
  42. 'name' => $this->getName(),
  43. 'value' => $this->getValue(),
  44. ];
  45. }
  46. }