-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathRestoreOptions.php
More file actions
72 lines (59 loc) · 1.74 KB
/
RestoreOptions.php
File metadata and controls
72 lines (59 loc) · 1.74 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
<?php
declare(strict_types=1);
namespace Platformsh\Client\Model\Backups;
class RestoreOptions
{
private ?string $environmentName = null;
private ?string $branchFrom = null;
private ?bool $restoreCode;
private ?bool $restoreResources;
private ?string $resourcesInit;
public function setEnvironmentName(?string $environmentName): static
{
$this->environmentName = $environmentName;
return $this;
}
public function setBranchFrom(?string $branchFrom): static
{
$this->branchFrom = $branchFrom;
return $this;
}
public function setRestoreCode(?bool $restoreCode): static
{
$this->restoreCode = $restoreCode;
return $this;
}
public function setRestoreResources(?bool $restoreResources): static
{
$this->restoreResources = $restoreResources;
return $this;
}
public function setResourcesInit(?string $init): static
{
$this->resourcesInit = $init;
return $this;
}
/**
* Returns a resource options structure as an associative array.
*/
public function toArray(): array
{
$arr = [];
if ($this->environmentName !== null) {
$arr['environment_name'] = $this->environmentName;
}
if ($this->branchFrom !== null) {
$arr['branch_from'] = $this->branchFrom;
}
if ($this->restoreCode !== null) {
$arr['restore_code'] = $this->restoreCode;
}
if ($this->restoreResources !== null) {
$arr['restore_resources'] = $this->restoreResources;
}
if ($this->resourcesInit !== null) {
$arr['resources']['init'] = $this->resourcesInit;
}
return $arr;
}
}