Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
InstanceCreate
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Vultr\VultrPhp\Services\Instances;
6
7use Vultr\VultrPhp\Util\ModelOptions;
8
9class InstanceCreate extends ModelOptions
10{
11    /**
12     * @see https://www.vultr.com/api/#operation/create-instance
13     */
14    protected string $region;
15    protected string $plan;
16
17    // 1 of these has to be specified.
18    protected ?int $os_id = null;
19    protected ?string $iso_id = null;
20    protected ?string $snapshot_id = null;
21    protected ?int $app_id = null;
22    protected ?string $image_id = null;
23
24    // Optional fields.
25    protected ?string $script_id = null;
26    protected ?array $sshkey_id = null;
27    protected ?string $ipxe_chain_url = null;
28    protected ?bool $enable_ipv6 = null;
29    protected ?string $backups = null;
30    protected ?string $user_data = null;
31
32    protected ?string $firewall_group_id = null;
33    protected ?string $reserved_ip = null;
34
35    protected ?bool $ddos_protection = null;
36    protected ?bool $activation_email = null;
37
38    protected ?array $attach_vpc = null;
39    protected ?bool $enable_vpc = null;
40
41    protected ?string $hostname = null;
42    protected ?string $label = null;
43    protected ?array $tags = null;
44
45    public function __construct(string $region, string $plan)
46    {
47        $this->region = $region;
48        $this->plan = $plan;
49        parent::__construct();
50    }
51}