-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathBetaOverloadedError.php
More file actions
65 lines (53 loc) · 1.37 KB
/
BetaOverloadedError.php
File metadata and controls
65 lines (53 loc) · 1.37 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
<?php
declare(strict_types=1);
namespace Anthropic\Beta;
use Anthropic\Core\Attributes\Api;
use Anthropic\Core\Concerns\SdkModel;
use Anthropic\Core\Contracts\BaseModel;
/**
* @phpstan-type beta_overloaded_error = array{message: string, type: string}
*/
final class BetaOverloadedError implements BaseModel
{
/** @use SdkModel<beta_overloaded_error> */
use SdkModel;
#[Api]
public string $type = 'overloaded_error';
#[Api]
public string $message;
/**
* `new BetaOverloadedError()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* BetaOverloadedError::with(message: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new BetaOverloadedError)->withMessage(...)
* ```
*/
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.
*/
public static function with(string $message = 'Overloaded'): self
{
$obj = new self;
$obj->message = $message;
return $obj;
}
public function withMessage(string $message): self
{
$obj = clone $this;
$obj->message = $message;
return $obj;
}
}