-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathDeletedFile.php
More file actions
98 lines (83 loc) · 1.93 KB
/
DeletedFile.php
File metadata and controls
98 lines (83 loc) · 1.93 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
declare(strict_types=1);
namespace Anthropic\Beta\Files;
use Anthropic\Beta\Files\DeletedFile\Type;
use Anthropic\Core\Attributes\Api;
use Anthropic\Core\Concerns\SdkModel;
use Anthropic\Core\Contracts\BaseModel;
/**
* @phpstan-type deleted_file = array{id: string, type?: Type::*|null}
*/
final class DeletedFile implements BaseModel
{
/** @use SdkModel<deleted_file> */
use SdkModel;
/**
* ID of the deleted file.
*/
#[Api]
public string $id;
/**
* Deleted object type.
*
* For file deletion, this is always `"file_deleted"`.
*
* @var Type::*|null $type
*/
#[Api(enum: Type::class, optional: true)]
public ?string $type;
/**
* `new DeletedFile()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* DeletedFile::with(id: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new DeletedFile)->withID(...)
* ```
*/
public function __construct()
{
$this->initialize();
}
/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Type::* $type
*/
public static function with(string $id, ?string $type = null): self
{
$obj = new self;
$obj->id = $id;
null !== $type && $obj->type = $type;
return $obj;
}
/**
* ID of the deleted file.
*/
public function withID(string $id): self
{
$obj = clone $this;
$obj->id = $id;
return $obj;
}
/**
* Deleted object type.
*
* For file deletion, this is always `"file_deleted"`.
*
* @param Type::* $type
*/
public function withType(string $type): self
{
$obj = clone $this;
$obj->type = $type;
return $obj;
}
}