2024-04-29 10:21:07 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace OCP\TaskProcessing;
|
|
|
|
|
|
2024-04-30 09:48:00 -04:00
|
|
|
/**
|
|
|
|
|
* Data object for input output shape entries
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-04-30 11:01:41 -04:00
|
|
|
class ShapeDescriptor implements \JsonSerializable {
|
2024-04-30 09:48:00 -04:00
|
|
|
/**
|
|
|
|
|
* @param string $name
|
|
|
|
|
* @param string $description
|
|
|
|
|
* @param EShapeType $shapeType
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-04-29 10:21:07 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private string $name,
|
|
|
|
|
private string $description,
|
|
|
|
|
private EShapeType $shapeType,
|
|
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 09:48:00 -04:00
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-04-29 10:21:07 -04:00
|
|
|
public function getName(): string {
|
|
|
|
|
return $this->name;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 09:48:00 -04:00
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-04-29 10:21:07 -04:00
|
|
|
public function getDescription(): string {
|
|
|
|
|
return $this->description;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-30 09:48:00 -04:00
|
|
|
/**
|
|
|
|
|
* @return EShapeType
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
2024-04-29 10:21:07 -04:00
|
|
|
public function getShapeType(): EShapeType {
|
|
|
|
|
return $this->shapeType;
|
|
|
|
|
}
|
2024-04-30 11:01:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return array{name: string, description: string, type: int}
|
|
|
|
|
*/
|
|
|
|
|
public function jsonSerialize(): array {
|
|
|
|
|
return [
|
|
|
|
|
'name' => $this->getName(),
|
|
|
|
|
'description' => $this->getDescription(),
|
|
|
|
|
'type' => $this->getShapeType()->value,
|
|
|
|
|
];
|
|
|
|
|
}
|
2024-04-29 10:21:07 -04:00
|
|
|
}
|