-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCreateParams.php
51 lines (47 loc) · 2.18 KB
/
CreateParams.php
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
<?php
declare(strict_types=1);
namespace Upmind\ProvisionProviders\Servers\Data;
use Upmind\ProvisionBase\Provider\DataSet\DataSet;
use Upmind\ProvisionBase\Provider\DataSet\Rules;
/**
* @property-read string|int|null $customer_identifier Existing customer id
* @property-read int|null $upmind_client_int_id Numeric upmind client id
* @property-read string|null $customer_name Customer name
* @property-read string $email Customer email address
* @property-read string $label Server instance label/name
* @property-read string $location Server dc/location/region
* @property-read string $image Image name/identifier
* @property-read string $size Server specs/size name
* @property-read integer $memory_mb Server video memory in megabytes
* @property-read integer $cpu_cores Server number of CPUs
* @property-read integer $disk_mb Server RAM size in megabytes
* @property-read string|null $root_password Server root password
* @property-read string|null $virtualization_type Virtualization type
* @property-read string[]|null $software Software to install
* @property-read string[]|null $licenses Licenses to create
* @property-read array|null $metadata Additional metadata
*/
class CreateParams extends DataSet
{
public static function rules(): Rules
{
return new Rules([
'customer_identifier' => ['nullable'],
'upmind_client_int_id' => ['nullable', 'integer'],
'customer_name' => ['nullable', 'string'],
'email' => ['required', 'email'],
'label' => ['required', 'alpha_dash_dot'],
'location' => ['required', 'string'],
'image' => ['required', 'string'],
'size' => ['required_without:memory_mb,cpu_cores,disk_mb', 'string'],
'memory_mb' => ['required_without:size', 'integer'],
'cpu_cores' => ['required_without:size', 'integer'],
'disk_mb' => ['required_without:size', 'integer'],
'root_password' => ['nullable', 'string'],
'virtualization_type' => ['nullable', 'string'],
'software' => ['nullable', 'array'],
'licenses' => ['nullable', 'array'],
'metadata' => ['nullable', 'array'],
]);
}
}