-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathAttributeStatus.php
More file actions
67 lines (59 loc) · 1.63 KB
/
AttributeStatus.php
File metadata and controls
67 lines (59 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace Appwrite\Enums;
use JsonSerializable;
class AttributeStatus implements JsonSerializable
{
private static AttributeStatus $AVAILABLE;
private static AttributeStatus $PROCESSING;
private static AttributeStatus $DELETING;
private static AttributeStatus $STUCK;
private static AttributeStatus $FAILED;
private string $value;
private function __construct(string $value)
{
$this->value = $value;
}
public function __toString(): string
{
return $this->value;
}
public function jsonSerialize(): string
{
return $this->value;
}
public static function AVAILABLE(): AttributeStatus
{
if (!isset(self::$AVAILABLE)) {
self::$AVAILABLE = new AttributeStatus('available');
}
return self::$AVAILABLE;
}
public static function PROCESSING(): AttributeStatus
{
if (!isset(self::$PROCESSING)) {
self::$PROCESSING = new AttributeStatus('processing');
}
return self::$PROCESSING;
}
public static function DELETING(): AttributeStatus
{
if (!isset(self::$DELETING)) {
self::$DELETING = new AttributeStatus('deleting');
}
return self::$DELETING;
}
public static function STUCK(): AttributeStatus
{
if (!isset(self::$STUCK)) {
self::$STUCK = new AttributeStatus('stuck');
}
return self::$STUCK;
}
public static function FAILED(): AttributeStatus
{
if (!isset(self::$FAILED)) {
self::$FAILED = new AttributeStatus('failed');
}
return self::$FAILED;
}
}